mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-22 20:19:50 -04:00
fix: got rid of shadowRoot
plotly didn't play well with it.
This commit is contained in:
parent
d78c1ea26c
commit
59f8a5401a
@ -122,10 +122,6 @@ pub async fn index(State(config): State<Config>) -> Markup {
|
||||
script src="/js/plotly.js" { }
|
||||
script src="/js/htmx.js" { }
|
||||
script src="/js/lib.js" { }
|
||||
template id="timeseries_template" {
|
||||
div;
|
||||
div;
|
||||
}
|
||||
(app(State(config.clone())).await)
|
||||
}
|
||||
}
|
||||
|
@ -5,14 +5,13 @@ class TimeseriesGraph extends HTMLElement {
|
||||
#intervalId;
|
||||
#pollSeconds;
|
||||
#label;
|
||||
#targetNode = null;
|
||||
constructor() {
|
||||
super();
|
||||
const root = this.attachShadow({ mode: "open" });
|
||||
var template = document.getElementById("timeseries_template");
|
||||
this.#width = 800;
|
||||
this.#height = 600;
|
||||
this.#pollSeconds = 30;
|
||||
root.appendChild(template.content.cloneNode(true));
|
||||
this.#targetNode = this.appendChild(document.createElement("div"));
|
||||
}
|
||||
|
||||
static observedAttributes = ['uri', 'width', 'height', 'poll-seconds'];
|
||||
@ -56,8 +55,8 @@ class TimeseriesGraph extends HTMLElement {
|
||||
static elementName = "timeseries-graph";
|
||||
|
||||
getTargetNode() {
|
||||
console.log("shadowroot: ", this.shadowRoot);
|
||||
return this.shadowRoot.firstChild;
|
||||
console.log("targetNode: ", this.#targetNode);
|
||||
return this.#targetNode;
|
||||
}
|
||||
|
||||
stopInterval() {
|
||||
@ -96,7 +95,7 @@ class TimeseriesGraph extends HTMLElement {
|
||||
const labels = pair[0];
|
||||
var trace = {
|
||||
type: "scatter",
|
||||
mode: "lines",
|
||||
mode: "lines+text",
|
||||
x: [],
|
||||
y: []
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user