Move component labels to containers

This commit is contained in:
Zaid Abdulla committed 2018-12-26 00:22:07 -08:00
1 parent 30dbf0cf40
commit 7194fcab44
5 files changed
+46 -12

No files matched your search

+5 -8
View File
@@ -103,14 +103,11 @@ const component = {
return m("tr", attrs, m("td.left", k), m("td.right", val));
});
return [
m("h2", "Device parameters"),
m(
".all-parameters",
search,
m(".parameter-list", m("table", m("tbody", rows)))
)
];
return m(
".all-parameters",
search,
m(".parameter-list", m("table", m("tbody", rows)))
);
}
};
+11
View File
@@ -2,10 +2,21 @@
import m from "mithril";
import * as components from "../components";
import * as store from "../store";
import Filter from "../../common/filter";
import * as funcCache from "../../common/func-cache";
const component = {
view: vnode => {
if (vnode.attrs.filter) {
const filter = store.unpackFilter(
funcCache.get(Filter.parse, vnode.attrs.filter)
);
if (!filter.test(vnode.attrs.device)) return;
}
let children = Object.values(vnode.attrs.components).map(c => {
if (typeof c !== "object") return `${c}`;
const attrs = Object.assign({}, vnode.attrs, c);
return m(components.get(attrs.type), attrs);
});
+1 -1
View File
@@ -64,7 +64,7 @@ const component = {
m("tr.empty", m("td", { colspan: headers.length }, "No faults"))
);
return [m("h2", "Faults"), m("table.table", thead, tbody)];
return m("table.table", thead, tbody);
}
};