@c8y/ngx-components 1023.0.0 → 1023.0.2
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/fesm2022/c8y-ngx-components-echart.mjs +15 -17
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/locales/de.po +34 -37
- package/locales/es.po +27 -27
- package/locales/fr.po +21 -24
- package/locales/ja_JP.po +20 -20
- package/locales/ko.po +25 -25
- package/locales/nl.po +22 -22
- package/locales/pl.po +37 -40
- package/locales/pt_BR.po +24 -24
- package/locales/zh_CN.po +22 -22
- package/locales/zh_TW.po +32 -32
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable,
|
|
2
|
+
import { Injectable, Input, Component, EventEmitter, inject, Output, ViewChild } from '@angular/core';
|
|
3
3
|
import { gettext } from '@c8y/ngx-components/gettext';
|
|
4
4
|
import { from, merge, interval, BehaviorSubject, of, lastValueFrom, defer, forkJoin } from 'rxjs';
|
|
5
5
|
import { mergeMap, map, tap, throttleTime, buffer, switchMap } from 'rxjs/operators';
|
|
@@ -13,7 +13,6 @@ import * as i4 from '@c8y/ngx-components/alarms';
|
|
|
13
13
|
import { AlarmsModule, AlarmSeverityToIconPipe, AlarmSeverityToLabelPipe } from '@c8y/ngx-components/alarms';
|
|
14
14
|
import { INTERVALS } from '@c8y/ngx-components/interval-picker';
|
|
15
15
|
import * as i5 from '@ngx-translate/core';
|
|
16
|
-
import * as i7 from '@angular/platform-browser';
|
|
17
16
|
import * as i1$1 from '@angular/common';
|
|
18
17
|
import { NgIf, NgForOf, CommonModule as CommonModule$1 } from '@angular/common';
|
|
19
18
|
import * as i3$1 from 'ngx-echarts';
|
|
@@ -367,7 +366,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
367
366
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
368
367
|
const INDEX_HTML = '/index.html';
|
|
369
368
|
class EchartsOptionsService {
|
|
370
|
-
constructor(datePipe, yAxisService, chartTypesService, severityIconPipe, severityLabelPipe, translate, router
|
|
369
|
+
constructor(datePipe, yAxisService, chartTypesService, severityIconPipe, severityLabelPipe, translate, router) {
|
|
371
370
|
this.datePipe = datePipe;
|
|
372
371
|
this.yAxisService = yAxisService;
|
|
373
372
|
this.chartTypesService = chartTypesService;
|
|
@@ -375,7 +374,6 @@ class EchartsOptionsService {
|
|
|
375
374
|
this.severityLabelPipe = severityLabelPipe;
|
|
376
375
|
this.translate = translate;
|
|
377
376
|
this.router = router;
|
|
378
|
-
this.sanitizer = sanitizer;
|
|
379
377
|
this.TOOLTIP_WIDTH = 300;
|
|
380
378
|
}
|
|
381
379
|
getChartOptions(datapointsWithValues, timeRange, showSplitLines, events, alarms, displayOptions, selectedTimeRange, aggregatedDatapoint, sliderZoomUsed = false) {
|
|
@@ -985,11 +983,11 @@ class EchartsOptionsService {
|
|
|
985
983
|
*/
|
|
986
984
|
processEvent(event, XAxisValue) {
|
|
987
985
|
let value = `<ul class="list-unstyled small separator-top text-default">`;
|
|
988
|
-
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="${echarts.format.encodeHTML(event.type)}">${echarts.format.encodeHTML(event.type)}</code></li>`;
|
|
989
|
-
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="${echarts.format.encodeHTML(event.text)}">${echarts.format.encodeHTML(event.text)}</span></li>`;
|
|
990
|
-
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">${echarts.format.encodeHTML(this.datePipe.transform(XAxisValue))}<span></li>`;
|
|
986
|
+
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">${echarts.format.encodeHTML(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="${echarts.format.encodeHTML(event.type)}">${echarts.format.encodeHTML(event.type)}</code></li>`;
|
|
987
|
+
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">${echarts.format.encodeHTML(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="${echarts.format.encodeHTML(event.text)}">${echarts.format.encodeHTML(event.text)}</span></li>`;
|
|
988
|
+
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">${echarts.format.encodeHTML(this.translate.instant(gettext('Event time')))}</label><span class="m-l-auto">${echarts.format.encodeHTML(this.datePipe.transform(XAxisValue))}<span></li>`;
|
|
991
989
|
value += `</ul>`;
|
|
992
|
-
return
|
|
990
|
+
return value;
|
|
993
991
|
}
|
|
994
992
|
/**
|
|
995
993
|
* This method is used to process the alarm tooltip.
|
|
@@ -998,21 +996,21 @@ class EchartsOptionsService {
|
|
|
998
996
|
*/
|
|
999
997
|
async processAlarm(alarm) {
|
|
1000
998
|
let value = `<ul class="list-unstyled small separator-top text-default m-0">`;
|
|
1001
|
-
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>`;
|
|
999
|
+
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">${echarts.format.encodeHTML(this.translate.instant(gettext('Alarm severity')))}</label>`;
|
|
1002
1000
|
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-${echarts.format.encodeHTML(this.severityIconPipe.transform(alarm.severity))} ${alarm.severity.toLowerCase()}" > </i> ${this.severityLabelPipe.transform(alarm.severity)} </span></li>`;
|
|
1003
|
-
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>${echarts.format.encodeHTML(alarm.type)}</code></span></li>`;
|
|
1004
|
-
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="${echarts.format.encodeHTML(this.translate.instant(alarm.text))}">${echarts.format.encodeHTML(this.translate.instant(alarm.text))}</span></li>`;
|
|
1005
|
-
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">${echarts.format.encodeHTML(this.datePipe.transform(alarm['lastUpdated']))}</span></li>`;
|
|
1001
|
+
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">${echarts.format.encodeHTML(this.translate.instant(gettext('Alarm type')))}</label><span class="small m-l-auto"><code>${echarts.format.encodeHTML(alarm.type)}</code></span></li>`;
|
|
1002
|
+
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">${echarts.format.encodeHTML(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="${echarts.format.encodeHTML(this.translate.instant(alarm.text))}">${echarts.format.encodeHTML(this.translate.instant(alarm.text))}</span></li>`;
|
|
1003
|
+
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">${echarts.format.encodeHTML(this.translate.instant(gettext('Last updated')))}</label><span class="small m-l-auto">${echarts.format.encodeHTML(this.datePipe.transform(alarm['lastUpdated']))}</span></li>`;
|
|
1006
1004
|
const exists = await this.alarmRouteExists();
|
|
1007
1005
|
if (exists) {
|
|
1008
1006
|
const currentUrl = window.location.href;
|
|
1009
1007
|
const baseUrlIndex = currentUrl.indexOf(INDEX_HTML);
|
|
1010
1008
|
const baseUrl = currentUrl.substring(0, baseUrlIndex + INDEX_HTML.length);
|
|
1011
|
-
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>`;
|
|
1009
|
+
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">${echarts.format.encodeHTML(this.translate.instant(gettext('Open details')))}</label><span class="small m-l-auto"><a href="${baseUrl}#/alarms/${alarm.id}/details?showCleared=true">${echarts.format.encodeHTML(this.translate.instant(gettext('Alarm details')))}</a></span></li>`;
|
|
1012
1010
|
}
|
|
1013
|
-
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>`;
|
|
1011
|
+
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">${echarts.format.encodeHTML(this.translate.instant(gettext('Alarm count')))}</label><span class="small m-l-auto"><span class="badge badge-info">${alarm.count}</span></span></li>`;
|
|
1014
1012
|
value += `</ul>`;
|
|
1015
|
-
return
|
|
1013
|
+
return value;
|
|
1016
1014
|
}
|
|
1017
1015
|
async alarmRouteExists() {
|
|
1018
1016
|
const exists = this.router.config.some(route => {
|
|
@@ -1407,12 +1405,12 @@ class EchartsOptionsService {
|
|
|
1407
1405
|
return acc;
|
|
1408
1406
|
}, null);
|
|
1409
1407
|
}
|
|
1410
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: EchartsOptionsService, deps: [{ token: i1.DatePipe }, { token: YAxisService }, { token: ChartTypesService }, { token: i4.AlarmSeverityToIconPipe }, { token: i4.AlarmSeverityToLabelPipe }, { token: i5.TranslateService }, { token: i6.Router }
|
|
1408
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: EchartsOptionsService, deps: [{ token: i1.DatePipe }, { token: YAxisService }, { token: ChartTypesService }, { token: i4.AlarmSeverityToIconPipe }, { token: i4.AlarmSeverityToLabelPipe }, { token: i5.TranslateService }, { token: i6.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1411
1409
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: EchartsOptionsService }); }
|
|
1412
1410
|
}
|
|
1413
1411
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: EchartsOptionsService, decorators: [{
|
|
1414
1412
|
type: Injectable
|
|
1415
|
-
}], ctorParameters: () => [{ type: i1.DatePipe }, { type: YAxisService }, { type: ChartTypesService }, { type: i4.AlarmSeverityToIconPipe }, { type: i4.AlarmSeverityToLabelPipe }, { type: i5.TranslateService }, { type: i6.Router }
|
|
1413
|
+
}], ctorParameters: () => [{ type: i1.DatePipe }, { type: YAxisService }, { type: ChartTypesService }, { type: i4.AlarmSeverityToIconPipe }, { type: i4.AlarmSeverityToLabelPipe }, { type: i5.TranslateService }, { type: i6.Router }] });
|
|
1416
1414
|
|
|
1417
1415
|
class ChartRealtimeService {
|
|
1418
1416
|
constructor(measurementRealtime, alarmRealtimeService, eventRealtimeService, echartsOptionsService) {
|