@c8y/ngx-components 1022.21.3 → 1022.27.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/asset-properties/asset-properties.model.d.ts +117 -0
- package/asset-properties/asset-properties.model.d.ts.map +1 -0
- package/asset-properties/asset-properties.service.d.ts +72 -0
- package/asset-properties/asset-properties.service.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-action.directive.d.ts +11 -0
- package/asset-properties/asset-property-list/asset-property-action.directive.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-icon.pipe.d.ts +11 -0
- package/asset-properties/asset-property-list/asset-property-icon.pipe.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-list.component.d.ts +195 -0
- package/asset-properties/asset-property-list/asset-property-list.component.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-value.pipe.d.ts +17 -0
- package/asset-properties/asset-property-list/asset-property-value.pipe.d.ts.map +1 -0
- package/asset-properties/asset-property-list/tree-data-source.d.ts +19 -0
- package/asset-properties/asset-property-list/tree-data-source.d.ts.map +1 -0
- package/asset-properties/asset-property-selector-drawer/asset-property-selector-drawer.component.d.ts +75 -0
- package/asset-properties/asset-property-selector-drawer/asset-property-selector-drawer.component.d.ts.map +1 -0
- package/asset-properties/c8y-ngx-components-asset-properties.d.ts.map +1 -0
- package/asset-properties/index.d.ts +6 -0
- package/asset-properties/index.d.ts.map +1 -0
- package/core/search/inventory-search.service.d.ts +4 -3
- package/core/search/inventory-search.service.d.ts.map +1 -1
- package/core/search/search-input.component.d.ts +5 -2
- package/core/search/search-input.component.d.ts.map +1 -1
- package/core/search/search.model.d.ts +4 -0
- package/core/search/search.model.d.ts.map +1 -1
- package/core/search/search.service.d.ts +2 -1
- package/core/search/search.service.d.ts.map +1 -1
- package/core/select/typeahead.component.d.ts +2 -1
- package/core/select/typeahead.component.d.ts.map +1 -1
- package/core/user/user-edit-modal.component.d.ts.map +1 -1
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts +2 -0
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts.map +1 -1
- package/device-grid/device-grid.component.d.ts.map +1 -1
- package/device-grid/device-grid.service.d.ts +4 -3
- package/device-grid/device-grid.service.d.ts.map +1 -1
- package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts +8 -2
- package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts.map +1 -1
- package/echart/charts.component.d.ts +1 -1
- package/echart/charts.component.d.ts.map +1 -1
- package/echart/index.d.ts +1 -0
- package/echart/index.d.ts.map +1 -1
- package/echart/models/datapoints-graph-widget.model.d.ts +13 -0
- package/echart/models/datapoints-graph-widget.model.d.ts.map +1 -1
- package/echart/services/chart-helpers.service.d.ts +23 -0
- package/echart/services/chart-helpers.service.d.ts.map +1 -0
- package/echart/services/echarts-options.service.d.ts +1 -1
- package/echart/services/echarts-options.service.d.ts.map +1 -1
- package/ecosystem/application-plugins/application-plugins.component.d.ts +3 -0
- package/ecosystem/application-plugins/application-plugins.component.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +1573 -0
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-assets-navigator.mjs +2 -2
- package/fesm2022/c8y-ngx-components-assets-navigator.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +22 -7
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-grid.mjs +21 -13
- package/fesm2022/c8y-ngx-components-device-grid.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-device-profile.mjs +1 -1
- package/fesm2022/c8y-ngx-components-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs +32 -18
- package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs +14 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +109 -98
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs +41 -21
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-configuration.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs +2 -2
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs +3 -3
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +2 -2
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-shared.mjs +2 -2
- package/fesm2022/c8y-ngx-components-repository-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-search.mjs +328 -210
- package/fesm2022/c8y-ngx-components-search.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-sub-assets.mjs +36 -16
- package/fesm2022/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +6 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +12 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +51 -10
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +7390 -7345
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +43 -24
- package/locales/es.po +43 -24
- package/locales/fr.po +43 -24
- package/locales/ja_JP.po +41 -24
- package/locales/ko.po +42 -24
- package/locales/locales.pot +67 -12
- package/locales/nl.po +43 -24
- package/locales/pl.po +43 -24
- package/locales/pt_BR.po +43 -24
- package/locales/zh_CN.po +43 -24
- package/locales/zh_TW.po +43 -24
- package/package.json +1 -1
- package/search/columns/asset-type-search-grid-column.d.ts.map +1 -1
- package/search/search-action.component.d.ts +12 -8
- package/search/search-action.component.d.ts.map +1 -1
- package/search/search-custom-filters.component.d.ts +18 -4
- package/search/search-custom-filters.component.d.ts.map +1 -1
- package/search/search-grid.component.d.ts +14 -14
- package/search/search-grid.component.d.ts.map +1 -1
- package/search/search-results.component.d.ts +3 -1
- package/search/search-results.component.d.ts.map +1 -1
- package/search/search.module.d.ts.map +1 -1
- package/search/search.service.d.ts +14 -6
- package/search/search.service.d.ts.map +1 -1
- package/sub-assets/sub-assets.service.d.ts +9 -5
- package/sub-assets/sub-assets.service.d.ts.map +1 -1
- package/widgets/definitions/html-widget/html-widget-config.factory.d.ts.map +1 -1
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts +2 -0
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts.map +1 -1
- package/widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.d.ts +17 -0
- package/widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.d.ts.map +1 -0
- package/widgets/implementations/html-widget/html-widget.model.d.ts +2 -2
- package/widgets/implementations/html-widget/html-widget.model.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +1 -0
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/echart/services/custom-measurements.service.d.ts +0 -12
- package/echart/services/custom-measurements.service.d.ts.map +0 -1
|
@@ -1,68 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Input, Component, EventEmitter, inject, ViewChild, Output } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import * as i1 from '@c8y/
|
|
6
|
-
import { MeasurementService, AlarmStatus, aggregationType } from '@c8y/client';
|
|
7
|
-
import { fromFetch } from 'rxjs/fetch';
|
|
8
|
-
import * as i2 from '@c8y/ngx-components/api';
|
|
9
|
-
import { cloneDeep } from 'lodash-es';
|
|
10
|
-
import * as i1$1 from '@c8y/ngx-components';
|
|
3
|
+
import { from, merge, interval, BehaviorSubject, of, lastValueFrom, defer, forkJoin } from 'rxjs';
|
|
4
|
+
import { mergeMap, map, tap, throttleTime, buffer, switchMap } from 'rxjs/operators';
|
|
5
|
+
import * as i1 from '@c8y/ngx-components';
|
|
11
6
|
import { gettext, CommonModule, WidgetTimeContextDateRangeService, DismissAlertStrategy, DynamicComponentAlert, CoreModule, MeasurementRealtimeService, AlarmRealtimeService, EventRealtimeService } from '@c8y/ngx-components';
|
|
7
|
+
import * as i1$1 from '@c8y/client';
|
|
8
|
+
import { AlarmStatus, MeasurementService, aggregationType } from '@c8y/client';
|
|
12
9
|
import * as i6 from '@angular/router';
|
|
13
10
|
import * as i4 from '@c8y/ngx-components/alarms';
|
|
14
11
|
import { AlarmsModule, AlarmSeverityToIconPipe, AlarmSeverityToLabelPipe } from '@c8y/ngx-components/alarms';
|
|
15
12
|
import { INTERVALS } from '@c8y/ngx-components/interval-picker';
|
|
16
13
|
import * as i5 from '@ngx-translate/core';
|
|
17
|
-
import * as i2
|
|
14
|
+
import * as i2 from '@angular/common';
|
|
18
15
|
import { CommonModule as CommonModule$1 } from '@angular/common';
|
|
19
16
|
import * as i3 from 'ngx-echarts';
|
|
20
17
|
import { NgxEchartsModule, NGX_ECHARTS_CONFIG } from 'ngx-echarts';
|
|
21
18
|
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
22
19
|
import { PopoverModule } from 'ngx-bootstrap/popover';
|
|
23
20
|
|
|
24
|
-
class CustomMeasurementService extends MeasurementService {
|
|
25
|
-
constructor(client, realtime, apiService) {
|
|
26
|
-
super(client, realtime);
|
|
27
|
-
this.apiService = apiService;
|
|
28
|
-
}
|
|
29
|
-
listSeries$(params) {
|
|
30
|
-
const url = `/${this.baseUrl}/${this.listUrl}/series`;
|
|
31
|
-
const fetchOptions = {
|
|
32
|
-
params: {
|
|
33
|
-
revert: true,
|
|
34
|
-
...params
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const options = this.client.getFetchOptions(fetchOptions);
|
|
38
|
-
const fullUrl = this.client.getUrl(url, fetchOptions);
|
|
39
|
-
const callOnStart = {
|
|
40
|
-
options,
|
|
41
|
-
method: 'GET',
|
|
42
|
-
url
|
|
43
|
-
};
|
|
44
|
-
const callOnFinish = {
|
|
45
|
-
...cloneDeep(callOnStart),
|
|
46
|
-
response: { status: null }
|
|
47
|
-
};
|
|
48
|
-
return defer(() => {
|
|
49
|
-
this.apiService.onStart(callOnStart);
|
|
50
|
-
return fromFetch(fullUrl, options);
|
|
51
|
-
}).pipe(switchMap(async (res) => {
|
|
52
|
-
callOnFinish.response = res;
|
|
53
|
-
const data = await res.json();
|
|
54
|
-
return { res: res, data };
|
|
55
|
-
}), finalize(() => {
|
|
56
|
-
this.apiService.onFinish(callOnFinish);
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomMeasurementService, deps: [{ token: i1.FetchClient }, { token: i1.Realtime }, { token: i2.ApiService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
60
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomMeasurementService }); }
|
|
61
|
-
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomMeasurementService, decorators: [{
|
|
63
|
-
type: Injectable
|
|
64
|
-
}], ctorParameters: () => [{ type: i1.FetchClient }, { type: i1.Realtime }, { type: i2.ApiService }] });
|
|
65
|
-
|
|
66
21
|
class YAxisService {
|
|
67
22
|
constructor(appStateService) {
|
|
68
23
|
this.appStateService = appStateService;
|
|
@@ -236,12 +191,12 @@ class YAxisService {
|
|
|
236
191
|
return 'left';
|
|
237
192
|
}
|
|
238
193
|
}
|
|
239
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: YAxisService, deps: [{ token: i1
|
|
194
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: YAxisService, deps: [{ token: i1.AppStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
240
195
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: YAxisService }); }
|
|
241
196
|
}
|
|
242
197
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: YAxisService, decorators: [{
|
|
243
198
|
type: Injectable
|
|
244
|
-
}], ctorParameters: () => [{ type: i1
|
|
199
|
+
}], ctorParameters: () => [{ type: i1.AppStateService }] });
|
|
245
200
|
|
|
246
201
|
function assertUnreachable(_) {
|
|
247
202
|
throw new Error('Case unreachable.');
|
|
@@ -698,7 +653,7 @@ class EchartsOptionsService {
|
|
|
698
653
|
* @param allAlarms - All alarms.
|
|
699
654
|
* @returns The formatted string for the tooltip.
|
|
700
655
|
*/
|
|
701
|
-
getTooltipFormatterForAlarmAndEvents(tooltipParams, params, allEvents, allAlarms) {
|
|
656
|
+
getTooltipFormatterForAlarmAndEvents(tooltipParams, params, allEvents, allAlarms, displayOptions) {
|
|
702
657
|
if (!Array.isArray(tooltipParams)) {
|
|
703
658
|
return '';
|
|
704
659
|
}
|
|
@@ -707,7 +662,7 @@ class EchartsOptionsService {
|
|
|
707
662
|
const allSeries = this.echartsInstance?.getOption()['series'];
|
|
708
663
|
// filter out alarm and event series
|
|
709
664
|
const allDataPointSeries = allSeries.filter(series => series['typeOfSeries'] !== 'alarm' && series['typeOfSeries'] !== 'event');
|
|
710
|
-
this.processSeries(allDataPointSeries, XAxisValue, YAxisReadings);
|
|
665
|
+
this.processSeries(allDataPointSeries, XAxisValue, YAxisReadings, displayOptions);
|
|
711
666
|
// find event and alarm of the same type as the hovered markedLine or markedPoint
|
|
712
667
|
const event = allEvents.find(e => e.type === params.data.itemType);
|
|
713
668
|
const alarm = allAlarms.find(a => a.type === params.data.itemType);
|
|
@@ -896,17 +851,17 @@ class EchartsOptionsService {
|
|
|
896
851
|
* @param XAxisValue - The X Axis value.
|
|
897
852
|
* @param YAxisReadings - The Y Axis readings.
|
|
898
853
|
*/
|
|
899
|
-
processSeries(allDataPointSeries, XAxisValue, YAxisReadings) {
|
|
854
|
+
processSeries(allDataPointSeries, XAxisValue, YAxisReadings, displayOptions) {
|
|
900
855
|
allDataPointSeries.forEach((series) => {
|
|
901
856
|
if (series.datapointId === 'aggregated') {
|
|
902
857
|
return;
|
|
903
858
|
}
|
|
904
859
|
let value = '';
|
|
905
860
|
if (series.id.endsWith('/min')) {
|
|
906
|
-
value = this.processMinSeries(series, allDataPointSeries, XAxisValue);
|
|
861
|
+
value = this.processMinSeries(series, allDataPointSeries, XAxisValue, displayOptions);
|
|
907
862
|
}
|
|
908
863
|
else if (!series.id.endsWith('/max')) {
|
|
909
|
-
value = this.processRegularSeries(series, XAxisValue);
|
|
864
|
+
value = this.processRegularSeries(series, XAxisValue, displayOptions);
|
|
910
865
|
}
|
|
911
866
|
if (value) {
|
|
912
867
|
YAxisReadings.push(`<div class="d-flex a-i-center p-b-8 text-default"><span class='dlt-c8y-icon-circle m-r-4' style='color: ${series.itemStyle.color};'></span>` + // color circle
|
|
@@ -923,7 +878,7 @@ class EchartsOptionsService {
|
|
|
923
878
|
* @param XAxisValue - The X Axis value.
|
|
924
879
|
* @returns The processed value.
|
|
925
880
|
*/
|
|
926
|
-
processMinSeries(series, allDataPointSeries, XAxisValue) {
|
|
881
|
+
processMinSeries(series, allDataPointSeries, XAxisValue, displayOptions) {
|
|
927
882
|
const minValue = this.findValueForExactOrEarlierTimestamp(series.data, XAxisValue);
|
|
928
883
|
if (!minValue) {
|
|
929
884
|
return '';
|
|
@@ -931,7 +886,7 @@ class EchartsOptionsService {
|
|
|
931
886
|
const maxSeries = allDataPointSeries.find(s => s['id'] === series.id.replace('/min', '/max'));
|
|
932
887
|
const maxValue = this.findValueForExactOrEarlierTimestamp(maxSeries?.['data'], XAxisValue);
|
|
933
888
|
return (`<div class="d-flex a-i-center separator-top p-t-8 p-b-8 text-default"><label class="text-12 m-r-8 m-b-0">${this.datePipe.transform(minValue[0])}</label>` +
|
|
934
|
-
`<span class="m-l-auto text-12">${minValue[1]} — ${maxValue?.[1]}` +
|
|
889
|
+
`<span class="m-l-auto text-12">${minValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'} — ${maxValue?.[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
935
890
|
(series.datapointUnit ? ` ${series.datapointUnit}` : '') +
|
|
936
891
|
`</span></div>`);
|
|
937
892
|
}
|
|
@@ -941,14 +896,14 @@ class EchartsOptionsService {
|
|
|
941
896
|
* @param XAxisValue - The X Axis value.
|
|
942
897
|
* @returns The processed value.
|
|
943
898
|
*/
|
|
944
|
-
processRegularSeries(series, XAxisValue) {
|
|
899
|
+
processRegularSeries(series, XAxisValue, displayOptions) {
|
|
945
900
|
const seriesValue = this.findValueForExactOrEarlierTimestamp(series.data, XAxisValue);
|
|
946
901
|
if (!seriesValue) {
|
|
947
902
|
return '';
|
|
948
903
|
}
|
|
949
904
|
return (`<div class="d-flex a-i-center p-t-8 p-b-8 separator-top text-default">` +
|
|
950
905
|
`<label class="m-b-0 m-r-8 text-12">${this.datePipe.transform(seriesValue[0])}</label><span class="m-l-auto text-12">` +
|
|
951
|
-
seriesValue[1]?.
|
|
906
|
+
`${seriesValue[1]?.toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
952
907
|
(series.datapointUnit ? ` ${series.datapointUnit}` : '') +
|
|
953
908
|
`</span></div>`);
|
|
954
909
|
}
|
|
@@ -959,9 +914,9 @@ class EchartsOptionsService {
|
|
|
959
914
|
*/
|
|
960
915
|
processEvent(event, XAxisValue) {
|
|
961
916
|
let value = `<ul class="list-unstyled small separator-top text-default">`;
|
|
962
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8"
|
|
963
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8"
|
|
964
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8"
|
|
917
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8">${this.translate.instant(gettext('Event type'))}</label><code class="m-l-auto" style="display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-word; white-space: normal; max-width: 200px; -webkit-line-clamp: 2;" title="${event.type}">${event.type}</code></li>`;
|
|
918
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8">${this.translate.instant(gettext('Event text'))}</label><span class="m-l-auto" style="display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-word; white-space: normal; max-width: 200px; -webkit-line-clamp: 5;" title="${event.text}">${event.text}</span></li>`;
|
|
919
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8">${this.translate.instant(gettext('Event time'))}</label><span class="m-l-auto">${this.datePipe.transform(XAxisValue)}<span></li>`;
|
|
965
920
|
value += `</ul>`;
|
|
966
921
|
return value;
|
|
967
922
|
}
|
|
@@ -972,19 +927,19 @@ class EchartsOptionsService {
|
|
|
972
927
|
*/
|
|
973
928
|
async processAlarm(alarm) {
|
|
974
929
|
let value = `<ul class="list-unstyled small separator-top text-default m-0">`;
|
|
975
|
-
value += `<li class="p-t-4 p-b-4 d-flex a-i-center separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
930
|
+
value += `<li class="p-t-4 p-b-4 d-flex a-i-center separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Alarm severity'))}</label>`;
|
|
976
931
|
value += `<span class="small d-inline-flex a-i-center gap-4 m-l-auto"><i class="stroked-icon icon-14 status dlt-c8y-icon-${this.severityIconPipe.transform(alarm.severity)} ${alarm.severity.toLowerCase()}" > </i> ${this.severityLabelPipe.transform(alarm.severity)} </span></li>`;
|
|
977
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
978
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
979
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
932
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Alarm type'))}</label><span class="small m-l-auto"><code>${alarm.type}</code></span></li>`;
|
|
933
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Message'))}</label><span class="small m-l-auto" style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; text-overflow: ellipsis; word-break: break-word; white-space: normal; max-width: 200px;" title="${this.translate.instant(alarm.text)}">${this.translate.instant(alarm.text)}</span></li>`;
|
|
934
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Last updated'))}</label><span class="small m-l-auto">${this.datePipe.transform(alarm['lastUpdated'])}</span></li>`;
|
|
980
935
|
const exists = await this.alarmRouteExists();
|
|
981
936
|
if (exists) {
|
|
982
937
|
const currentUrl = window.location.href;
|
|
983
938
|
const baseUrlIndex = currentUrl.indexOf(INDEX_HTML);
|
|
984
939
|
const baseUrl = currentUrl.substring(0, baseUrlIndex + INDEX_HTML.length);
|
|
985
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
940
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Open details'))}</label><span class="small m-l-auto"><a href="${baseUrl}#/alarms/${alarm.id}/details?showCleared=true">${this.translate.instant(gettext('Alarm details'))}</a></span></li>`;
|
|
986
941
|
}
|
|
987
|
-
value += `<li class="p-t-4 p-b-4 d-flex text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
942
|
+
value += `<li class="p-t-4 p-b-4 d-flex text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Alarm count'))}</label><span class="small m-l-auto"><span class="badge badge-info">${alarm.count}</span></span></li>`;
|
|
988
943
|
value += `</ul>`;
|
|
989
944
|
return value;
|
|
990
945
|
}
|
|
@@ -1307,7 +1262,7 @@ class EchartsOptionsService {
|
|
|
1307
1262
|
getTooltipFormatter(displayOptions) {
|
|
1308
1263
|
return params => {
|
|
1309
1264
|
if (!Array.isArray(params) || !params[0]?.data) {
|
|
1310
|
-
return
|
|
1265
|
+
return null;
|
|
1311
1266
|
}
|
|
1312
1267
|
const data = params[0].data;
|
|
1313
1268
|
const XAxisValue = data[0];
|
|
@@ -1335,7 +1290,7 @@ class EchartsOptionsService {
|
|
|
1335
1290
|
value =
|
|
1336
1291
|
`<div class="d-flex a-i-center separator-top text-default p-t-8 p-b-8">` +
|
|
1337
1292
|
`<label class="text-12 m-r-8 m-b-0">${this.datePipe.transform(minValue[0])}</label>` +
|
|
1338
|
-
`<div class="m-l-auto text-12" >${minValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2)} — ${maxValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2)}` +
|
|
1293
|
+
`<div class="m-l-auto text-12" >${minValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'} — ${maxValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
1339
1294
|
(series['datapointUnit'] ? ` ${series['datapointUnit']}` : '') +
|
|
1340
1295
|
`</div></div>`;
|
|
1341
1296
|
}
|
|
@@ -1351,7 +1306,7 @@ class EchartsOptionsService {
|
|
|
1351
1306
|
value =
|
|
1352
1307
|
`<div class="d-flex a-i-center separator-top text-default p-t-8 p-b-8">` +
|
|
1353
1308
|
`<label class="text-12 m-r-8 m-b-0">${this.datePipe.transform(seriesValue[0])}</label>` +
|
|
1354
|
-
`<div class="m-l-auto text-12" >${seriesValue[1]?.toFixed(displayOptions.numberOfDecimalPlaces ?? 2)}` +
|
|
1309
|
+
`<div class="m-l-auto text-12" >${seriesValue[1]?.toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
1355
1310
|
(series['datapointUnit'] ? ` ${series['datapointUnit']}` : '') +
|
|
1356
1311
|
`</div></div>`;
|
|
1357
1312
|
}
|
|
@@ -1377,12 +1332,12 @@ class EchartsOptionsService {
|
|
|
1377
1332
|
return acc;
|
|
1378
1333
|
}, null);
|
|
1379
1334
|
}
|
|
1380
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EchartsOptionsService, deps: [{ token: i1
|
|
1335
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EchartsOptionsService, deps: [{ token: i1.DatePipe }, { token: YAxisService }, { token: ChartTypesService }, { token: i4.AlarmSeverityToIconPipe }, { token: i4.AlarmSeverityToLabelPipe }, { token: i5.TranslateService }, { token: i6.Router }, { token: i1.AppStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1381
1336
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EchartsOptionsService }); }
|
|
1382
1337
|
}
|
|
1383
1338
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EchartsOptionsService, decorators: [{
|
|
1384
1339
|
type: Injectable
|
|
1385
|
-
}], ctorParameters: () => [{ type: i1
|
|
1340
|
+
}], ctorParameters: () => [{ type: i1.DatePipe }, { type: YAxisService }, { type: ChartTypesService }, { type: i4.AlarmSeverityToIconPipe }, { type: i4.AlarmSeverityToLabelPipe }, { type: i5.TranslateService }, { type: i6.Router }, { type: i1.AppStateService }] });
|
|
1386
1341
|
|
|
1387
1342
|
class ChartRealtimeService {
|
|
1388
1343
|
constructor(measurementRealtime, alarmRealtimeService, eventRealtimeService, echartsOptionsService) {
|
|
@@ -1632,20 +1587,20 @@ class ChartRealtimeService {
|
|
|
1632
1587
|
datapointOutOfSyncCallback(datapoint);
|
|
1633
1588
|
}
|
|
1634
1589
|
}
|
|
1635
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartRealtimeService, deps: [{ token: i1
|
|
1590
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartRealtimeService, deps: [{ token: i1.MeasurementRealtimeService }, { token: i1.AlarmRealtimeService }, { token: i1.EventRealtimeService }, { token: EchartsOptionsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1636
1591
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartRealtimeService }); }
|
|
1637
1592
|
}
|
|
1638
1593
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartRealtimeService, decorators: [{
|
|
1639
1594
|
type: Injectable
|
|
1640
|
-
}], ctorParameters: () => [{ type: i1
|
|
1595
|
+
}], ctorParameters: () => [{ type: i1.MeasurementRealtimeService }, { type: i1.AlarmRealtimeService }, { type: i1.EventRealtimeService }, { type: EchartsOptionsService }] });
|
|
1641
1596
|
|
|
1642
1597
|
class ChartAlertsComponent {
|
|
1643
1598
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlertsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1644
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ChartAlertsComponent, isStandalone: true, selector: "c8y-chart-alerts", inputs: { alerts: "alerts" }, ngImport: i0, template: "<div\n class=\"overlay-center-vertically d-
|
|
1599
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ChartAlertsComponent, isStandalone: true, selector: "c8y-chart-alerts", inputs: { alerts: "alerts" }, ngImport: i0, template: "<div\n class=\"overlay-center-vertically d-col p-16 p-r-24 p-l-24\"\n *ngIf=\"alerts?.anyAlertExists$ | async\"\n>\n <ng-container *ngFor=\"let alertGroup of alerts?.alertGroups\">\n <div\n class=\"alert\"\n role=\"alert\"\n *ngIf=\"alertGroup.value.alerts.length\"\n [ngClass]=\"'alert-' + alertGroup.type\"\n >\n <button\n class=\"close\"\n type=\"button\"\n (click)=\"alerts.dismissAlertGroup(alertGroup.type, dismissPermanently.checked)\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n <span class=\"sr-only\">{{ 'Close' | translate }}</span>\n </button>\n <p *ngFor=\"let alertItem of alertGroup.value.alerts\">\n {{ alertItem.text | translate }}\n </p>\n <label\n class=\"c8y-checkbox m-t-16\"\n title=\"{{ 'Don\\'t show again' | translate }}\"\n >\n <input\n type=\"checkbox\"\n #dismissPermanently\n />\n <span></span>\n <span>{{ \"Don't show again\" | translate }}</span>\n </label>\n </div>\n </ng-container>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] }); }
|
|
1645
1600
|
}
|
|
1646
1601
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlertsComponent, decorators: [{
|
|
1647
1602
|
type: Component,
|
|
1648
|
-
args: [{ selector: 'c8y-chart-alerts', standalone: true, imports: [CommonModule], template: "<div\n class=\"overlay-center-vertically d-
|
|
1603
|
+
args: [{ selector: 'c8y-chart-alerts', standalone: true, imports: [CommonModule], template: "<div\n class=\"overlay-center-vertically d-col p-16 p-r-24 p-l-24\"\n *ngIf=\"alerts?.anyAlertExists$ | async\"\n>\n <ng-container *ngFor=\"let alertGroup of alerts?.alertGroups\">\n <div\n class=\"alert\"\n role=\"alert\"\n *ngIf=\"alertGroup.value.alerts.length\"\n [ngClass]=\"'alert-' + alertGroup.type\"\n >\n <button\n class=\"close\"\n type=\"button\"\n (click)=\"alerts.dismissAlertGroup(alertGroup.type, dismissPermanently.checked)\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n <span class=\"sr-only\">{{ 'Close' | translate }}</span>\n </button>\n <p *ngFor=\"let alertItem of alertGroup.value.alerts\">\n {{ alertItem.text | translate }}\n </p>\n <label\n class=\"c8y-checkbox m-t-16\"\n title=\"{{ 'Don\\'t show again' | translate }}\"\n >\n <input\n type=\"checkbox\"\n #dismissPermanently\n />\n <span></span>\n <span>{{ \"Don't show again\" | translate }}</span>\n </label>\n </div>\n </ng-container>\n</div>\n" }]
|
|
1649
1604
|
}], propDecorators: { alerts: [{
|
|
1650
1605
|
type: Input
|
|
1651
1606
|
}] } });
|
|
@@ -1683,12 +1638,12 @@ class ChartEventsService {
|
|
|
1683
1638
|
const result = await Promise.all(promises);
|
|
1684
1639
|
return result.flat();
|
|
1685
1640
|
}
|
|
1686
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartEventsService, deps: [{ token: i1.EventService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1641
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartEventsService, deps: [{ token: i1$1.EventService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1687
1642
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartEventsService }); }
|
|
1688
1643
|
}
|
|
1689
1644
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartEventsService, decorators: [{
|
|
1690
1645
|
type: Injectable
|
|
1691
|
-
}], ctorParameters: () => [{ type: i1.EventService }] });
|
|
1646
|
+
}], ctorParameters: () => [{ type: i1$1.EventService }] });
|
|
1692
1647
|
|
|
1693
1648
|
class ChartAlarmsService {
|
|
1694
1649
|
constructor(alarmService) {
|
|
@@ -1737,12 +1692,12 @@ class ChartAlarmsService {
|
|
|
1737
1692
|
const result = await Promise.all(promises);
|
|
1738
1693
|
return result.flat();
|
|
1739
1694
|
}
|
|
1740
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlarmsService, deps: [{ token: i1.AlarmService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1695
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlarmsService, deps: [{ token: i1$1.AlarmService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1741
1696
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlarmsService }); }
|
|
1742
1697
|
}
|
|
1743
1698
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlarmsService, decorators: [{
|
|
1744
1699
|
type: Injectable
|
|
1745
|
-
}], ctorParameters: () => [{ type: i1.AlarmService }] });
|
|
1700
|
+
}], ctorParameters: () => [{ type: i1$1.AlarmService }] });
|
|
1746
1701
|
|
|
1747
1702
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1748
1703
|
class ChartsComponent {
|
|
@@ -1757,7 +1712,7 @@ class ChartsComponent {
|
|
|
1757
1712
|
this.updateAlarmsAndEvents = new EventEmitter();
|
|
1758
1713
|
this.isMarkedAreaEnabled = new EventEmitter();
|
|
1759
1714
|
this.configChangedSubject = new BehaviorSubject(null);
|
|
1760
|
-
this.measurementService = inject(
|
|
1715
|
+
this.measurementService = inject(MeasurementService);
|
|
1761
1716
|
this.echartsOptionsService = inject(EchartsOptionsService);
|
|
1762
1717
|
this.chartRealtimeService = inject(ChartRealtimeService);
|
|
1763
1718
|
this.chartEventsService = inject(ChartEventsService);
|
|
@@ -1859,7 +1814,15 @@ class ChartsComponent {
|
|
|
1859
1814
|
return;
|
|
1860
1815
|
}
|
|
1861
1816
|
updatedOptions.tooltip.formatter = (tooltipParams) => {
|
|
1862
|
-
return this.echartsOptionsService.getTooltipFormatterForAlarmAndEvents(tooltipParams, params, this.events, this.alarms
|
|
1817
|
+
return this.echartsOptionsService.getTooltipFormatterForAlarmAndEvents(tooltipParams, params, this.events, this.alarms, {
|
|
1818
|
+
displayMarkedLine: this.config.displayMarkedLine || false,
|
|
1819
|
+
displayMarkedPoint: this.config.displayMarkedPoint || false,
|
|
1820
|
+
mergeMatchingDatapoints: this.config.mergeMatchingDatapoints || false,
|
|
1821
|
+
forceMergeDatapoints: this.config.forceMergeDatapoints || false,
|
|
1822
|
+
showLabelAndUnit: this.config.showLabelAndUnit || false,
|
|
1823
|
+
showSlider: this.config.showSlider || false,
|
|
1824
|
+
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? 2
|
|
1825
|
+
});
|
|
1863
1826
|
};
|
|
1864
1827
|
this.echartsInstance.setOption(updatedOptions);
|
|
1865
1828
|
});
|
|
@@ -1873,7 +1836,7 @@ class ChartsComponent {
|
|
|
1873
1836
|
}
|
|
1874
1837
|
onChartClick(params) {
|
|
1875
1838
|
const options = this.echartsInstance.getOption();
|
|
1876
|
-
if (!this.
|
|
1839
|
+
if (!this.isAlarmOrEventClick(params)) {
|
|
1877
1840
|
this.echartsInstance.setOption({
|
|
1878
1841
|
tooltip: { triggerOn: 'mousemove' },
|
|
1879
1842
|
series: [{ markArea: { data: [] }, markLine: { data: [] } }]
|
|
@@ -1881,6 +1844,17 @@ class ChartsComponent {
|
|
|
1881
1844
|
return;
|
|
1882
1845
|
}
|
|
1883
1846
|
const clickedAlarms = this.alarms.filter(alarm => alarm.type === params.data.itemType);
|
|
1847
|
+
const clickedEvents = this.events.filter(event => event.type === params.data.itemType);
|
|
1848
|
+
if (clickedEvents.length > 0) {
|
|
1849
|
+
const updatedOptions = {
|
|
1850
|
+
tooltip: {
|
|
1851
|
+
enterable: true,
|
|
1852
|
+
triggerOn: 'click'
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
this.echartsInstance.setOption(updatedOptions);
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1884
1858
|
this.isMarkedAreaEnabled.emit(this.hasMarkArea(options));
|
|
1885
1859
|
const updatedOptions = !this.hasMarkArea(options)
|
|
1886
1860
|
? {
|
|
@@ -1903,8 +1877,9 @@ class ChartsComponent {
|
|
|
1903
1877
|
};
|
|
1904
1878
|
this.echartsInstance.setOption(updatedOptions);
|
|
1905
1879
|
}
|
|
1906
|
-
|
|
1907
|
-
return this.alarms.some(alarm => alarm.type === params.data.itemType)
|
|
1880
|
+
isAlarmOrEventClick(params) {
|
|
1881
|
+
return (this.alarms.some(alarm => alarm.type === params.data.itemType) ||
|
|
1882
|
+
this.events.some(event => event.type === params.data.itemType));
|
|
1908
1883
|
}
|
|
1909
1884
|
hasMarkArea(options) {
|
|
1910
1885
|
return options?.series?.[0]?.markArea?.data?.length > 0;
|
|
@@ -2173,8 +2148,8 @@ class ChartsComponent {
|
|
|
2173
2148
|
const datapointsWithValuesRequests = [];
|
|
2174
2149
|
const timeRange = this.getTimeRange(60_000);
|
|
2175
2150
|
for (const dp of activeDatapoints) {
|
|
2176
|
-
const request = this.measurementService
|
|
2177
|
-
|
|
2151
|
+
const request = defer(() => this.measurementService.listSeries({
|
|
2152
|
+
revert: true,
|
|
2178
2153
|
...(customTimeRange ? customTimeRange : timeRange),
|
|
2179
2154
|
source: dp.__target?.id || '',
|
|
2180
2155
|
series: [`${dp.fragment}.${dp.series}`],
|
|
@@ -2183,14 +2158,13 @@ class ChartsComponent {
|
|
|
2183
2158
|
aggregationType: customTimeRange ? aggregationType.HOURLY : this.config.aggregation
|
|
2184
2159
|
}
|
|
2185
2160
|
: {})
|
|
2186
|
-
})
|
|
2187
|
-
.pipe(map(res => {
|
|
2161
|
+
})).pipe(map(res => {
|
|
2188
2162
|
const values = res.data.values;
|
|
2189
2163
|
if (res.data.truncated && this.config.dateFrom) {
|
|
2190
2164
|
values[new Date(this.config.dateFrom).toISOString()] = [{ min: null, max: null }];
|
|
2191
2165
|
}
|
|
2192
2166
|
else {
|
|
2193
|
-
if (this.alerts) {
|
|
2167
|
+
if (this.alerts && !customTimeRange) {
|
|
2194
2168
|
this.alerts.clear();
|
|
2195
2169
|
}
|
|
2196
2170
|
}
|
|
@@ -2251,11 +2225,10 @@ class ChartsComponent {
|
|
|
2251
2225
|
EventRealtimeService,
|
|
2252
2226
|
ChartTypesService,
|
|
2253
2227
|
EchartsOptionsService,
|
|
2254
|
-
CustomMeasurementService,
|
|
2255
2228
|
YAxisService,
|
|
2256
2229
|
AlarmSeverityToIconPipe,
|
|
2257
2230
|
AlarmSeverityToLabelPipe
|
|
2258
|
-
], viewQueries: [{ propertyName: "chart", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"p-relative fit-h chart-container\"\n>\n <div\n class=\"fit-w fit-h\"\n #chart\n echarts\n [options]=\"chartOption$ | async\"\n (chartInit)=\"onChartInit($event)\"\n ></div>\n\n <c8y-chart-alerts [alerts]=\"alerts\"></c8y-chart-alerts>\n\n <div *ngIf=\"showLoadMore\" class=\"chart-load-more\">\n <button\n class=\"btn btn-primary btn-sm btn-block\"\n (click)=\"loadMoreData()\"\n >\n <i c8yIcon=\"restore\"></i>\n {{ 'Load more' | translate }}\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2
|
|
2231
|
+
], viewQueries: [{ propertyName: "chart", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"p-relative fit-h chart-container\"\n>\n <div\n class=\"fit-w fit-h\"\n #chart\n echarts\n [options]=\"chartOption$ | async\"\n (chartInit)=\"onChartInit($event)\"\n ></div>\n\n <c8y-chart-alerts [alerts]=\"alerts\"></c8y-chart-alerts>\n\n <div *ngIf=\"showLoadMore\" class=\"chart-load-more\">\n <button\n class=\"btn btn-primary btn-sm btn-block\"\n (click)=\"loadMoreData()\"\n >\n <i c8yIcon=\"restore\"></i>\n {{ 'Load more' | translate }}\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "ngmodule", type: NgxEchartsModule }, { kind: "directive", type: i3.NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: ChartAlertsComponent, selector: "c8y-chart-alerts", inputs: ["alerts"] }, { kind: "ngmodule", type: AlarmsModule }] }); }
|
|
2259
2232
|
}
|
|
2260
2233
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartsComponent, decorators: [{
|
|
2261
2234
|
type: Component,
|
|
@@ -2267,7 +2240,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2267
2240
|
EventRealtimeService,
|
|
2268
2241
|
ChartTypesService,
|
|
2269
2242
|
EchartsOptionsService,
|
|
2270
|
-
CustomMeasurementService,
|
|
2271
2243
|
YAxisService,
|
|
2272
2244
|
AlarmSeverityToIconPipe,
|
|
2273
2245
|
AlarmSeverityToLabelPipe
|
|
@@ -2299,6 +2271,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2299
2271
|
args: ['chart']
|
|
2300
2272
|
}] } });
|
|
2301
2273
|
|
|
2274
|
+
class ChartHelpersService {
|
|
2275
|
+
/**
|
|
2276
|
+
* Cleans the widget configuration which will be sent to Gainsight by removing unnecessary properties.
|
|
2277
|
+
* @param config The widget configuration to clean.
|
|
2278
|
+
* @returns The cleaned widget configuration.
|
|
2279
|
+
*/
|
|
2280
|
+
getConfigSummaryForGainsight(config) {
|
|
2281
|
+
return {
|
|
2282
|
+
datapointCount: config.datapoints?.length ?? 0,
|
|
2283
|
+
alarmsEventsCount: config.alarmsEventsConfigs?.length ?? 0,
|
|
2284
|
+
interval: config.interval,
|
|
2285
|
+
forceMergeDatapoints: config.forceMergeDatapoints,
|
|
2286
|
+
mergeMatchingDatapoints: config.mergeMatchingDatapoints,
|
|
2287
|
+
showSlider: config.showSlider,
|
|
2288
|
+
widgetInstanceGlobalTimeContext: config.widgetInstanceGlobalTimeContext,
|
|
2289
|
+
dateFrom: config.dateFrom,
|
|
2290
|
+
dateTo: config.dateTo
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartHelpersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2294
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartHelpersService }); }
|
|
2295
|
+
}
|
|
2296
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartHelpersService, decorators: [{
|
|
2297
|
+
type: Injectable
|
|
2298
|
+
}] });
|
|
2299
|
+
|
|
2302
2300
|
var DATE_SELECTION_EXTENDED;
|
|
2303
2301
|
(function (DATE_SELECTION_EXTENDED) {
|
|
2304
2302
|
DATE_SELECTION_EXTENDED["CONFIG"] = "config";
|
|
@@ -2308,6 +2306,19 @@ const REALTIME_TEXTS = {
|
|
|
2308
2306
|
ACTIVE: gettext('Realtime active'),
|
|
2309
2307
|
INACTIVE: gettext('Realtime inactive')
|
|
2310
2308
|
};
|
|
2309
|
+
const PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH = {
|
|
2310
|
+
EVENTS: {
|
|
2311
|
+
DATA_EXPLORER_AND_GRAPH: 'data-explorer-and-graph'
|
|
2312
|
+
},
|
|
2313
|
+
COMPONENTS: {
|
|
2314
|
+
DATA_EXPLORER_DETAILS: 'data-explorer-details'
|
|
2315
|
+
},
|
|
2316
|
+
ACTIONS: {
|
|
2317
|
+
DATA_EXPLORER_CONFIG_INIT: 'data-explorer-config-init',
|
|
2318
|
+
DATA_EXPLORER_CONFIG_CHANGE: 'data-explorer-config-change',
|
|
2319
|
+
DATA_GRAPH_WIDGET_CONFIG: 'data-graph-widget-config'
|
|
2320
|
+
}
|
|
2321
|
+
};
|
|
2311
2322
|
const SEVERITY_LABELS = {
|
|
2312
2323
|
CRITICAL: gettext('Critical`alarm`'),
|
|
2313
2324
|
MAJOR: gettext('Major`alarm`'),
|
|
@@ -2319,5 +2330,5 @@ const SEVERITY_LABELS = {
|
|
|
2319
2330
|
* Generated bundle index. Do not edit.
|
|
2320
2331
|
*/
|
|
2321
2332
|
|
|
2322
|
-
export { ChartAlarmsService, ChartEventsService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, REALTIME_TEXTS, SEVERITY_LABELS };
|
|
2333
|
+
export { ChartAlarmsService, ChartEventsService, ChartHelpersService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH, REALTIME_TEXTS, SEVERITY_LABELS };
|
|
2323
2334
|
//# sourceMappingURL=c8y-ngx-components-echart.mjs.map
|