# HG changeset patch
# User drewp@bigasterisk.com
# Date 1631428117 25200
# Node ID 24e8cd8fcdcd579854cc0a338d9299507f5af392
# Parent ea559a84671417586db67efb8af743bac7ec852b
new grid layout in web ui
diff -r ea559a846714 -r 24e8cd8fcdcd service/mqtt_to_rdf/src/index.ts
--- a/service/mqtt_to_rdf/src/index.ts Sat Sep 11 23:27:32 2021 -0700
+++ b/service/mqtt_to_rdf/src/index.ts Sat Sep 11 23:28:37 2021 -0700
@@ -21,10 +21,6 @@
// return "(unknown)";
// }
-interface Msg {
- t: number;
- msg: string;
-}
interface GraphAtTime {
t: number;
n3: string;
@@ -36,10 +32,8 @@
}
interface Subscribed {
topic: string;
- recentMessages: Msg[];
- recentParsed: GraphAtTime[];
- recentConversions: GraphAtTime[];
- currentMetrics: Metric[];
+ recentMessageGraphs: GraphAtTime[];
+ recentMetrics: Metric[];
currentOutputGraph: GraphAtTime;
}
interface PageData {
@@ -81,13 +75,8 @@
subscribed: [
{
topic: "top1",
- recentMessages: [
- { t: 123456, msg: "one" },
- { t: 234567, msg: "two" },
- ],
- recentParsed: [{ t: 123, n3: ":a :b :c ." }],
- recentConversions: [],
- currentMetrics: [],
+ recentMessageGraphs: [],
+ recentMetrics: [],
currentOutputGraph: { t: 1, n3: "(n3)" },
},
],
@@ -97,23 +86,19 @@
const d = this.pageData;
const now = Date.now() / 1000;
const ago = (t: number) => html`${Math.round(now - t)}s ago`;
- const recentMsg = (m: Msg) => html`
${ago(m.t)} msg=${m.msg}
`;
const topicItem = (t: Subscribed, index: number) =>
html`
- ${t.topic}
- ${t.recentMessages.map(recentMsg)}
+ ${t.topic} sticky this to graph column
`;
- const parsedMessage = (g: GraphAtTime) => html` graph: ${g.n3}
`;
- const parsedMessages = (t: Subscribed, index: number) =>
- html` ${t.recentParsed.map(parsedMessage)}
`;
+ const parsedGraphAtTime = (g: GraphAtTime) => html` graph: ${g.n3}
`;
+ const recentMessageGraphs = (t: Subscribed, index: number) =>
+ html` ${t.recentMessageGraphs.map(parsedGraphAtTime)}
`;
const metric = (m: Metric) => html`metrix ${m.name} ${JSON.stringify(m.labels)} = ${m.value}
`;
- const conversions = (t: Subscribed, index: number) =>
- html` ${t.recentConversions.map(parsedMessage)}
`;
- const outputMetrics = (t: Subscribed, index: number) => html` ${t.currentMetrics.map(metric)}
`;
+ const outputMetrics = (t: Subscribed, index: number) => html` ${t.recentMetrics.map(metric)}
`;
const outputGraph = (t: Subscribed, index: number) =>
- html` ${parsedMessage(t.currentOutputGraph)}
`;
+ html` ${parsedGraphAtTime(t.currentOutputGraph)}
`;
return html`
mqtt_to_rdf
@@ -123,16 +108,13 @@
subscribed topics
${d.subscribed.map(topicItem)}
- parsed message: rx stream of Graph
- ${d.subscribed.map(parsedMessages)}
+ recent incoming messages
+ ${d.subscribed.map(recentMessageGraphs)}
- conversions: rx stream (possible separate times from the previous) of Callable[[Graph], Graph]
- ${d.subscribed.map(conversions)}
-
- output metrics: prom collection according to converted graph
+ output metrics: prom collection according to converted graph
${d.subscribed.map(outputMetrics)}
- output graph: PatchableGraph
+ output subgraph
${d.subscribed.map(outputGraph)}
`;
diff -r ea559a846714 -r 24e8cd8fcdcd service/mqtt_to_rdf/src/style.styl
--- a/service/mqtt_to_rdf/src/style.styl Sat Sep 11 23:27:32 2021 -0700
+++ b/service/mqtt_to_rdf/src/style.styl Sat Sep 11 23:28:37 2021 -0700
@@ -33,5 +33,6 @@
font-family: monospace
.graph
- white-space: pre-line
- font-family: monospace
\ No newline at end of file
+ white-space: pre-wrap
+ font-family: monospace
+ border-top: 1px solid darkgreen
\ No newline at end of file