Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

introduce panel for setting up asset

Vincent5c674766e013
diff --git a/manager/src/web/shared/locales/en/or.json b/manager/src/web/shared/locales/en/or.json
index 89f42bcc8..03cf6e0e6 100644
--- a/manager/src/web/shared/locales/en/or.json
+++ b/manager/src/web/shared/locales/en/or.json
@@ -152,6 +152,7 @@
"matchedOfType": "Matched of type {{type}}",
"unmatched": "Unmatched",
"wait": "Wait",
+ "setup": "Setup",
"underlyingAssets": "Underlying assets",
"groupAssetName": "Asset name",
"history": "History",
diff --git a/manager/src/web/shared/locales/nl/or.json b/manager/src/web/shared/locales/nl/or.json
index dbff2b91e..439c26720 100644
--- a/manager/src/web/shared/locales/nl/or.json
+++ b/manager/src/web/shared/locales/nl/or.json
@@ -152,6 +152,7 @@
"matchedOfType": "Hetzelfde type: {{type}}",
"unmatched": "Niet dezelfde",
"wait": "Wacht",
+ "setup": "Instellingen",
"underlyingAssets": "Onderliggende assets",
"groupAssetName": "Asset naam",
"history": "Geschiedenis",
diff --git a/ui/app/manager/src/pages/page-assets.ts b/ui/app/manager/src/pages/page-assets.ts
index 366129332..1eb4b16ef 100644
--- a/ui/app/manager/src/pages/page-assets.ts
+++ b/ui/app/manager/src/pages/page-assets.ts
@@ -59,14 +59,11 @@ export const PAGE_ASSETS_CONFIG_DEFAULT: PageAssetsConfig = {
WellknownAssets.MACROAGENT,
WellknownAssets.CONTROLLERAGENT,
WellknownAssets.TRADFRILIGHTASSET,
- WellknownAssets.KNXAGENT,
- WellknownAssets.ZWAGENT,
WellknownAssets.TRADFRIAGENT,
WellknownAssets.TRADFRIPLUGASSET,
WellknownAssets.VELBUSTCPAGENT,
WellknownAssets.ARTNETLIGHTASSET,
WellknownAssets.TIMERAGENT,
- WellknownAssets.VELBUSSERIALAGENT,
WellknownAssets.CONSOLEASSET
]
}
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index 78fcfc084..51e61f086 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -43,7 +43,7 @@ import "@openremote/or-mwc-components/or-mwc-snackbar";
import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";
export interface PanelConfig {
- type?: "info" | "history" | "group" | "survey" | "survey-results";
+ type?: "info" | "setup" | "history" | "group" | "survey" | "survey-results";
title?: string;
hide?: boolean;
hideOnMobile?: boolean;
@@ -80,6 +80,10 @@ export interface InfoPanelConfig extends PanelConfig {
}
}
+export interface SetupPanelConfig extends PanelConfig {
+ type: "setup"
+}
+
export interface HistoryPanelConfig extends PanelConfig {
type: "history",
include?: string[];
@@ -96,7 +100,7 @@ export interface GroupPanelConfig extends PanelConfig {
};
}
-export type PanelConfigUnion = InfoPanelConfig | GroupPanelConfig | PanelConfig;
+export type PanelConfigUnion = InfoPanelConfig | SetupPanelConfig | GroupPanelConfig | PanelConfig;
export type PanelViewProvider = (asset: Asset, attributes: { [index: string]: Attribute<any> }, panelName: string, hostElement: LitElement, viewerConfig: AssetViewerConfig, panelConfig: PanelConfigUnion) => TemplateResult | undefined;
export type PropertyViewProvider = (asset: Asset, property: string, value: any, hostElement: LitElement, viewerConfig: AssetViewerConfig, panelConfig: PanelConfigUnion) => TemplateResult | undefined;
export type AttributeViewProvider = (asset: Asset, attribute: Attribute<any>, hostElement: LitElement, viewerConfig: AssetViewerConfig, panelConfig: PanelConfigUnion) => TemplateResult | undefined;
@@ -284,7 +288,7 @@ export function getPanelContent(panelName: string, asset: Asset, attributes: { [
}
}
- if (panelConfig.type === "info") {
+ if (panelConfig && panelConfig.type === "info") {
// This type of panel shows attributes and/or properties of the asset
const infoConfig = panelConfig as InfoPanelConfig;
@@ -352,6 +356,14 @@ export function getPanelContent(panelName: string, asset: Asset, attributes: { [
})}`;
}
+ if (panelConfig && panelConfig.type === "setup") {
+ const historyConfig = panelConfig as SetupPanelConfig;
+
+ return html`
+ <pre>${JSON.stringify(historyConfig, undefined, 2)}</pre>
+ `;
+ }
+
if (panelConfig && panelConfig.type === "survey") {
return html`
<or-survey id="survey" .surveyId="${asset.id}"></or-survey>
@@ -801,6 +813,11 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
include: ["notes", "manufacturer", "model"]
}
},
+ setup: {
+ type: "setup",
+ title: "setup",
+ hideOnMobile: false
+ },
location: {
type: "info",
properties: {