diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html index 2033801e0c..9958a877ba 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html @@ -76,18 +76,10 @@ @switch (ws.type) { @case ('instruction') { -
- @if (gatewayDockerComposeAvailable) { -
- {{ 'iot-hub.device-install-gateway-docker-compose' | translate }} - -
- } +
+ [usePlainMarkdown]="true" + (ready)="onMarkdownReady(instructionContainer)">
} diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.scss index cd17092788..a0a5793e7d 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.scss @@ -123,22 +123,6 @@ min-height: 120px; } -// Gateway download bar -.tb-gateway-download-bar { - display: flex; - align-items: center; - justify-content: space-between; - padding: 12px 16px; - margin-bottom: 16px; - background: #e3f2fd; - border-radius: 8px; - - span { - font-size: 14px; - color: rgba(0, 0, 0, 0.87); - } -} - // Instruction view .tb-device-install-instruction { ::ng-deep tb-markdown { @@ -151,6 +135,24 @@ margin-top: 0; } } + + .tb-download-btn { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 6px 16px; + border: 1px solid #305680; + border-radius: 4px; + color: #305680; + font-size: 14px; + font-weight: 500; + text-decoration: none; + cursor: pointer; + + &:hover { + background: rgba(48, 86, 128, 0.08); + } + } } } diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts index fda2ade211..e11c854e16 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts @@ -240,16 +240,17 @@ export class TbDeviceInstallDialogComponent extends DialogComponent { + btn.addEventListener('click', (e) => { + e.preventDefault(); + const gateway = this.entityOutputs.get('gateway'); + if (gateway?.id) { + this.deviceService.downloadGatewayDockerComposeFile(gateway.id).subscribe(); + } + }); + }); } getPatternErrorMessage(field: FormFieldDefinition): string { @@ -266,6 +267,10 @@ export class TbDeviceInstallDialogComponent extends DialogComponent⬇ Download docker-compose.yml'; + } const dotIdx = key.indexOf('.'); if (dotIdx > 0) { const alias = key.substring(0, dotIdx);