@c8y/ngx-components 1011.0.22 → 1011.0.25
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/bundles/c8y-ngx-components-repository.umd.js +38 -15
- package/bundles/c8y-ngx-components-repository.umd.js.map +1 -1
- package/bundles/c8y-ngx-components-repository.umd.min.js +1 -1
- package/bundles/c8y-ngx-components-repository.umd.min.js.map +1 -1
- package/bundles/c8y-ngx-components-search.umd.js +7 -4
- package/bundles/c8y-ngx-components-search.umd.js.map +1 -1
- package/bundles/c8y-ngx-components-search.umd.min.js +1 -1
- package/bundles/c8y-ngx-components-search.umd.min.js.map +1 -1
- package/bundles/c8y-ngx-components-sensor-phone.umd.js +1 -1
- package/bundles/c8y-ngx-components-sensor-phone.umd.js.map +1 -1
- package/bundles/c8y-ngx-components-sensor-phone.umd.min.js +2 -2
- package/bundles/c8y-ngx-components-sensor-phone.umd.min.js.map +1 -1
- package/esm2015/repository/configuration/configuration-detail.component.js +7 -2
- package/esm2015/repository/configuration-device-tab/device-configuration.component.js +7 -2
- package/esm2015/repository/configuration-device-tab/device-configuration.guard.js +4 -2
- package/esm2015/repository/firmware-device-tab/firmware-device-tab.component.js +4 -3
- package/esm2015/repository/firmware-device-tab/firmware-device-tab.guard.js +4 -5
- package/esm2015/repository/software-device-tab/device-software-list.component.js +10 -3
- package/esm2015/repository/software-device-tab/installed-software.component.js +10 -2
- package/esm2015/repository/software-device-tab/software-device-tab.component.js +2 -2
- package/esm2015/repository/software-device-tab/software-device-tab.guard.js +9 -5
- package/esm2015/search/search-grid.component.js +2 -2
- package/esm2015/search/search.service.js +6 -4
- package/esm2015/sensor-phone/sensor-phone-modal.component.js +2 -2
- package/fesm2015/c8y-ngx-components-repository.js +43 -16
- package/fesm2015/c8y-ngx-components-repository.js.map +1 -1
- package/fesm2015/c8y-ngx-components-search.js +6 -4
- package/fesm2015/c8y-ngx-components-search.js.map +1 -1
- package/fesm2015/c8y-ngx-components-sensor-phone.js +1 -1
- package/fesm2015/c8y-ngx-components-sensor-phone.js.map +1 -1
- package/locales/locales.pot +13 -6
- package/package.json +2 -2
- package/repository/c8y-ngx-components-repository.metadata.json +1 -1
- package/repository/configuration/configuration-detail.component.d.ts +1 -0
- package/repository/configuration-device-tab/device-configuration.guard.d.ts +1 -1
- package/repository/firmware-device-tab/firmware-device-tab.component.d.ts +1 -0
- package/repository/firmware-device-tab/firmware-device-tab.guard.d.ts +1 -1
- package/repository/software-device-tab/device-software-list.component.d.ts +7 -2
- package/repository/software-device-tab/installed-software.component.d.ts +4 -0
- package/repository/software-device-tab/software-device-tab.guard.d.ts +2 -2
- package/search/c8y-ngx-components-search.metadata.json +1 -1
- package/search/search.service.d.ts +3 -1
- package/sensor-phone/c8y-ngx-components-sensor-phone.metadata.json +1 -1
|
@@ -2490,6 +2490,7 @@
|
|
|
2490
2490
|
this.mo = {};
|
|
2491
2491
|
this.saving = false;
|
|
2492
2492
|
this.uploadChoice = 'uploadBinary';
|
|
2493
|
+
this.textForConfigurationUrlPopover = ngxComponents.gettext("Path for binaries can vary depending on device agent implementation, e.g.:\n /configuration/binaries/configuration1.bin\n https://configuration/binary/123\n ftp://configuration/binary/123.tar.gz\n ");
|
|
2493
2494
|
this.result = new Promise(function (resolve, reject) {
|
|
2494
2495
|
_this._save = resolve;
|
|
2495
2496
|
_this._cancel = reject;
|
|
@@ -2587,7 +2588,7 @@
|
|
|
2587
2588
|
ConfigurationDetailComponent.decorators = [
|
|
2588
2589
|
{ type: core.Component, args: [{
|
|
2589
2590
|
selector: 'c8y-configuration-detail',
|
|
2590
|
-
template: "<div class=\"viewport-modal\">\n <div class=\"modal-header dialog-header\">\n <i [c8yIcon]=\"'cogs'\"></i>\n <h4 translate *ngIf=\"mo.id\">Update configuration</h4>\n <h4 translate *ngIf=\"!mo.id\">Add configuration</h4>\n </div>\n\n <form class=\"d-contents\" #configurationForm=\"ngForm\" (ngSubmit)=\"configurationForm.form.valid && save()\">\n <div class=\"modal-inner-scroll\">\n <div class=\"modal-body\">\n <c8y-form-group>\n <label translate>Name</label>\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} hosts\"\n autocomplete=\"off\"\n required\n maxlength=\"254\"\n [(ngModel)]=\"version\"\n name=\"version\"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Device type</label>\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} c8y_Linux\"\n maxlength=\"254\"\n autocomplete=\"off\"\n [(ngModel)]=\"deviceType\"\n name=\"deviceType\"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Description</label>\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'e.g. Host configuration' | translate }} c8y_Linux\"\n maxlength=\"254\"\n autocomplete=\"off\"\n [(ngModel)]=\"description\"\n name=\"description\"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Configuration type</label>\n <c8y-typeahead\n [(ngModel)]=\"selected\"\n name=\"confType\"\n placeholder=\"{{ 'e.g.' | translate }} ssh\"\n (onSearch)=\"setPipe($event)\"\n displayProperty=\"configurationType\"\n >\n <c8y-li\n *c8yFor=\"let config of configs; pipe: filterPipe; notFound: notFoundTemplate\"\n class=\"p-l-8 p-r-8 c8y-list__item--link\"\n (click)=\"selected = config; setPipe('')\"\n [active]=\"selected === config\"\n >\n <c8y-highlight\n [text]=\"config.configurationType || '--'\"\n [pattern]=\"pattern\"\n ></c8y-highlight>\n </c8y-li>\n <ng-template #notFoundTemplate>\n <c8y-li class=\"bg-gray-lighter p-8\" *ngIf=\"pattern.length > 0\">\n <span translate>No match found, add new`configuration`?</span>\n <button title=\"Create new`configuration`\" type=\"button\" class=\"btn btn-primary btn-xs m-l-16\" translate>\n Create new`configuration`\n </button>\n </c8y-li>\n </ng-template>\n </c8y-typeahead>\n </c8y-form-group>\n\n <c8y-form-group>\n <div class=\"legend form-block m-t-40\" translate>Configuration file</div>\n <c8y-file-picker\n [maxAllowedFiles]=\"1\"\n (onFilesPicked)=\"onFile($event)\"\n [uploadChoice]=\"uploadChoice\"\n [fileUrl]=\"binary.url\"\n [fileBinary]=\"binary.file\"\n >\n </c8y-file-picker>\n </c8y-form-group>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button\n (click)=\"cancel()\"\n type=\"button\"\n class=\"btn btn-default\"\n title=\"{{ 'Cancel' | translate }}\"\n [disabled]=\"saving\"\n >\n <span translate>Cancel</span>\n </button>\n <button\n class=\"btn btn-primary\"\n type=\"submit\"\n title=\"{{ submitButtonTitle | translate }}\"\n [ngClass]=\"{ 'btn-pending': saving }\"\n [disabled]=\"\n !configurationForm.valid ||\n configurationForm.pristine ||\n (!binary?.url && !binary?.file) ||\n saving\n \"\n >\n {{ submitButtonTitle | translate }}\n </button>\n </div>\n </form>\n</div>\n"
|
|
2591
|
+
template: "<div class=\"viewport-modal\">\n <div class=\"modal-header dialog-header\">\n <i [c8yIcon]=\"'cogs'\"></i>\n <h4 translate *ngIf=\"mo.id\">Update configuration</h4>\n <h4 translate *ngIf=\"!mo.id\">Add configuration</h4>\n </div>\n\n <form class=\"d-contents\" #configurationForm=\"ngForm\" (ngSubmit)=\"configurationForm.form.valid && save()\">\n <div class=\"modal-inner-scroll\">\n <div class=\"modal-body\">\n <c8y-form-group>\n <label translate>Name</label>\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} hosts\"\n autocomplete=\"off\"\n required\n maxlength=\"254\"\n [(ngModel)]=\"version\"\n name=\"version\"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Device type</label>\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} c8y_Linux\"\n maxlength=\"254\"\n autocomplete=\"off\"\n [(ngModel)]=\"deviceType\"\n name=\"deviceType\"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Description</label>\n <input\n type=\"text\"\n class=\"form-control\"\n placeholder=\"{{ 'e.g. Host configuration' | translate }} c8y_Linux\"\n maxlength=\"254\"\n autocomplete=\"off\"\n [(ngModel)]=\"description\"\n name=\"description\"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Configuration type</label>\n <c8y-typeahead\n [(ngModel)]=\"selected\"\n name=\"confType\"\n placeholder=\"{{ 'e.g.' | translate }} ssh\"\n (onSearch)=\"setPipe($event)\"\n displayProperty=\"configurationType\"\n >\n <c8y-li\n *c8yFor=\"let config of configs; pipe: filterPipe; notFound: notFoundTemplate\"\n class=\"p-l-8 p-r-8 c8y-list__item--link\"\n (click)=\"selected = config; setPipe('')\"\n [active]=\"selected === config\"\n >\n <c8y-highlight\n [text]=\"config.configurationType || '--'\"\n [pattern]=\"pattern\"\n ></c8y-highlight>\n </c8y-li>\n <ng-template #notFoundTemplate>\n <c8y-li class=\"bg-gray-lighter p-8\" *ngIf=\"pattern.length > 0\">\n <span translate>No match found, add new`configuration`?</span>\n <button title=\"Create new`configuration`\" type=\"button\" class=\"btn btn-primary btn-xs m-l-16\" translate>\n Create new`configuration`\n </button>\n </c8y-li>\n </ng-template>\n </c8y-typeahead>\n </c8y-form-group>\n\n <c8y-form-group>\n <div class=\"legend form-block m-t-40\" translate>Configuration file</div>\n <c8y-file-picker\n [maxAllowedFiles]=\"1\"\n (onFilesPicked)=\"onFile($event)\"\n [uploadChoice]=\"uploadChoice\"\n [fileUrl]=\"binary.url\"\n [fileBinary]=\"binary.file\"\n [fileUrlPopover]=\"textForConfigurationUrlPopover\"\n >\n </c8y-file-picker>\n </c8y-form-group>\n </div>\n </div>\n\n <div class=\"modal-footer\">\n <button\n (click)=\"cancel()\"\n type=\"button\"\n class=\"btn btn-default\"\n title=\"{{ 'Cancel' | translate }}\"\n [disabled]=\"saving\"\n >\n <span translate>Cancel</span>\n </button>\n <button\n class=\"btn btn-primary\"\n type=\"submit\"\n title=\"{{ submitButtonTitle | translate }}\"\n [ngClass]=\"{ 'btn-pending': saving }\"\n [disabled]=\"\n !configurationForm.valid ||\n configurationForm.pristine ||\n (!binary?.url && !binary?.file) ||\n saving\n \"\n >\n {{ submitButtonTitle | translate }}\n </button>\n </div>\n </form>\n</div>\n"
|
|
2591
2592
|
},] }
|
|
2592
2593
|
];
|
|
2593
2594
|
ConfigurationDetailComponent.ctorParameters = function () { return [
|
|
@@ -3130,6 +3131,7 @@
|
|
|
3130
3131
|
return rxjs.of([]);
|
|
3131
3132
|
}
|
|
3132
3133
|
}), operators.shareReplay(1));
|
|
3134
|
+
this.supportsFirmwareOperations$ = this.device$.pipe(operators.map(function (device) { return lodashEs.get(device, 'c8y_SupportedOperations', []).indexOf('c8y_Firmware') > -1; }));
|
|
3133
3135
|
this.changesOperation$ = new rxjs.BehaviorSubject(null);
|
|
3134
3136
|
this.changesInProgress$ = this.changesOperation$.pipe(operators.map(function (operation) { return _this.isInProgress(operation); }));
|
|
3135
3137
|
}
|
|
@@ -3314,7 +3316,7 @@
|
|
|
3314
3316
|
FirmwareDeviceTabComponent.decorators = [
|
|
3315
3317
|
{ type: core.Component, args: [{
|
|
3316
3318
|
selector: 'c8y-firmware-device-tab',
|
|
3317
|
-
template: "<div class=\"row\">\n <div class=\"col-lg-12 col-lg-max\">\n <div class=\"card\">\n <div class=\"card-header separator\">\n <h4 class=\"card-title\" translate>Current firmware</h4>\n </div>\n <div class=\"inner-scroll\">\n <fieldset *ngIf=\"changesOperation$ | async\" class=\"card-block bg-gray-white\">\n <c8y-single-operation [operation]=\"changesOperation$ | async\"></c8y-single-operation>\n </fieldset>\n <div class=\"card-block p-t-0 p-b-0\">\n
|
|
3319
|
+
template: "<div class=\"row\">\n <div class=\"col-lg-12 col-lg-max\">\n <div class=\"card\">\n <div class=\"card-header separator\">\n <h4 class=\"card-title\" translate>Current firmware</h4>\n </div>\n <div class=\"inner-scroll\">\n <fieldset *ngIf=\"changesOperation$ | async\" class=\"card-block bg-gray-white\">\n <c8y-single-operation [operation]=\"changesOperation$ | async\"></c8y-single-operation>\n </fieldset>\n <div class=\"card-block p-t-0 p-b-0\">\n <!-- EMPTY STATE -->\n <ng-container *ngIf=\"isEmpty(deviceFirmwareFragment$ | async); else firmwareBlock\">\n <div class=\"c8y-empty-state text-center\">\n <h1 c8yIcon=\"c8y-firmware\" class=\"c8y-icon-duocolor\"></h1>\n <p>\n <strong translate>No firmware installed.</strong> <br />\n <small translate>Click below to install firmware into this device.</small>\n </p>\n </div>\n </ng-container>\n\n <!-- FIRMWARE -->\n <ng-template #firmwareBlock>\n <c8y-list-group class=\"no-border-last\">\n <c8y-li>\n <c8y-li-icon>\n <i c8yIcon=\"c8y-firmware\"></i>\n </c8y-li-icon>\n\n <c8y-li-body *ngIf=\"deviceFirmwareFragment$ | async as deviceFirmwareFragment\">\n <!-- Firmware title -->\n <p class=\"m-b-16 text-medium\">\n {{ deviceFirmwareFragment.name }}\n </p>\n <!-- Firmware description -->\n <div *ngIf=\"repositoryEntry$ | async as repositoryEntry\">\n <p class=\"text-label-small\" translate>Description</p>\n <p>\n {{ repositoryEntry.description }}\n </p>\n </div>\n\n <!-- BASE/PATCH VERSION -->\n <div class=\"m-b-16\">\n <p class=\"text-label-small\" translate>Version</p>\n <p *ngIf=\"deviceFirmwareFragment.version; else versionNotSpecified\">\n {{ deviceFirmwareFragment.version }}\n </p>\n <ng-template #versionNotSpecified>\n <p>\n <em class=\"text-muted\"> ({{ 'not specified`version`' | translate }}) </em>\n </p>\n </ng-template>\n </div>\n\n <!-- ADD PATCH -->\n <button\n *ngIf=\"\n (supportsFirmwareOperations$ | async) && (this.patches$ | async)?.length > 0\n \"\n (click)=\"addPatch()\"\n class=\"btn btn-xs btn-primary\"\n [disabled]=\"changesInProgress$ | async\"\n title=\"{{ 'Patches available' | translate }}\"\n >\n {{ 'Patches available' | translate }}\n </button>\n </c8y-li-body>\n </c8y-li>\n </c8y-list-group>\n </ng-template>\n </div>\n </div>\n <div *ngIf=\"supportsFirmwareOperations$ | async\" class=\"card-footer separator-top\">\n <!-- INSTALL FIRMWARE -->\n <button\n *ngIf=\"isEmpty(deviceFirmwareFragment$ | async)\"\n class=\"btn btn-primary\"\n (click)=\"installFirmware()\"\n title=\"{{ 'Install firmware' | translate }}\"\n >\n {{ 'Install firmware' | translate }}\n </button>\n\n <!-- REPLACE FIRMWARE -->\n <button\n *ngIf=\"!isEmpty(deviceFirmwareFragment$ | async)\"\n class=\"btn btn-primary\"\n (click)=\"installFirmware()\"\n [disabled]=\"changesInProgress$ | async\"\n title=\"{{ 'Replace firmware' | translate }}\"\n >\n {{ 'Replace firmware' | translate }}\n </button>\n </div>\n </div>\n </div>\n</div>\n"
|
|
3318
3320
|
},] }
|
|
3319
3321
|
];
|
|
3320
3322
|
FirmwareDeviceTabComponent.ctorParameters = function () { return [
|
|
@@ -3332,9 +3334,8 @@
|
|
|
3332
3334
|
FirmwareDeviceTabGuard.prototype.canActivate = function (route) {
|
|
3333
3335
|
var contextData = lodashEs.get(route, 'data.contextData') || lodashEs.get(route, 'parent.data.contextData');
|
|
3334
3336
|
var supportedOperations = lodashEs.get(contextData, SUPPORTED_OPERATIONS_FRAGMENT);
|
|
3335
|
-
return !!supportedOperations
|
|
3336
|
-
|
|
3337
|
-
: false;
|
|
3337
|
+
return ((!!supportedOperations ? lodashEs.indexOf(supportedOperations, FIRMWARE_FRAGMENT) >= 0 : false) ||
|
|
3338
|
+
lodashEs.has(contextData, 'c8y_Firmware'));
|
|
3338
3339
|
};
|
|
3339
3340
|
return FirmwareDeviceTabGuard;
|
|
3340
3341
|
}());
|
|
@@ -3470,7 +3471,7 @@
|
|
|
3470
3471
|
SoftwareDeviceTabComponent.decorators = [
|
|
3471
3472
|
{ type: core.Component, args: [{
|
|
3472
3473
|
selector: 'c8y-software-device-tab',
|
|
3473
|
-
template: "<c8y-action-bar-item [placement]=\"'right'\">\n <button class=\"btn btn-link\" title=\"{{ 'Reload' | translate }}\" (click)=\"loadDevice()\">\n <i c8yIcon=\"refresh\" [ngClass]=\"{ 'icon-spin': reloading }\"></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card d-grid grid__col--8-4--md m-b-0\">\n <c8y-installed-software\n class=\"card--fullpage bg-white\"\n [deviceTypeQuery]=\"deviceTypeQuery$ | async\"\n [softwareList]=\"list$ | async\"\n [deviceSoftwareChanges]=\"changes$ | async\"\n [deviceSoftwareChangesOperation]=\"changesOperation$ | async\"\n [deviceSoftwareChangesInProgress]=\"changesInProgress$ | async\"\n (changes)=\"addChanges($event)\"\n ></c8y-installed-software>\n <c8y-device-software-changes\n class=\"card--fullpage bg-gray-white\"\n [changes]=\"changes$ | async\"\n [changesInProgress]=\"changesInProgress$ | async\"\n (clear)=\"clearChanges()\"\n (drop)=\"dropChange($event)\"\n (apply)=\"applyChanges()\"\n ></c8y-device-software-changes>\n</div>\n"
|
|
3474
|
+
template: "<c8y-action-bar-item [placement]=\"'right'\">\n <button class=\"btn btn-link\" title=\"{{ 'Reload' | translate }}\" (click)=\"loadDevice()\">\n <i c8yIcon=\"refresh\" [ngClass]=\"{ 'icon-spin': reloading }\"></i>\n {{ 'Reload' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card d-grid grid__col--8-4--md m-b-0\">\n <c8y-installed-software\n class=\"card--fullpage bg-white\"\n [device]=\"device$ | async\"\n [deviceTypeQuery]=\"deviceTypeQuery$ | async\"\n [softwareList]=\"list$ | async\"\n [deviceSoftwareChanges]=\"changes$ | async\"\n [deviceSoftwareChangesOperation]=\"changesOperation$ | async\"\n [deviceSoftwareChangesInProgress]=\"changesInProgress$ | async\"\n (changes)=\"addChanges($event)\"\n ></c8y-installed-software>\n <c8y-device-software-changes\n class=\"card--fullpage bg-gray-white\"\n [changes]=\"changes$ | async\"\n [changesInProgress]=\"changesInProgress$ | async\"\n (clear)=\"clearChanges()\"\n (drop)=\"dropChange($event)\"\n (apply)=\"applyChanges()\"\n ></c8y-device-software-changes>\n</div>\n"
|
|
3474
3475
|
},] }
|
|
3475
3476
|
];
|
|
3476
3477
|
SoftwareDeviceTabComponent.ctorParameters = function () { return [
|
|
@@ -3484,11 +3485,14 @@
|
|
|
3484
3485
|
this.operations = ['c8y_SoftwareUpdate', 'c8y_SoftwareList', 'c8y_Software'];
|
|
3485
3486
|
}
|
|
3486
3487
|
SoftwareDeviceTabGuard.prototype.canActivate = function (route) {
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3488
|
+
var device = lodashEs.get(route, 'data.contextData') || lodashEs.get(route, 'parent.data.contextData');
|
|
3489
|
+
return (this.isAnyOperationSupported(device) ||
|
|
3490
|
+
lodashEs.has(device, 'c8y_Software') ||
|
|
3491
|
+
lodashEs.has(device, 'c8y_SoftwareList') ||
|
|
3492
|
+
lodashEs.has(device, 'c8y_SupportedSoftwareTypes'));
|
|
3493
|
+
};
|
|
3494
|
+
SoftwareDeviceTabGuard.prototype.isAnyOperationSupported = function (device) {
|
|
3495
|
+
var supportedOperations = (device === null || device === void 0 ? void 0 : device.c8y_SupportedOperations) || [];
|
|
3492
3496
|
return this.operations.some(function (operation) { return supportedOperations.indexOf(operation) >= 0; });
|
|
3493
3497
|
};
|
|
3494
3498
|
return SoftwareDeviceTabGuard;
|
|
@@ -3503,7 +3507,13 @@
|
|
|
3503
3507
|
this.inventory = inventory;
|
|
3504
3508
|
this.bsModal = bsModal;
|
|
3505
3509
|
this.changes = new core.EventEmitter();
|
|
3510
|
+
this.supportsSoftwareOperations = false;
|
|
3511
|
+
this.operationTypes = ['c8y_SoftwareUpdate', 'c8y_SoftwareList', 'c8y_Software'];
|
|
3506
3512
|
}
|
|
3513
|
+
InstalledSoftwareComponent.prototype.ngOnInit = function () {
|
|
3514
|
+
var supportedOperations = lodashEs.get(this.device, 'c8y_SupportedOperations', []);
|
|
3515
|
+
this.supportsSoftwareOperations = this.operationTypes.some(function (operationType) { return supportedOperations.indexOf(operationType) > -1; });
|
|
3516
|
+
};
|
|
3507
3517
|
InstalledSoftwareComponent.prototype.installSoftware = function () {
|
|
3508
3518
|
var _this = this;
|
|
3509
3519
|
this.displaySoftwareSelectModal({
|
|
@@ -3589,7 +3599,7 @@
|
|
|
3589
3599
|
InstalledSoftwareComponent.decorators = [
|
|
3590
3600
|
{ type: core.Component, args: [{
|
|
3591
3601
|
selector: 'c8y-installed-software',
|
|
3592
|
-
template: "<div class=\"inner-scroll d-flex d-col\">\n <div class=\"card-header large-padding separator sticky-top\">\n <h4 class=\"card-title\" translate>Installed software</h4>\n </div>\n <div class=\"flex-grow\">\n <fieldset *ngIf=\"deviceSoftwareChangesOperation\" class=\"card-block large-padding bg-gray-lighter\">\n <c8y-single-operation [operation]=\"deviceSoftwareChangesOperation\"></c8y-single-operation>\n </fieldset>\n\n <fieldset class=\"d-contents\" [disabled]=\"deviceSoftwareChangesInProgress\">\n <!-- EMPTY STATE -->\n <div class=\"card-block\" *ngIf=\"softwareList.length === 0\">\n <div class=\"c8y-empty-state text-center m-t-16\">\n <h1 class=\"c8y-icon c8y-icon-tools c8y-icon-duocolor\"></h1>\n <p>\n <strong translate>No software installed.</strong> <br />\n <small translate>Click below to install software into this device.</small>\n </p>\n </div>\n </div>\n\n <!-- NOT EMPTY STATE -->\n <ng-container *ngIf=\"softwareList.length > 0\">\n <c8y-device-software-list\n [softwareList]=\"softwareList\"\n [deviceSoftwareChanges]=\"deviceSoftwareChanges\"\n (update)=\"updateSoftware($event)\"\n (remove)=\"removeSoftware($event)\"\n class=\"d-block p-l-16 p-r-16\"\n >\n </c8y-device-software-list>\n </ng-container>\n </fieldset>\n </div>\n<!-- INSTALL SOFTWARE-->\n <div class=\"card-footer large-padding separator sticky-bottom\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Install software' | translate }}\"\n (click)=\"installSoftware()\"\n [disabled]=\"deviceSoftwareChangesInProgress\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Install software' | translate }}\n </button>\n </div>\n</div>\n"
|
|
3602
|
+
template: "<div class=\"inner-scroll d-flex d-col\">\n <div class=\"card-header large-padding separator sticky-top\">\n <h4 class=\"card-title\" translate>Installed software</h4>\n </div>\n <div class=\"flex-grow\">\n <fieldset *ngIf=\"deviceSoftwareChangesOperation\" class=\"card-block large-padding bg-gray-lighter\">\n <c8y-single-operation [operation]=\"deviceSoftwareChangesOperation\"></c8y-single-operation>\n </fieldset>\n\n <fieldset class=\"d-contents\" [disabled]=\"deviceSoftwareChangesInProgress\">\n <!-- EMPTY STATE -->\n <div class=\"card-block\" *ngIf=\"softwareList.length === 0\">\n <div class=\"c8y-empty-state text-center m-t-16\">\n <h1 class=\"c8y-icon c8y-icon-tools c8y-icon-duocolor\"></h1>\n <p>\n <strong translate>No software installed.</strong> <br />\n <small translate>Click below to install software into this device.</small>\n </p>\n </div>\n </div>\n\n <!-- NOT EMPTY STATE -->\n <ng-container *ngIf=\"softwareList.length > 0\">\n <c8y-device-software-list\n [device]=\"device\"\n [softwareList]=\"softwareList\"\n [deviceSoftwareChanges]=\"deviceSoftwareChanges\"\n (update)=\"updateSoftware($event)\"\n (remove)=\"removeSoftware($event)\"\n class=\"d-block p-l-16 p-r-16\"\n >\n </c8y-device-software-list>\n </ng-container>\n </fieldset>\n </div>\n <!-- INSTALL SOFTWARE-->\n <div *ngIf=\"supportsSoftwareOperations\" class=\"card-footer large-padding separator sticky-bottom\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Install software' | translate }}\"\n (click)=\"installSoftware()\"\n [disabled]=\"deviceSoftwareChangesInProgress\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Install software' | translate }}\n </button>\n </div>\n</div>\n"
|
|
3593
3603
|
},] }
|
|
3594
3604
|
];
|
|
3595
3605
|
InstalledSoftwareComponent.ctorParameters = function () { return [
|
|
@@ -3598,6 +3608,7 @@
|
|
|
3598
3608
|
{ type: modal.BsModalService }
|
|
3599
3609
|
]; };
|
|
3600
3610
|
InstalledSoftwareComponent.propDecorators = {
|
|
3611
|
+
device: [{ type: core.Input }],
|
|
3601
3612
|
softwareList: [{ type: core.Input }],
|
|
3602
3613
|
deviceSoftwareChanges: [{ type: core.Input }],
|
|
3603
3614
|
deviceSoftwareChangesOperation: [{ type: core.Input }],
|
|
@@ -3610,7 +3621,13 @@
|
|
|
3610
3621
|
function DeviceSoftwareListComponent() {
|
|
3611
3622
|
this.update = new core.EventEmitter();
|
|
3612
3623
|
this.remove = new core.EventEmitter();
|
|
3624
|
+
this.supportsSoftwareOperations = false;
|
|
3625
|
+
this.operationTypes = ['c8y_SoftwareUpdate', 'c8y_SoftwareList', 'c8y_Software'];
|
|
3613
3626
|
}
|
|
3627
|
+
DeviceSoftwareListComponent.prototype.ngOnInit = function () {
|
|
3628
|
+
var supportedOperations = lodashEs.get(this.device, 'c8y_SupportedOperations', []);
|
|
3629
|
+
this.supportsSoftwareOperations = this.operationTypes.some(function (operationType) { return supportedOperations.indexOf(operationType) > -1; });
|
|
3630
|
+
};
|
|
3614
3631
|
DeviceSoftwareListComponent.prototype.ngAfterContentInit = function () {
|
|
3615
3632
|
this.showUpdate = this.update.observers.length > 0;
|
|
3616
3633
|
this.showRemove = this.remove.observers.length > 0;
|
|
@@ -3624,11 +3641,12 @@
|
|
|
3624
3641
|
DeviceSoftwareListComponent.decorators = [
|
|
3625
3642
|
{ type: core.Component, args: [{
|
|
3626
3643
|
selector: 'c8y-device-software-list',
|
|
3627
|
-
template: "<c8y-list-group class=\"no-border-last\">\n <c8y-li\n [ngClass]=\"{ disabled: isSoftwareGoingToBeChanged(software) }\"\n *ngFor=\"let software of softwareList\"\n >\n <!-- SOFTWARE ICON -->\n <c8y-li-icon>\n <i c8yIcon=\"c8y-tools\"></i>\n </c8y-li-icon>\n\n <c8y-li-body class=\"content-flex-20\">\n <div title=\"{{ software.name }}\" class=\"col-8\">\n <!-- SOFTWARE NAME -->\n <p class=\"text-truncate\">{{ software.name }}</p>\n <!-- SOFTWARE VERSION -->\n <p class=\"text-truncate\">\n <span class=\"text-label-small m-r-4\" translate>\n Version\n </span>\n <span title=\"{{ software.version }}\">\n {{ software.version }}\n </span>\n </p>\n </div>\n\n <div
|
|
3644
|
+
template: "<c8y-list-group class=\"no-border-last\">\n <c8y-li\n [ngClass]=\"{ disabled: isSoftwareGoingToBeChanged(software) }\"\n *ngFor=\"let software of softwareList\"\n >\n <!-- SOFTWARE ICON -->\n <c8y-li-icon>\n <i c8yIcon=\"c8y-tools\"></i>\n </c8y-li-icon>\n\n <c8y-li-body class=\"content-flex-20\">\n <div title=\"{{ software.name }}\" class=\"col-8\">\n <!-- SOFTWARE NAME -->\n <p class=\"text-truncate\">{{ software.name }}</p>\n <!-- SOFTWARE VERSION -->\n <p class=\"text-truncate\">\n <span class=\"text-label-small m-r-4\" translate>\n Version\n </span>\n <span title=\"{{ software.version }}\">\n {{ software.version }}\n </span>\n </p>\n </div>\n\n <div\n *ngIf=\"supportsSoftwareOperations && (showUpdate || showRemove)\"\n class=\"col-4 text-right\"\n >\n <!-- UPDATE SOFTWARE -->\n <button\n *ngIf=\"showUpdate && !isSoftwareGoingToBeChanged(software)\"\n class=\"btn btn-default btn-xs showOnHover\"\n (click)=\"update.emit(software)\"\n title=\"{{ 'Update`software,verb`' | translate }}\"\n translate\n >\n Update\n </button>\n\n <!-- REMOVE SOFTWARE -->\n <button\n *ngIf=\"showRemove && !isSoftwareGoingToBeChanged(software)\"\n title=\"{{ 'Remove`software`' | translate }}\"\n class=\"showOnHover btn btn-dot pull-right\"\n (click)=\"remove.emit(software)\"\n >\n <i c8yIcon=\"minus-circle\" class=\"text-danger\"></i>\n </button>\n </div>\n </c8y-li-body>\n </c8y-li>\n</c8y-list-group>\n"
|
|
3628
3645
|
},] }
|
|
3629
3646
|
];
|
|
3630
3647
|
DeviceSoftwareListComponent.propDecorators = {
|
|
3631
3648
|
softwareList: [{ type: core.Input }],
|
|
3649
|
+
device: [{ type: core.Input }],
|
|
3632
3650
|
deviceSoftwareChanges: [{ type: core.Input }],
|
|
3633
3651
|
update: [{ type: core.Output }],
|
|
3634
3652
|
remove: [{ type: core.Output }]
|
|
@@ -3917,7 +3935,11 @@
|
|
|
3917
3935
|
title: ngxComponents.gettext('No configurations available.'),
|
|
3918
3936
|
text: ngxComponents.gettext('Add configuration to configuration repository')
|
|
3919
3937
|
};
|
|
3920
|
-
this.showTextBasedConfig =
|
|
3938
|
+
this.showTextBasedConfig =
|
|
3939
|
+
this.deviceConfigurationService.hasAnySupportedOperation(this.device, [
|
|
3940
|
+
exports.DeviceConfigurationOperation.CONFIG,
|
|
3941
|
+
exports.DeviceConfigurationOperation.SEND_CONFIG
|
|
3942
|
+
]) || lodashEs.has(this.device, 'c8y_Configuration');
|
|
3921
3943
|
};
|
|
3922
3944
|
DeviceConfigurationComponent.prototype.onConfigTypeSelected = function (config) {
|
|
3923
3945
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4363,7 +4385,8 @@
|
|
|
4363
4385
|
exports.DeviceConfigurationOperation.UPLOAD_CONFIG,
|
|
4364
4386
|
exports.DeviceConfigurationOperation.CONFIG,
|
|
4365
4387
|
exports.DeviceConfigurationOperation.SEND_CONFIG
|
|
4366
|
-
])
|
|
4388
|
+
]) ||
|
|
4389
|
+
lodashEs.has(contextData, 'c8y_Configuration'));
|
|
4367
4390
|
};
|
|
4368
4391
|
return DeviceConfigurationGuard;
|
|
4369
4392
|
}());
|