100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
UI updates: minor
Rich Turner0f942268827f
diff --git a/ui/component/or-asset-tree/src/index.ts b/ui/component/or-asset-tree/src/index.tsindex e26518caf..416e78995 100644--- a/ui/component/or-asset-tree/src/index.ts+++ b/ui/component/or-asset-tree/src/index.ts@@ -11,7 +11,8 @@ import {AssetsEvent,AssetTreeNode,ClientRole,- SharedEvent+ SharedEvent,+ AssetType} from "@openremote/model";import "@openremote/or-translate";import {style} from "./style";@@ -187,7 +188,7 @@ export const getAssetTypes = async () => {}export function getDefaultAllowedAddAssetTypes(): [AgentDescriptor[], AssetDescriptor[]] {- return [AssetModelUtil.getAgentDescriptors(), AssetModelUtil.getAssetDescriptors()];+ return [AssetModelUtil.getAgentDescriptors(), AssetModelUtil.getAssetDescriptors().filter((descriptor) => descriptor.type !== AssetType.AGENT.type)];}@customElement("or-asset-tree")@@ -537,10 +538,7 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {actions: [{actionName: "cancel",- content: i18next.t("cancel"),- action: () => {- console.log("CLOSED");- }+ content: i18next.t("cancel")},{actionName: "add",diff --git a/ui/component/or-asset-tree/src/or-add-asset-dialog.ts b/ui/component/or-asset-tree/src/or-add-asset-dialog.tsindex 08a2c6d05..87aa62096 100644--- a/ui/component/or-asset-tree/src/or-add-asset-dialog.ts+++ b/ui/component/or-asset-tree/src/or-add-asset-dialog.ts@@ -153,18 +153,25 @@ export class OrAddAssetDialog extends LitElement {<div id="asset-type-option-container">${!this.selectedType? html``- : html`- <or-icon id="type-icon" .icon="${this.selectedType.icon}"></or-icon>- <or-translate id="type-description" .value="${Util.getAssetTypeLabel(this.selectedType)}"></or-translate>- `}+ : this.getTypeTemplate(this.selectedType)}</div></form>`;}+ protected getTypeTemplate(descriptor: AgentDescriptor | AssetDescriptor) {++ return html`+ <or-icon style="--or-icon-fill: ${descriptor.color ? "#" + descriptor.color : "unset"}" id="type-icon" .icon="${descriptor.icon}"></or-icon>+ <or-translate id="type-description" .value="${Util.getAssetTypeLabel(descriptor)}"></or-translate>+ `;+ }+protected onTypeChanged(isAgent: boolean, listItem: ListItem) {const descriptor = listItem.data as AssetDescriptor | AgentDescriptor;this.selectedType = descriptor;++ // Deselect other list selectionconst otherList = isAgent ? this.assetList : this.agentList;if (otherList) {otherList.values = undefined;