From 2d72c278503e6c27de1cc8c332b2c05c623b3cb0 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Thu, 23 Apr 2026 13:52:01 +0300 Subject: [PATCH] feat(iot-hub): implement IoT Hub home-page widget with item cards - Two-column widget showing top-3 solution templates and top-3 devices fetched by totalInstallCount DESC, with installed-state fetching (solution templates list + device counts) - Section titles as .tb-title-link routerLinks to /iot-hub/solution-templates and /iot-hub/devices - Item cards open detail dialog via IotHubActionsService; solution template cards show green check_circle badge in top-right when installed - HomePageWidgetsModule now imports IotHubComponentsModule to resolve IotHubActionsService Device preview styling: - Switch item card .tb-iot-hub-card-preview to white bg + bottom border when item.type === DEVICE - Switch detail dialog .dlg-preview to white bg + full border when DEVICE --- .../iot-hub/iot-hub-item-card.component.html | 2 +- .../iot-hub/iot-hub-item-card.component.scss | 5 + .../iot-hub-item-detail-dialog.component.html | 4 +- .../iot-hub-item-detail-dialog.component.scss | 5 + .../lib/home-page/home-page-widgets.module.ts | 4 +- .../home-page/iot-hub-widget.component.html | 56 +++++- .../home-page/iot-hub-widget.component.scss | 164 ++++++++++++++++++ .../lib/home-page/iot-hub-widget.component.ts | 80 ++++++++- 8 files changed, 312 insertions(+), 8 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html index dc2030b00a..70dc7d986e 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html @@ -80,7 +80,7 @@ } @else {
-
+
@if (getPreviewUrl(); as previewUrl) { } @else { diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.scss index d46124d91e..77d363f4ad 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.scss @@ -52,6 +52,11 @@ position: relative; overflow: hidden; padding: 12px; + + &.tb-iot-hub-card-preview-device { + background: white; + border-bottom: 1px solid rgba(0, 0, 0, 0.12); + } } .tb-iot-hub-preview-image { diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html index a8c943ffa1..b3db15ab0b 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html @@ -93,7 +93,9 @@ } @else {
-
+
@if (item.type === ItemType.SOLUTION_TEMPLATE && carouselImages.length > 1) {