@c8y/ngx-components 1021.21.0 → 1021.22.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/alarms/alarm-details.component.d.ts +1 -3
- package/alarms/alarm-details.component.d.ts.map +1 -1
- package/alarms/alarm-info.component.d.ts +9 -14
- package/alarms/alarm-info.component.d.ts.map +1 -1
- package/alarms/alarms-view.service.d.ts.map +1 -1
- package/alarms/alarms.component.d.ts.map +1 -1
- package/alarms/alarms.helper.d.ts +5 -0
- package/alarms/alarms.helper.d.ts.map +1 -0
- package/alarms/alarms.module.d.ts.map +1 -1
- package/alarms/cockpit/index.d.ts.map +1 -1
- package/alarms/devicemanagement/index.d.ts.map +1 -1
- package/alarms/index.d.ts +5 -4
- package/alarms/index.d.ts.map +1 -1
- package/core/router/context-route.component.d.ts +8 -3
- package/core/router/context-route.component.d.ts.map +1 -1
- package/core/router/context-route.service.d.ts +29 -3
- package/core/router/context-route.service.d.ts.map +1 -1
- package/core/router/router-tabs.resolver.d.ts +4 -1
- package/core/router/router-tabs.resolver.d.ts.map +1 -1
- package/core/router/router.model.d.ts +40 -3
- package/core/router/router.model.d.ts.map +1 -1
- package/core/router/router.module.d.ts +2 -1
- package/core/router/router.module.d.ts.map +1 -1
- package/core/router/router.service.d.ts +5 -4
- package/core/router/router.service.d.ts.map +1 -1
- package/core/router/scoped-context-route.service.d.ts +57 -0
- package/core/router/scoped-context-route.service.d.ts.map +1 -0
- package/core/router/view-context.service.d.ts +8 -18
- package/core/router/view-context.service.d.ts.map +1 -1
- package/esm2022/alarms/alarm-details.component.mjs +7 -9
- package/esm2022/alarms/alarm-info.component.mjs +23 -33
- package/esm2022/alarms/alarms-view.service.mjs +2 -2
- package/esm2022/alarms/alarms.component.mjs +10 -3
- package/esm2022/alarms/alarms.helper.mjs +32 -0
- package/esm2022/alarms/alarms.module.mjs +5 -5
- package/esm2022/alarms/cockpit/index.mjs +13 -17
- package/esm2022/alarms/devicemanagement/index.mjs +15 -18
- package/esm2022/alarms/index.mjs +6 -5
- package/esm2022/core/router/context-route.component.mjs +23 -13
- package/esm2022/core/router/context-route.service.mjs +37 -5
- package/esm2022/core/router/router-tabs.resolver.mjs +46 -15
- package/esm2022/core/router/router.model.mjs +6 -1
- package/esm2022/core/router/router.module.mjs +20 -13
- package/esm2022/core/router/router.service.mjs +24 -10
- package/esm2022/core/router/scoped-context-route.service.mjs +152 -0
- package/esm2022/core/router/view-context.service.mjs +59 -16
- package/fesm2022/c8y-ngx-components-alarms-cockpit.mjs +12 -16
- package/fesm2022/c8y-ngx-components-alarms-cockpit.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms-devicemanagement.mjs +14 -17
- package/fesm2022/c8y-ngx-components-alarms-devicemanagement.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +198 -170
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +403 -131
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable,
|
|
2
|
+
import { Injectable, Pipe, InjectionToken, Component, Optional, Input, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import { combineLatest, firstValueFrom, map as map$1, shareReplay, Subject, BehaviorSubject, of, from, forkJoin, EMPTY, Observable, pipe, fromEvent, takeUntil as takeUntil$1 } from 'rxjs';
|
|
4
|
+
import { filter, map, switchMap, startWith, takeUntil, catchError, finalize, tap, debounceTime, distinctUntilChanged, shareReplay as shareReplay$1, throttleTime } from 'rxjs/operators';
|
|
5
|
+
import * as i3 from '@c8y/ngx-components';
|
|
6
|
+
import { Permissions, gettext, ViewContext, CountdownIntervalComponent, DynamicComponentAlertAggregator, DynamicComponentAlert, AlarmWithChildrenRealtimeService, ContextRouteComponent, ContextRouteGuard, RouterTabsResolver, hookNavigator, hookRoute, CommonModule, CoreModule, HeaderModule, DynamicComponentModule, RelativeTimePipe } from '@c8y/ngx-components';
|
|
7
|
+
import { sortBy, cloneDeep } from 'lodash-es';
|
|
3
8
|
import * as i2 from '@c8y/client';
|
|
4
9
|
import { AlarmStatus, Severity, ALARM_STATUS_LABELS, SEVERITY_LABELS } from '@c8y/client';
|
|
5
|
-
import * as i3 from '@c8y/ngx-components';
|
|
6
|
-
import { Permissions, gettext, ViewContext, CountdownIntervalComponent, DynamicComponentAlertAggregator, DynamicComponentAlert, AlarmWithChildrenRealtimeService, hookNavigator, hookRoute, CommonModule, CoreModule, HeaderModule, DynamicComponentModule, RelativeTimePipe } from '@c8y/ngx-components';
|
|
7
10
|
import * as i1 from '@ngx-translate/core';
|
|
8
11
|
import { TranslateModule } from '@ngx-translate/core';
|
|
9
|
-
import { sortBy, cloneDeep } from 'lodash-es';
|
|
10
|
-
import { firstValueFrom, map, shareReplay, Subject, BehaviorSubject, combineLatest, tap, switchMap as switchMap$1, takeUntil, from, forkJoin, EMPTY, Observable, pipe, fromEvent } from 'rxjs';
|
|
11
12
|
import * as i8 from '@c8y/ngx-components/interval-picker';
|
|
12
13
|
import { INTERVAL_TITLES, INTERVALS, IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';
|
|
13
14
|
import * as i7 from '@angular/common';
|
|
14
15
|
import { DatePipe, TitleCasePipe } from '@angular/common';
|
|
15
16
|
import * as i1$1 from '@angular/router';
|
|
16
17
|
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
17
|
-
import { filter, map as map$1, switchMap, startWith, takeUntil as takeUntil$1, catchError, finalize, tap as tap$1, debounceTime, distinctUntilChanged, shareReplay as shareReplay$1, throttleTime } from 'rxjs/operators';
|
|
18
18
|
import * as i1$2 from '@angular/forms';
|
|
19
19
|
import { FormControl } from '@angular/forms';
|
|
20
20
|
import * as i6 from 'ngx-bootstrap/dropdown';
|
|
@@ -27,6 +27,63 @@ import * as i2$1 from '@c8y/ngx-components/alarm-event-selector';
|
|
|
27
27
|
import { AlarmEventSelectorModule } from '@c8y/ngx-components/alarm-event-selector';
|
|
28
28
|
import { PopoverModule } from 'ngx-bootstrap/popover';
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* A service to retrieve custom buttons for the alarm details view.
|
|
32
|
+
*/
|
|
33
|
+
class AlarmDetailsButtonService {
|
|
34
|
+
constructor(serviceRegistry, pluginsResolver) {
|
|
35
|
+
this.serviceRegistry = serviceRegistry;
|
|
36
|
+
this.pluginsResolver = pluginsResolver;
|
|
37
|
+
}
|
|
38
|
+
get$(alarm, source) {
|
|
39
|
+
const providers$ = this.pluginsResolver.allPluginsLoaded$.pipe(filter(Boolean), map(() => {
|
|
40
|
+
return this.serviceRegistry.get('alarmDetailsButton');
|
|
41
|
+
}));
|
|
42
|
+
return providers$.pipe(switchMap(providers => {
|
|
43
|
+
const observables$ = providers.map(provider => provider.getAlarmDetailsButton$(alarm, source).pipe(startWith(false)));
|
|
44
|
+
return combineLatest(observables$);
|
|
45
|
+
}), map(indicators => {
|
|
46
|
+
return indicators.filter(Boolean);
|
|
47
|
+
}), map(indicators => sortBy(indicators, this.byPriority)));
|
|
48
|
+
}
|
|
49
|
+
byPriority(item) {
|
|
50
|
+
if (item.priority === undefined) {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
return -item.priority;
|
|
54
|
+
}
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonService, deps: [{ token: i3.ServiceRegistry }, { token: i3.PluginsResolveService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
56
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonService, providedIn: 'root' }); }
|
|
57
|
+
}
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonService, decorators: [{
|
|
59
|
+
type: Injectable,
|
|
60
|
+
args: [{ providedIn: 'root' }]
|
|
61
|
+
}], ctorParameters: () => [{ type: i3.ServiceRegistry }, { type: i3.PluginsResolveService }] });
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A pipe to provide custom buttons for the alarm details view.
|
|
65
|
+
*
|
|
66
|
+
* Will call `get$()` method of `AlarmDetailsButtonService` to get the custom buttons for the provided alarm.
|
|
67
|
+
*/
|
|
68
|
+
class AlarmDetailsButtonPipe {
|
|
69
|
+
constructor(alarmDetailsButtonService) {
|
|
70
|
+
this.alarmDetailsButtonService = alarmDetailsButtonService;
|
|
71
|
+
}
|
|
72
|
+
transform(alarm, source) {
|
|
73
|
+
return this.alarmDetailsButtonService.get$(alarm, source);
|
|
74
|
+
}
|
|
75
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonPipe, deps: [{ token: AlarmDetailsButtonService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
76
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonPipe, isStandalone: true, name: "alarmDetailsButton" }); }
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonPipe, decorators: [{
|
|
79
|
+
type: Pipe,
|
|
80
|
+
args: [{
|
|
81
|
+
standalone: true,
|
|
82
|
+
name: 'alarmDetailsButton',
|
|
83
|
+
pure: true
|
|
84
|
+
}]
|
|
85
|
+
}], ctorParameters: () => [{ type: AlarmDetailsButtonService }] });
|
|
86
|
+
|
|
30
87
|
class AlarmDetailsService {
|
|
31
88
|
constructor(stateService, permissions) {
|
|
32
89
|
this.stateService = stateService;
|
|
@@ -149,7 +206,7 @@ class AlarmDetailsService {
|
|
|
149
206
|
* @returns A promise that resolves to the requested application or undefined if the application is not found.
|
|
150
207
|
*/
|
|
151
208
|
async getApplication(applicationKey) {
|
|
152
|
-
return await firstValueFrom(this.stateService.currentAppsOfUser.pipe(map(apps => apps.find(app => app.key === applicationKey)), shareReplay(1)));
|
|
209
|
+
return await firstValueFrom(this.stateService.currentAppsOfUser.pipe(map$1(apps => apps.find(app => app.key === applicationKey)), shareReplay(1)));
|
|
153
210
|
}
|
|
154
211
|
checkIfHasAnyRoleAllowingToCreateSmartRule() {
|
|
155
212
|
const ROLES_ALLOWING_SMART_RULE_CREATION = [
|
|
@@ -508,63 +565,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
508
565
|
}]
|
|
509
566
|
}], ctorParameters: () => [{ type: i2.AlarmService }, { type: i3.OptionsService }] });
|
|
510
567
|
|
|
511
|
-
/**
|
|
512
|
-
* A service to retrieve custom buttons for the alarm details view.
|
|
513
|
-
*/
|
|
514
|
-
class AlarmDetailsButtonService {
|
|
515
|
-
constructor(serviceRegistry, pluginsResolver) {
|
|
516
|
-
this.serviceRegistry = serviceRegistry;
|
|
517
|
-
this.pluginsResolver = pluginsResolver;
|
|
518
|
-
}
|
|
519
|
-
get$(alarm, source) {
|
|
520
|
-
const providers$ = this.pluginsResolver.allPluginsLoaded$.pipe(filter(Boolean), map$1(() => {
|
|
521
|
-
return this.serviceRegistry.get('alarmDetailsButton');
|
|
522
|
-
}));
|
|
523
|
-
return providers$.pipe(switchMap(providers => {
|
|
524
|
-
const observables$ = providers.map(provider => provider.getAlarmDetailsButton$(alarm, source).pipe(startWith(false)));
|
|
525
|
-
return combineLatest(observables$);
|
|
526
|
-
}), map$1(indicators => {
|
|
527
|
-
return indicators.filter(Boolean);
|
|
528
|
-
}), map$1(indicators => sortBy(indicators, this.byPriority)));
|
|
529
|
-
}
|
|
530
|
-
byPriority(item) {
|
|
531
|
-
if (item.priority === undefined) {
|
|
532
|
-
return 0;
|
|
533
|
-
}
|
|
534
|
-
return -item.priority;
|
|
535
|
-
}
|
|
536
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonService, deps: [{ token: i3.ServiceRegistry }, { token: i3.PluginsResolveService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
537
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonService, providedIn: 'root' }); }
|
|
538
|
-
}
|
|
539
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonService, decorators: [{
|
|
540
|
-
type: Injectable,
|
|
541
|
-
args: [{ providedIn: 'root' }]
|
|
542
|
-
}], ctorParameters: () => [{ type: i3.ServiceRegistry }, { type: i3.PluginsResolveService }] });
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* A pipe to provide custom buttons for the alarm details view.
|
|
546
|
-
*
|
|
547
|
-
* Will call `get$()` method of `AlarmDetailsButtonService` to get the custom buttons for the provided alarm.
|
|
548
|
-
*/
|
|
549
|
-
class AlarmDetailsButtonPipe {
|
|
550
|
-
constructor(alarmDetailsButtonService) {
|
|
551
|
-
this.alarmDetailsButtonService = alarmDetailsButtonService;
|
|
552
|
-
}
|
|
553
|
-
transform(alarm, source) {
|
|
554
|
-
return this.alarmDetailsButtonService.get$(alarm, source);
|
|
555
|
-
}
|
|
556
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonPipe, deps: [{ token: AlarmDetailsButtonService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
557
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonPipe, isStandalone: true, name: "alarmDetailsButton" }); }
|
|
558
|
-
}
|
|
559
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsButtonPipe, decorators: [{
|
|
560
|
-
type: Pipe,
|
|
561
|
-
args: [{
|
|
562
|
-
standalone: true,
|
|
563
|
-
name: 'alarmDetailsButton',
|
|
564
|
-
pure: true
|
|
565
|
-
}]
|
|
566
|
-
}], ctorParameters: () => [{ type: AlarmDetailsButtonService }] });
|
|
567
|
-
|
|
568
568
|
/**
|
|
569
569
|
* Pipe for transforming alarm severity types into corresponding icons.
|
|
570
570
|
*
|
|
@@ -703,10 +703,12 @@ class AlarmDetailsComponent {
|
|
|
703
703
|
this.customFragments = null;
|
|
704
704
|
}
|
|
705
705
|
async ngOnInit() {
|
|
706
|
+
const isSmartRulesServiceSubscribed = !!(await this.alarmDetailsService.getApplication(this.alarmDetailsService.SMART_RULES_APPLICATION_KEY));
|
|
707
|
+
const hasAnyRoleAllowingToCreateSmartRule = this.alarmDetailsService.checkIfHasAnyRoleAllowingToCreateSmartRule();
|
|
706
708
|
this.isCreateSmartRulesButtonAvailable =
|
|
707
709
|
!!this.ng1SmartRulesUpgradeService &&
|
|
708
|
-
|
|
709
|
-
|
|
710
|
+
isSmartRulesServiceSubscribed &&
|
|
711
|
+
hasAnyRoleAllowingToCreateSmartRule;
|
|
710
712
|
this.userDeviceManagementApp = await this.alarmDetailsService.getApplication(this.alarmDetailsService.DEVICE_MANAGEMENT_APPLICATION_KEY);
|
|
711
713
|
this.showSourceNavigationLink =
|
|
712
714
|
!!this.userDeviceManagementApp && !this.isDeviceManagementView();
|
|
@@ -981,19 +983,15 @@ class AlarmDetailsComponent {
|
|
|
981
983
|
return customProperties;
|
|
982
984
|
}
|
|
983
985
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsComponent, deps: [{ token: AlarmDetailsService }, { token: i2.AlarmService }, { token: i3.AlertService }, { token: i3.AppStateService }, { token: i2.AuditService }, { token: i3.RelativeTimePipe }, { token: Ng1SmartRulesUpgradeService, optional: true }, { token: i1.TranslateService }, { token: i2.InventoryService }, { token: AlarmsViewService }, { token: i3.ColorService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
984
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: AlarmDetailsComponent, selector: "c8y-alarm-details", inputs: { selectedAlarm: "selectedAlarm", hasAnyRoleAllowingToCreateSmartRule: "hasAnyRoleAllowingToCreateSmartRule", isSmartRulesServiceSubscribed: "isSmartRulesServiceSubscribed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex row tight-grid flex-wrap a-i-stretch\">\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 c8y-icon\"\n [c8yIcon]=\"selectedAlarm.status | AlarmStatusToIcon\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Status' | translate }}</p>\n <p class=\"small\">{{ statusMessage }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n [c8yIcon]=\"selectedAlarm.severity | AlarmSeverityToIcon\"\n [ngClass]=\"selectedAlarm.severity?.toString() | lowercase\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Severity' | translate }}</p>\n <p class=\"small\">{{ SEVERITY_LABELS[selectedAlarm.severity] | translate }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n c8yIcon=\"contactless-payment\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Source' | translate }}</p>\n <p class=\"small\">\n <button\n class=\"btn-link text-muted p-0 m-r-8\"\n title=\"{{ selectedAlarm.source.name }}\"\n type=\"button\"\n routerLink=\"{{ selectedAlarmMO | assetLink }}\"\n >\n <small class=\"icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n {{ selectedAlarm.source.name || selectedAlarm.source.id }}\n </small>\n </button>\n <ng-container *ngIf=\"showSourceNavigationLink\">\n <button\n class=\"btn-link p-0\"\n title=\"{{\n linkTitle\n | translate: { appName: userDeviceManagementApp | humanizeAppName | async }\n }}\"\n type=\"button\"\n (click)=\"goToAlarmSource(selectedAlarm.id)\"\n data-cy=\"alarm-details-device-management-link\"\n >\n {{ userDeviceManagementApp | humanizeAppName | async }}\n <i c8yIcon=\"external-link\"></i>\n </button>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <span\n class=\"circle-icon-wrapper\"\n [ngStyle]=\"{ 'background-color': typeColor }\"\n >\n <i\n class=\"stroked-icon\"\n c8yIcon=\"bell\"\n ></i>\n </span>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8 min-width-0\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Type' | translate }}</p>\n <p\n class=\"small text-truncate\"\n title=\"{{ selectedAlarm.type }}\"\n >\n <code>{{ selectedAlarm.type }}</code>\n </p>\n </div>\n </div>\n </div>\n\n <div class=\"col-xs-12 col-md-12 p-b-16\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"calendar\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-0 p-r-8 flex-grow\">\n <div class=\"content-flex-50\">\n <div class=\"col-4 p-b-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Last updated' | translate }}</p>\n <p class=\"small\">\n {{ lastUpdated | c8yDate: 'medium' }}\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Number of occurrences' | translate }}</p>\n <p>\n <span class=\"badge badge-info\">{{ selectedAlarm.count }}</span>\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'First occurrence' | translate }}</p>\n <p class=\"small\">\n {{ selectedAlarm.creationTime | c8yDate: 'medium' }}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"col-xs-12 col-md-12 p-b-16\"\n *ngIf=\"customFragments\"\n >\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"outgoing-data\"\n ></i>\n </div>\n <div\n class=\"p-t-8 p-b-0 p-r-8 flex-grow\"\n data-cy=\"alarm-details-custom-data\"\n >\n <p class=\"text-label-small m-b-4 m-r-8\">{{ 'Custom data' | translate }}</p>\n <pre><code>{{ customFragments | json }}</code></pre>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"d-flex flex-wrap gap-8\">\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Reload audit logs' | translate\"\n type=\"submit\"\n (click)=\"reloadAuditLog(true, true)\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading }\"\n ></i>\n {{ 'Reload audit logs' | translate }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n \"\n type=\"submit\"\n (click)=\"\n onUpdateDetails(\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? ACKNOWLEDGED_STATUS_VALUE\n : ACTIVE_STATUS_VALUE\n )\n \"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE || isAlarmStatusChanging\"\n >\n <i\n [c8yIcon]=\"selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE ? BELL_SLASH_ICON : BELL_ICON\"\n ></i>\n {{\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Create smart rule' | translate\"\n type=\"submit\"\n *ngIf=\"isCreateSmartRulesButtonAvailable\"\n (click)=\"createSmartRule()\"\n >\n <i c8yIcon=\"c8y-icon c8y-icon-smart-rules\"></i>\n {{ 'Create smart rule' | translate }}\n </button>\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Clear`alarm`' | translate\"\n type=\"submit\"\n (click)=\"onUpdateDetails(CLEARED_STATUS_VALUE)\"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE\"\n >\n <i c8yIcon=\"c8y-alert-idle\"></i>\n {{ 'Clear`alarm`' | translate }}\n </button>\n\n <button\n *ngFor=\"let button of selectedAlarm | alarmDetailsButton: selectedAlarmMO | async\"\n class=\"btn btn-default btn-sm\"\n [ngClass]=\"button.additionalButtonClasses\"\n [title]=\"button.title | translate\"\n type=\"button\"\n (click)=\"detailsButtonAction(button, selectedAlarm)\"\n [disabled]=\"button.disabled\"\n >\n <i [ngClass]=\"button.additionalIconClasses\" [c8yIcon]=\"button.icon\"></i>\n <span *ngIf=\"button.label\">{{ button.label | translate }}</span>\n </button>\n</div>\n\n<ng-template #noAuditLogAvailable>\n <div class=\"p-16\">\n <c8y-ui-empty-state\n [icon]=\"'archive'\"\n [title]=\"'No audit logs found.' | translate\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </div>\n</ng-template>\n\n<div class=\"legend form-block\">{{ 'Audit logs' | translate }}</div>\n\n<ng-container *ngIf=\"isLoading || auditLog?.data.length; else noAuditLogAvailable\">\n <c8y-loading *ngIf=\"isLoading\"></c8y-loading>\n\n <c8y-list-group\n data-cy=\"c8y-alarms-details--audit-logs\"\n *ngIf=\"!isLoading\"\n >\n <c8y-li-timeline *c8yFor=\"let log of auditLog; loadMore: 'hidden'\">\n {{ log.creationTime | date: 'mediumDate' }}\n {{ log.creationTime | date: 'mediumTime' }}\n <c8y-li>\n <c8y-li-body>\n <p class=\"text-truncate-wrap separator-bottom p-b-4\">\n {{ log | auditChangesMessage }}\n </p>\n <div class=\"c8y-list__item__footer\">\n <span\n class=\"m-r-16 small\"\n *ngIf=\"log.user\"\n >\n <span class=\"text-label-small\">\n {{ 'by`user`' | translate }}\n </span>\n {{ log.user }}\n </span>\n <span class=\"small\">\n <span class=\"text-label-small\">\n {{ 'device time' | translate }}\n </span>\n {{ log.time | c8yDate: 'medium' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n</ng-container>\n", dependencies: [{ 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: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: i3.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: i3.LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { 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.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i3.ListItemTimelineComponent, selector: "c8y-list-item-timeline, c8y-li-timeline" }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i7.LowerCasePipe, name: "lowercase" }, { kind: "pipe", type: i7.JsonPipe, name: "json" }, { kind: "pipe", type: i7.DatePipe, name: "date" }, { kind: "pipe", type: i3.HumanizeAppNamePipe, name: "humanizeAppName" }, { kind: "pipe", type: i3.DatePipe, name: "c8yDate" }, { kind: "pipe", type: i3.AssetLinkPipe, name: "assetLink" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: AlarmDetailsButtonPipe, name: "alarmDetailsButton" }, { kind: "pipe", type: AlarmSeverityToIconPipe, name: "AlarmSeverityToIcon" }, { kind: "pipe", type: AlarmStatusToIconPipe, name: "AlarmStatusToIcon" }, { kind: "pipe", type: AuditChangesMessagePipe, name: "auditChangesMessage" }] }); }
|
|
986
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: AlarmDetailsComponent, selector: "c8y-alarm-details", inputs: { selectedAlarm: "selectedAlarm" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex row tight-grid flex-wrap a-i-stretch\">\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 c8y-icon\"\n [c8yIcon]=\"selectedAlarm.status | AlarmStatusToIcon\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Status' | translate }}</p>\n <p class=\"small\">{{ statusMessage }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n [c8yIcon]=\"selectedAlarm.severity | AlarmSeverityToIcon\"\n [ngClass]=\"selectedAlarm.severity?.toString() | lowercase\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Severity' | translate }}</p>\n <p class=\"small\">{{ SEVERITY_LABELS[selectedAlarm.severity] | translate }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n c8yIcon=\"contactless-payment\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Source' | translate }}</p>\n <p class=\"small\">\n <button\n class=\"btn-link text-muted p-0 m-r-8 text-left\"\n title=\"{{ selectedAlarm.source.name }}\"\n type=\"button\"\n routerLink=\"{{ selectedAlarmMO | assetLink }}\"\n >\n <small class=\"icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n {{ selectedAlarm.source.name || selectedAlarm.source.id }}\n </small>\n </button>\n <ng-container *ngIf=\"showSourceNavigationLink\">\n <button\n class=\"btn-link p-0 text-left\"\n title=\"{{\n linkTitle\n | translate: { appName: userDeviceManagementApp | humanizeAppName | async }\n }}\"\n type=\"button\"\n (click)=\"goToAlarmSource(selectedAlarm.id)\"\n data-cy=\"alarm-details-device-management-link\"\n >\n {{ userDeviceManagementApp | humanizeAppName | async }}\n <i c8yIcon=\"external-link\"></i>\n </button>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <span\n class=\"circle-icon-wrapper\"\n [ngStyle]=\"{ 'background-color': typeColor }\"\n >\n <i\n class=\"stroked-icon\"\n c8yIcon=\"bell\"\n ></i>\n </span>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8 min-width-0\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Type' | translate }}</p>\n <p\n class=\"small text-truncate\"\n title=\"{{ selectedAlarm.type }}\"\n >\n <code>{{ selectedAlarm.type }}</code>\n </p>\n </div>\n </div>\n </div>\n\n <div class=\"col-xs-12 col-md-12 p-b-16\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"calendar\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-0 p-r-8 flex-grow\">\n <div class=\"content-flex-50\">\n <div class=\"col-4 p-b-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Last updated' | translate }}</p>\n <p class=\"small\">\n {{ lastUpdated | c8yDate: 'medium' }}\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Number of occurrences' | translate }}</p>\n <p>\n <span class=\"badge badge-info\">{{ selectedAlarm.count }}</span>\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'First occurrence' | translate }}</p>\n <p class=\"small\">\n {{ selectedAlarm.creationTime | c8yDate: 'medium' }}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"col-xs-12 col-md-12 p-b-16\"\n *ngIf=\"customFragments\"\n >\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"outgoing-data\"\n ></i>\n </div>\n <div\n class=\"p-t-8 p-b-0 p-r-8 flex-grow\"\n data-cy=\"alarm-details-custom-data\"\n >\n <p class=\"text-label-small m-b-4 m-r-8\">{{ 'Custom data' | translate }}</p>\n <pre><code>{{ customFragments | json }}</code></pre>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"d-flex flex-wrap gap-8\">\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Reload audit logs' | translate\"\n type=\"submit\"\n (click)=\"reloadAuditLog(true, true)\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading }\"\n ></i>\n {{ 'Reload audit logs' | translate }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n \"\n type=\"submit\"\n (click)=\"\n onUpdateDetails(\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? ACKNOWLEDGED_STATUS_VALUE\n : ACTIVE_STATUS_VALUE\n )\n \"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE || isAlarmStatusChanging\"\n >\n <i\n [c8yIcon]=\"selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE ? BELL_SLASH_ICON : BELL_ICON\"\n ></i>\n {{\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Create smart rule' | translate\"\n type=\"submit\"\n *ngIf=\"isCreateSmartRulesButtonAvailable\"\n (click)=\"createSmartRule()\"\n >\n <i c8yIcon=\"c8y-icon c8y-icon-smart-rules\"></i>\n {{ 'Create smart rule' | translate }}\n </button>\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Clear`alarm`' | translate\"\n type=\"submit\"\n (click)=\"onUpdateDetails(CLEARED_STATUS_VALUE)\"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE\"\n >\n <i c8yIcon=\"c8y-alert-idle\"></i>\n {{ 'Clear`alarm`' | translate }}\n </button>\n\n <button\n *ngFor=\"let button of selectedAlarm | alarmDetailsButton: selectedAlarmMO | async\"\n class=\"btn btn-default btn-sm\"\n [ngClass]=\"button.additionalButtonClasses\"\n [title]=\"button.title | translate\"\n type=\"button\"\n (click)=\"detailsButtonAction(button, selectedAlarm)\"\n [disabled]=\"button.disabled\"\n >\n <i [ngClass]=\"button.additionalIconClasses\" [c8yIcon]=\"button.icon\"></i>\n <span *ngIf=\"button.label\">{{ button.label | translate }}</span>\n </button>\n</div>\n\n<ng-template #noAuditLogAvailable>\n <div class=\"p-16\">\n <c8y-ui-empty-state\n [icon]=\"'archive'\"\n [title]=\"'No audit logs found.' | translate\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </div>\n</ng-template>\n\n<div class=\"legend form-block\">{{ 'Audit logs' | translate }}</div>\n\n<ng-container *ngIf=\"isLoading || auditLog?.data.length; else noAuditLogAvailable\">\n <c8y-loading *ngIf=\"isLoading\"></c8y-loading>\n\n <c8y-list-group\n data-cy=\"c8y-alarms-details--audit-logs\"\n *ngIf=\"!isLoading\"\n >\n <c8y-li-timeline *c8yFor=\"let log of auditLog; loadMore: 'hidden'\">\n {{ log.creationTime | date: 'mediumDate' }}\n {{ log.creationTime | date: 'mediumTime' }}\n <c8y-li>\n <c8y-li-body>\n <p class=\"text-truncate-wrap separator-bottom p-b-4\">\n {{ log | auditChangesMessage }}\n </p>\n <div class=\"c8y-list__item__footer\">\n <span\n class=\"m-r-16 small\"\n *ngIf=\"log.user\"\n >\n <span class=\"text-label-small\">\n {{ 'by`user`' | translate }}\n </span>\n {{ log.user }}\n </span>\n <span class=\"small\">\n <span class=\"text-label-small\">\n {{ 'device time' | translate }}\n </span>\n {{ log.time | c8yDate: 'medium' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n</ng-container>\n", dependencies: [{ 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: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: i3.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: i3.LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { 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.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i3.ListItemTimelineComponent, selector: "c8y-list-item-timeline, c8y-li-timeline" }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i7.LowerCasePipe, name: "lowercase" }, { kind: "pipe", type: i7.JsonPipe, name: "json" }, { kind: "pipe", type: i7.DatePipe, name: "date" }, { kind: "pipe", type: i3.HumanizeAppNamePipe, name: "humanizeAppName" }, { kind: "pipe", type: i3.DatePipe, name: "c8yDate" }, { kind: "pipe", type: i3.AssetLinkPipe, name: "assetLink" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: AlarmDetailsButtonPipe, name: "alarmDetailsButton" }, { kind: "pipe", type: AlarmSeverityToIconPipe, name: "AlarmSeverityToIcon" }, { kind: "pipe", type: AlarmStatusToIconPipe, name: "AlarmStatusToIcon" }, { kind: "pipe", type: AuditChangesMessagePipe, name: "auditChangesMessage" }] }); }
|
|
985
987
|
}
|
|
986
988
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmDetailsComponent, decorators: [{
|
|
987
989
|
type: Component,
|
|
988
|
-
args: [{ selector: 'c8y-alarm-details', template: "<div class=\"d-flex row tight-grid flex-wrap a-i-stretch\">\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 c8y-icon\"\n [c8yIcon]=\"selectedAlarm.status | AlarmStatusToIcon\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Status' | translate }}</p>\n <p class=\"small\">{{ statusMessage }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n [c8yIcon]=\"selectedAlarm.severity | AlarmSeverityToIcon\"\n [ngClass]=\"selectedAlarm.severity?.toString() | lowercase\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Severity' | translate }}</p>\n <p class=\"small\">{{ SEVERITY_LABELS[selectedAlarm.severity] | translate }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n c8yIcon=\"contactless-payment\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Source' | translate }}</p>\n <p class=\"small\">\n <button\n class=\"btn-link text-muted p-0 m-r-8\"\n title=\"{{ selectedAlarm.source.name }}\"\n type=\"button\"\n routerLink=\"{{ selectedAlarmMO | assetLink }}\"\n >\n <small class=\"icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n {{ selectedAlarm.source.name || selectedAlarm.source.id }}\n </small>\n </button>\n <ng-container *ngIf=\"showSourceNavigationLink\">\n <button\n class=\"btn-link p-0\"\n title=\"{{\n linkTitle\n | translate: { appName: userDeviceManagementApp | humanizeAppName | async }\n }}\"\n type=\"button\"\n (click)=\"goToAlarmSource(selectedAlarm.id)\"\n data-cy=\"alarm-details-device-management-link\"\n >\n {{ userDeviceManagementApp | humanizeAppName | async }}\n <i c8yIcon=\"external-link\"></i>\n </button>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <span\n class=\"circle-icon-wrapper\"\n [ngStyle]=\"{ 'background-color': typeColor }\"\n >\n <i\n class=\"stroked-icon\"\n c8yIcon=\"bell\"\n ></i>\n </span>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8 min-width-0\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Type' | translate }}</p>\n <p\n class=\"small text-truncate\"\n title=\"{{ selectedAlarm.type }}\"\n >\n <code>{{ selectedAlarm.type }}</code>\n </p>\n </div>\n </div>\n </div>\n\n <div class=\"col-xs-12 col-md-12 p-b-16\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"calendar\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-0 p-r-8 flex-grow\">\n <div class=\"content-flex-50\">\n <div class=\"col-4 p-b-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Last updated' | translate }}</p>\n <p class=\"small\">\n {{ lastUpdated | c8yDate: 'medium' }}\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Number of occurrences' | translate }}</p>\n <p>\n <span class=\"badge badge-info\">{{ selectedAlarm.count }}</span>\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'First occurrence' | translate }}</p>\n <p class=\"small\">\n {{ selectedAlarm.creationTime | c8yDate: 'medium' }}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"col-xs-12 col-md-12 p-b-16\"\n *ngIf=\"customFragments\"\n >\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"outgoing-data\"\n ></i>\n </div>\n <div\n class=\"p-t-8 p-b-0 p-r-8 flex-grow\"\n data-cy=\"alarm-details-custom-data\"\n >\n <p class=\"text-label-small m-b-4 m-r-8\">{{ 'Custom data' | translate }}</p>\n <pre><code>{{ customFragments | json }}</code></pre>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"d-flex flex-wrap gap-8\">\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Reload audit logs' | translate\"\n type=\"submit\"\n (click)=\"reloadAuditLog(true, true)\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading }\"\n ></i>\n {{ 'Reload audit logs' | translate }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n \"\n type=\"submit\"\n (click)=\"\n onUpdateDetails(\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? ACKNOWLEDGED_STATUS_VALUE\n : ACTIVE_STATUS_VALUE\n )\n \"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE || isAlarmStatusChanging\"\n >\n <i\n [c8yIcon]=\"selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE ? BELL_SLASH_ICON : BELL_ICON\"\n ></i>\n {{\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Create smart rule' | translate\"\n type=\"submit\"\n *ngIf=\"isCreateSmartRulesButtonAvailable\"\n (click)=\"createSmartRule()\"\n >\n <i c8yIcon=\"c8y-icon c8y-icon-smart-rules\"></i>\n {{ 'Create smart rule' | translate }}\n </button>\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Clear`alarm`' | translate\"\n type=\"submit\"\n (click)=\"onUpdateDetails(CLEARED_STATUS_VALUE)\"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE\"\n >\n <i c8yIcon=\"c8y-alert-idle\"></i>\n {{ 'Clear`alarm`' | translate }}\n </button>\n\n <button\n *ngFor=\"let button of selectedAlarm | alarmDetailsButton: selectedAlarmMO | async\"\n class=\"btn btn-default btn-sm\"\n [ngClass]=\"button.additionalButtonClasses\"\n [title]=\"button.title | translate\"\n type=\"button\"\n (click)=\"detailsButtonAction(button, selectedAlarm)\"\n [disabled]=\"button.disabled\"\n >\n <i [ngClass]=\"button.additionalIconClasses\" [c8yIcon]=\"button.icon\"></i>\n <span *ngIf=\"button.label\">{{ button.label | translate }}</span>\n </button>\n</div>\n\n<ng-template #noAuditLogAvailable>\n <div class=\"p-16\">\n <c8y-ui-empty-state\n [icon]=\"'archive'\"\n [title]=\"'No audit logs found.' | translate\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </div>\n</ng-template>\n\n<div class=\"legend form-block\">{{ 'Audit logs' | translate }}</div>\n\n<ng-container *ngIf=\"isLoading || auditLog?.data.length; else noAuditLogAvailable\">\n <c8y-loading *ngIf=\"isLoading\"></c8y-loading>\n\n <c8y-list-group\n data-cy=\"c8y-alarms-details--audit-logs\"\n *ngIf=\"!isLoading\"\n >\n <c8y-li-timeline *c8yFor=\"let log of auditLog; loadMore: 'hidden'\">\n {{ log.creationTime | date: 'mediumDate' }}\n {{ log.creationTime | date: 'mediumTime' }}\n <c8y-li>\n <c8y-li-body>\n <p class=\"text-truncate-wrap separator-bottom p-b-4\">\n {{ log | auditChangesMessage }}\n </p>\n <div class=\"c8y-list__item__footer\">\n <span\n class=\"m-r-16 small\"\n *ngIf=\"log.user\"\n >\n <span class=\"text-label-small\">\n {{ 'by`user`' | translate }}\n </span>\n {{ log.user }}\n </span>\n <span class=\"small\">\n <span class=\"text-label-small\">\n {{ 'device time' | translate }}\n </span>\n {{ log.time | c8yDate: 'medium' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n</ng-container>\n" }]
|
|
990
|
+
args: [{ selector: 'c8y-alarm-details', template: "<div class=\"d-flex row tight-grid flex-wrap a-i-stretch\">\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 c8y-icon\"\n [c8yIcon]=\"selectedAlarm.status | AlarmStatusToIcon\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Status' | translate }}</p>\n <p class=\"small\">{{ statusMessage }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n [c8yIcon]=\"selectedAlarm.severity | AlarmSeverityToIcon\"\n [ngClass]=\"selectedAlarm.severity?.toString() | lowercase\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Severity' | translate }}</p>\n <p class=\"small\">{{ SEVERITY_LABELS[selectedAlarm.severity] | translate }}</p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4 stroked-icon status\"\n c8yIcon=\"contactless-payment\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Source' | translate }}</p>\n <p class=\"small\">\n <button\n class=\"btn-link text-muted p-0 m-r-8 text-left\"\n title=\"{{ selectedAlarm.source.name }}\"\n type=\"button\"\n routerLink=\"{{ selectedAlarmMO | assetLink }}\"\n >\n <small class=\"icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n {{ selectedAlarm.source.name || selectedAlarm.source.id }}\n </small>\n </button>\n <ng-container *ngIf=\"showSourceNavigationLink\">\n <button\n class=\"btn-link p-0 text-left\"\n title=\"{{\n linkTitle\n | translate: { appName: userDeviceManagementApp | humanizeAppName | async }\n }}\"\n type=\"button\"\n (click)=\"goToAlarmSource(selectedAlarm.id)\"\n data-cy=\"alarm-details-device-management-link\"\n >\n {{ userDeviceManagementApp | humanizeAppName | async }}\n <i c8yIcon=\"external-link\"></i>\n </button>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"col-xs-12 col-md-6 d-flex p-b-8\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <span\n class=\"circle-icon-wrapper\"\n [ngStyle]=\"{ 'background-color': typeColor }\"\n >\n <i\n class=\"stroked-icon\"\n c8yIcon=\"bell\"\n ></i>\n </span>\n </div>\n <div class=\"p-t-8 p-b-8 p-r-8 min-width-0\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Type' | translate }}</p>\n <p\n class=\"small text-truncate\"\n title=\"{{ selectedAlarm.type }}\"\n >\n <code>{{ selectedAlarm.type }}</code>\n </p>\n </div>\n </div>\n </div>\n\n <div class=\"col-xs-12 col-md-12 p-b-16\">\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"calendar\"\n ></i>\n </div>\n <div class=\"p-t-8 p-b-0 p-r-8 flex-grow\">\n <div class=\"content-flex-50\">\n <div class=\"col-4 p-b-8\">\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Last updated' | translate }}</p>\n <p class=\"small\">\n {{ lastUpdated | c8yDate: 'medium' }}\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'Number of occurrences' | translate }}</p>\n <p>\n <span class=\"badge badge-info\">{{ selectedAlarm.count }}</span>\n </p>\n </div>\n <div\n class=\"col-4 p-b-8\"\n *ngIf=\"selectedAlarm.count > 1\"\n >\n <p class=\"text-label-small m-b-0 m-r-8\">{{ 'First occurrence' | translate }}</p>\n <p class=\"small\">\n {{ selectedAlarm.creationTime | c8yDate: 'medium' }}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"col-xs-12 col-md-12 p-b-16\"\n *ngIf=\"customFragments\"\n >\n <div class=\"border-all fit-w d-flex\">\n <div class=\"p-8\">\n <i\n class=\"icon-24 text-gray-dark m-t-4\"\n c8yIcon=\"outgoing-data\"\n ></i>\n </div>\n <div\n class=\"p-t-8 p-b-0 p-r-8 flex-grow\"\n data-cy=\"alarm-details-custom-data\"\n >\n <p class=\"text-label-small m-b-4 m-r-8\">{{ 'Custom data' | translate }}</p>\n <pre><code>{{ customFragments | json }}</code></pre>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"d-flex flex-wrap gap-8\">\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Reload audit logs' | translate\"\n type=\"submit\"\n (click)=\"reloadAuditLog(true, true)\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading }\"\n ></i>\n {{ 'Reload audit logs' | translate }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n \"\n type=\"submit\"\n (click)=\"\n onUpdateDetails(\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? ACKNOWLEDGED_STATUS_VALUE\n : ACTIVE_STATUS_VALUE\n )\n \"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE || isAlarmStatusChanging\"\n >\n <i\n [c8yIcon]=\"selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE ? BELL_SLASH_ICON : BELL_ICON\"\n ></i>\n {{\n selectedAlarm.status !== ACKNOWLEDGED_STATUS_VALUE\n ? (ACKNOWLEDGE_LABEL | translate)\n : (REACTIVATE_LABEL | translate)\n }}\n </button>\n\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Create smart rule' | translate\"\n type=\"submit\"\n *ngIf=\"isCreateSmartRulesButtonAvailable\"\n (click)=\"createSmartRule()\"\n >\n <i c8yIcon=\"c8y-icon c8y-icon-smart-rules\"></i>\n {{ 'Create smart rule' | translate }}\n </button>\n <button\n class=\"btn btn-default btn-sm\"\n [title]=\"'Clear`alarm`' | translate\"\n type=\"submit\"\n (click)=\"onUpdateDetails(CLEARED_STATUS_VALUE)\"\n [disabled]=\"selectedAlarm.status === CLEARED_STATUS_VALUE\"\n >\n <i c8yIcon=\"c8y-alert-idle\"></i>\n {{ 'Clear`alarm`' | translate }}\n </button>\n\n <button\n *ngFor=\"let button of selectedAlarm | alarmDetailsButton: selectedAlarmMO | async\"\n class=\"btn btn-default btn-sm\"\n [ngClass]=\"button.additionalButtonClasses\"\n [title]=\"button.title | translate\"\n type=\"button\"\n (click)=\"detailsButtonAction(button, selectedAlarm)\"\n [disabled]=\"button.disabled\"\n >\n <i [ngClass]=\"button.additionalIconClasses\" [c8yIcon]=\"button.icon\"></i>\n <span *ngIf=\"button.label\">{{ button.label | translate }}</span>\n </button>\n</div>\n\n<ng-template #noAuditLogAvailable>\n <div class=\"p-16\">\n <c8y-ui-empty-state\n [icon]=\"'archive'\"\n [title]=\"'No audit logs found.' | translate\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </div>\n</ng-template>\n\n<div class=\"legend form-block\">{{ 'Audit logs' | translate }}</div>\n\n<ng-container *ngIf=\"isLoading || auditLog?.data.length; else noAuditLogAvailable\">\n <c8y-loading *ngIf=\"isLoading\"></c8y-loading>\n\n <c8y-list-group\n data-cy=\"c8y-alarms-details--audit-logs\"\n *ngIf=\"!isLoading\"\n >\n <c8y-li-timeline *c8yFor=\"let log of auditLog; loadMore: 'hidden'\">\n {{ log.creationTime | date: 'mediumDate' }}\n {{ log.creationTime | date: 'mediumTime' }}\n <c8y-li>\n <c8y-li-body>\n <p class=\"text-truncate-wrap separator-bottom p-b-4\">\n {{ log | auditChangesMessage }}\n </p>\n <div class=\"c8y-list__item__footer\">\n <span\n class=\"m-r-16 small\"\n *ngIf=\"log.user\"\n >\n <span class=\"text-label-small\">\n {{ 'by`user`' | translate }}\n </span>\n {{ log.user }}\n </span>\n <span class=\"small\">\n <span class=\"text-label-small\">\n {{ 'device time' | translate }}\n </span>\n {{ log.time | c8yDate: 'medium' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n</ng-container>\n" }]
|
|
989
991
|
}], ctorParameters: () => [{ type: AlarmDetailsService }, { type: i2.AlarmService }, { type: i3.AlertService }, { type: i3.AppStateService }, { type: i2.AuditService }, { type: i3.RelativeTimePipe }, { type: Ng1SmartRulesUpgradeService, decorators: [{
|
|
990
992
|
type: Optional
|
|
991
993
|
}] }, { type: i1.TranslateService }, { type: i2.InventoryService }, { type: AlarmsViewService }, { type: i3.ColorService }], propDecorators: { selectedAlarm: [{
|
|
992
994
|
type: Input
|
|
993
|
-
}], hasAnyRoleAllowingToCreateSmartRule: [{
|
|
994
|
-
type: Input
|
|
995
|
-
}], isSmartRulesServiceSubscribed: [{
|
|
996
|
-
type: Input
|
|
997
995
|
}] } });
|
|
998
996
|
|
|
999
997
|
class AlarmEmptyComponent {
|
|
@@ -1006,40 +1004,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
1006
1004
|
}] });
|
|
1007
1005
|
|
|
1008
1006
|
class AlarmInfoComponent {
|
|
1009
|
-
constructor(
|
|
1010
|
-
this.alarmDetailsService = alarmDetailsService;
|
|
1007
|
+
constructor(activatedRoute, router, contextRouteService, alarmsViewService) {
|
|
1011
1008
|
this.activatedRoute = activatedRoute;
|
|
1012
|
-
this.alarmsService = alarmsService;
|
|
1013
1009
|
this.router = router;
|
|
1014
1010
|
this.contextRouteService = contextRouteService;
|
|
1015
1011
|
this.alarmsViewService = alarmsViewService;
|
|
1016
|
-
this.
|
|
1017
|
-
|
|
1018
|
-
ngOnInit() {
|
|
1019
|
-
this.selectedAlarm$ = this.activatedRoute.params.pipe(tap(() => (this.isLoading = true)), switchMap$1(params => this.alarmsService.detail(params.id)), map(alarmResult => alarmResult.data), tap(() => this.loadingDone()), shareReplay(), takeUntil(this.destroy$));
|
|
1020
|
-
}
|
|
1021
|
-
ngOnDestroy() {
|
|
1022
|
-
this.destroy$.next();
|
|
1023
|
-
this.destroy$.complete();
|
|
1012
|
+
this.isContextRoute = false;
|
|
1013
|
+
this.TITLE = gettext('Alarms');
|
|
1024
1014
|
}
|
|
1025
|
-
async
|
|
1026
|
-
|
|
1027
|
-
this.
|
|
1028
|
-
|
|
1029
|
-
|
|
1015
|
+
async ngOnInit() {
|
|
1016
|
+
const contextData = this.contextRouteService.getContextData(this.activatedRoute);
|
|
1017
|
+
this.selectedAlarm$ = of(contextData.contextData);
|
|
1018
|
+
this.isContextRoute = this.contextRouteService.isContextRoute(this.router.url, [
|
|
1019
|
+
ViewContext.Device,
|
|
1020
|
+
ViewContext.Group
|
|
1021
|
+
]);
|
|
1030
1022
|
}
|
|
1031
1023
|
back() {
|
|
1032
1024
|
const contextData = this.contextRouteService.getContextData(this.activatedRoute);
|
|
1033
1025
|
const backLink = this.alarmsViewService.getRouterNavigationArray(contextData);
|
|
1034
1026
|
this.router.navigate(backLink, { queryParamsHandling: 'preserve' });
|
|
1035
1027
|
}
|
|
1036
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmInfoComponent, deps: [{ token:
|
|
1037
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: AlarmInfoComponent, selector: "c8y-alarm-info", ngImport: i0, template: "<div\n class=\"inner-scroll split-view__detail split-view__detail--selected\"\n *ngIf=\"selectedAlarm$ | async\"\n>\n <div\n class=\"card-header gap-16 d-block-xs d-block-sm p-l-24 p-r-24 p-t-16 separator
|
|
1028
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmInfoComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: i3.ContextRouteService }, { token: AlarmsViewService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1029
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: AlarmInfoComponent, selector: "c8y-alarm-info", ngImport: i0, template: "<ng-container *ngIf=\"!isContextRoute\">\n <c8y-title>{{ TITLE | translate }}</c8y-title>\n</ng-container>\n\n<div\n class=\"inner-scroll split-view__detail split-view__detail--selected\"\n *ngIf=\"selectedAlarm$ | async\"\n>\n <div class=\"sticky-top bg-component\">\n <div class=\"card-header gap-16 d-block-xs d-block-sm p-l-24 p-r-24 p-t-16 separator\">\n <button\n class=\"btn btn-clean text-primary visible-sm visible-xs\"\n [title]=\"'Back' | translate\"\n (click)=\"back()\"\n >\n <i c8yIcon=\"chevron-left\"></i>\n <span>{{ 'Back' | translate }}</span>\n </button>\n\n <div class=\"flex-no-shrink a-s-start\"></div>\n <div class=\"flex-grow d-col\">\n <div\n class=\"text-break-word flex-grow text-16\"\n data-cy=\"c8y-alarms-info--title\"\n >\n {{ (selectedAlarm$ | async)?.text | translate }}\n </div>\n </div>\n <div class=\"p-relative\">\n <c8y-tabs-outlet\n outletName=\"alarms\"\n orientation=\"horizontal\"\n ></c8y-tabs-outlet>\n </div>\n </div>\n <div class=\"card-block overflow-visible p-l-24 p-r-24\">\n <c8y-alarm-details [selectedAlarm]=\"selectedAlarm$ | async\"></c8y-alarm-details>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i3.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "component", type: i3.TabsOutletComponent, selector: "c8y-tabs-outlet,c8y-ui-tabs", inputs: ["tabs", "orientation", "navigatorOpen", "outletName", "context", "hasHeader"] }, { kind: "component", type: AlarmDetailsComponent, selector: "c8y-alarm-details", inputs: ["selectedAlarm"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] }); }
|
|
1038
1030
|
}
|
|
1039
1031
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmInfoComponent, decorators: [{
|
|
1040
1032
|
type: Component,
|
|
1041
|
-
args: [{ selector: 'c8y-alarm-info', template: "<div\n class=\"inner-scroll split-view__detail split-view__detail--selected\"\n *ngIf=\"selectedAlarm$ | async\"\n>\n <div\n class=\"card-header gap-16 d-block-xs d-block-sm p-l-24 p-r-24 p-t-16 separator
|
|
1042
|
-
}], ctorParameters: () => [{ type:
|
|
1033
|
+
args: [{ selector: 'c8y-alarm-info', template: "<ng-container *ngIf=\"!isContextRoute\">\n <c8y-title>{{ TITLE | translate }}</c8y-title>\n</ng-container>\n\n<div\n class=\"inner-scroll split-view__detail split-view__detail--selected\"\n *ngIf=\"selectedAlarm$ | async\"\n>\n <div class=\"sticky-top bg-component\">\n <div class=\"card-header gap-16 d-block-xs d-block-sm p-l-24 p-r-24 p-t-16 separator\">\n <button\n class=\"btn btn-clean text-primary visible-sm visible-xs\"\n [title]=\"'Back' | translate\"\n (click)=\"back()\"\n >\n <i c8yIcon=\"chevron-left\"></i>\n <span>{{ 'Back' | translate }}</span>\n </button>\n\n <div class=\"flex-no-shrink a-s-start\"></div>\n <div class=\"flex-grow d-col\">\n <div\n class=\"text-break-word flex-grow text-16\"\n data-cy=\"c8y-alarms-info--title\"\n >\n {{ (selectedAlarm$ | async)?.text | translate }}\n </div>\n </div>\n <div class=\"p-relative\">\n <c8y-tabs-outlet\n outletName=\"alarms\"\n orientation=\"horizontal\"\n ></c8y-tabs-outlet>\n </div>\n </div>\n <div class=\"card-block overflow-visible p-l-24 p-r-24\">\n <c8y-alarm-details [selectedAlarm]=\"selectedAlarm$ | async\"></c8y-alarm-details>\n </div>\n </div>\n</div>\n" }]
|
|
1034
|
+
}], ctorParameters: () => [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: i3.ContextRouteService }, { type: AlarmsViewService }] });
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* A service to retrieve custom indicators for the alarm list view.
|
|
1038
|
+
*/
|
|
1039
|
+
class AlarmListIndicatorService {
|
|
1040
|
+
constructor(serviceRegistry, pluginsResolver) {
|
|
1041
|
+
this.serviceRegistry = serviceRegistry;
|
|
1042
|
+
this.pluginsResolver = pluginsResolver;
|
|
1043
|
+
}
|
|
1044
|
+
get$(alarm) {
|
|
1045
|
+
const providers$ = this.pluginsResolver.allPluginsLoaded$.pipe(filter(Boolean), map(() => {
|
|
1046
|
+
return this.serviceRegistry.get('alarmListIndicator');
|
|
1047
|
+
}));
|
|
1048
|
+
return providers$.pipe(switchMap(providers => {
|
|
1049
|
+
const observables$ = providers.map(provider => provider.getAlarmListIndicator$(alarm).pipe(startWith(false)));
|
|
1050
|
+
return combineLatest(observables$);
|
|
1051
|
+
}), map(indicators => {
|
|
1052
|
+
return indicators.filter(Boolean);
|
|
1053
|
+
}), map(indicators => sortBy(indicators, this.byPriority)));
|
|
1054
|
+
}
|
|
1055
|
+
byPriority(item) {
|
|
1056
|
+
if (item.priority === undefined) {
|
|
1057
|
+
return 0;
|
|
1058
|
+
}
|
|
1059
|
+
return -item.priority;
|
|
1060
|
+
}
|
|
1061
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorService, deps: [{ token: i3.ServiceRegistry }, { token: i3.PluginsResolveService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1062
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorService, providedIn: 'root' }); }
|
|
1063
|
+
}
|
|
1064
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorService, decorators: [{
|
|
1065
|
+
type: Injectable,
|
|
1066
|
+
args: [{ providedIn: 'root' }]
|
|
1067
|
+
}], ctorParameters: () => [{ type: i3.ServiceRegistry }, { type: i3.PluginsResolveService }] });
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* A pipe to provide custom indicators for the alarm list view.
|
|
1071
|
+
*
|
|
1072
|
+
* Will call `get$()` method of `AlarmListIndicatorService` to get the custom indicators for the provided alarm.
|
|
1073
|
+
*/
|
|
1074
|
+
class AlarmListIndicatorPipe {
|
|
1075
|
+
constructor(alarmListIndicatorService) {
|
|
1076
|
+
this.alarmListIndicatorService = alarmListIndicatorService;
|
|
1077
|
+
}
|
|
1078
|
+
transform(alarm) {
|
|
1079
|
+
return this.alarmListIndicatorService.get$(alarm);
|
|
1080
|
+
}
|
|
1081
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorPipe, deps: [{ token: AlarmListIndicatorService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1082
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorPipe, isStandalone: true, name: "alarmListIndicator" }); }
|
|
1083
|
+
}
|
|
1084
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorPipe, decorators: [{
|
|
1085
|
+
type: Pipe,
|
|
1086
|
+
args: [{
|
|
1087
|
+
standalone: true,
|
|
1088
|
+
name: 'alarmListIndicator',
|
|
1089
|
+
pure: true
|
|
1090
|
+
}]
|
|
1091
|
+
}], ctorParameters: () => [{ type: AlarmListIndicatorService }] });
|
|
1043
1092
|
|
|
1044
1093
|
/**
|
|
1045
1094
|
* Pipe for transforming an array of alarm severity types into a comma-separated string.
|
|
@@ -1165,7 +1214,7 @@ class AlarmsFilterComponent {
|
|
|
1165
1214
|
this.destroy$ = new Subject();
|
|
1166
1215
|
}
|
|
1167
1216
|
ngOnInit() {
|
|
1168
|
-
this.activatedRoute.queryParams.pipe(takeUntil
|
|
1217
|
+
this.activatedRoute.queryParams.pipe(takeUntil(this.destroy$)).subscribe(params => {
|
|
1169
1218
|
this.showCleared = params.showCleared === 'true';
|
|
1170
1219
|
this.formGroup.setValue({
|
|
1171
1220
|
[Severity.CRITICAL]: params[Severity.CRITICAL] === 'true',
|
|
@@ -1184,7 +1233,7 @@ class AlarmsFilterComponent {
|
|
|
1184
1233
|
}
|
|
1185
1234
|
ngAfterViewInit() {
|
|
1186
1235
|
this.filtersDropdown.isOpenChange
|
|
1187
|
-
.pipe(takeUntil
|
|
1236
|
+
.pipe(takeUntil(this.destroy$), filter(Boolean))
|
|
1188
1237
|
.subscribe(() => this.updateAlarmsCount());
|
|
1189
1238
|
}
|
|
1190
1239
|
ngOnDestroy() {
|
|
@@ -1290,19 +1339,19 @@ class AlarmsFilterComponent {
|
|
|
1290
1339
|
this.shouldDisableApplyButton$ = this.createDisableApplyButtonStream();
|
|
1291
1340
|
}
|
|
1292
1341
|
createAllSelectedStream(formValue$) {
|
|
1293
|
-
return formValue$.pipe(map
|
|
1342
|
+
return formValue$.pipe(map(severities => Object.values(severities).every(Boolean)));
|
|
1294
1343
|
}
|
|
1295
1344
|
createIndeterminateStream(formValue$) {
|
|
1296
|
-
return formValue$.pipe(map
|
|
1345
|
+
return formValue$.pipe(map(severities => Object.values(severities).some(Boolean) && !Object.values(severities).every(Boolean)));
|
|
1297
1346
|
}
|
|
1298
1347
|
trackAllCheckboxesDisabled(formValue$) {
|
|
1299
|
-
formValue$.pipe(takeUntil
|
|
1348
|
+
formValue$.pipe(takeUntil(this.destroy$)).subscribe(severities => {
|
|
1300
1349
|
const areAllDisabled = Object.values(severities).every(value => !value);
|
|
1301
1350
|
this.isNoneCheckboxSelected$.next(areAllDisabled);
|
|
1302
1351
|
});
|
|
1303
1352
|
}
|
|
1304
1353
|
createDisableApplyButtonStream() {
|
|
1305
|
-
return combineLatest([this.isNoneCheckboxSelected$, this.severitiesTouched$]).pipe(map
|
|
1354
|
+
return combineLatest([this.isNoneCheckboxSelected$, this.severitiesTouched$]).pipe(map(([allCheckboxesAreDisabled, severitiesTouched]) => allCheckboxesAreDisabled || !severitiesTouched));
|
|
1306
1355
|
}
|
|
1307
1356
|
updateChipsAndDefaultValues() {
|
|
1308
1357
|
const severityFilter = this.formGroup;
|
|
@@ -1444,7 +1493,7 @@ class AlarmsIntervalRefreshComponent {
|
|
|
1444
1493
|
onIntervalToggleChange() {
|
|
1445
1494
|
this.toggleIntervalForm
|
|
1446
1495
|
.get('intervalToggle')
|
|
1447
|
-
.valueChanges.pipe(takeUntil
|
|
1496
|
+
.valueChanges.pipe(takeUntil(this.destroy$), filter(Boolean))
|
|
1448
1497
|
.subscribe(() => setTimeout(() => this.startCountdown()));
|
|
1449
1498
|
}
|
|
1450
1499
|
initForm() {
|
|
@@ -1456,12 +1505,12 @@ class AlarmsIntervalRefreshComponent {
|
|
|
1456
1505
|
listenToRefreshIntervalChange() {
|
|
1457
1506
|
this.toggleIntervalForm
|
|
1458
1507
|
.get('refreshInterval')
|
|
1459
|
-
.valueChanges.pipe(takeUntil
|
|
1508
|
+
.valueChanges.pipe(takeUntil(this.destroy$))
|
|
1460
1509
|
.subscribe(() => this.resetCountdown());
|
|
1461
1510
|
}
|
|
1462
1511
|
listenOnLoadingChanges() {
|
|
1463
1512
|
this.alarmsListLoading$
|
|
1464
|
-
.pipe(tap
|
|
1513
|
+
.pipe(tap(() => this.countdownIntervalComponent?.stop()))
|
|
1465
1514
|
.subscribe(state => {
|
|
1466
1515
|
!state && this.countdownIntervalComponent?.reset();
|
|
1467
1516
|
});
|
|
@@ -1485,63 +1534,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
1485
1534
|
args: [CountdownIntervalComponent]
|
|
1486
1535
|
}] } });
|
|
1487
1536
|
|
|
1488
|
-
/**
|
|
1489
|
-
* A service to retrieve custom indicators for the alarm list view.
|
|
1490
|
-
*/
|
|
1491
|
-
class AlarmListIndicatorService {
|
|
1492
|
-
constructor(serviceRegistry, pluginsResolver) {
|
|
1493
|
-
this.serviceRegistry = serviceRegistry;
|
|
1494
|
-
this.pluginsResolver = pluginsResolver;
|
|
1495
|
-
}
|
|
1496
|
-
get$(alarm) {
|
|
1497
|
-
const providers$ = this.pluginsResolver.allPluginsLoaded$.pipe(filter(Boolean), map$1(() => {
|
|
1498
|
-
return this.serviceRegistry.get('alarmListIndicator');
|
|
1499
|
-
}));
|
|
1500
|
-
return providers$.pipe(switchMap(providers => {
|
|
1501
|
-
const observables$ = providers.map(provider => provider.getAlarmListIndicator$(alarm).pipe(startWith(false)));
|
|
1502
|
-
return combineLatest(observables$);
|
|
1503
|
-
}), map$1(indicators => {
|
|
1504
|
-
return indicators.filter(Boolean);
|
|
1505
|
-
}), map$1(indicators => sortBy(indicators, this.byPriority)));
|
|
1506
|
-
}
|
|
1507
|
-
byPriority(item) {
|
|
1508
|
-
if (item.priority === undefined) {
|
|
1509
|
-
return 0;
|
|
1510
|
-
}
|
|
1511
|
-
return -item.priority;
|
|
1512
|
-
}
|
|
1513
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorService, deps: [{ token: i3.ServiceRegistry }, { token: i3.PluginsResolveService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1514
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorService, providedIn: 'root' }); }
|
|
1515
|
-
}
|
|
1516
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorService, decorators: [{
|
|
1517
|
-
type: Injectable,
|
|
1518
|
-
args: [{ providedIn: 'root' }]
|
|
1519
|
-
}], ctorParameters: () => [{ type: i3.ServiceRegistry }, { type: i3.PluginsResolveService }] });
|
|
1520
|
-
|
|
1521
|
-
/**
|
|
1522
|
-
* A pipe to provide custom indicators for the alarm list view.
|
|
1523
|
-
*
|
|
1524
|
-
* Will call `get$()` method of `AlarmListIndicatorService` to get the custom indicators for the provided alarm.
|
|
1525
|
-
*/
|
|
1526
|
-
class AlarmListIndicatorPipe {
|
|
1527
|
-
constructor(alarmListIndicatorService) {
|
|
1528
|
-
this.alarmListIndicatorService = alarmListIndicatorService;
|
|
1529
|
-
}
|
|
1530
|
-
transform(alarm) {
|
|
1531
|
-
return this.alarmListIndicatorService.get$(alarm);
|
|
1532
|
-
}
|
|
1533
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorPipe, deps: [{ token: AlarmListIndicatorService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1534
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorPipe, isStandalone: true, name: "alarmListIndicator" }); }
|
|
1535
|
-
}
|
|
1536
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmListIndicatorPipe, decorators: [{
|
|
1537
|
-
type: Pipe,
|
|
1538
|
-
args: [{
|
|
1539
|
-
standalone: true,
|
|
1540
|
-
name: 'alarmListIndicator',
|
|
1541
|
-
pure: true
|
|
1542
|
-
}]
|
|
1543
|
-
}], ctorParameters: () => [{ type: AlarmListIndicatorService }] });
|
|
1544
|
-
|
|
1545
1537
|
class AlarmsListComponent {
|
|
1546
1538
|
constructor(activatedRoute, alarmsViewService, contextRouteService, router) {
|
|
1547
1539
|
this.activatedRoute = activatedRoute;
|
|
@@ -1604,7 +1596,7 @@ class AlarmsListComponent {
|
|
|
1604
1596
|
*/
|
|
1605
1597
|
this.isEmptyListLoading = true;
|
|
1606
1598
|
this.alertAggregator = new DynamicComponentAlertAggregator();
|
|
1607
|
-
this.mapAlarmLink = pipe(map
|
|
1599
|
+
this.mapAlarmLink = pipe(map((alarms) => alarms.map((alarm) => {
|
|
1608
1600
|
alarm.link = this.getRouterLink(alarm);
|
|
1609
1601
|
return alarm;
|
|
1610
1602
|
})));
|
|
@@ -1644,7 +1636,7 @@ class AlarmsListComponent {
|
|
|
1644
1636
|
if (this.alarmsViewService.isIntervalRefresh()) {
|
|
1645
1637
|
const scrollElement = this.innerScrollWrapper.nativeElement;
|
|
1646
1638
|
fromEvent(scrollElement, 'scroll')
|
|
1647
|
-
.pipe(takeUntil
|
|
1639
|
+
.pipe(takeUntil(this.destroy$), debounceTime(300))
|
|
1648
1640
|
.subscribe((event) => {
|
|
1649
1641
|
const target = event.target;
|
|
1650
1642
|
this.isScrolling = this.shouldCountdownIntervalBeHidden(target);
|
|
@@ -1671,7 +1663,7 @@ class AlarmsListComponent {
|
|
|
1671
1663
|
return scrollTopPixels > this.HIDE_INTERVAL_COUNTDOWN_SCROLL;
|
|
1672
1664
|
}
|
|
1673
1665
|
verifyIfFiltersMatchingAlarm() {
|
|
1674
|
-
this.activeChildParam$ = this.router.events.pipe(filter(e => e instanceof NavigationEnd && this.activatedRoute.children.length > 0), switchMap(() => this.activatedRoute.children[0].params), map
|
|
1666
|
+
this.activeChildParam$ = this.router.events.pipe(filter(e => e instanceof NavigationEnd && this.activatedRoute.children.length > 0), switchMap(() => this.activatedRoute.children[0].params), map(params => params.id), distinctUntilChanged(), shareReplay$1(), takeUntil(this.destroy$));
|
|
1675
1667
|
// done to get the first navigation
|
|
1676
1668
|
this.activeChildParam$.subscribe();
|
|
1677
1669
|
}
|
|
@@ -1723,7 +1715,7 @@ class AlarmsDateFilterComponent {
|
|
|
1723
1715
|
this.form.value.currentDateContextFromDate,
|
|
1724
1716
|
this.form.value.currentDateContextToDate
|
|
1725
1717
|
];
|
|
1726
|
-
this.activatedRoute.queryParams.pipe(takeUntil(this.destroy$)).subscribe(params => {
|
|
1718
|
+
this.activatedRoute.queryParams.pipe(takeUntil$1(this.destroy$)).subscribe(params => {
|
|
1727
1719
|
this.showCleared = params.showCleared === 'true';
|
|
1728
1720
|
this.severityOptions = {
|
|
1729
1721
|
[Severity.CRITICAL]: params.critical === 'true',
|
|
@@ -1786,7 +1778,7 @@ class AlarmsDateFilterComponent {
|
|
|
1786
1778
|
}
|
|
1787
1779
|
subscribeToIntervalChange() {
|
|
1788
1780
|
this.form.controls.currentDateContextInterval.valueChanges
|
|
1789
|
-
.pipe(takeUntil(this.destroy$))
|
|
1781
|
+
.pipe(takeUntil$1(this.destroy$))
|
|
1790
1782
|
.subscribe(interval => {
|
|
1791
1783
|
if (interval === 'custom') {
|
|
1792
1784
|
this.form.patchValue({
|
|
@@ -1845,14 +1837,14 @@ class AlarmsTypeFilterComponent {
|
|
|
1845
1837
|
}
|
|
1846
1838
|
ngOnInit() {
|
|
1847
1839
|
this.activatedRoute.queryParams
|
|
1848
|
-
.pipe(map
|
|
1840
|
+
.pipe(map(params => {
|
|
1849
1841
|
const alarms = this.formGroup.get(this.formControlName).value;
|
|
1850
1842
|
return this.getActiveAlarmFiltersFromQueryParameter(alarms, params[this.queryParamName]);
|
|
1851
|
-
}), takeUntil
|
|
1843
|
+
}), takeUntil(this.destroy$))
|
|
1852
1844
|
.subscribe((alarmFilters) => this.formGroup.get(this.formControlName).patchValue(alarmFilters));
|
|
1853
1845
|
this.formGroup
|
|
1854
1846
|
.get(this.formControlName)
|
|
1855
|
-
.valueChanges.pipe(takeUntil
|
|
1847
|
+
.valueChanges.pipe(takeUntil(this.destroy$))
|
|
1856
1848
|
.subscribe((alarmFilters) => this.applyFilterChange(alarmFilters));
|
|
1857
1849
|
}
|
|
1858
1850
|
ngOnChanges(changes) {
|
|
@@ -1980,7 +1972,7 @@ class AlarmsComponent {
|
|
|
1980
1972
|
this.handleLegacyRealtime();
|
|
1981
1973
|
}
|
|
1982
1974
|
this.alarmsViewService.reloadAlarmsList$
|
|
1983
|
-
.pipe(debounceTime(this.WAIT_TIME_AVOID_MULTIPLE_REQUEST_BY_PARAM_CHANGE), takeUntil
|
|
1975
|
+
.pipe(debounceTime(this.WAIT_TIME_AVOID_MULTIPLE_REQUEST_BY_PARAM_CHANGE), takeUntil(this.destroy$))
|
|
1984
1976
|
.subscribe(() => {
|
|
1985
1977
|
this.updateAlarms();
|
|
1986
1978
|
});
|
|
@@ -2087,7 +2079,7 @@ class AlarmsComponent {
|
|
|
2087
2079
|
subscribeToRealtimeUpdates() {
|
|
2088
2080
|
this.alarmWithChildrenRealtimeService
|
|
2089
2081
|
.onAll$(this.contextSourceId)
|
|
2090
|
-
.pipe(takeUntil
|
|
2082
|
+
.pipe(takeUntil(this.destroy$), throttleTime(THROTTLE_REALTIME_REFRESH, undefined, { trailing: true }))
|
|
2091
2083
|
.subscribe(() => {
|
|
2092
2084
|
if (this.isRealtimeToggleOn) {
|
|
2093
2085
|
this.refresh();
|
|
@@ -2098,7 +2090,14 @@ class AlarmsComponent {
|
|
|
2098
2090
|
});
|
|
2099
2091
|
}
|
|
2100
2092
|
initializeContextSourceId() {
|
|
2101
|
-
|
|
2093
|
+
const routeContext = this.contextRouteService.getContextData(this.activatedRoute);
|
|
2094
|
+
if (!routeContext) {
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
const { context, contextData } = routeContext;
|
|
2098
|
+
if ([ViewContext.Device, ViewContext.Group].includes(context)) {
|
|
2099
|
+
this.contextSourceId = contextData?.id;
|
|
2100
|
+
}
|
|
2102
2101
|
}
|
|
2103
2102
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AlarmsComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: AlarmsViewService }, { token: i3.AlarmWithChildrenRealtimeService }, { token: i3.AlertService }, { token: i3.ContextRouteService }, { token: i3.ModalService }, { token: i1.TranslateService }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2104
2103
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: AlarmsComponent, selector: "c8y-alarms", providers: [AlarmWithChildrenRealtimeService], viewQueries: [{ propertyName: "alarmIntervalRefreshComponent", first: true, predicate: AlarmsIntervalRefreshComponent, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"(activatedRoute.data | async)?.title\">\n <c8y-title>{{ TITLE | translate }}</c8y-title>\n</ng-container>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form min-width-fit\"\n>\n <c8y-alarms-filter\n [contextSourceId]=\"contextSourceId\"\n (onFilterApplied)=\"applyFormFilters($event)\"\n class=\"d-block fit-w\"\n ></c8y-alarms-filter>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item \n [placement]=\"'left'\"\n itemClass=\"navbar-form min-width-fit\"\n>\n <c8y-alarms-date-filter (dateFilterChange)=\"applyFormFilters($event)\"></c8y-alarms-date-filter>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"navbar-form\"\n>\n <c8y-alarms-type-filter\n [alarms]=\"alarms$ | async\"\n (onFilterChanged)=\"applyTypeFilters($event)\"\n class=\"d-block fit-w\"\n ></c8y-alarms-type-filter>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"0\"\n>\n <button\n class=\"btn btn-link\"\n [title]=\"'Clear all alarms' | translate\"\n type=\"button\"\n (click)=\"clearAll()\"\n data-cy=\"c8y-alarms-view--clear-all-button\"\n >\n <i c8yIcon=\"c8y-alert-idle\"></i>\n {{ 'Clear all`alarms`' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<!--Realtime button-->\n<ng-template #realtimeRefresh>\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"\n (isRealtimeActive | async)\n ? (NEW_REALTIME_ALARM_MESSAGE | translate)\n : (REFRESH_LABEL | translate)\n \"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"isLoading$ | async\"\n (click)=\"refresh()\"\n >\n <span\n class=\"tag tag--info m-r-8\"\n *ngIf=\"isRealtimeActive | async\"\n >\n {{ 'New alarms' | translate }}\n </span>\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading$ | async }\"\n ></i>\n </button>\n <button\n class=\"c8y-realtime btn btn-default btn-sm\"\n [attr.aria-label]=\"realtimeIconTitle\"\n [tooltip]=\"realtimeIconTitle\"\n placement=\"bottom\"\n type=\"button\"\n [container]=\"'body'\"\n (click)=\"toggleRealtimeState()\"\n >\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{\n active: isRealtimeToggleOn,\n inactive: !isRealtimeToggleOn\n }\"\n ></span>\n </button>\n </div>\n</ng-template>\n\n<c8y-help\n src=\"/docs/device-management-application/monitoring-and-controlling-devices/#working-with-alarms\"\n></c8y-help>\n\n<div class=\"card content-fullpage split-view--5-7 grid__row--1\">\n <c8y-alarms-list\n class=\"d-contents\"\n [isInitialLoading]=\"isLoading$ | async\"\n [alarms]=\"alarms$ | async\"\n [typeFilters]=\"typeFilters\"\n (onScrollingStateChange)=\"changeInterval(!$event)\"\n (onSelectedAlarm)=\"changeInterval(false)\"\n [splitView]=\"true\"\n [hasPermissions]=\"!isDisabled\"\n >\n <ng-container *ngIf=\"isIntervalRefresh; else realtimeRefresh\">\n <c8y-alarms-interval-refresh\n [alarmsListLoading$]=\"isLoading$\"\n [isIntervalToggleEnabled]=\"shouldShowIntervalToggle$ | async\"\n (onCountdownEnded)=\"refresh()\"\n [isDisabled]=\"isDisabled\"\n ></c8y-alarms-interval-refresh>\n </ng-container>\n </c8y-alarms-list>\n\n <router-outlet class=\"d-contents\"></router-outlet>\n</div>\n", dependencies: [{ kind: "directive", type: i3.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "component", type: i3.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "component", type: i3.HelpComponent, selector: "c8y-help", inputs: ["src", "isCollapsed", "priority", "icon"] }, { 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$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: AlarmsFilterComponent, selector: "c8y-alarms-filter", inputs: ["contextSourceId"], outputs: ["onFilterApplied"] }, { kind: "component", type: AlarmsIntervalRefreshComponent, selector: "c8y-alarms-interval-refresh", inputs: ["isDisabled", "alarmsListLoading$", "isIntervalToggleEnabled"], outputs: ["onCountdownEnded"] }, { kind: "component", type: AlarmsListComponent, selector: "c8y-alarms-list", inputs: ["alarms", "hasPermissions", "typeFilters", "loadMoreMode", "navigationOptions", "isInitialLoading", "splitView"], outputs: ["onSelectedAlarm", "onScrollingStateChange"] }, { kind: "component", type: AlarmsDateFilterComponent, selector: "c8y-alarms-date-filter", outputs: ["dateFilterChange"] }, { kind: "component", type: AlarmsTypeFilterComponent, selector: "c8y-alarms-type-filter", inputs: ["alarms"], outputs: ["onFilterChanged"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] }); }
|
|
@@ -2111,6 +2110,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
2111
2110
|
args: [AlarmsIntervalRefreshComponent]
|
|
2112
2111
|
}] } });
|
|
2113
2112
|
|
|
2113
|
+
function getViewContextRoutes(contexts) {
|
|
2114
|
+
return contexts.map(context => ({
|
|
2115
|
+
context,
|
|
2116
|
+
path: 'details',
|
|
2117
|
+
icon: 'bell',
|
|
2118
|
+
label: gettext('Details'),
|
|
2119
|
+
component: AlarmInfoComponent,
|
|
2120
|
+
tabsOutlet: 'alarms'
|
|
2121
|
+
}));
|
|
2122
|
+
}
|
|
2123
|
+
function getChildrenForViewContext(context) {
|
|
2124
|
+
return [
|
|
2125
|
+
{
|
|
2126
|
+
path: '',
|
|
2127
|
+
component: AlarmEmptyComponent
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
path: ':id',
|
|
2131
|
+
rootContext: context,
|
|
2132
|
+
component: ContextRouteComponent,
|
|
2133
|
+
canActivate: [ContextRouteGuard],
|
|
2134
|
+
data: { context, contextData: {} },
|
|
2135
|
+
resolve: {
|
|
2136
|
+
tabs: RouterTabsResolver
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
];
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2114
2142
|
const defaultAlarmsConfig = {
|
|
2115
2143
|
hybrid: true
|
|
2116
2144
|
};
|
|
@@ -2236,5 +2264,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
2236
2264
|
* Generated bundle index. Do not edit.
|
|
2237
2265
|
*/
|
|
2238
2266
|
|
|
2239
|
-
export { ALARMS_MODULE_CONFIG, ALARMS_PATH, ALARM_DEFAULT_PROPERTIES, ALARM_SEVERITY_ICON, ALARM_SEVERITY_ICON_MAP, ALARM_STATUS_ICON, AlarmDetailsButtonPipe, AlarmDetailsButtonService, AlarmDetailsComponent, AlarmDetailsService, AlarmEmptyComponent, AlarmIconMap, AlarmInfoComponent, AlarmListIndicatorPipe, AlarmListIndicatorService, AlarmSeveritiesToTitlePipe, AlarmSeverityToIconPipe, AlarmSeverityToLabelPipe, AlarmStatusToIconPipe, AlarmStatusToLabelPipe, AlarmsComponent, AlarmsFilterComponent, AlarmsIconComponent, AlarmsIntervalRefreshComponent, AlarmsListComponent, AlarmsModule, AlarmsViewService, AuditChangesMessagePipe, DEFAULT_ALARM_COUNTS, DEFAULT_SEVERITY_VALUES, DEFAULT_STATUS_VALUES, HELP_ICON, INTERVALS_EXTENDED, INTERVAL_TITLES_EXTENDED, Ng1SmartRulesUpgradeService, SmartRulesUpgradeServiceFactory, THROTTLE_REALTIME_REFRESH, smartRulesUpgradeServiceProvider };
|
|
2267
|
+
export { ALARMS_MODULE_CONFIG, ALARMS_PATH, ALARM_DEFAULT_PROPERTIES, ALARM_SEVERITY_ICON, ALARM_SEVERITY_ICON_MAP, ALARM_STATUS_ICON, AlarmDetailsButtonPipe, AlarmDetailsButtonService, AlarmDetailsComponent, AlarmDetailsService, AlarmEmptyComponent, AlarmIconMap, AlarmInfoComponent, AlarmListIndicatorPipe, AlarmListIndicatorService, AlarmSeveritiesToTitlePipe, AlarmSeverityToIconPipe, AlarmSeverityToLabelPipe, AlarmStatusToIconPipe, AlarmStatusToLabelPipe, AlarmsComponent, AlarmsFilterComponent, AlarmsIconComponent, AlarmsIntervalRefreshComponent, AlarmsListComponent, AlarmsModule, AlarmsViewService, AuditChangesMessagePipe, DEFAULT_ALARM_COUNTS, DEFAULT_SEVERITY_VALUES, DEFAULT_STATUS_VALUES, HELP_ICON, INTERVALS_EXTENDED, INTERVAL_TITLES_EXTENDED, Ng1SmartRulesUpgradeService, SmartRulesUpgradeServiceFactory, THROTTLE_REALTIME_REFRESH, getChildrenForViewContext, getViewContextRoutes, smartRulesUpgradeServiceProvider };
|
|
2240
2268
|
//# sourceMappingURL=c8y-ngx-components-alarms.mjs.map
|