diff --git a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts index dc7c36371d..19b84cef15 100644 --- a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts +++ b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts @@ -36,8 +36,6 @@ import { PageLink } from '@shared/models/page/page-link'; import { OtaUpdateComponent } from '@home/pages/ota-update/ota-update.component'; import { EntityAction } from '@home/models/entity/entity-component.models'; import { FileSizePipe } from '@shared/pipe/file-size.pipe'; -import { ClipboardService } from 'ngx-clipboard'; -import { ActionNotificationShow } from '@core/notification/notification.actions'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; @@ -51,8 +49,7 @@ export class OtaUpdateTableConfigResolve implements Resolve, private otaPackageService: OtaPackageService, - private fileSize: FileSizePipe, - private clipboardService: ClipboardService) { + private fileSize: FileSizePipe) { this.config.entityType = EntityType.OTA_PACKAGE; this.config.entityComponent = OtaUpdateComponent; this.config.entityTranslations = entityTypeTranslations.get(EntityType.OTA_PACKAGE); @@ -67,11 +64,11 @@ export class OtaUpdateTableConfigResolve implements Resolve('type', 'ota-update.package-type', '20%', entity => { return this.translate.instant(OtaUpdateTypeTranslationMap.get(entity.type)); }), - new EntityTableColumn('url', 'ota-update.url', '20%', entity => { + new EntityTableColumn('url', 'ota-update.direct-url', '20%', entity => { return entity.url && entity.url.length > 20 ? `${entity.url.slice(0, 20)}…` : ''; }, () => ({}), true, () => ({}), () => undefined, false, { - name: this.translate.instant('ota-update.copy-checksum'), + name: this.translate.instant('ota-update.copy-direct-url'), icon: 'content_paste', style: { 'font-size': '16px', diff --git a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.html b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.html index 35b4fcba08..bde274c28f 100644 --- a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.html +++ b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.html @@ -41,10 +41,18 @@ ngxClipboard (cbOnSuccess)="onPackageChecksumCopied()" [cbContent]="entity?.checksum" - [fxShow]="!isEdit"> + [fxShow]="!isEdit && entity?.checksum"> ota-update.copy-checksum +
@@ -137,12 +145,12 @@
- ota-update.url + ota-update.direct-url - ota-update.url-required + ota-update.direct-url-required
diff --git a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts index 9193b37c8e..1182e6c40a 100644 --- a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts +++ b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update.component.ts @@ -160,6 +160,17 @@ export class OtaUpdateComponent extends EntityComponent implements O })); } + onPackageDirectUrlCopied() { + this.store.dispatch(new ActionNotificationShow( + { + message: this.translate.instant('ota-update.checksum-copied-message'), + type: 'success', + duration: 750, + verticalPosition: 'bottom', + horizontalPosition: 'right' + })); + } + prepareFormValue(formValue: any): any { delete formValue.resource; delete formValue.generateChecksum; diff --git a/ui-ngx/src/app/shared/components/button/copy-button.component.html b/ui-ngx/src/app/shared/components/button/copy-button.component.html index 6b38870d3e..20dd7d06ed 100644 --- a/ui-ngx/src/app/shared/components/button/copy-button.component.html +++ b/ui-ngx/src/app/shared/components/button/copy-button.component.html @@ -16,12 +16,9 @@ -->