mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Visual Console Refactor: added the events history item to the visual console container
Former-commit-id: 0105d2cc1a93a24e0d53df8fe057ef233d8a2843
This commit is contained in:
parent
ae0ca5a204
commit
8c1076453f
@ -15,6 +15,9 @@ import Box, { boxPropsDecoder } from "./items/Box";
|
|||||||
import Line, { linePropsDecoder } from "./items/Line";
|
import Line, { linePropsDecoder } from "./items/Line";
|
||||||
import Label, { labelPropsDecoder } from "./items/Label";
|
import Label, { labelPropsDecoder } from "./items/Label";
|
||||||
import SimpleValue, { simpleValuePropsDecoder } from "./items/SimpleValue";
|
import SimpleValue, { simpleValuePropsDecoder } from "./items/SimpleValue";
|
||||||
|
import EventsHistory, {
|
||||||
|
eventsHistoryPropsDecoder
|
||||||
|
} from "./items/EventsHistory";
|
||||||
|
|
||||||
// Base properties.
|
// Base properties.
|
||||||
export interface VisualConsoleProps extends Size {
|
export interface VisualConsoleProps extends Size {
|
||||||
@ -101,7 +104,7 @@ function itemInstanceFrom(data: UnknownObject) {
|
|||||||
case ItemType.LINE_ITEM:
|
case ItemType.LINE_ITEM:
|
||||||
return new Line(linePropsDecoder(data));
|
return new Line(linePropsDecoder(data));
|
||||||
case ItemType.AUTO_SLA_GRAPH:
|
case ItemType.AUTO_SLA_GRAPH:
|
||||||
throw new TypeError("item not found");
|
return new EventsHistory(eventsHistoryPropsDecoder(data));
|
||||||
case ItemType.CIRCULAR_PROGRESS_BAR:
|
case ItemType.CIRCULAR_PROGRESS_BAR:
|
||||||
case ItemType.CIRCULAR_INTERIOR_PROGRESS_BAR:
|
case ItemType.CIRCULAR_INTERIOR_PROGRESS_BAR:
|
||||||
case ItemType.DONUT_GRAPH:
|
case ItemType.DONUT_GRAPH:
|
||||||
@ -247,6 +250,7 @@ export default class VisualConsole {
|
|||||||
public remove(): void {
|
public remove(): void {
|
||||||
this.elements.forEach(e => e.remove()); // Arrow function.
|
this.elements.forEach(e => e.remove()); // Arrow function.
|
||||||
this.elements = [];
|
this.elements = [];
|
||||||
// TODO: Clean container.
|
// Clean container.
|
||||||
|
this.containerRef.innerHTML = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user