Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new widget to list asset and data transmission statuses #2

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ui/component/or-dashboard-builder/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {OrChartWidget} from "./widgets/or-chart-widget";
import { OrKpiWidget } from "./widgets/or-kpi-widget";
import { OrGaugeWidget } from "./widgets/or-gauge-widget";
import {OrMapWidget} from "./widgets/or-map-widget";
import {OrWarnWidget} from "./widgets/or-warn-widget";

// language=CSS
const styling = css`
Expand Down Expand Up @@ -214,6 +215,7 @@ export function registerWidgetTypes() {
widgetTypes.set("kpi", new OrKpiWidget());
widgetTypes.set("gauge", new OrGaugeWidget());
widgetTypes.set("map", new OrMapWidget());
widgetTypes.set("warn", new OrWarnWidget());
}

@customElement("or-dashboard-builder")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class OrDashboardBrowser extends LitElement {

protected renderGrid() {
const sidebarElement = this.shadowRoot?.getElementById("sidebarElement");
const coords: Array<[number, number]> = new Array<[number, number]>([0,0], [2,0], [0,2], [2,2], [4,2], [4,4], [6,4], [6,6], [8,6], [8,8]) // TODO: make this unlimited possibilities with a formula
const coords: Array<[number, number]> = new Array<[number, number]>([0,0], [2,0], [0,2], [2,2], [0,4], [2,4], [0,6], [2,6], [0,8], [2,8]) // TODO: make this unlimited possibilities with a formula
const sidebarItems: any[] = Array.from(widgetTypes).map((typeArr, index) => {
return {x: coords[index][0], y: coords[index][1], w: 2, h: 2, widgetTypeId: typeArr[0], locked: true, content: `<div class="sidebarItem"><or-icon icon="${typeArr[1].DISPLAY_MDI_ICON}"></or-icon><span class="itemText">${typeArr[1].DISPLAY_NAME}</span>`}
});
Expand Down
Loading