diff --git a/src/Model/DeviceItem.ts b/src/Model/DeviceItem.ts index 38b8ffb..954a491 100644 --- a/src/Model/DeviceItem.ts +++ b/src/Model/DeviceItem.ts @@ -13,6 +13,7 @@ export class DeviceItem extends TreeItem implements QuickPickItem { public description: string) { super(deviceId); this.contextValue = "device"; + this.tooltip = this.connectionState; this.collapsibleState = TreeItemCollapsibleState.Collapsed; } } diff --git a/src/Model/ModuleItem.ts b/src/Model/ModuleItem.ts index faa8ac0..5c1fc8f 100644 --- a/src/Model/ModuleItem.ts +++ b/src/Model/ModuleItem.ts @@ -16,13 +16,14 @@ export class ModuleItem extends TreeItem { public readonly contextValue: string) { super(moduleId); this.deviceId = deviceItem.deviceId; + this.tooltip = connectionState; this.command = { command: "azure-iot-toolkit.getModule", title: "", arguments: [this], }; - if (connectionState === "Connected") { - this.description = runtimeStatus ? `${connectionState} (${runtimeStatus})` : connectionState; + if (runtimeStatus) { + this.description = runtimeStatus; } } } diff --git a/src/utility.ts b/src/utility.ts index 141051a..801ae33 100644 --- a/src/utility.ts +++ b/src/utility.ts @@ -200,12 +200,12 @@ export class Utility { const moduleId = module.moduleId.substring(1); if (desiredTwin.systemModules && desiredTwin.systemModules[moduleId]) { return new ModuleItem(deviceItem, module.moduleId, module.connectionString, module.connectionState, - isConnected && reportedTwin ? this.getModuleRuntimeStatus(moduleId, reportedTwin.systemModules) : undefined, iconPath, "edge-module"); + reportedTwin ? this.getModuleRuntimeStatus(moduleId, reportedTwin.systemModules) : undefined, iconPath, "edge-module"); } } else { if (desiredTwin.modules && desiredTwin.modules[module.moduleId]) { return new ModuleItem(deviceItem, module.moduleId, module.connectionString, module.connectionState, - isConnected && reportedTwin ? this.getModuleRuntimeStatus(module.moduleId, reportedTwin.modules) : undefined, iconPath, "edge-module"); + reportedTwin ? this.getModuleRuntimeStatus(module.moduleId, reportedTwin.modules) : undefined, iconPath, "edge-module"); } } const moduleType = module.moduleId.startsWith("$") ? "edge-module" : "module"; @@ -292,13 +292,11 @@ export class Utility { return deviceList.map((device) => { const isConnected = device.connectionState.toString() === "Connected"; const state: string = isConnected ? "on" : "off"; - if (isConnected) { - device.description = device.connectionState.toString(); - } let deviceType: string; if (edgeDeviceIdSet.has(device.deviceId)) { deviceType = "edge"; device.contextValue = "edge"; + device.tooltip = ""; } else { deviceType = "device"; }