@c8y/ngx-components 1019.2.4 → 1019.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/common/forOf.directive.d.ts +10 -1
- package/core/common/forOf.directive.d.ts.map +1 -1
- package/core/common/geo.service.d.ts +9 -0
- package/core/common/geo.service.d.ts.map +1 -0
- package/core/common/index.d.ts +1 -0
- package/core/common/index.d.ts.map +1 -1
- package/core/common/load-more.component.d.ts +1 -0
- package/core/common/load-more.component.d.ts.map +1 -1
- package/core/core.module.d.ts +50 -49
- package/core/core.module.d.ts.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/core/realtime/realtime-button.component.d.ts +5 -2
- package/core/realtime/realtime-button.component.d.ts.map +1 -1
- package/core/router/context-route.service.d.ts +6 -5
- package/core/router/context-route.service.d.ts.map +1 -1
- package/core/time-interval/index.d.ts +3 -0
- package/core/time-interval/index.d.ts.map +1 -0
- package/core/time-interval/time-interval.component.d.ts +26 -0
- package/core/time-interval/time-interval.component.d.ts.map +1 -0
- package/core/time-interval/time-interval.model.d.ts +33 -0
- package/core/time-interval/time-interval.model.d.ts.map +1 -0
- package/esm2022/context-dashboard/report-dashboard/report-dashboard-list.component.mjs +1 -1
- package/esm2022/core/audit-log/audit-log.component.mjs +1 -1
- package/esm2022/core/bootstrap/bootstrap.component.mjs +3 -3
- package/esm2022/core/common/forOf.directive.mjs +18 -2
- package/esm2022/core/common/geo.service.mjs +30 -0
- package/esm2022/core/common/index.mjs +2 -1
- package/esm2022/core/common/load-more.component.mjs +5 -2
- package/esm2022/core/core.module.mjs +11 -7
- package/esm2022/core/dynamic-forms/typeahead/typeahead.type.component.mjs +1 -1
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/core/realtime/realtime-button.component.mjs +10 -4
- package/esm2022/core/router/context-route.service.mjs +10 -4
- package/esm2022/core/search/search-input.component.mjs +1 -1
- package/esm2022/core/time-interval/index.mjs +3 -0
- package/esm2022/core/time-interval/time-interval.component.mjs +85 -0
- package/esm2022/core/time-interval/time-interval.model.mjs +54 -0
- package/esm2022/datapoint-library/list/datapoint-library-list.component.mjs +2 -2
- package/esm2022/datapoint-selector/datapoint-selector-list-item/datapoint-selector-list-item.component.mjs +1 -1
- package/esm2022/device-profile/device-profile-list.component.mjs +1 -1
- package/esm2022/device-profile/device-tab-profile/device-tab-profile.component.mjs +1 -1
- package/esm2022/device-shell/shell/shell.component.mjs +1 -1
- package/esm2022/diagnostics/diagnostics.component.mjs +1 -1
- package/esm2022/ecosystem/applications/install-from-package/install-from-package.component.mjs +1 -1
- package/esm2022/ecosystem/shared/package-version-select/package-version-select.component.mjs +1 -1
- package/esm2022/location/location.component.mjs +1 -1
- package/esm2022/map/cluster-map.component.mjs +7 -7
- package/esm2022/map/map.component.mjs +92 -36
- package/esm2022/map/map.model.mjs +3 -2
- package/esm2022/operations/bulk-operations-list/bulk-operations-list.component.mjs +1 -1
- package/esm2022/operations/bulk-single-operations-list/single-operations-list.component.mjs +1 -1
- package/esm2022/operations/operations-list/operations-list.component.mjs +1 -1
- package/esm2022/operations/operations-timeline/operations-timeline.component.mjs +1 -1
- package/esm2022/operations/stepper-bulk-type-configuration/stepper-bulk-type-configuration.component.mjs +1 -1
- package/esm2022/operations/stepper-bulk-type-device-profile/select-device-profile-step.component.mjs +1 -1
- package/esm2022/operations/stepper-bulk-type-firmware/select-firmware.component.mjs +1 -1
- package/esm2022/operations/stepper-bulk-type-firmware/version-or-patch.component.mjs +1 -1
- package/esm2022/operations/stepper-bulk-type-software/select-software-step.component.mjs +1 -1
- package/esm2022/protocol-lpwan/lpwan-set-connections.component.mjs +1 -1
- package/esm2022/protocol-lpwan/lpwan-set-device-protocol.component.mjs +1 -1
- package/esm2022/repository/configuration/list/configuration-detail.component.mjs +1 -1
- package/esm2022/repository/configuration/list/configuration-list.component.mjs +1 -1
- package/esm2022/repository/firmware/list/add-firmware-modal.component.mjs +1 -1
- package/esm2022/repository/firmware/list/add-firmware-patch-modal.component.mjs +1 -1
- package/esm2022/repository/firmware/list/firmware-details.component.mjs +1 -1
- package/esm2022/repository/firmware/list/firmware-list.component.mjs +1 -1
- package/esm2022/repository/shared/software-type/software-type.component.mjs +1 -1
- package/esm2022/repository/software/device-tab/device-software-list.component.mjs +1 -1
- package/esm2022/repository/software/list/add-software-modal.component.mjs +1 -1
- package/esm2022/repository/software/list/columns/software-type.filtering-form-renderer.component.mjs +1 -1
- package/esm2022/repository/software/list/software-details.component.mjs +1 -1
- package/esm2022/sub-assets/location/asset-location.component.mjs +1 -1
- package/esm2022/tracking/c8y-ngx-components-tracking.mjs +5 -0
- package/esm2022/tracking/index.mjs +6 -0
- package/esm2022/tracking/tracking-marker-popup.component.mjs +34 -0
- package/esm2022/tracking/tracking-tab.guard.mjs +25 -0
- package/esm2022/tracking/tracking.component.mjs +92 -0
- package/esm2022/tracking/tracking.feature.mjs +16 -0
- package/esm2022/tracking/tracking.service.mjs +124 -0
- package/esm2022/trusted-certificates/crl/crl-settings.component.mjs +5 -5
- package/esm2022/trusted-certificates/list/trusted-certificate-list.component.mjs +1 -1
- package/esm2022/widgets/implementations/map/map-widget-config.component.mjs +2 -2
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-list.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-profile.mjs +2 -2
- package/fesm2022/c8y-ngx-components-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-shell.mjs +1 -1
- package/fesm2022/c8y-ngx-components-device-shell.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-diagnostics.mjs +1 -1
- package/fesm2022/c8y-ngx-components-diagnostics.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-location.mjs +1 -1
- package/fesm2022/c8y-ngx-components-location.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +95 -38
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operations-list.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operations-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-single-operations-list.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-single-operations-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-operations-list.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-operations-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-configuration.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs +2 -2
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs +2 -2
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs +2 -2
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +4 -4
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-shared.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +4 -4
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-sub-assets.mjs +1 -1
- package/fesm2022/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-tracking.mjs +271 -0
- package/fesm2022/c8y-ngx-components-tracking.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-trusted-certificates.mjs +5 -5
- package/fesm2022/c8y-ngx-components-trusted-certificates.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +204 -16
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +158 -83
- package/locales/en.po +6 -0
- package/locales/fr.po +342 -186
- package/locales/locales.pot +34 -28
- package/locales/nl.po +326 -170
- package/locales/pt_BR.po +342 -186
- package/map/cluster-map.component.d.ts +3 -3
- package/map/cluster-map.component.d.ts.map +1 -1
- package/map/map.component.d.ts +17 -7
- package/map/map.component.d.ts.map +1 -1
- package/map/map.model.d.ts +14 -6
- package/map/map.model.d.ts.map +1 -1
- package/package.json +1 -1
- package/tracking/c8y-ngx-components-tracking.d.ts.map +1 -0
- package/tracking/index.d.ts +6 -0
- package/tracking/index.d.ts.map +1 -0
- package/tracking/tracking-marker-popup.component.d.ts +17 -0
- package/tracking/tracking-marker-popup.component.d.ts.map +1 -0
- package/tracking/tracking-tab.guard.d.ts +12 -0
- package/tracking/tracking-tab.guard.d.ts.map +1 -0
- package/tracking/tracking.component.d.ts +33 -0
- package/tracking/tracking.component.d.ts.map +1 -0
- package/tracking/tracking.feature.d.ts +3 -0
- package/tracking/tracking.feature.d.ts.map +1 -0
- package/tracking/tracking.service.d.ts +38 -0
- package/tracking/tracking.service.d.ts.map +1 -0
- package/trusted-certificates/crl/crl-settings.component.d.ts +1 -1
- package/trusted-certificates/crl/crl-settings.component.d.ts.map +1 -1
|
@@ -235,7 +235,7 @@ class DeviceShellComponent {
|
|
|
235
235
|
this.destroyed$.complete();
|
|
236
236
|
}
|
|
237
237
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DeviceShellComponent, deps: [{ token: DeviceShellService }, { token: i2.OperationRealtimeService }, { token: i2.ManagedObjectRealtimeService }, { token: i2$1.OperationService }, { token: i4.ActivatedRoute }, { token: i1.BsModalService }, { token: i2.AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
238
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DeviceShellComponent, selector: "c8y-device-shell", providers: [OperationRealtimeService, ManagedObjectRealtimeService], ngImport: i0, template: "<c8y-action-bar-item [placement]=\"'right'\">\n <c8y-realtime-btn [service]=\"operationRealtime\"></c8y-realtime-btn>\n</c8y-action-bar-item>\n\n<div class=\"card content-fullpage d-grid grid__col--6-6--md\">\n <div class=\"inner-scroll d-flex d-col bg-level-0\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Command' | translate }}\n </div>\n </div>\n\n <div class=\"card-block d-flex d-col flex-grow large-padding\">\n <div class=\"d-flex p-b-16\">\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n (click)=\"getPredefinedCommand()\"\n [title]=\"'Display a list of predefined commands' | translate\"\n data-cy=\"shell--predefined-commands\"\n >\n {{ 'Predefined commands' | translate }}\n </button>\n\n <div class=\"m-l-auto\">\n <device-status [mo]=\"device$ | async\"></device-status>\n </div>\n </div>\n <textarea\n [attr.aria-label]=\"'Commands' | translate\"\n class=\"form-control inner-scroll flex-grow bg-level-2 text-monospace\"\n [(ngModel)]=\"command.text\"\n data-cy=\"shell-component--commands\"\n (ngModelChange)=\"$event || resetSupportedDeliveryTypes()\"\n placeholder=\"{{ 'Add commands or use predefined commands above.' | translate }}\"\n ></textarea>\n </div>\n\n <div class=\"card-footer large-padding separator\">\n <ng-container *ngFor=\"let deliveryType of deliveryTypes\">\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n *ngIf=\"deliveryType.isSupportedByCommand\"\n [disabled]=\"!command?.text || (sendingCommand$ | async)\"\n (click)=\"execute(deliveryType.name)\"\n >\n <span\n [title]=\"\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n \"\n >\n {{\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n }}\n </span>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"inner-scroll bg-level-1\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Operations' | translate }}\n </div>\n </div>\n <div class=\"card-block large-padding\">\n <c8y-operations-timeline\n [operations]=\"operations\"\n [sourceId]=\"device.id\"\n [filterPipe]=\"filterPipe\"\n [bodyTemplate]=\"timelineItemBody\"\n [footerTemplates]=\"[timelineItemFooter]\"\n [propertiesToHide]=\"['c8y_Command']\"\n ></c8y-operations-timeline>\n <ng-template #timelineItemBody let-operation>\n <small>{{ operation.c8y_Command?.text || operation.description }}</small>\n </ng-template>\n <ng-template #timelineItemFooter let-operation>\n <div *ngIf=\"operation.c8y_Command?.text\">\n <div class=\"legend form-block\" translate>Command</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.text}}</code>\n </pre>\n </div>\n <div *ngIf=\"operation.c8y_Command?.result\">\n <div class=\"legend form-block\" translate>Response</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.result}}</code>\n </pre>\n </div>\n </ng-template>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.DeviceStatusComponent, selector: "device-status", inputs: ["mo"] }, { kind: "component", type: i2.RealtimeButtonComponent, selector: "c8y-realtime-btn", inputs: ["service", "label", "title"] }, { kind: "component", type: i8.OperationsTimelineComponent, selector: "c8y-operations-timeline", inputs: ["operations", "sourceId", "filterPipe", "bodyTemplate", "footerTemplates", "propertiesToHide"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }] }); }
|
|
238
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DeviceShellComponent, selector: "c8y-device-shell", providers: [OperationRealtimeService, ManagedObjectRealtimeService], ngImport: i0, template: "<c8y-action-bar-item [placement]=\"'right'\">\n <c8y-realtime-btn [service]=\"operationRealtime\"></c8y-realtime-btn>\n</c8y-action-bar-item>\n\n<div class=\"card content-fullpage d-grid grid__col--6-6--md\">\n <div class=\"inner-scroll d-flex d-col bg-level-0\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Command' | translate }}\n </div>\n </div>\n\n <div class=\"card-block d-flex d-col flex-grow large-padding\">\n <div class=\"d-flex p-b-16\">\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n (click)=\"getPredefinedCommand()\"\n [title]=\"'Display a list of predefined commands' | translate\"\n data-cy=\"shell--predefined-commands\"\n >\n {{ 'Predefined commands' | translate }}\n </button>\n\n <div class=\"m-l-auto\">\n <device-status [mo]=\"device$ | async\"></device-status>\n </div>\n </div>\n <textarea\n [attr.aria-label]=\"'Commands' | translate\"\n class=\"form-control inner-scroll flex-grow bg-level-2 text-monospace\"\n [(ngModel)]=\"command.text\"\n data-cy=\"shell-component--commands\"\n (ngModelChange)=\"$event || resetSupportedDeliveryTypes()\"\n placeholder=\"{{ 'Add commands or use predefined commands above.' | translate }}\"\n ></textarea>\n </div>\n\n <div class=\"card-footer large-padding separator\">\n <ng-container *ngFor=\"let deliveryType of deliveryTypes\">\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n *ngIf=\"deliveryType.isSupportedByCommand\"\n [disabled]=\"!command?.text || (sendingCommand$ | async)\"\n (click)=\"execute(deliveryType.name)\"\n >\n <span\n [title]=\"\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n \"\n >\n {{\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n }}\n </span>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"inner-scroll bg-level-1\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Operations' | translate }}\n </div>\n </div>\n <div class=\"card-block large-padding\">\n <c8y-operations-timeline\n [operations]=\"operations\"\n [sourceId]=\"device.id\"\n [filterPipe]=\"filterPipe\"\n [bodyTemplate]=\"timelineItemBody\"\n [footerTemplates]=\"[timelineItemFooter]\"\n [propertiesToHide]=\"['c8y_Command']\"\n ></c8y-operations-timeline>\n <ng-template #timelineItemBody let-operation>\n <small>{{ operation.c8y_Command?.text || operation.description }}</small>\n </ng-template>\n <ng-template #timelineItemFooter let-operation>\n <div *ngIf=\"operation.c8y_Command?.text\">\n <div class=\"legend form-block\" translate>Command</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.text}}</code>\n </pre>\n </div>\n <div *ngIf=\"operation.c8y_Command?.result\">\n <div class=\"legend form-block\" translate>Response</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.result}}</code>\n </pre>\n </div>\n </ng-template>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.DeviceStatusComponent, selector: "device-status", inputs: ["mo"] }, { kind: "component", type: i2.RealtimeButtonComponent, selector: "c8y-realtime-btn", inputs: ["service", "label", "title", "disabled"], outputs: ["onToggle"] }, { kind: "component", type: i8.OperationsTimelineComponent, selector: "c8y-operations-timeline", inputs: ["operations", "sourceId", "filterPipe", "bodyTemplate", "footerTemplates", "propertiesToHide"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }] }); }
|
|
239
239
|
}
|
|
240
240
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DeviceShellComponent, decorators: [{
|
|
241
241
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-device-shell.mjs","sources":["../../device-shell/command-templates/command-templates.directive.ts","../../device-shell/command-templates/command-templates.component.ts","../../device-shell/command-templates/command-templates.module.ts","../../device-shell/device-shell.guard.ts","../../device-shell/shared/device-shell.model.ts","../../device-shell/shared/device-shell.service.ts","../../device-shell/shared/device-shell-shared.module.ts","../../device-shell/shell/shell.component.ts","../../device-shell/shell/shell.component.html","../../device-shell/shell/shell.module.ts","../../device-shell/device-shell.module.ts","../../device-shell/c8y-ngx-components-device-shell.ts"],"sourcesContent":["import { Directive, ElementRef, EventEmitter, Injector, Output } from '@angular/core';\nimport { UpgradeComponent } from '@angular/upgrade/static';\n\n@Directive({\n selector: 'c8y-command-templates-directive'\n})\nexport class CommandTemplates extends UpgradeComponent {\n @Output()\n close: EventEmitter<void>;\n\n @Output()\n dismiss: EventEmitter<void>;\n\n constructor(elementRef: ElementRef, injector: Injector) {\n super('c8yCommandTemplates', elementRef, injector);\n }\n}\n","import { Component, EventEmitter, Injector } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\n\n/* https://stackoverflow.com/a/65290658 */\nexport function rootScopeCommandTemplateFactory($injector: Injector) {\n return $injector.get('$rootScope').$new();\n}\n\n@Component({\n selector: 'c8y-command-templates',\n template: `<c8y-command-templates-directive\n (close)=\"modalRef.hide(); onTemplateSelected.next($event)\"\n (dismiss)=\"modalRef.hide()\"\n ></c8y-command-templates-directive>`,\n providers: [\n {\n deps: ['$injector'],\n provide: '$scope',\n useFactory: rootScopeCommandTemplateFactory\n }\n ]\n})\nexport class CommandTemplatesComponent {\n onTemplateSelected: EventEmitter<object> = new EventEmitter();\n\n constructor(public modalRef: BsModalRef) {}\n}\n","import { NgModule } from '@angular/core';\nimport { CommandTemplatesComponent } from './command-templates.component';\nimport { CommandTemplates } from './command-templates.directive';\n\n@NgModule({\n declarations: [CommandTemplates, CommandTemplatesComponent],\n exports: [CommandTemplatesComponent]\n})\nexport class CommandTemplatesModule {}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\n\n@Injectable()\nexport class DeviceShellGuard {\n private readonly operation = 'c8y_Command';\n\n canActivate(route: ActivatedRouteSnapshot) {\n const device = route.data.contextData || route.parent.data.contextData;\n const supportedOperations = (device && device.c8y_SupportedOperations) || [];\n return supportedOperations.indexOf(this.operation) >= 0;\n }\n}\n","export enum CommandDeliveryType {\n DEFAULT = 'Default',\n SMS = 'SMS'\n}\n\nexport interface DeliveryType {\n name: string;\n default?: boolean;\n}\n\nexport interface Command {\n id: string;\n name: string;\n text: string;\n deliveryTypes: string[];\n command: string;\n category: string;\n}\n","import { Injectable } from '@angular/core';\nimport { IOperation, IResult, OperationService } from '@c8y/client';\nimport { gettext, OptionsService } from '@c8y/ngx-components';\nimport { Command, CommandDeliveryType, DeliveryType } from './device-shell.model';\n\n@Injectable()\nexport class DeviceShellService {\n constructor(private optionsService: OptionsService, private operationService: OperationService) {}\n\n getDeliveryTypes(): DeliveryType[] {\n return [\n {\n name: gettext(CommandDeliveryType.DEFAULT),\n default: true\n },\n {\n name: gettext(CommandDeliveryType.SMS)\n }\n ];\n }\n\n async canSendCommandsViaSMS(): Promise<boolean> {\n return !!(await this.optionsService.getSystemOption('messaging', 'provider', false));\n }\n\n createCommandOperation(\n deviceId: string,\n command: Command,\n deliveryType: CommandDeliveryType\n ): Promise<IResult<IOperation>> {\n const operation: IOperation = {\n deviceId,\n description: gettext('Execute shell command') + (command.name ? `: ${command.name}` : ''),\n deliveryType: deliveryType === CommandDeliveryType.SMS ? CommandDeliveryType.SMS : undefined,\n c8y_Command: {\n text: command.text\n }\n };\n return this.operationService.create(operation);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DeviceShellService } from './device-shell.service';\n\n@NgModule({\n providers: [DeviceShellService]\n})\nexport class DeviceShellSharedModule {}\n","import { Component, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { IManagedObject, IOperation, IResultList, OperationService } from '@c8y/client';\nimport {\n AlertService,\n gettext,\n ManagedObjectRealtimeService,\n OperationRealtimeService\n} from '@c8y/ngx-components';\nimport { includes, isEmpty } from 'lodash-es';\nimport { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';\nimport { BehaviorSubject, Observable, of, pipe, Subject } from 'rxjs';\nimport { filter, map, startWith, takeUntil } from 'rxjs/operators';\nimport { CommandTemplatesComponent } from '../command-templates';\nimport { Command, CommandDeliveryType, DeliveryType, DeviceShellService } from '../shared';\n\n@Component({\n selector: 'c8y-device-shell',\n templateUrl: 'shell.component.html',\n providers: [OperationRealtimeService, ManagedObjectRealtimeService]\n})\nexport class DeviceShellComponent implements OnInit, OnDestroy {\n device: IManagedObject = this.route.snapshot.parent.data.contextData;\n device$: Observable<IManagedObject> = of({} as any);\n deliveryTypes: Array<DeliveryType & { isSupportedByCommand?: boolean }> = (\n this.service.getDeliveryTypes() || []\n ).map(deliveryType => ({ ...deliveryType, isSupportedByCommand: true }));\n command: Command = {} as Command;\n smsEnabled = false;\n sendingCommand$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n operations: IResultList<IOperation>;\n filterPipe = pipe(\n map((operations: IOperation[]) =>\n (operations || []).filter((operation: IOperation) => !!operation.c8y_Command)\n )\n );\n\n executeViaLabel = gettext('Execute via ({{deliveryType}})');\n\n private destroyed$: Subject<void> = new Subject();\n\n constructor(\n public service: DeviceShellService,\n public operationRealtime: OperationRealtimeService,\n private moRealtime: ManagedObjectRealtimeService,\n private operationService: OperationService,\n private route: ActivatedRoute,\n private modalService: BsModalService,\n private alertService: AlertService\n ) {}\n\n async ngOnInit(): Promise<void> {\n this.smsEnabled = await this.service.canSendCommandsViaSMS();\n\n this.device$ = this.moRealtime.onUpdate$(this.device.id).pipe(startWith(this.device));\n\n this.operations = await this.operationService.list({\n deviceId: this.device.id,\n fragmentType: 'c8y_Command',\n dateFrom: new Date(0).toISOString(),\n dateTo: new Date().toISOString(),\n pageSize: 50,\n withTotalPages: true,\n revert: true\n });\n\n this.operationRealtime\n .onCreate$(this.device.id)\n .pipe(takeUntil(this.destroyed$))\n .subscribe(() => this.alertService.success(gettext('Command sent.')));\n\n this.operationRealtime\n .onUpdate$(this.device.id)\n .pipe(\n filter(op => op.failureReason !== 'Operation cancelled by user.'), // avoid duplicate alerts\n takeUntil(this.destroyed$)\n )\n .subscribe(() => this.alertService.success(gettext('Command status updated.')));\n }\n\n getPredefinedCommand() {\n const modal: BsModalRef<CommandTemplatesComponent> = this.modalService.show(\n CommandTemplatesComponent,\n {\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title'\n }\n );\n modal.content.onTemplateSelected.pipe(takeUntil(this.destroyed$)).subscribe(result => {\n this.command = { ...(result as any).commandTemplate } as Command;\n this.deliveryTypes = this.deliveryTypes.map(deliveryType => ({\n ...deliveryType,\n isSupportedByCommand:\n isEmpty(this.command.deliveryTypes) ||\n includes(this.command.deliveryTypes, deliveryType.name)\n }));\n });\n }\n\n resetSupportedDeliveryTypes(): void {\n this.deliveryTypes = (this.service.getDeliveryTypes() || []).map(deliveryType => ({\n ...deliveryType,\n isSupportedByCommand: true\n }));\n }\n\n async execute(commandDeliveryType): Promise<void> {\n const useSMS = commandDeliveryType === CommandDeliveryType.SMS;\n if (useSMS && !this.smsEnabled) {\n this.alertService.warning(gettext('SMS transport is not configured.'));\n return;\n }\n this.sendingCommand$.next(true);\n\n await this.service.createCommandOperation(this.device.id, this.command, commandDeliveryType);\n\n this.command.text = '';\n this.command.name = '';\n this.resetSupportedDeliveryTypes();\n this.sendingCommand$.next(false);\n }\n\n ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n}\n","<c8y-action-bar-item [placement]=\"'right'\">\n <c8y-realtime-btn [service]=\"operationRealtime\"></c8y-realtime-btn>\n</c8y-action-bar-item>\n\n<div class=\"card content-fullpage d-grid grid__col--6-6--md\">\n <div class=\"inner-scroll d-flex d-col bg-level-0\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Command' | translate }}\n </div>\n </div>\n\n <div class=\"card-block d-flex d-col flex-grow large-padding\">\n <div class=\"d-flex p-b-16\">\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n (click)=\"getPredefinedCommand()\"\n [title]=\"'Display a list of predefined commands' | translate\"\n data-cy=\"shell--predefined-commands\"\n >\n {{ 'Predefined commands' | translate }}\n </button>\n\n <div class=\"m-l-auto\">\n <device-status [mo]=\"device$ | async\"></device-status>\n </div>\n </div>\n <textarea\n [attr.aria-label]=\"'Commands' | translate\"\n class=\"form-control inner-scroll flex-grow bg-level-2 text-monospace\"\n [(ngModel)]=\"command.text\"\n data-cy=\"shell-component--commands\"\n (ngModelChange)=\"$event || resetSupportedDeliveryTypes()\"\n placeholder=\"{{ 'Add commands or use predefined commands above.' | translate }}\"\n ></textarea>\n </div>\n\n <div class=\"card-footer large-padding separator\">\n <ng-container *ngFor=\"let deliveryType of deliveryTypes\">\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n *ngIf=\"deliveryType.isSupportedByCommand\"\n [disabled]=\"!command?.text || (sendingCommand$ | async)\"\n (click)=\"execute(deliveryType.name)\"\n >\n <span\n [title]=\"\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n \"\n >\n {{\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n }}\n </span>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"inner-scroll bg-level-1\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Operations' | translate }}\n </div>\n </div>\n <div class=\"card-block large-padding\">\n <c8y-operations-timeline\n [operations]=\"operations\"\n [sourceId]=\"device.id\"\n [filterPipe]=\"filterPipe\"\n [bodyTemplate]=\"timelineItemBody\"\n [footerTemplates]=\"[timelineItemFooter]\"\n [propertiesToHide]=\"['c8y_Command']\"\n ></c8y-operations-timeline>\n <ng-template #timelineItemBody let-operation>\n <small>{{ operation.c8y_Command?.text || operation.description }}</small>\n </ng-template>\n <ng-template #timelineItemFooter let-operation>\n <div *ngIf=\"operation.c8y_Command?.text\">\n <div class=\"legend form-block\" translate>Command</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.text}}</code>\n </pre>\n </div>\n <div *ngIf=\"operation.c8y_Command?.result\">\n <div class=\"legend form-block\" translate>Response</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.result}}</code>\n </pre>\n </div>\n </ng-template>\n </div>\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { OperationsTimelineModule } from '@c8y/ngx-components/operations/operations-timeline';\nimport { CommandTemplatesModule } from '../command-templates';\nimport { DeviceShellSharedModule } from '../shared';\nimport { DeviceShellComponent } from './shell.component';\n\n@NgModule({\n imports: [\n CommonModule,\n CoreModule,\n OperationsTimelineModule,\n CommandTemplatesModule,\n DeviceShellSharedModule\n ],\n declarations: [DeviceShellComponent],\n exports: [DeviceShellComponent]\n})\nexport class ShellModule {}\n","import { NgModule } from '@angular/core';\nimport { gettext, hookRoute, Route, ViewContext } from '@c8y/ngx-components';\nimport { DeviceShellGuard } from './device-shell.guard';\nimport { DeviceShellComponent, ShellModule } from './shell';\n\nconst DEVICE_SHELL_ROUTE: Route = {\n path: 'shell',\n context: ViewContext.Device,\n component: DeviceShellComponent,\n label: gettext('Shell'),\n icon: 'terminal',\n canActivate: [DeviceShellGuard]\n};\n\n@NgModule({\n imports: [ShellModule],\n providers: [DeviceShellGuard, hookRoute(DEVICE_SHELL_ROUTE)]\n})\nexport class DeviceShellModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.CommandTemplates","i1","i2","i1.DeviceShellService","i3","i5"],"mappings":";;;;;;;;;;;;;;;;;AAMM,MAAO,gBAAiB,SAAQ,gBAAgB,CAAA;IAOpD,WAAY,CAAA,UAAsB,EAAE,QAAkB,EAAA;AACpD,QAAA,KAAK,CAAC,qBAAqB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;KACpD;+GATU,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAhB,gBAAgB,EAAA,QAAA,EAAA,iCAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iCAAiC;AAC5C,iBAAA,CAAA;wHAGC,KAAK,EAAA,CAAA;sBADJ,MAAM;gBAIP,OAAO,EAAA,CAAA;sBADN,MAAM;;;ACPT;AACM,SAAU,+BAA+B,CAAC,SAAmB,EAAA;I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;;;ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-device-shell.mjs","sources":["../../device-shell/command-templates/command-templates.directive.ts","../../device-shell/command-templates/command-templates.component.ts","../../device-shell/command-templates/command-templates.module.ts","../../device-shell/device-shell.guard.ts","../../device-shell/shared/device-shell.model.ts","../../device-shell/shared/device-shell.service.ts","../../device-shell/shared/device-shell-shared.module.ts","../../device-shell/shell/shell.component.ts","../../device-shell/shell/shell.component.html","../../device-shell/shell/shell.module.ts","../../device-shell/device-shell.module.ts","../../device-shell/c8y-ngx-components-device-shell.ts"],"sourcesContent":["import { Directive, ElementRef, EventEmitter, Injector, Output } from '@angular/core';\nimport { UpgradeComponent } from '@angular/upgrade/static';\n\n@Directive({\n selector: 'c8y-command-templates-directive'\n})\nexport class CommandTemplates extends UpgradeComponent {\n @Output()\n close: EventEmitter<void>;\n\n @Output()\n dismiss: EventEmitter<void>;\n\n constructor(elementRef: ElementRef, injector: Injector) {\n super('c8yCommandTemplates', elementRef, injector);\n }\n}\n","import { Component, EventEmitter, Injector } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\n\n/* https://stackoverflow.com/a/65290658 */\nexport function rootScopeCommandTemplateFactory($injector: Injector) {\n return $injector.get('$rootScope').$new();\n}\n\n@Component({\n selector: 'c8y-command-templates',\n template: `<c8y-command-templates-directive\n (close)=\"modalRef.hide(); onTemplateSelected.next($event)\"\n (dismiss)=\"modalRef.hide()\"\n ></c8y-command-templates-directive>`,\n providers: [\n {\n deps: ['$injector'],\n provide: '$scope',\n useFactory: rootScopeCommandTemplateFactory\n }\n ]\n})\nexport class CommandTemplatesComponent {\n onTemplateSelected: EventEmitter<object> = new EventEmitter();\n\n constructor(public modalRef: BsModalRef) {}\n}\n","import { NgModule } from '@angular/core';\nimport { CommandTemplatesComponent } from './command-templates.component';\nimport { CommandTemplates } from './command-templates.directive';\n\n@NgModule({\n declarations: [CommandTemplates, CommandTemplatesComponent],\n exports: [CommandTemplatesComponent]\n})\nexport class CommandTemplatesModule {}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\n\n@Injectable()\nexport class DeviceShellGuard {\n private readonly operation = 'c8y_Command';\n\n canActivate(route: ActivatedRouteSnapshot) {\n const device = route.data.contextData || route.parent.data.contextData;\n const supportedOperations = (device && device.c8y_SupportedOperations) || [];\n return supportedOperations.indexOf(this.operation) >= 0;\n }\n}\n","export enum CommandDeliveryType {\n DEFAULT = 'Default',\n SMS = 'SMS'\n}\n\nexport interface DeliveryType {\n name: string;\n default?: boolean;\n}\n\nexport interface Command {\n id: string;\n name: string;\n text: string;\n deliveryTypes: string[];\n command: string;\n category: string;\n}\n","import { Injectable } from '@angular/core';\nimport { IOperation, IResult, OperationService } from '@c8y/client';\nimport { gettext, OptionsService } from '@c8y/ngx-components';\nimport { Command, CommandDeliveryType, DeliveryType } from './device-shell.model';\n\n@Injectable()\nexport class DeviceShellService {\n constructor(private optionsService: OptionsService, private operationService: OperationService) {}\n\n getDeliveryTypes(): DeliveryType[] {\n return [\n {\n name: gettext(CommandDeliveryType.DEFAULT),\n default: true\n },\n {\n name: gettext(CommandDeliveryType.SMS)\n }\n ];\n }\n\n async canSendCommandsViaSMS(): Promise<boolean> {\n return !!(await this.optionsService.getSystemOption('messaging', 'provider', false));\n }\n\n createCommandOperation(\n deviceId: string,\n command: Command,\n deliveryType: CommandDeliveryType\n ): Promise<IResult<IOperation>> {\n const operation: IOperation = {\n deviceId,\n description: gettext('Execute shell command') + (command.name ? `: ${command.name}` : ''),\n deliveryType: deliveryType === CommandDeliveryType.SMS ? CommandDeliveryType.SMS : undefined,\n c8y_Command: {\n text: command.text\n }\n };\n return this.operationService.create(operation);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DeviceShellService } from './device-shell.service';\n\n@NgModule({\n providers: [DeviceShellService]\n})\nexport class DeviceShellSharedModule {}\n","import { Component, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { IManagedObject, IOperation, IResultList, OperationService } from '@c8y/client';\nimport {\n AlertService,\n gettext,\n ManagedObjectRealtimeService,\n OperationRealtimeService\n} from '@c8y/ngx-components';\nimport { includes, isEmpty } from 'lodash-es';\nimport { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';\nimport { BehaviorSubject, Observable, of, pipe, Subject } from 'rxjs';\nimport { filter, map, startWith, takeUntil } from 'rxjs/operators';\nimport { CommandTemplatesComponent } from '../command-templates';\nimport { Command, CommandDeliveryType, DeliveryType, DeviceShellService } from '../shared';\n\n@Component({\n selector: 'c8y-device-shell',\n templateUrl: 'shell.component.html',\n providers: [OperationRealtimeService, ManagedObjectRealtimeService]\n})\nexport class DeviceShellComponent implements OnInit, OnDestroy {\n device: IManagedObject = this.route.snapshot.parent.data.contextData;\n device$: Observable<IManagedObject> = of({} as any);\n deliveryTypes: Array<DeliveryType & { isSupportedByCommand?: boolean }> = (\n this.service.getDeliveryTypes() || []\n ).map(deliveryType => ({ ...deliveryType, isSupportedByCommand: true }));\n command: Command = {} as Command;\n smsEnabled = false;\n sendingCommand$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n operations: IResultList<IOperation>;\n filterPipe = pipe(\n map((operations: IOperation[]) =>\n (operations || []).filter((operation: IOperation) => !!operation.c8y_Command)\n )\n );\n\n executeViaLabel = gettext('Execute via ({{deliveryType}})');\n\n private destroyed$: Subject<void> = new Subject();\n\n constructor(\n public service: DeviceShellService,\n public operationRealtime: OperationRealtimeService,\n private moRealtime: ManagedObjectRealtimeService,\n private operationService: OperationService,\n private route: ActivatedRoute,\n private modalService: BsModalService,\n private alertService: AlertService\n ) {}\n\n async ngOnInit(): Promise<void> {\n this.smsEnabled = await this.service.canSendCommandsViaSMS();\n\n this.device$ = this.moRealtime.onUpdate$(this.device.id).pipe(startWith(this.device));\n\n this.operations = await this.operationService.list({\n deviceId: this.device.id,\n fragmentType: 'c8y_Command',\n dateFrom: new Date(0).toISOString(),\n dateTo: new Date().toISOString(),\n pageSize: 50,\n withTotalPages: true,\n revert: true\n });\n\n this.operationRealtime\n .onCreate$(this.device.id)\n .pipe(takeUntil(this.destroyed$))\n .subscribe(() => this.alertService.success(gettext('Command sent.')));\n\n this.operationRealtime\n .onUpdate$(this.device.id)\n .pipe(\n filter(op => op.failureReason !== 'Operation cancelled by user.'), // avoid duplicate alerts\n takeUntil(this.destroyed$)\n )\n .subscribe(() => this.alertService.success(gettext('Command status updated.')));\n }\n\n getPredefinedCommand() {\n const modal: BsModalRef<CommandTemplatesComponent> = this.modalService.show(\n CommandTemplatesComponent,\n {\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title'\n }\n );\n modal.content.onTemplateSelected.pipe(takeUntil(this.destroyed$)).subscribe(result => {\n this.command = { ...(result as any).commandTemplate } as Command;\n this.deliveryTypes = this.deliveryTypes.map(deliveryType => ({\n ...deliveryType,\n isSupportedByCommand:\n isEmpty(this.command.deliveryTypes) ||\n includes(this.command.deliveryTypes, deliveryType.name)\n }));\n });\n }\n\n resetSupportedDeliveryTypes(): void {\n this.deliveryTypes = (this.service.getDeliveryTypes() || []).map(deliveryType => ({\n ...deliveryType,\n isSupportedByCommand: true\n }));\n }\n\n async execute(commandDeliveryType): Promise<void> {\n const useSMS = commandDeliveryType === CommandDeliveryType.SMS;\n if (useSMS && !this.smsEnabled) {\n this.alertService.warning(gettext('SMS transport is not configured.'));\n return;\n }\n this.sendingCommand$.next(true);\n\n await this.service.createCommandOperation(this.device.id, this.command, commandDeliveryType);\n\n this.command.text = '';\n this.command.name = '';\n this.resetSupportedDeliveryTypes();\n this.sendingCommand$.next(false);\n }\n\n ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n}\n","<c8y-action-bar-item [placement]=\"'right'\">\n <c8y-realtime-btn [service]=\"operationRealtime\"></c8y-realtime-btn>\n</c8y-action-bar-item>\n\n<div class=\"card content-fullpage d-grid grid__col--6-6--md\">\n <div class=\"inner-scroll d-flex d-col bg-level-0\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Command' | translate }}\n </div>\n </div>\n\n <div class=\"card-block d-flex d-col flex-grow large-padding\">\n <div class=\"d-flex p-b-16\">\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n (click)=\"getPredefinedCommand()\"\n [title]=\"'Display a list of predefined commands' | translate\"\n data-cy=\"shell--predefined-commands\"\n >\n {{ 'Predefined commands' | translate }}\n </button>\n\n <div class=\"m-l-auto\">\n <device-status [mo]=\"device$ | async\"></device-status>\n </div>\n </div>\n <textarea\n [attr.aria-label]=\"'Commands' | translate\"\n class=\"form-control inner-scroll flex-grow bg-level-2 text-monospace\"\n [(ngModel)]=\"command.text\"\n data-cy=\"shell-component--commands\"\n (ngModelChange)=\"$event || resetSupportedDeliveryTypes()\"\n placeholder=\"{{ 'Add commands or use predefined commands above.' | translate }}\"\n ></textarea>\n </div>\n\n <div class=\"card-footer large-padding separator\">\n <ng-container *ngFor=\"let deliveryType of deliveryTypes\">\n <button\n class=\"btn btn-primary\"\n type=\"button\"\n *ngIf=\"deliveryType.isSupportedByCommand\"\n [disabled]=\"!command?.text || (sendingCommand$ | async)\"\n (click)=\"execute(deliveryType.name)\"\n >\n <span\n [title]=\"\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n \"\n >\n {{\n deliveryType.default\n ? ('Execute' | translate)\n : (executeViaLabel | translate: { deliveryType: deliveryType.name })\n }}\n </span>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"inner-scroll bg-level-1\">\n <div class=\"card-header large-padding separator sticky-top\">\n <div class=\"card-title\">\n {{ 'Operations' | translate }}\n </div>\n </div>\n <div class=\"card-block large-padding\">\n <c8y-operations-timeline\n [operations]=\"operations\"\n [sourceId]=\"device.id\"\n [filterPipe]=\"filterPipe\"\n [bodyTemplate]=\"timelineItemBody\"\n [footerTemplates]=\"[timelineItemFooter]\"\n [propertiesToHide]=\"['c8y_Command']\"\n ></c8y-operations-timeline>\n <ng-template #timelineItemBody let-operation>\n <small>{{ operation.c8y_Command?.text || operation.description }}</small>\n </ng-template>\n <ng-template #timelineItemFooter let-operation>\n <div *ngIf=\"operation.c8y_Command?.text\">\n <div class=\"legend form-block\" translate>Command</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.text}}</code>\n </pre>\n </div>\n <div *ngIf=\"operation.c8y_Command?.result\">\n <div class=\"legend form-block\" translate>Response</div>\n <pre class=\"p-8 text-pre-normal\">\n <code>{{operation.c8y_Command.result}}</code>\n </pre>\n </div>\n </ng-template>\n </div>\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { OperationsTimelineModule } from '@c8y/ngx-components/operations/operations-timeline';\nimport { CommandTemplatesModule } from '../command-templates';\nimport { DeviceShellSharedModule } from '../shared';\nimport { DeviceShellComponent } from './shell.component';\n\n@NgModule({\n imports: [\n CommonModule,\n CoreModule,\n OperationsTimelineModule,\n CommandTemplatesModule,\n DeviceShellSharedModule\n ],\n declarations: [DeviceShellComponent],\n exports: [DeviceShellComponent]\n})\nexport class ShellModule {}\n","import { NgModule } from '@angular/core';\nimport { gettext, hookRoute, Route, ViewContext } from '@c8y/ngx-components';\nimport { DeviceShellGuard } from './device-shell.guard';\nimport { DeviceShellComponent, ShellModule } from './shell';\n\nconst DEVICE_SHELL_ROUTE: Route = {\n path: 'shell',\n context: ViewContext.Device,\n component: DeviceShellComponent,\n label: gettext('Shell'),\n icon: 'terminal',\n canActivate: [DeviceShellGuard]\n};\n\n@NgModule({\n imports: [ShellModule],\n providers: [DeviceShellGuard, hookRoute(DEVICE_SHELL_ROUTE)]\n})\nexport class DeviceShellModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.CommandTemplates","i1","i2","i1.DeviceShellService","i3","i5"],"mappings":";;;;;;;;;;;;;;;;;AAM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B,IAAA,SAAS,EAAE,oBAAoB;AAC/B,IAAA,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC;AACvB,IAAA,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,CAAC,gBAAgB,CAAC;CAChC,CAAC;MAMW,iBAAiB,CAAA;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAHlB,WAAW,CAAA,EAAA,CAAA,CAAA,EAAA;gHAGV,iBAAiB,EAAA,SAAA,EAFjB,CAAC,gBAAgB,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAA,OAAA,EAAA,CADlD,WAAW,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAGV,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,WAAW,CAAC;oBACtB,SAAS,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAC7D,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -175,7 +175,7 @@ class DiagnosticsComponent {
|
|
|
175
175
|
this.diagnosticService.cancelOperation(operation);
|
|
176
176
|
}
|
|
177
177
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagnosticsComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: DiagnosticsService }, { token: i3.OperationRealtimeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DiagnosticsComponent, selector: "c8y-diagnostics", ngImport: i0, template: "<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n type=\"button\"\n title=\"{{ 'Request diagnostic file' | translate }}\"\n (click)=\"onDiagnosticRequest()\"\n >\n <i c8yIcon=\"stethoscope\"></i>\n <span translate>Request diagnostic file</span>\n </button>\n</c8y-action-bar-item>\n\n<div\n class=\"page-sticky-header hidden-xs c8y-list__item c8y-list--timeline\"\n *ngIf=\"operationCount > 0\"\n>\n <div class=\"d-flex\">\n <div class=\"c8y-list--timeline__item__date a-s-center\">\n <label>{{ 'Date' | translate }}</label>\n </div>\n <div class=\"c8y-list__item__block flex-grow\">\n <div class=\"c8y-list__item__icon\">\n <i class=\"p-l-24\"></i>\n </div>\n <div class=\"c8y-list__item__body\">\n <div class=\"content-flex-40\">\n <div class=\"col-4\">{{ 'Event' | translate }}</div>\n <div class=\"col-5 m-l-8\">{{ 'File' | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<c8y-list-group>\n <ng-template\n c8yFor\n let-operation\n [c8yForOf]=\"operations$\"\n [c8yForPipe]=\"operationsPipe\"\n [c8yForRealtime]=\"operationRealtime\"\n [c8yForRealtimeOptions]=\"realtimeOptions\"\n (c8yForCount)=\"operationCount = $event\"\n >\n <c8y-li-timeline>\n {{ operation.creationTime | c8yDate }}\n <c8y-li>\n <c8y-li-icon>\n <i\n [c8yIcon]=\"statusIcons[operation.status]\"\n [ngClass]=\"statusClasses[operation.status]\"\n [tooltip]=\"operation.status?.toString() | translate\"\n ></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-40\">\n <div class=\"col-4\">\n <p class=\"text-truncate-wrap\" title=\"{{ operation.description | translate }}\">\n {{ operation.description | translate }}\n </p>\n </div>\n <div class=\"col-5\" *ngIf=\"operation.c8y_DiagnosticReport?.file\">\n <div class=\"text-truncate-wrap m-t-xs-8\">\n <span class=\"text-label-small visible-xs\" translate>File</span>\n <span title=\"{{ operation.c8y_DiagnosticReport.file }}\">\n <c8y-file-download\n url=\"{{ operation.c8y_DiagnosticReport.file }}\"\n ></c8y-file-download>\n </span>\n </div>\n </div>\n </c8y-li-body>\n <c8y-li-action\n (click)=\"onCancel(operation)\"\n *ngIf=\"operation.status === 'PENDING'\"\n icon=\"times\"\n label=\"{{ 'Cancel' | translate }}\"\n ></c8y-li-action>\n <c8y-li-action\n (click)=\"onDelete(operation)\"\n *ngIf=\"operation.status === 'SUCCESSFUL'\"\n icon=\"delete\"\n label=\"{{ 'Delete' | translate }}\"\n ></c8y-li-action>\n </c8y-li>\n </c8y-li-timeline>\n </ng-template>\n</c8y-list-group>\n\n<!-- EMPTY STATE -->\n\n<c8y-ui-empty-state\n *ngIf=\"operationCount === 0\"\n [icon]=\"'stethoscope'\"\n [title]=\"'No diagnostic files available.' | translate\"\n></c8y-ui-empty-state>\n", dependencies: [{ kind: "component", type: i3.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "component", type: i3.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i3.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount"] }, { kind: "component", type: i3.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i3.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "emptyActions", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i3.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i3.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i3.ListItemActionComponent, selector: "c8y-list-item-action, c8y-li-action", inputs: ["label", "icon", "disabled"], outputs: ["click"] }, { kind: "component", type: i3.ListItemTimelineComponent, selector: "c8y-list-item-timeline, c8y-li-timeline" }, { kind: "component", type: i5.FileDownloadComponent, selector: "c8y-file-download", inputs: ["url"] }, { kind: "directive", type: i6.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.DatePipe, name: "c8yDate" }] }); }
|
|
178
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DiagnosticsComponent, selector: "c8y-diagnostics", ngImport: i0, template: "<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n type=\"button\"\n title=\"{{ 'Request diagnostic file' | translate }}\"\n (click)=\"onDiagnosticRequest()\"\n >\n <i c8yIcon=\"stethoscope\"></i>\n <span translate>Request diagnostic file</span>\n </button>\n</c8y-action-bar-item>\n\n<div\n class=\"page-sticky-header hidden-xs c8y-list__item c8y-list--timeline\"\n *ngIf=\"operationCount > 0\"\n>\n <div class=\"d-flex\">\n <div class=\"c8y-list--timeline__item__date a-s-center\">\n <label>{{ 'Date' | translate }}</label>\n </div>\n <div class=\"c8y-list__item__block flex-grow\">\n <div class=\"c8y-list__item__icon\">\n <i class=\"p-l-24\"></i>\n </div>\n <div class=\"c8y-list__item__body\">\n <div class=\"content-flex-40\">\n <div class=\"col-4\">{{ 'Event' | translate }}</div>\n <div class=\"col-5 m-l-8\">{{ 'File' | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<c8y-list-group>\n <ng-template\n c8yFor\n let-operation\n [c8yForOf]=\"operations$\"\n [c8yForPipe]=\"operationsPipe\"\n [c8yForRealtime]=\"operationRealtime\"\n [c8yForRealtimeOptions]=\"realtimeOptions\"\n (c8yForCount)=\"operationCount = $event\"\n >\n <c8y-li-timeline>\n {{ operation.creationTime | c8yDate }}\n <c8y-li>\n <c8y-li-icon>\n <i\n [c8yIcon]=\"statusIcons[operation.status]\"\n [ngClass]=\"statusClasses[operation.status]\"\n [tooltip]=\"operation.status?.toString() | translate\"\n ></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-40\">\n <div class=\"col-4\">\n <p class=\"text-truncate-wrap\" title=\"{{ operation.description | translate }}\">\n {{ operation.description | translate }}\n </p>\n </div>\n <div class=\"col-5\" *ngIf=\"operation.c8y_DiagnosticReport?.file\">\n <div class=\"text-truncate-wrap m-t-xs-8\">\n <span class=\"text-label-small visible-xs\" translate>File</span>\n <span title=\"{{ operation.c8y_DiagnosticReport.file }}\">\n <c8y-file-download\n url=\"{{ operation.c8y_DiagnosticReport.file }}\"\n ></c8y-file-download>\n </span>\n </div>\n </div>\n </c8y-li-body>\n <c8y-li-action\n (click)=\"onCancel(operation)\"\n *ngIf=\"operation.status === 'PENDING'\"\n icon=\"times\"\n label=\"{{ 'Cancel' | translate }}\"\n ></c8y-li-action>\n <c8y-li-action\n (click)=\"onDelete(operation)\"\n *ngIf=\"operation.status === 'SUCCESSFUL'\"\n icon=\"delete\"\n label=\"{{ 'Delete' | translate }}\"\n ></c8y-li-action>\n </c8y-li>\n </c8y-li-timeline>\n </ng-template>\n</c8y-list-group>\n\n<!-- EMPTY STATE -->\n\n<c8y-ui-empty-state\n *ngIf=\"operationCount === 0\"\n [icon]=\"'stethoscope'\"\n [title]=\"'No diagnostic files available.' | translate\"\n></c8y-ui-empty-state>\n", dependencies: [{ kind: "component", type: i3.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "component", type: i3.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i3.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForLoadMoreComponent"] }, { kind: "component", type: i3.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i3.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "emptyActions", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i3.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i3.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i3.ListItemActionComponent, selector: "c8y-list-item-action, c8y-li-action", inputs: ["label", "icon", "disabled"], outputs: ["click"] }, { kind: "component", type: i3.ListItemTimelineComponent, selector: "c8y-list-item-timeline, c8y-li-timeline" }, { kind: "component", type: i5.FileDownloadComponent, selector: "c8y-file-download", inputs: ["url"] }, { kind: "directive", type: i6.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.DatePipe, name: "c8yDate" }] }); }
|
|
179
179
|
}
|
|
180
180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagnosticsComponent, decorators: [{
|
|
181
181
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-diagnostics.mjs","sources":["../../diagnostics/diagnostics.service.ts","../../diagnostics/diagnostics-tab.guard.ts","../../diagnostics/diagnostics.component.ts","../../diagnostics/diagnostics.component.html","../../diagnostics/diagnostics.module.ts","../../diagnostics/c8y-ngx-components-diagnostics.ts"],"sourcesContent":["import { Observable } from 'rxjs';\nimport { Injectable } from '@angular/core';\nimport {\n IManagedObject,\n IResultList,\n InventoryBinaryService,\n IOperation,\n OperationService,\n OperationStatus\n} from '@c8y/client';\nimport { AlertService, gettext, ModalService } from '@c8y/ngx-components';\nimport { assign } from 'lodash-es';\nimport { switchMap } from 'rxjs/operators';\n\n@Injectable()\nexport class DiagnosticsService {\n readonly fragment = 'c8y_DiagnosticReport';\n constructor(\n private operationService: OperationService,\n private inventoryBinary: InventoryBinaryService,\n private modalService: ModalService,\n private alertService: AlertService\n ) {}\n\n isSupportedDevice(device): boolean {\n const supportedOperations = (device && device.c8y_SupportedOperations) || [];\n return supportedOperations.includes(this.fragment);\n }\n\n getOperations$(device$: Observable<IManagedObject>): Observable<IResultList<IOperation>> {\n return device$.pipe(\n switchMap(device =>\n this.operationService.list({\n deviceId: device.id,\n fragmentType: this.fragment,\n dateFrom: new Date(0).toISOString(),\n dateTo: new Date(Date.now()).toISOString(),\n revert: true,\n pageSize: 10,\n withTotalPages: true\n })\n )\n );\n }\n\n async createOperation(deviceId: string) {\n const operation = {\n deviceId,\n description: gettext('Diagnostic file request'),\n [this.fragment]: {}\n };\n try {\n await this.operationService.create(operation);\n this.alertService.success(gettext('Diagnostic file request sent.'));\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n\n async deleteOperation(operation: IOperation) {\n try {\n const result = await this.modalService.confirm(\n gettext('Delete diagnostic file'),\n gettext('You are about to delete this diagnostic file. Do you want to proceed?'),\n 'danger',\n {\n ok: gettext('Delete'),\n cancel: gettext('Cancel')\n }\n );\n\n if (result) {\n this.deleteDiagnosticsBinary(operation);\n }\n } catch (error) {\n // Do nothing\n }\n }\n\n async cancelOperation(operation: IOperation) {\n try {\n const operationAfterUpdate = (\n await this.operationService.update({\n id: operation.id,\n status: OperationStatus.FAILED,\n failureReason: gettext('Operation cancelled by user.')\n })\n ).data;\n assign(operation, operationAfterUpdate);\n this.alertService.success(gettext('Diagnostic file request cancelled.'));\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n }\n\n private getOperation(op: IOperation) {\n if (!op) {\n return null;\n }\n return op && op[this.fragment];\n }\n\n private async deleteDiagnosticsBinary(op: IOperation) {\n const operation = this.getOperation(op);\n if (operation && operation.file) {\n const { file } = operation;\n try {\n const binaryId = this.inventoryBinary.getIdFromUrl(file);\n const result = await this.inventoryBinary.delete(binaryId);\n if (result) {\n this.deleteDiagnosticsFragment(op);\n }\n } catch (err) {\n if (err.res.status === 404) {\n // In case the file is already deleted via other means we want to delete the fragment\n this.deleteDiagnosticsFragment(op);\n } else {\n const msg = gettext('Could not delete the diagnostic file.');\n this.alertService.danger(msg);\n }\n }\n }\n }\n\n private async deleteDiagnosticsFragment(op: IOperation) {\n const deleteOp = {\n id: op.id,\n status: op.status,\n [this.fragment]: null\n };\n try {\n const operationAfterUpdate = (await this.operationService.update(deleteOp)).data;\n assign(op, operationAfterUpdate);\n this.alertService.success(gettext('Diagnostic file deleted.'));\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n}\n","import { DiagnosticsService } from './diagnostics.service';\nimport { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\n\n@Injectable()\nexport class DiagnosticsTabGuard {\n constructor(private diagnosticsService: DiagnosticsService) {}\n\n canActivate(route: ActivatedRouteSnapshot) {\n const device = route.data.contextData || route.parent.data.contextData;\n return this.diagnosticsService.isSupportedDevice(device);\n }\n}\n","import { DiagnosticsService } from './diagnostics.service';\nimport { ActivatedRoute } from '@angular/router';\nimport { Component } from '@angular/core';\nimport { BehaviorSubject, pipe } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport {\n ForOfRealtimeOptions,\n operationStatusClasses,\n operationStatusIcons,\n OperationRealtimeService,\n ForOfFilterPipe\n} from '@c8y/ngx-components';\nimport { IManagedObject, IOperation } from '@c8y/client';\n@Component({\n templateUrl: './diagnostics.component.html',\n selector: 'c8y-diagnostics'\n})\nexport class DiagnosticsComponent {\n statusIcons = operationStatusIcons;\n statusClasses = operationStatusClasses;\n deviceId: string = this.route.snapshot.parent.data.contextData.id;\n device$ = new BehaviorSubject<IManagedObject>(this.route.snapshot.parent.data.contextData);\n operations$ = this.diagnosticService.getOperations$(this.device$);\n operationsPipe: ForOfFilterPipe<IOperation> = pipe(\n map(ops => ops.filter(op => op[this.diagnosticService.fragment]))\n );\n realtimeOptions: ForOfRealtimeOptions = {\n entityOrId: this.deviceId,\n removeOnUpdate: true,\n insertOnUpdate: true\n } as ForOfRealtimeOptions;\n operationCount: number;\n\n constructor(\n private route: ActivatedRoute,\n private diagnosticService: DiagnosticsService,\n public operationRealtime: OperationRealtimeService\n ) {}\n\n onDiagnosticRequest() {\n this.diagnosticService.createOperation(this.deviceId);\n }\n\n onDelete(operation: IOperation) {\n this.diagnosticService.deleteOperation(operation);\n }\n\n onCancel(operation: IOperation) {\n this.diagnosticService.cancelOperation(operation);\n }\n}\n","<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n type=\"button\"\n title=\"{{ 'Request diagnostic file' | translate }}\"\n (click)=\"onDiagnosticRequest()\"\n >\n <i c8yIcon=\"stethoscope\"></i>\n <span translate>Request diagnostic file</span>\n </button>\n</c8y-action-bar-item>\n\n<div\n class=\"page-sticky-header hidden-xs c8y-list__item c8y-list--timeline\"\n *ngIf=\"operationCount > 0\"\n>\n <div class=\"d-flex\">\n <div class=\"c8y-list--timeline__item__date a-s-center\">\n <label>{{ 'Date' | translate }}</label>\n </div>\n <div class=\"c8y-list__item__block flex-grow\">\n <div class=\"c8y-list__item__icon\">\n <i class=\"p-l-24\"></i>\n </div>\n <div class=\"c8y-list__item__body\">\n <div class=\"content-flex-40\">\n <div class=\"col-4\">{{ 'Event' | translate }}</div>\n <div class=\"col-5 m-l-8\">{{ 'File' | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<c8y-list-group>\n <ng-template\n c8yFor\n let-operation\n [c8yForOf]=\"operations$\"\n [c8yForPipe]=\"operationsPipe\"\n [c8yForRealtime]=\"operationRealtime\"\n [c8yForRealtimeOptions]=\"realtimeOptions\"\n (c8yForCount)=\"operationCount = $event\"\n >\n <c8y-li-timeline>\n {{ operation.creationTime | c8yDate }}\n <c8y-li>\n <c8y-li-icon>\n <i\n [c8yIcon]=\"statusIcons[operation.status]\"\n [ngClass]=\"statusClasses[operation.status]\"\n [tooltip]=\"operation.status?.toString() | translate\"\n ></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-40\">\n <div class=\"col-4\">\n <p class=\"text-truncate-wrap\" title=\"{{ operation.description | translate }}\">\n {{ operation.description | translate }}\n </p>\n </div>\n <div class=\"col-5\" *ngIf=\"operation.c8y_DiagnosticReport?.file\">\n <div class=\"text-truncate-wrap m-t-xs-8\">\n <span class=\"text-label-small visible-xs\" translate>File</span>\n <span title=\"{{ operation.c8y_DiagnosticReport.file }}\">\n <c8y-file-download\n url=\"{{ operation.c8y_DiagnosticReport.file }}\"\n ></c8y-file-download>\n </span>\n </div>\n </div>\n </c8y-li-body>\n <c8y-li-action\n (click)=\"onCancel(operation)\"\n *ngIf=\"operation.status === 'PENDING'\"\n icon=\"times\"\n label=\"{{ 'Cancel' | translate }}\"\n ></c8y-li-action>\n <c8y-li-action\n (click)=\"onDelete(operation)\"\n *ngIf=\"operation.status === 'SUCCESSFUL'\"\n icon=\"delete\"\n label=\"{{ 'Delete' | translate }}\"\n ></c8y-li-action>\n </c8y-li>\n </c8y-li-timeline>\n </ng-template>\n</c8y-list-group>\n\n<!-- EMPTY STATE -->\n\n<c8y-ui-empty-state\n *ngIf=\"operationCount === 0\"\n [icon]=\"'stethoscope'\"\n [title]=\"'No diagnostic files available.' | translate\"\n></c8y-ui-empty-state>\n","import { DiagnosticsTabGuard } from './diagnostics-tab.guard';\nimport { ListGroupModule } from '@c8y/ngx-components';\nimport { RouterModule } from '@angular/router';\nimport { DiagnosticsService } from './diagnostics.service';\nimport { CoreModule, gettext, hookRoute, ViewContext } from '@c8y/ngx-components';\nimport { DiagnosticsComponent } from './diagnostics.component';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { BsDropdownModule, BsDropdownConfig } from 'ngx-bootstrap/dropdown';\nimport { SharedRepositoryModule } from '@c8y/ngx-components/repository/shared';\n\n@NgModule({\n imports: [\n CoreModule,\n RouterModule,\n CommonModule,\n ListGroupModule,\n SharedRepositoryModule,\n BsDropdownModule,\n TooltipModule\n ],\n declarations: [DiagnosticsComponent],\n exports: [DiagnosticsComponent],\n providers: [\n DiagnosticsService,\n BsDropdownConfig,\n DiagnosticsTabGuard,\n hookRoute({\n context: ViewContext.Device,\n path: 'diagnostics',\n component: DiagnosticsComponent,\n label: gettext('Diagnostics'),\n icon: 'stethoscope',\n canActivate: [DiagnosticsTabGuard],\n priority: 200\n })\n ]\n})\nexport class DiagnosticsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1.DiagnosticsService","i1","i2.DiagnosticsService"],"mappings":";;;;;;;;;;;;;;;;;;;MAea,kBAAkB,CAAA;AAE7B,IAAA,WAAA,CACU,gBAAkC,EAClC,eAAuC,EACvC,YAA0B,EAC1B,YAA0B,EAAA;QAH1B,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QAClC,IAAe,CAAA,eAAA,GAAf,eAAe,CAAwB;QACvC,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAC1B,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAL3B,IAAQ,CAAA,QAAA,GAAG,sBAAsB,CAAC;KAMvC;AAEJ,IAAA,iBAAiB,CAAC,MAAM,EAAA;QACtB,MAAM,mBAAmB,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,uBAAuB,KAAK,EAAE,CAAC;QAC7E,OAAO,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACpD;AAED,IAAA,cAAc,CAAC,OAAmC,EAAA;AAChD,QAAA,OAAO,OAAO,CAAC,IAAI,CACjB,SAAS,CAAC,MAAM,IACd,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;YACzB,QAAQ,EAAE,MAAM,CAAC,EAAE;YACnB,YAA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s","sources":["../../diagnostics/diagnostics.service.ts","../../diagnostics/diagnostics-tab.guard.ts","../../diagnostics/diagnostics.component.ts","../../diagnostics/diagnostics.component.html","../../diagnostics/diagnostics.module.ts","../../diagnostics/c8y-ngx-components-diagnostics.ts"],"sourcesContent":["import { Observable } from 'rxjs';\nimport { Injectable } from '@angular/core';\nimport {\n IManagedObject,\n IResultList,\n InventoryBinaryService,\n IOperation,\n OperationService,\n OperationStatus\n} from '@c8y/client';\nimport { AlertService, gettext, ModalService } from '@c8y/ngx-components';\nimport { assign } from 'lodash-es';\nimport { switchMap } from 'rxjs/operators';\n\n@Injectable()\nexport class DiagnosticsService {\n readonly fragment = 'c8y_DiagnosticReport';\n constructor(\n private operationService: OperationService,\n private inventoryBinary: InventoryBinaryService,\n private modalService: ModalService,\n private alertService: AlertService\n ) {}\n\n isSupportedDevice(device): boolean {\n const supportedOperations = (device && device.c8y_SupportedOperations) || [];\n return supportedOperations.includes(this.fragment);\n }\n\n getOperations$(device$: Observable<IManagedObject>): Observable<IResultList<IOperation>> {\n return device$.pipe(\n switchMap(device =>\n this.operationService.list({\n deviceId: device.id,\n fragmentType: this.fragment,\n dateFrom: new Date(0).toISOString(),\n dateTo: new Date(Date.now()).toISOString(),\n revert: true,\n pageSize: 10,\n withTotalPages: true\n })\n )\n );\n }\n\n async createOperation(deviceId: string) {\n const operation = {\n deviceId,\n description: gettext('Diagnostic file request'),\n [this.fragment]: {}\n };\n try {\n await this.operationService.create(operation);\n this.alertService.success(gettext('Diagnostic file request sent.'));\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n\n async deleteOperation(operation: IOperation) {\n try {\n const result = await this.modalService.confirm(\n gettext('Delete diagnostic file'),\n gettext('You are about to delete this diagnostic file. Do you want to proceed?'),\n 'danger',\n {\n ok: gettext('Delete'),\n cancel: gettext('Cancel')\n }\n );\n\n if (result) {\n this.deleteDiagnosticsBinary(operation);\n }\n } catch (error) {\n // Do nothing\n }\n }\n\n async cancelOperation(operation: IOperation) {\n try {\n const operationAfterUpdate = (\n await this.operationService.update({\n id: operation.id,\n status: OperationStatus.FAILED,\n failureReason: gettext('Operation cancelled by user.')\n })\n ).data;\n assign(operation, operationAfterUpdate);\n this.alertService.success(gettext('Diagnostic file request cancelled.'));\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n }\n\n private getOperation(op: IOperation) {\n if (!op) {\n return null;\n }\n return op && op[this.fragment];\n }\n\n private async deleteDiagnosticsBinary(op: IOperation) {\n const operation = this.getOperation(op);\n if (operation && operation.file) {\n const { file } = operation;\n try {\n const binaryId = this.inventoryBinary.getIdFromUrl(file);\n const result = await this.inventoryBinary.delete(binaryId);\n if (result) {\n this.deleteDiagnosticsFragment(op);\n }\n } catch (err) {\n if (err.res.status === 404) {\n // In case the file is already deleted via other means we want to delete the fragment\n this.deleteDiagnosticsFragment(op);\n } else {\n const msg = gettext('Could not delete the diagnostic file.');\n this.alertService.danger(msg);\n }\n }\n }\n }\n\n private async deleteDiagnosticsFragment(op: IOperation) {\n const deleteOp = {\n id: op.id,\n status: op.status,\n [this.fragment]: null\n };\n try {\n const operationAfterUpdate = (await this.operationService.update(deleteOp)).data;\n assign(op, operationAfterUpdate);\n this.alertService.success(gettext('Diagnostic file deleted.'));\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n}\n","import { DiagnosticsService } from './diagnostics.service';\nimport { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\n\n@Injectable()\nexport class DiagnosticsTabGuard {\n constructor(private diagnosticsService: DiagnosticsService) {}\n\n canActivate(route: ActivatedRouteSnapshot) {\n const device = route.data.contextData || route.parent.data.contextData;\n return this.diagnosticsService.isSupportedDevice(device);\n }\n}\n","import { DiagnosticsService } from './diagnostics.service';\nimport { ActivatedRoute } from '@angular/router';\nimport { Component } from '@angular/core';\nimport { BehaviorSubject, pipe } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport {\n ForOfRealtimeOptions,\n operationStatusClasses,\n operationStatusIcons,\n OperationRealtimeService,\n ForOfFilterPipe\n} from '@c8y/ngx-components';\nimport { IManagedObject, IOperation } from '@c8y/client';\n@Component({\n templateUrl: './diagnostics.component.html',\n selector: 'c8y-diagnostics'\n})\nexport class DiagnosticsComponent {\n statusIcons = operationStatusIcons;\n statusClasses = operationStatusClasses;\n deviceId: string = this.route.snapshot.parent.data.contextData.id;\n device$ = new BehaviorSubject<IManagedObject>(this.route.snapshot.parent.data.contextData);\n operations$ = this.diagnosticService.getOperations$(this.device$);\n operationsPipe: ForOfFilterPipe<IOperation> = pipe(\n map(ops => ops.filter(op => op[this.diagnosticService.fragment]))\n );\n realtimeOptions: ForOfRealtimeOptions = {\n entityOrId: this.deviceId,\n removeOnUpdate: true,\n insertOnUpdate: true\n } as ForOfRealtimeOptions;\n operationCount: number;\n\n constructor(\n private route: ActivatedRoute,\n private diagnosticService: DiagnosticsService,\n public operationRealtime: OperationRealtimeService\n ) {}\n\n onDiagnosticRequest() {\n this.diagnosticService.createOperation(this.deviceId);\n }\n\n onDelete(operation: IOperation) {\n this.diagnosticService.deleteOperation(operation);\n }\n\n onCancel(operation: IOperation) {\n this.diagnosticService.cancelOperation(operation);\n }\n}\n","<c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link\"\n type=\"button\"\n title=\"{{ 'Request diagnostic file' | translate }}\"\n (click)=\"onDiagnosticRequest()\"\n >\n <i c8yIcon=\"stethoscope\"></i>\n <span translate>Request diagnostic file</span>\n </button>\n</c8y-action-bar-item>\n\n<div\n class=\"page-sticky-header hidden-xs c8y-list__item c8y-list--timeline\"\n *ngIf=\"operationCount > 0\"\n>\n <div class=\"d-flex\">\n <div class=\"c8y-list--timeline__item__date a-s-center\">\n <label>{{ 'Date' | translate }}</label>\n </div>\n <div class=\"c8y-list__item__block flex-grow\">\n <div class=\"c8y-list__item__icon\">\n <i class=\"p-l-24\"></i>\n </div>\n <div class=\"c8y-list__item__body\">\n <div class=\"content-flex-40\">\n <div class=\"col-4\">{{ 'Event' | translate }}</div>\n <div class=\"col-5 m-l-8\">{{ 'File' | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<c8y-list-group>\n <ng-template\n c8yFor\n let-operation\n [c8yForOf]=\"operations$\"\n [c8yForPipe]=\"operationsPipe\"\n [c8yForRealtime]=\"operationRealtime\"\n [c8yForRealtimeOptions]=\"realtimeOptions\"\n (c8yForCount)=\"operationCount = $event\"\n >\n <c8y-li-timeline>\n {{ operation.creationTime | c8yDate }}\n <c8y-li>\n <c8y-li-icon>\n <i\n [c8yIcon]=\"statusIcons[operation.status]\"\n [ngClass]=\"statusClasses[operation.status]\"\n [tooltip]=\"operation.status?.toString() | translate\"\n ></i>\n </c8y-li-icon>\n <c8y-li-body class=\"content-flex-40\">\n <div class=\"col-4\">\n <p class=\"text-truncate-wrap\" title=\"{{ operation.description | translate }}\">\n {{ operation.description | translate }}\n </p>\n </div>\n <div class=\"col-5\" *ngIf=\"operation.c8y_DiagnosticReport?.file\">\n <div class=\"text-truncate-wrap m-t-xs-8\">\n <span class=\"text-label-small visible-xs\" translate>File</span>\n <span title=\"{{ operation.c8y_DiagnosticReport.file }}\">\n <c8y-file-download\n url=\"{{ operation.c8y_DiagnosticReport.file }}\"\n ></c8y-file-download>\n </span>\n </div>\n </div>\n </c8y-li-body>\n <c8y-li-action\n (click)=\"onCancel(operation)\"\n *ngIf=\"operation.status === 'PENDING'\"\n icon=\"times\"\n label=\"{{ 'Cancel' | translate }}\"\n ></c8y-li-action>\n <c8y-li-action\n (click)=\"onDelete(operation)\"\n *ngIf=\"operation.status === 'SUCCESSFUL'\"\n icon=\"delete\"\n label=\"{{ 'Delete' | translate }}\"\n ></c8y-li-action>\n </c8y-li>\n </c8y-li-timeline>\n </ng-template>\n</c8y-list-group>\n\n<!-- EMPTY STATE -->\n\n<c8y-ui-empty-state\n *ngIf=\"operationCount === 0\"\n [icon]=\"'stethoscope'\"\n [title]=\"'No diagnostic files available.' | translate\"\n></c8y-ui-empty-state>\n","import { DiagnosticsTabGuard } from './diagnostics-tab.guard';\nimport { ListGroupModule } from '@c8y/ngx-components';\nimport { RouterModule } from '@angular/router';\nimport { DiagnosticsService } from './diagnostics.service';\nimport { CoreModule, gettext, hookRoute, ViewContext } from '@c8y/ngx-components';\nimport { DiagnosticsComponent } from './diagnostics.component';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { BsDropdownModule, BsDropdownConfig } from 'ngx-bootstrap/dropdown';\nimport { SharedRepositoryModule } from '@c8y/ngx-components/repository/shared';\n\n@NgModule({\n imports: [\n CoreModule,\n RouterModule,\n CommonModule,\n ListGroupModule,\n SharedRepositoryModule,\n BsDropdownModule,\n TooltipModule\n ],\n declarations: [DiagnosticsComponent],\n exports: [DiagnosticsComponent],\n providers: [\n DiagnosticsService,\n BsDropdownConfig,\n DiagnosticsTabGuard,\n hookRoute({\n context: ViewContext.Device,\n path: 'diagnostics',\n component: DiagnosticsComponent,\n label: gettext('Diagnostics'),\n icon: 'stethoscope',\n canActivate: [DiagnosticsTabGuard],\n priority: 200\n })\n ]\n})\nexport class DiagnosticsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1.DiagnosticsService","i1","i2.DiagnosticsService"],"mappings":";;;;;;;;;;;;;;;;;;;MAea,kBAAkB,CAAA;AAE7B,IAAA,WAAA,CACU,gBAAkC,EAClC,eAAuC,EACvC,YAA0B,EAC1B,YAA0B,EAAA;QAH1B,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QAClC,IAAe,CAAA,eAAA,GAAf,eAAe,CAAwB;QACvC,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAC1B,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAL3B,IAAQ,CAAA,QAAA,GAAG,sBAAsB,CAAC;KAMvC;AAEJ,IAAA,iBAAiB,CAAC,MAAM,EAAA;QACtB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4BACR,OAAO,EAAE,WAAW,CAAC,MAAM;AAC3B,4BAAA,IAAI,EAAE,aAAa;AACnB,4BAAA,SAAS,EAAE,oBAAoB;AAC/B,4BAAA,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC;AAC7B,4BAAA,IAAI,EAAE,aAAa;4BACnB,WAAW,EAAE,CAAC,mBAAmB,CAAC;AAClC,4BAAA,QAAQ,EAAE,GAAG;yBACd,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;ACtCD;;AAEG;;;;"}
|
|
@@ -1661,7 +1661,7 @@ class PackageVersionSelectComponent {
|
|
|
1661
1661
|
multi: true,
|
|
1662
1662
|
useExisting: forwardRef(() => PackageVersionSelectComponent)
|
|
1663
1663
|
}
|
|
1664
|
-
], usesOnChanges: true, ngImport: i0, template: "<label for=\"packageVersion\">{{ label | translate }}</label>\n<c8y-form-group>\n <c8y-typeahead\n [(ngModel)]=\"selectedVersion\"\n name=\"packageVersion\"\n (onSearch)=\"onInput$.next($event)\"\n placeholder=\"{{ 'Select below or start typing' | translate }}\"\n [displayProperty]=\"'version'\"\n [required]=\"true\"\n [disabled]=\"isDisabled\"\n [hideNew]=\"true\"\n [container]=\"'body'\"\n >\n <c8y-li\n *c8yFor=\"let appVersion of versions$; loadMore: 'auto'; notFound: notFoundTemplate\"\n (click)=\"onVersionSelect(appVersion)\"\n class=\"p-l-8 p-r-8 c8y-list__item--link\"\n [active]=\"selectedVersion === appVersion\"\n >\n <c8y-li-icon icon=\"big-parcel\"></c8y-li-icon>\n <span\n [ngStyle]=\"{\n display: 'flex',\n 'flex-direction': 'row',\n 'align-content': 'center',\n 'justify-content': 'space-between',\n 'align-items': 'center'\n }\"\n >\n <c8y-highlight\n [text]=\"appVersion.version || '--'\"\n [pattern]=\"onInput$ | async\"\n ></c8y-highlight>\n <span>\n <span *ngFor=\"let tag of appVersion.tags\" class=\"label label-info m-l-4\">\n {{ tag }}\n </span>\n </span>\n </span>\n </c8y-li>\n <ng-template #notFoundTemplate>\n <c8y-li\n class=\"bg-gray-lighter p-8\"\n *ngIf=\"(onInput$ | async)?.length > 0 && (versions$ | async)?.data?.length === 0\"\n >\n <span translate>No match found.</span>\n </c8y-li>\n </ng-template>\n </c8y-typeahead>\n</c8y-form-group>\n", dependencies: [{ kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount"] }, { kind: "component", type: i2.HighlightComponent, selector: "c8y-highlight", inputs: ["pattern", "text", "elementClass", "shouldTrimPattern"] }, { kind: "component", type: i2.TypeaheadComponent, selector: "c8y-typeahead", inputs: ["required", "maxlength", "disabled", "allowFreeEntries", "placeholder", "displayProperty", "icon", "name", "autoClose", "hideNew", "container", "selected"], outputs: ["onSearch", "onIconClick"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "emptyActions", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i2.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }] }); }
|
|
1664
|
+
], usesOnChanges: true, ngImport: i0, template: "<label for=\"packageVersion\">{{ label | translate }}</label>\n<c8y-form-group>\n <c8y-typeahead\n [(ngModel)]=\"selectedVersion\"\n name=\"packageVersion\"\n (onSearch)=\"onInput$.next($event)\"\n placeholder=\"{{ 'Select below or start typing' | translate }}\"\n [displayProperty]=\"'version'\"\n [required]=\"true\"\n [disabled]=\"isDisabled\"\n [hideNew]=\"true\"\n [container]=\"'body'\"\n >\n <c8y-li\n *c8yFor=\"let appVersion of versions$; loadMore: 'auto'; notFound: notFoundTemplate\"\n (click)=\"onVersionSelect(appVersion)\"\n class=\"p-l-8 p-r-8 c8y-list__item--link\"\n [active]=\"selectedVersion === appVersion\"\n >\n <c8y-li-icon icon=\"big-parcel\"></c8y-li-icon>\n <span\n [ngStyle]=\"{\n display: 'flex',\n 'flex-direction': 'row',\n 'align-content': 'center',\n 'justify-content': 'space-between',\n 'align-items': 'center'\n }\"\n >\n <c8y-highlight\n [text]=\"appVersion.version || '--'\"\n [pattern]=\"onInput$ | async\"\n ></c8y-highlight>\n <span>\n <span *ngFor=\"let tag of appVersion.tags\" class=\"label label-info m-l-4\">\n {{ tag }}\n </span>\n </span>\n </span>\n </c8y-li>\n <ng-template #notFoundTemplate>\n <c8y-li\n class=\"bg-gray-lighter p-8\"\n *ngIf=\"(onInput$ | async)?.length > 0 && (versions$ | async)?.data?.length === 0\"\n >\n <span translate>No match found.</span>\n </c8y-li>\n </ng-template>\n </c8y-typeahead>\n</c8y-form-group>\n", dependencies: [{ kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForLoadMoreComponent"] }, { kind: "component", type: i2.HighlightComponent, selector: "c8y-highlight", inputs: ["pattern", "text", "elementClass", "shouldTrimPattern"] }, { kind: "component", type: i2.TypeaheadComponent, selector: "c8y-typeahead", inputs: ["required", "maxlength", "disabled", "allowFreeEntries", "placeholder", "displayProperty", "icon", "name", "autoClose", "hideNew", "container", "selected"], outputs: ["onSearch", "onIconClick"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "emptyActions", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i2.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }] }); }
|
|
1665
1665
|
}
|
|
1666
1666
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PackageVersionSelectComponent, decorators: [{
|
|
1667
1667
|
type: Component,
|