@c8y/ngx-components 1021.62.9 → 1021.63.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/echart/services/echarts-options.service.d.ts +3 -1
- package/echart/services/echarts-options.service.d.ts.map +1 -1
- package/esm2022/alarms/alarm-details.component.mjs +3 -3
- package/esm2022/alarms/alarms-filter.component.mjs +3 -3
- package/esm2022/alarms/alarms-icon.component.mjs +3 -3
- package/esm2022/alarms/alarms-interval-refresh.component.mjs +3 -3
- package/esm2022/alarms/alarms-list.component.mjs +3 -3
- package/esm2022/alarms/alarms.component.mjs +3 -3
- package/esm2022/auth-configuration/sso-configuration/sso-configuration.component.mjs +3 -3
- package/esm2022/core/countdown-interval/countdown-interval.component.mjs +3 -3
- package/esm2022/echart/services/echarts-options.service.mjs +28 -12
- package/esm2022/register-device/device-registration-view.component.mjs +39 -9
- package/esm2022/register-device/general/general-device-registration-button.component.mjs +13 -14
- package/esm2022/register-device/general/general-device-registration.component.mjs +19 -5
- package/esm2022/register-device/general/general-device-registration.service.mjs +30 -0
- package/esm2022/register-device/index.mjs +2 -1
- package/esm2022/widgets/implementations/alarms/alarm-list-widget-config/alarm-list-widget-config.component.mjs +3 -3
- package/fesm2022/c8y-ngx-components-alarms.mjs +12 -12
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs +2 -2
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +26 -11
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-register-device.mjs +86 -19
- package/fesm2022/c8y-ngx-components-register-device.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +2 -2
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/locales.pot +3 -0
- package/package.json +1 -1
- package/register-device/device-registration-view.component.d.ts +6 -1
- package/register-device/device-registration-view.component.d.ts.map +1 -1
- package/register-device/general/general-device-registration-button.component.d.ts +3 -3
- package/register-device/general/general-device-registration-button.component.d.ts.map +1 -1
- package/register-device/general/general-device-registration.component.d.ts +5 -0
- package/register-device/general/general-device-registration.component.d.ts.map +1 -1
- package/register-device/general/general-device-registration.service.d.ts +9 -0
- package/register-device/general/general-device-registration.service.d.ts.map +1 -0
- package/register-device/index.d.ts +1 -0
- package/register-device/index.d.ts.map +1 -1
|
@@ -8,11 +8,12 @@ import { fromFetch } from 'rxjs/fetch';
|
|
|
8
8
|
import * as i2 from '@c8y/ngx-components/api';
|
|
9
9
|
import { cloneDeep } from 'lodash-es';
|
|
10
10
|
import * as i1$1 from '@c8y/ngx-components';
|
|
11
|
-
import { CommonModule, WidgetTimeContextDateRangeService, DismissAlertStrategy,
|
|
12
|
-
import * as
|
|
11
|
+
import { gettext, CommonModule, WidgetTimeContextDateRangeService, DismissAlertStrategy, DynamicComponentAlert, MeasurementRealtimeService, AlarmRealtimeService, EventRealtimeService, CoreModule } from '@c8y/ngx-components';
|
|
12
|
+
import * as i6 from '@angular/router';
|
|
13
13
|
import * as i4 from '@c8y/ngx-components/alarms';
|
|
14
14
|
import { AlarmSeverityToIconPipe, AlarmSeverityToLabelPipe, AlarmsModule } from '@c8y/ngx-components/alarms';
|
|
15
15
|
import { INTERVALS } from '@c8y/ngx-components/interval-picker';
|
|
16
|
+
import * as i5 from '@ngx-translate/core';
|
|
16
17
|
import * as i2$1 from '@angular/common';
|
|
17
18
|
import { CommonModule as CommonModule$1 } from '@angular/common';
|
|
18
19
|
import * as i3 from 'ngx-echarts';
|
|
@@ -333,12 +334,13 @@ const ICONS_MAP = {
|
|
|
333
334
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
334
335
|
const INDEX_HTML = '/index.html';
|
|
335
336
|
class EchartsOptionsService {
|
|
336
|
-
constructor(datePipe, yAxisService, chartTypesService, severityIconPipe, severityLabelPipe, router) {
|
|
337
|
+
constructor(datePipe, yAxisService, chartTypesService, severityIconPipe, severityLabelPipe, translate, router) {
|
|
337
338
|
this.datePipe = datePipe;
|
|
338
339
|
this.yAxisService = yAxisService;
|
|
339
340
|
this.chartTypesService = chartTypesService;
|
|
340
341
|
this.severityIconPipe = severityIconPipe;
|
|
341
342
|
this.severityLabelPipe = severityLabelPipe;
|
|
343
|
+
this.translate = translate;
|
|
342
344
|
this.router = router;
|
|
343
345
|
this.TOOLTIP_WIDTH = 300;
|
|
344
346
|
}
|
|
@@ -565,7 +567,7 @@ class EchartsOptionsService {
|
|
|
565
567
|
yAxisIndex: idx,
|
|
566
568
|
...this.chartTypesService.getSeriesOptions(dp, isMinMaxChart, renderType)
|
|
567
569
|
};
|
|
568
|
-
const markLineData = this.createMarkLine(itemsOfType);
|
|
570
|
+
const markLineData = this.createMarkLine(itemsOfType, itemType);
|
|
569
571
|
// Construct series with markLine
|
|
570
572
|
const seriesWithMarkLine = {
|
|
571
573
|
id: `${type}/${dp.__target?.id}+${id ? id : ''}-markLine`,
|
|
@@ -618,7 +620,7 @@ class EchartsOptionsService {
|
|
|
618
620
|
const alarm = allAlarms.find(a => a.type === params.data.itemType);
|
|
619
621
|
let value = '';
|
|
620
622
|
if (event) {
|
|
621
|
-
value = this.processEvent(event);
|
|
623
|
+
value = this.processEvent(event, XAxisValue);
|
|
622
624
|
}
|
|
623
625
|
if (alarm) {
|
|
624
626
|
this.processAlarm(alarm).then(alarmVal => {
|
|
@@ -699,6 +701,9 @@ class EchartsOptionsService {
|
|
|
699
701
|
*/
|
|
700
702
|
processSeries(allDataPointSeries, XAxisValue, YAxisReadings) {
|
|
701
703
|
allDataPointSeries.forEach((series) => {
|
|
704
|
+
if (series.datapointId === 'aggregated') {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
702
707
|
let value = '';
|
|
703
708
|
if (series.id.endsWith('/min')) {
|
|
704
709
|
value = this.processMinSeries(series, allDataPointSeries, XAxisValue);
|
|
@@ -755,11 +760,11 @@ class EchartsOptionsService {
|
|
|
755
760
|
* @param event - The event object.
|
|
756
761
|
* @returns The processed value.
|
|
757
762
|
*/
|
|
758
|
-
processEvent(event) {
|
|
763
|
+
processEvent(event, XAxisValue) {
|
|
759
764
|
let value = `<ul class="list-unstyled small separator-top">`;
|
|
760
765
|
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">Event type</label><code class="m-l-auto">${event.type}</code></li>`;
|
|
761
766
|
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">Event text</label><span class="m-l-auto">${event.text}<span></li>`;
|
|
762
|
-
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">
|
|
767
|
+
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">Event time</label><span class="m-l-auto">${this.datePipe.transform(XAxisValue)}<span></li>`;
|
|
763
768
|
value += `</ul>`;
|
|
764
769
|
return value;
|
|
765
770
|
}
|
|
@@ -780,7 +785,7 @@ class EchartsOptionsService {
|
|
|
780
785
|
const currentUrl = window.location.href;
|
|
781
786
|
const baseUrlIndex = currentUrl.indexOf(INDEX_HTML);
|
|
782
787
|
const baseUrl = currentUrl.substring(0, baseUrlIndex + INDEX_HTML.length);
|
|
783
|
-
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">Link</label><span class="small m-l-auto"><a href="${baseUrl}#/alarms/${alarm.id}"
|
|
788
|
+
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">Link</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>`;
|
|
784
789
|
}
|
|
785
790
|
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">Alarm count</label><span class="small m-l-auto"><span class="badge badge-info">${alarm.count}</span></span></li>`;
|
|
786
791
|
value += `</ul>`;
|
|
@@ -1036,11 +1041,21 @@ class EchartsOptionsService {
|
|
|
1036
1041
|
* @param items Array of alarms or events
|
|
1037
1042
|
* @returns MarkLineDataItemOptionBase[]
|
|
1038
1043
|
*/
|
|
1039
|
-
createMarkLine(items) {
|
|
1044
|
+
createMarkLine(items, itemType) {
|
|
1040
1045
|
return items.reduce((acc, item) => {
|
|
1041
1046
|
if (!item.creationTime) {
|
|
1042
1047
|
return acc;
|
|
1043
1048
|
}
|
|
1049
|
+
if (itemType === 'event') {
|
|
1050
|
+
return acc.concat([
|
|
1051
|
+
{
|
|
1052
|
+
xAxis: item.time,
|
|
1053
|
+
itemType: item.type,
|
|
1054
|
+
label: { show: false, formatter: () => item.type },
|
|
1055
|
+
itemStyle: { color: item['color'] }
|
|
1056
|
+
}
|
|
1057
|
+
]);
|
|
1058
|
+
}
|
|
1044
1059
|
if (item.creationTime === item['lastUpdated']) {
|
|
1045
1060
|
return acc.concat([
|
|
1046
1061
|
{
|
|
@@ -1165,12 +1180,12 @@ class EchartsOptionsService {
|
|
|
1165
1180
|
return acc;
|
|
1166
1181
|
}, null);
|
|
1167
1182
|
}
|
|
1168
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EchartsOptionsService, deps: [{ token: i1$1.DatePipe }, { token: YAxisService }, { token: ChartTypesService }, { token: i4.AlarmSeverityToIconPipe }, { token: i4.AlarmSeverityToLabelPipe }, { token: i5.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EchartsOptionsService, deps: [{ token: i1$1.DatePipe }, { token: YAxisService }, { token: ChartTypesService }, { token: i4.AlarmSeverityToIconPipe }, { token: i4.AlarmSeverityToLabelPipe }, { token: i5.TranslateService }, { token: i6.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1169
1184
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EchartsOptionsService }); }
|
|
1170
1185
|
}
|
|
1171
1186
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EchartsOptionsService, decorators: [{
|
|
1172
1187
|
type: Injectable
|
|
1173
|
-
}], ctorParameters: () => [{ type: i1$1.DatePipe }, { type: YAxisService }, { type: ChartTypesService }, { type: i4.AlarmSeverityToIconPipe }, { type: i4.AlarmSeverityToLabelPipe }, { type: i5.Router }] });
|
|
1188
|
+
}], ctorParameters: () => [{ type: i1$1.DatePipe }, { type: YAxisService }, { type: ChartTypesService }, { type: i4.AlarmSeverityToIconPipe }, { type: i4.AlarmSeverityToLabelPipe }, { type: i5.TranslateService }, { type: i6.Router }] });
|
|
1174
1189
|
|
|
1175
1190
|
class ChartRealtimeService {
|
|
1176
1191
|
constructor(measurementRealtime, alarmRealtimeService, eventRealtimeService, echartsOptionsService) {
|