@c8y/ngx-components 1021.49.6 → 1021.50.0
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/LICENSE +1 -1
- package/alarms/alarms.component.d.ts +1 -1
- package/alarms/alarms.component.d.ts.map +1 -1
- package/context-dashboard/context-dashboard.component.d.ts +3 -2
- package/context-dashboard/context-dashboard.component.d.ts.map +1 -1
- package/core/i18n/pattern-messages.data.d.ts +18 -0
- package/core/i18n/pattern-messages.data.d.ts.map +1 -1
- package/core/select/typeahead.component.d.ts.map +1 -1
- package/esm2022/alarms/alarms-type-filter.component.mjs +3 -3
- package/esm2022/alarms/alarms.component.mjs +2 -2
- package/esm2022/context-dashboard/context-dashboard.component.mjs +11 -8
- package/esm2022/context-dashboard/device-info-dashboard/device-info-dashboard.component.mjs +3 -3
- package/esm2022/core/i18n/pattern-messages.data.mjs +19 -1
- package/esm2022/core/search/search-input.component.mjs +3 -3
- package/esm2022/core/select/typeahead.component.mjs +2 -2
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.mjs +2 -2
- package/esm2022/device-list/add-smart-group.component.mjs +3 -3
- package/esm2022/operations/bulk-operation-list-item/bulk-operation-list-item.service.mjs +5 -4
- package/esm2022/operations/operation-details/operation-details.module.mjs +7 -7
- package/esm2022/operations/operations-list/device-control.feature.mjs +20 -0
- package/esm2022/operations/operations-list/index.mjs +4 -3
- package/esm2022/operations/operations-list/operations-list-item.component.mjs +11 -9
- package/esm2022/operations/operations-list/operations-list.component.mjs +15 -10
- package/esm2022/operations/operations-list/operations-list.module.mjs +16 -41
- package/esm2022/operations/operations-list/operations-list.service.mjs +4 -3
- package/esm2022/operations/operations.module.mjs +21 -14
- package/esm2022/operations/shared/operations.service.mjs +4 -3
- package/esm2022/services/index.mjs +14 -3
- package/esm2022/services/service-command-tab/c8y-ngx-components-services-service-command-tab.mjs +5 -0
- package/esm2022/services/service-command-tab/index.mjs +3 -0
- package/esm2022/services/service-command-tab/service-command-tab.component.mjs +33 -0
- package/esm2022/services/service-command-tab/service-command.feature.mjs +14 -0
- package/esm2022/services/services-device-tab/index.mjs +9 -3
- package/esm2022/services/services-device-tab/services-device-tab.component.mjs +3 -4
- package/esm2022/services/services-device-tab/services-device-tab.guard.mjs +2 -2
- package/esm2022/services/services-device-tab/services.breadcrumb-factory.mjs +13 -1
- package/esm2022/services/services.module.mjs +4 -2
- package/esm2022/services/shared/c8y-ngx-components-services-shared.mjs +5 -0
- package/esm2022/services/shared/index.mjs +3 -0
- package/esm2022/services/shared/service-command.service.mjs +118 -0
- package/esm2022/services/shared/services.model.mjs +23 -0
- package/fesm2022/c8y-ngx-components-alarms.mjs +3 -3
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +12 -9
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs +3 -2
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-operation-details.mjs +5 -5
- package/fesm2022/c8y-ngx-components-operations-operation-details.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-operations-list.mjs +57 -52
- package/fesm2022/c8y-ngx-components-operations-operations-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-shared.mjs +3 -2
- package/fesm2022/c8y-ngx-components-operations-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations.mjs +42 -35
- package/fesm2022/c8y-ngx-components-operations.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-services-service-command-tab.mjs +49 -0
- package/fesm2022/c8y-ngx-components-services-service-command-tab.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-services-shared.mjs +145 -0
- package/fesm2022/c8y-ngx-components-services-shared.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-services.mjs +20 -113
- package/fesm2022/c8y-ngx-components-services.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +21 -3
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +12 -14
- package/locales/es.po +12 -14
- package/locales/fr.po +11 -13
- package/locales/ja_JP.po +13 -17
- package/locales/ko.po +13 -10
- package/locales/locales.pot +19 -6
- package/locales/nl.po +12 -14
- package/locales/pl.po +12 -14
- package/locales/pt_BR.po +11 -13
- package/locales/zh_CN.po +12 -9
- package/locales/zh_TW.po +12 -9
- package/operations/bulk-operation-list-item/bulk-operation-list-item.service.d.ts +2 -2
- package/operations/bulk-operation-list-item/bulk-operation-list-item.service.d.ts.map +1 -1
- package/operations/operation-details/operation-details.module.d.ts +1 -1
- package/operations/operations-list/device-control.feature.d.ts +4 -0
- package/operations/operations-list/device-control.feature.d.ts.map +1 -0
- package/operations/operations-list/index.d.ts +3 -2
- package/operations/operations-list/index.d.ts.map +1 -1
- package/operations/operations-list/operations-list-item.component.d.ts +1 -1
- package/operations/operations-list/operations-list-item.component.d.ts.map +1 -1
- package/operations/operations-list/operations-list.component.d.ts +3 -1
- package/operations/operations-list/operations-list.component.d.ts.map +1 -1
- package/operations/operations-list/operations-list.module.d.ts +3 -9
- package/operations/operations-list/operations-list.module.d.ts.map +1 -1
- package/operations/operations.module.d.ts +1 -2
- package/operations/operations.module.d.ts.map +1 -1
- package/package.json +1 -1
- package/services/index.d.ts +13 -2
- package/services/index.d.ts.map +1 -1
- package/services/service-command-tab/c8y-ngx-components-services-service-command-tab.d.ts.map +1 -0
- package/services/service-command-tab/index.d.ts +3 -0
- package/services/service-command-tab/index.d.ts.map +1 -0
- package/services/service-command-tab/service-command-tab.component.d.ts +12 -0
- package/services/service-command-tab/service-command-tab.component.d.ts.map +1 -0
- package/services/service-command-tab/service-command.feature.d.ts +3 -0
- package/services/service-command-tab/service-command.feature.d.ts.map +1 -0
- package/services/services-device-tab/index.d.ts +8 -2
- package/services/services-device-tab/index.d.ts.map +1 -1
- package/services/services-device-tab/services-device-tab.component.d.ts +2 -2
- package/services/services-device-tab/services-device-tab.component.d.ts.map +1 -1
- package/services/services-device-tab/services.breadcrumb-factory.d.ts.map +1 -1
- package/services/services.module.d.ts.map +1 -1
- package/services/shared/c8y-ngx-components-services-shared.d.ts.map +1 -0
- package/services/shared/index.d.ts +3 -0
- package/services/shared/index.d.ts.map +1 -0
- package/services/{services-device-tab → shared}/service-command.service.d.ts +10 -7
- package/services/shared/service-command.service.d.ts.map +1 -0
- package/services/shared/services.model.d.ts +31 -0
- package/services/shared/services.model.d.ts.map +1 -0
- package/esm2022/services/services-device-tab/service-command.service.mjs +0 -113
- package/esm2022/services/services-device-tab/service-device-tab.model.mjs +0 -2
- package/services/services-device-tab/service-command.service.d.ts.map +0 -1
- package/services/services-device-tab/service-device-tab.model.d.ts +0 -11
- package/services/services-device-tab/service-device-tab.model.d.ts.map +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { OperationService } from '@c8y/client';
|
|
3
|
+
import { AlertService, gettext } from '@c8y/ngx-components';
|
|
4
|
+
import { map } from 'lodash-es';
|
|
5
|
+
import { SERVICE_COMMANDS_MAP } from './services.model';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@c8y/client";
|
|
8
|
+
import * as i2 from "@c8y/ngx-components";
|
|
9
|
+
export class ServiceCommandService {
|
|
10
|
+
constructor(operationService, alertService) {
|
|
11
|
+
this.operationService = operationService;
|
|
12
|
+
this.alertService = alertService;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Check if the service supports service commands.
|
|
16
|
+
* @param service The service object containing supported operations.
|
|
17
|
+
* @returns boolean indicating if the service supports service commands.
|
|
18
|
+
*/
|
|
19
|
+
isServiceCommandSupported(service) {
|
|
20
|
+
return service.c8y_SupportedOperations?.includes('c8y_ServiceCommand');
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the list of supported service commands for the given service object.
|
|
24
|
+
* @param service The service object containing the c8y_SupportedServiceCommands fragment.
|
|
25
|
+
* @returns Array of supported commands.
|
|
26
|
+
*/
|
|
27
|
+
getSupportedCommands(service) {
|
|
28
|
+
return service.c8y_SupportedServiceCommands || map(SERVICE_COMMANDS_MAP, 'command');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if a specific command is supported for the given service.
|
|
32
|
+
* @param service The service object.
|
|
33
|
+
* @param command The command to check (e.g., START, STOP).
|
|
34
|
+
* @returns boolean indicating if the command is supported.
|
|
35
|
+
*/
|
|
36
|
+
isCommandSupported(service, command) {
|
|
37
|
+
const supportedCommands = this.getSupportedCommands(service);
|
|
38
|
+
return supportedCommands.includes(command);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get all supported commands for a list of services.
|
|
42
|
+
* @param services The list of service objects to evaluate.
|
|
43
|
+
* @returns Array of all unique supported commands.
|
|
44
|
+
*/
|
|
45
|
+
getAllSupportedCommands(services) {
|
|
46
|
+
const allCommands = services
|
|
47
|
+
.filter(service => this.isServiceCommandSupported(service))
|
|
48
|
+
.flatMap(service => this.getSupportedCommands(service));
|
|
49
|
+
return Array.from(new Set(allCommands));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create an operation for the selected service command.
|
|
53
|
+
* @param service The service object the operation should target.
|
|
54
|
+
* @param command The command to execute (e.g., START, STOP).
|
|
55
|
+
* @returns Promise of the created operation.
|
|
56
|
+
*/
|
|
57
|
+
createOperation({ id, name, serviceType }, command) {
|
|
58
|
+
const operation = {
|
|
59
|
+
deviceId: id,
|
|
60
|
+
description: `${command} ${name}`,
|
|
61
|
+
c8y_ServiceCommand: {
|
|
62
|
+
command,
|
|
63
|
+
serviceName: name,
|
|
64
|
+
serviceType: serviceType
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return this.operationService.create(operation);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generate a static list of action controls.
|
|
71
|
+
* The specific logic for each service is handled dynamically in showIf and callback.
|
|
72
|
+
* @returns Array of ActionControl objects.
|
|
73
|
+
*/
|
|
74
|
+
generateActionControls(commands) {
|
|
75
|
+
return commands.map(command => ({
|
|
76
|
+
type: command.toLowerCase(),
|
|
77
|
+
icon: this.getCommandIcon(command),
|
|
78
|
+
iconClasses: this.getCommandIconClass(command),
|
|
79
|
+
text: command,
|
|
80
|
+
showIf: (service) => this.isServiceCommandSupported(service) && this.isCommandSupported(service, command),
|
|
81
|
+
callback: async (service) => {
|
|
82
|
+
try {
|
|
83
|
+
await this.createOperation(service, command);
|
|
84
|
+
this.alertService.success(gettext('Operation created.'));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
const alertMessage = gettext('Could not create operation.');
|
|
88
|
+
this.alertService.danger(alertMessage, error);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get the icon for a specific command.
|
|
95
|
+
* @param command The command name.
|
|
96
|
+
* @returns Icon string for the command.
|
|
97
|
+
*/
|
|
98
|
+
getCommandIcon(command) {
|
|
99
|
+
return SERVICE_COMMANDS_MAP[command]?.icon || 'console';
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get the icon class for a specific command.
|
|
103
|
+
* @param command The command name.
|
|
104
|
+
* @returns Icon class string for the command.
|
|
105
|
+
*/
|
|
106
|
+
getCommandIconClass(command) {
|
|
107
|
+
return SERVICE_COMMANDS_MAP[command]?.styleClass;
|
|
108
|
+
}
|
|
109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ServiceCommandService, deps: [{ token: i1.OperationService }, { token: i2.AlertService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
110
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ServiceCommandService, providedIn: 'root' }); }
|
|
111
|
+
}
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ServiceCommandService, decorators: [{
|
|
113
|
+
type: Injectable,
|
|
114
|
+
args: [{
|
|
115
|
+
providedIn: 'root'
|
|
116
|
+
}]
|
|
117
|
+
}], ctorParameters: () => [{ type: i1.OperationService }, { type: i2.AlertService }] });
|
|
118
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS1jb21tYW5kLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zZXJ2aWNlcy9zaGFyZWQvc2VydmljZS1jb21tYW5kLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQXVCLGdCQUFnQixFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ3BFLE9BQU8sRUFBaUIsWUFBWSxFQUFFLE9BQU8sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzNFLE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDaEMsT0FBTyxFQUFXLG9CQUFvQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7Ozs7QUFLakUsTUFBTSxPQUFPLHFCQUFxQjtJQUNoQyxZQUNVLGdCQUFrQyxFQUNsQyxZQUEwQjtRQUQxQixxQkFBZ0IsR0FBaEIsZ0JBQWdCLENBQWtCO1FBQ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+1,23 @@
|
|
|
1
|
+
import { gettext } from '@c8y/ngx-components';
|
|
2
|
+
export const SERVICE_FRAGMENT = 'c8y_Service';
|
|
3
|
+
export const SERVICE_COMMANDS_MAP = {
|
|
4
|
+
START: {
|
|
5
|
+
label: gettext('Start'),
|
|
6
|
+
command: 'START',
|
|
7
|
+
icon: 'play-circle',
|
|
8
|
+
styleClass: 'text-success'
|
|
9
|
+
},
|
|
10
|
+
STOP: {
|
|
11
|
+
label: gettext('Stop'),
|
|
12
|
+
command: 'STOP',
|
|
13
|
+
icon: 'stop-circle',
|
|
14
|
+
styleClass: 'text-danger'
|
|
15
|
+
},
|
|
16
|
+
RESTART: {
|
|
17
|
+
label: gettext('Restart'),
|
|
18
|
+
command: 'RESTART',
|
|
19
|
+
icon: 'refresh',
|
|
20
|
+
styleClass: 'text-info'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZXMubW9kZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zZXJ2aWNlcy9zaGFyZWQvc2VydmljZXMubW9kZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRTlDLE1BQU0sQ0FBQyxNQUFNLGdCQUFnQixHQUFHLGFBQWEsQ0FBQztBQUU5QyxNQUFNLENBQUMsTUFBTSxvQkFBb0IsR0FBRztJQUNsQyxLQUFLLEVBQUU7UUFDTCxLQUFLLEVBQUUsT0FBTyxDQUFDLE9BQU8sQ0FBQztRQUN2QixPQUFPLEVBQUUsT0FBTztRQUNoQixJQUFJLEVBQUUsYUFBYTtRQUNuQixVQUFVLEVBQUUsY0FBYztLQUMzQjtJQUNELElBQUksRUFBRTtRQUNKLEtBQUssRUFBRSxPQUFPLENBQUMsTUFBTSxDQUFD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bmc7XG4gIHNlcnZpY2VUeXBlOiBzdHJpbmc7XG4gIHN0YXR1czogc3RyaW5nO1xuICBjOHlfU3VwcG9ydGVkT3BlcmF0aW9ucz86IHN0cmluZ1tdO1xuICBjOHlfU3VwcG9ydGVkU2VydmljZUNvbW1hbmRzPzogc3RyaW5nW107XG4gIFtrZXk6IHN0cmluZ106IHVua25vd247XG59XG4iXX0=
|
|
@@ -1979,11 +1979,11 @@ class AlarmsTypeFilterComponent {
|
|
|
1979
1979
|
return activeFilters.map(filter => filter.filters.type).join(',');
|
|
1980
1980
|
}
|
|
1981
1981
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmsTypeFilterComponent, deps: [{ token: i1$3.AlarmEventSelectorService }, { token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: i3.ColorService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1982
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: AlarmsTypeFilterComponent, selector: "c8y-alarms-type-filter", inputs: { alarms: "alarms", possibleFilters: "possibleFilters", activeFilters: "activeFilters" }, outputs: { onFilterChanged: "onFilterChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex a-i-center\">\n <div\n class=\"dropdown\"\n title=\"{{ 'Filter by
|
|
1982
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: AlarmsTypeFilterComponent, selector: "c8y-alarms-type-filter", inputs: { alarms: "alarms", possibleFilters: "possibleFilters", activeFilters: "activeFilters" }, outputs: { onFilterChanged: "onFilterChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex a-i-center\">\n <div\n class=\"dropdown\"\n title=\"{{ 'Filter by alarm types' | translate }}\"\n dropdown\n #filtersDropdown=\"bs-dropdown\"\n [cdkTrapFocus]=\"filtersDropdown.isOpen\"\n (onHidden)=\"resetFilters()\"\n [insideClick]=\"true\"\n >\n <div class=\"input-group fit-w\">\n <div class=\"form-control d-flex a-i-center inner-scroll\">\n <ng-container *ngIf=\"activeFilters.length > 0; else allTypes\">\n <span\n class=\"tag tag--info chip\"\n *ngFor=\"let filter of activeFilters\"\n >\n <button\n class=\"btn btn-xs btn-clean text-10\"\n title=\"{{ 'Remove' | translate }}\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); deselect(filter)\"\n >\n <i c8yIcon=\"times\"></i>\n </button>\n <span\n class=\"circle-icon-wrapper circle-icon-wrapper--small\"\n [ngStyle]=\"{ 'background-color': filter.color }\"\n >\n <i\n class=\"stroked-icon\"\n c8yIcon=\"bell\"\n ></i>\n </span>\n {{ filter.filters.type }}\n </span>\n </ng-container>\n <ng-template #allTypes>\n <span class=\"text-nowrap\">\n {{ 'All alarm types' | translate }}\n </span>\n </ng-template>\n </div>\n <div class=\"input-group-btn input-group-btn--last text-center\">\n <button\n class=\"btn-default btn\"\n [title]=\"'Clear filters' | translate\"\n *ngIf=\"activeFilters.length\"\n (click)=\"deselectAll()\"\n >\n <i c8yIcon=\"times\"></i>\n </button>\n <button\n class=\"btn-default btn btn--caret\"\n [title]=\"'Alarm types' | translate\"\n data-cy=\"c8y-alarm-type-filter\"\n dropdownToggle\n >\n <i class=\"caret\"></i>\n </button>\n </div>\n </div>\n <div\n class=\"dropdown-menu dropdown-menu-action-bar\"\n style=\"max-width: unset; min-width: 250px\"\n *dropdownMenu\n >\n <div class=\"p-16 bg-level-2\">\n <div>\n <p>\n <i\n class=\"text-info m-r-4\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n <strong tanslate>The list below may not be complete.</strong>\n </p>\n <p tanslate>\n Recent alarms are displayed below. Past alarms might not be shown. Optionally you can\n add a custom alarm.\n </p>\n </div>\n </div>\n <c8y-list-group>\n <div class=\"input-group p-t-16 p-b-16 p-r-32 p-l-32 separator-bottom\">\n <input\n class=\"form-control\"\n placeholder=\"'Custom alarm type' | translate\"\n type=\"text\"\n [(ngModel)]=\"customAlarmTypeInput\"\n (keydown)=\"confirmWithEnter($event)\"\n />\n <div class=\"input-group-btn\">\n <button\n class=\"btn-dot text-primary\"\n [attr.aria-label]=\"'Add custom alarm' | translate\"\n tooltip=\"'Add' | translate\"\n placement=\"top\"\n [delay]=\"500\"\n (click)=\"addCustomAlarmType()\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n </button>\n </div>\n </div>\n\n <c8y-li\n class=\"c8y-list__item__collapse--container-small cdk-drag\"\n style=\"cursor: pointer\"\n *ngFor=\"let alarmType of possibleFilters\"\n (click)=\"toggleAlarmType(alarmType)\"\n >\n <c8y-li-checkbox\n class=\"a-s-center m-t-4 p-r-0 p-l-0\"\n [selected]=\"alarmType.__active\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"toggleAlarmType(alarmType); $event.stopPropagation()\"\n ></c8y-li-checkbox>\n <div class=\"d-flex a-i-center p-l-4\">\n <div class=\"c8y-list__item__colorpicker p-t-0 p-b-0 p-l-0\">\n <div class=\"c8y-colorpicker c8y-colorpicker--alarm\">\n <span\n class=\"circle-icon-wrapper\"\n [ngStyle]=\"{ 'background-color': alarmType.color }\"\n >\n <i\n class=\"stroked-icon\"\n [c8yIcon]=\"'bell'\"\n ></i>\n </span>\n </div>\n </div>\n <span class=\"text-truncate text-12 flex-grow\">\n {{ alarmType.label }}\n </span>\n <button\n class=\"btn-dot btn-dot--danger\"\n [attr.aria-label]=\"'Remove' | translate\"\n tooltip=\"'Remove' | translate\"\n placement=\"top\"\n *ngIf=\"alarmType.__target === null\"\n [delay]=\"500\"\n (click)=\"removeCustomAlarm(alarmType); $event.stopPropagation()\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n </c8y-li>\n <c8y-li *ngIf=\"possibleFilters.length === 0\">\n <c8y-ui-empty-state\n class=\"p-t-8\"\n icon=\"c8y-alarm\"\n [title]=\"'No alarm found' | translate\"\n [subtitle]=\"\n 'There is no alarm to filter. You can still add a custom alarm.' | translate\n \"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </c8y-li>\n <div class=\"sticky-bottom p-16\">\n <button\n class=\"btn btn-block btn-primary\"\n [disabled]=\"possibleFilters.length === 0\"\n (click)=\"applyFilterChange(); $event.stopPropagation(); filtersDropdown.hide()\"\n translate\n >\n Apply\n </button>\n </div>\n </c8y-list-group>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i5.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i6.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i6.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i6.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { 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: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.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: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i3.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i3.ListItemCheckboxComponent, selector: "c8y-list-item-checkbox, c8y-li-checkbox", inputs: ["selected", "indeterminate", "disabled", "displayAsSwitch"], outputs: ["onSelect"] }, { kind: "directive", type: i5$1.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: "directive", type: i1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] }); }
|
|
1983
1983
|
}
|
|
1984
1984
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmsTypeFilterComponent, decorators: [{
|
|
1985
1985
|
type: Component,
|
|
1986
|
-
args: [{ selector: 'c8y-alarms-type-filter', template: "<div class=\"d-flex a-i-center\">\n <div\n class=\"dropdown\"\n title=\"{{ 'Filter by
|
|
1986
|
+
args: [{ selector: 'c8y-alarms-type-filter', template: "<div class=\"d-flex a-i-center\">\n <div\n class=\"dropdown\"\n title=\"{{ 'Filter by alarm types' | translate }}\"\n dropdown\n #filtersDropdown=\"bs-dropdown\"\n [cdkTrapFocus]=\"filtersDropdown.isOpen\"\n (onHidden)=\"resetFilters()\"\n [insideClick]=\"true\"\n >\n <div class=\"input-group fit-w\">\n <div class=\"form-control d-flex a-i-center inner-scroll\">\n <ng-container *ngIf=\"activeFilters.length > 0; else allTypes\">\n <span\n class=\"tag tag--info chip\"\n *ngFor=\"let filter of activeFilters\"\n >\n <button\n class=\"btn btn-xs btn-clean text-10\"\n title=\"{{ 'Remove' | translate }}\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); deselect(filter)\"\n >\n <i c8yIcon=\"times\"></i>\n </button>\n <span\n class=\"circle-icon-wrapper circle-icon-wrapper--small\"\n [ngStyle]=\"{ 'background-color': filter.color }\"\n >\n <i\n class=\"stroked-icon\"\n c8yIcon=\"bell\"\n ></i>\n </span>\n {{ filter.filters.type }}\n </span>\n </ng-container>\n <ng-template #allTypes>\n <span class=\"text-nowrap\">\n {{ 'All alarm types' | translate }}\n </span>\n </ng-template>\n </div>\n <div class=\"input-group-btn input-group-btn--last text-center\">\n <button\n class=\"btn-default btn\"\n [title]=\"'Clear filters' | translate\"\n *ngIf=\"activeFilters.length\"\n (click)=\"deselectAll()\"\n >\n <i c8yIcon=\"times\"></i>\n </button>\n <button\n class=\"btn-default btn btn--caret\"\n [title]=\"'Alarm types' | translate\"\n data-cy=\"c8y-alarm-type-filter\"\n dropdownToggle\n >\n <i class=\"caret\"></i>\n </button>\n </div>\n </div>\n <div\n class=\"dropdown-menu dropdown-menu-action-bar\"\n style=\"max-width: unset; min-width: 250px\"\n *dropdownMenu\n >\n <div class=\"p-16 bg-level-2\">\n <div>\n <p>\n <i\n class=\"text-info m-r-4\"\n [c8yIcon]=\"'info-circle'\"\n ></i>\n <strong tanslate>The list below may not be complete.</strong>\n </p>\n <p tanslate>\n Recent alarms are displayed below. Past alarms might not be shown. Optionally you can\n add a custom alarm.\n </p>\n </div>\n </div>\n <c8y-list-group>\n <div class=\"input-group p-t-16 p-b-16 p-r-32 p-l-32 separator-bottom\">\n <input\n class=\"form-control\"\n placeholder=\"'Custom alarm type' | translate\"\n type=\"text\"\n [(ngModel)]=\"customAlarmTypeInput\"\n (keydown)=\"confirmWithEnter($event)\"\n />\n <div class=\"input-group-btn\">\n <button\n class=\"btn-dot text-primary\"\n [attr.aria-label]=\"'Add custom alarm' | translate\"\n tooltip=\"'Add' | translate\"\n placement=\"top\"\n [delay]=\"500\"\n (click)=\"addCustomAlarmType()\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n </button>\n </div>\n </div>\n\n <c8y-li\n class=\"c8y-list__item__collapse--container-small cdk-drag\"\n style=\"cursor: pointer\"\n *ngFor=\"let alarmType of possibleFilters\"\n (click)=\"toggleAlarmType(alarmType)\"\n >\n <c8y-li-checkbox\n class=\"a-s-center m-t-4 p-r-0 p-l-0\"\n [selected]=\"alarmType.__active\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"toggleAlarmType(alarmType); $event.stopPropagation()\"\n ></c8y-li-checkbox>\n <div class=\"d-flex a-i-center p-l-4\">\n <div class=\"c8y-list__item__colorpicker p-t-0 p-b-0 p-l-0\">\n <div class=\"c8y-colorpicker c8y-colorpicker--alarm\">\n <span\n class=\"circle-icon-wrapper\"\n [ngStyle]=\"{ 'background-color': alarmType.color }\"\n >\n <i\n class=\"stroked-icon\"\n [c8yIcon]=\"'bell'\"\n ></i>\n </span>\n </div>\n </div>\n <span class=\"text-truncate text-12 flex-grow\">\n {{ alarmType.label }}\n </span>\n <button\n class=\"btn-dot btn-dot--danger\"\n [attr.aria-label]=\"'Remove' | translate\"\n tooltip=\"'Remove' | translate\"\n placement=\"top\"\n *ngIf=\"alarmType.__target === null\"\n [delay]=\"500\"\n (click)=\"removeCustomAlarm(alarmType); $event.stopPropagation()\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n </c8y-li>\n <c8y-li *ngIf=\"possibleFilters.length === 0\">\n <c8y-ui-empty-state\n class=\"p-t-8\"\n icon=\"c8y-alarm\"\n [title]=\"'No alarm found' | translate\"\n [subtitle]=\"\n 'There is no alarm to filter. You can still add a custom alarm.' | translate\n \"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </c8y-li>\n <div class=\"sticky-bottom p-16\">\n <button\n class=\"btn btn-block btn-primary\"\n [disabled]=\"possibleFilters.length === 0\"\n (click)=\"applyFilterChange(); $event.stopPropagation(); filtersDropdown.hide()\"\n translate\n >\n Apply\n </button>\n </div>\n </c8y-list-group>\n </div>\n </div>\n</div>\n" }]
|
|
1987
1987
|
}], ctorParameters: () => [{ type: i1$3.AlarmEventSelectorService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: i3.ColorService }], propDecorators: { alarms: [{
|
|
1988
1988
|
type: Input
|
|
1989
1989
|
}], possibleFilters: [{
|
|
@@ -2154,7 +2154,7 @@ class AlarmsComponent {
|
|
|
2154
2154
|
return;
|
|
2155
2155
|
}
|
|
2156
2156
|
const { context, contextData } = routeContext;
|
|
2157
|
-
if ([ViewContext.Device, ViewContext.Group, ViewContext.Simulators].includes(context)) {
|
|
2157
|
+
if ([ViewContext.Device, ViewContext.Group, ViewContext.Service, ViewContext.Simulators].includes(context)) {
|
|
2158
2158
|
this.contextSourceId = contextData?.id;
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|