mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-24 13:09:47 -04:00
maint: formatting
This commit is contained in:
parent
49d4c2bfd4
commit
31af37467c
@ -31,22 +31,22 @@ class TimeseriesGraph extends HTMLElement {
|
|||||||
|
|
||||||
attributeChanged(name, _oldValue, newValue) {
|
attributeChanged(name, _oldValue, newValue) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'uri':
|
case 'uri':
|
||||||
this.#uri = newValue;
|
this.#uri = newValue;
|
||||||
break;
|
break;
|
||||||
case 'width':
|
case 'width':
|
||||||
this.#width = newValue;
|
this.#width = newValue;
|
||||||
break;
|
break;
|
||||||
case 'height':
|
case 'height':
|
||||||
this.#height = newValue;
|
this.#height = newValue;
|
||||||
break;
|
break;
|
||||||
case 'poll-seconds':
|
case 'poll-seconds':
|
||||||
this.#pollSeconds = newValue;
|
this.#pollSeconds = newValue;
|
||||||
break;
|
break;
|
||||||
case 'label':
|
case 'label':
|
||||||
this.#label = newValue;
|
this.#label = newValue;
|
||||||
break;
|
break;
|
||||||
default: // do nothing;
|
default: // do nothing;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.resetInterval();
|
this.resetInterval();
|
||||||
@ -71,14 +71,14 @@ class TimeseriesGraph extends HTMLElement {
|
|||||||
console.log("targetNode: ", this.#targetNode);
|
console.log("targetNode: ", this.#targetNode);
|
||||||
return this.#targetNode;
|
return this.#targetNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
stopInterval() {
|
stopInterval() {
|
||||||
if (this.#intervalId) {
|
if (this.#intervalId) {
|
||||||
clearInterval(this.#intervalId);
|
clearInterval(this.#intervalId);
|
||||||
this.#intervalId = null;
|
this.#intervalId = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resetInterval() {
|
resetInterval() {
|
||||||
this.stopInterval()
|
this.stopInterval()
|
||||||
if (this.#uri) {
|
if (this.#uri) {
|
||||||
@ -92,7 +92,7 @@ class TimeseriesGraph extends HTMLElement {
|
|||||||
customElements.define(TimeseriesGraph.elementName, TimeseriesGraph);
|
customElements.define(TimeseriesGraph.elementName, TimeseriesGraph);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchData() {
|
async fetchData() {
|
||||||
const response = await fetch(this.#uri);
|
const response = await fetch(this.#uri);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user