@c8y/ngx-components 1021.52.0 → 1021.54.4
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/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.d.ts +10 -2
- package/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.d.ts.map +1 -1
- package/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.model.d.ts +11 -0
- package/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.model.d.ts.map +1 -0
- package/alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.d.ts +10 -4
- package/alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.d.ts.map +1 -1
- package/alarm-event-selector/alarm-event-selector-list-item/alarm-event-selector-list-item.component.d.ts +3 -1
- package/alarm-event-selector/alarm-event-selector-list-item/alarm-event-selector-list-item.component.d.ts.map +1 -1
- package/alarm-event-selector/alarm-event-selector.model.d.ts +7 -0
- package/alarm-event-selector/alarm-event-selector.model.d.ts.map +1 -1
- package/core/application/app-icon.component.d.ts.map +1 -1
- package/core/dashboard/dashboard-child-action.component.d.ts +1 -1
- package/core/dashboard/dashboard-child-action.component.d.ts.map +1 -1
- package/core/dashboard/dashboard.module.d.ts +29 -29
- package/core/dashboard/index.d.ts +3 -0
- package/core/dashboard/index.d.ts.map +1 -1
- package/core/dashboard/widgets-dashboard.component.d.ts +1 -1
- package/core/dashboard/widgets-dashboard.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts +1 -1
- package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.d.ts +1 -1
- package/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context-date-range.service.d.ts +10 -0
- package/core/dashboard/wiget-time-context/widget-time-context-date-range.service.d.ts.map +1 -0
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +7 -4
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context.model.d.ts +0 -1
- package/core/dashboard/wiget-time-context/widget-time-context.model.d.ts.map +1 -1
- package/core/date-picker/date-picker.component.d.ts +1 -1
- package/core/date-picker/date-picker.component.d.ts.map +1 -1
- package/core/date-picker/date-picker.module.d.ts +9 -9
- package/core/date-time-picker/close-date-picker.directive.d.ts +1 -1
- package/core/date-time-picker/close-date-picker.directive.d.ts.map +1 -1
- package/core/date-time-picker/date-time-picker.component.d.ts +6 -3
- package/core/date-time-picker/date-time-picker.component.d.ts.map +1 -1
- package/core/date-time-picker/date-time-picker.module.d.ts +11 -11
- package/core/date-time-picker/date-time-picker.module.d.ts.map +1 -1
- package/core/forms/forms.module.d.ts +18 -18
- package/core/forms/required-input-placeholder.directive.d.ts +1 -1
- package/core/forms/required-input-placeholder.directive.d.ts.map +1 -1
- package/core/router/router.service.d.ts.map +1 -1
- package/core/user/user-menu.service.d.ts +36 -11
- package/core/user/user-menu.service.d.ts.map +1 -1
- package/datapoint-explorer/c8y-ngx-components-datapoint-explorer.d.ts.map +1 -0
- package/datapoint-explorer/datapoint-explorer.module.d.ts +7 -0
- package/datapoint-explorer/datapoint-explorer.module.d.ts.map +1 -0
- package/datapoint-explorer/index.d.ts +2 -0
- package/datapoint-explorer/index.d.ts.map +1 -0
- package/datapoint-explorer/view/c8y-ngx-components-datapoint-explorer-view.d.ts.map +1 -0
- package/datapoint-explorer/view/configuration/naming-dictionary.d.ts +3 -0
- package/datapoint-explorer/view/configuration/naming-dictionary.d.ts.map +1 -0
- package/datapoint-explorer/view/configuration/workspace-configuration.component.d.ts +38 -0
- package/datapoint-explorer/view/configuration/workspace-configuration.component.d.ts.map +1 -0
- package/datapoint-explorer/view/configuration/workspace-configuration.model.d.ts +7 -0
- package/datapoint-explorer/view/configuration/workspace-configuration.model.d.ts.map +1 -0
- package/datapoint-explorer/view/configuration/workspace-configuration.service.d.ts +15 -0
- package/datapoint-explorer/view/configuration/workspace-configuration.service.d.ts.map +1 -0
- package/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.d.ts +25 -0
- package/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.d.ts.map +1 -0
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts +67 -0
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts.map +1 -0
- package/datapoint-explorer/view/datapoint-explorer.service.d.ts +9 -0
- package/datapoint-explorer/view/datapoint-explorer.service.d.ts.map +1 -0
- package/datapoint-explorer/view/index.d.ts +2 -0
- package/datapoint-explorer/view/index.d.ts.map +1 -0
- package/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.d.ts +23 -0
- package/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.d.ts.map +1 -0
- package/echart/c8y-ngx-components-echart.d.ts.map +1 -0
- package/echart/chart-alerts/chart-alerts.component.d.ts +8 -0
- package/echart/chart-alerts/chart-alerts.component.d.ts.map +1 -0
- package/echart/charts.component.d.ts +63 -0
- package/echart/charts.component.d.ts.map +1 -0
- package/echart/index.d.ts +5 -0
- package/echart/index.d.ts.map +1 -0
- package/echart/models/c8y-ngx-components-echart-models.d.ts.map +1 -0
- package/echart/models/chart.model.d.ts +37 -0
- package/echart/models/chart.model.d.ts.map +1 -0
- package/echart/models/datapoints-graph-widget.model.d.ts +126 -0
- package/echart/models/datapoints-graph-widget.model.d.ts.map +1 -0
- package/echart/models/index.d.ts +4 -0
- package/echart/models/index.d.ts.map +1 -0
- package/echart/models/svg-icons.model.d.ts +22 -0
- package/echart/models/svg-icons.model.d.ts.map +1 -0
- package/echart/services/chart-alarms.service.d.ts +17 -0
- package/echart/services/chart-alarms.service.d.ts.map +1 -0
- package/echart/services/chart-events.service.d.ts +17 -0
- package/echart/services/chart-events.service.d.ts.map +1 -0
- package/echart/services/chart-realtime.service.d.ts +35 -0
- package/echart/services/chart-realtime.service.d.ts.map +1 -0
- package/echart/services/chart-types.service.d.ts +15 -0
- package/echart/services/chart-types.service.d.ts.map +1 -0
- package/echart/services/custom-measurements.service.d.ts +12 -0
- package/echart/services/custom-measurements.service.d.ts.map +1 -0
- package/echart/services/echarts-options.service.d.ts +143 -0
- package/echart/services/echarts-options.service.d.ts.map +1 -0
- package/echart/services/y-axis.service.d.ts +17 -0
- package/echart/services/y-axis.service.d.ts.map +1 -0
- package/esm2022/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.mjs +37 -12
- package/esm2022/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.model.mjs +2 -0
- package/esm2022/alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.mjs +39 -12
- package/esm2022/alarm-event-selector/alarm-event-selector-list-item/alarm-event-selector-list-item.component.mjs +6 -4
- package/esm2022/alarm-event-selector/alarm-event-selector.component.mjs +1 -1
- package/esm2022/alarm-event-selector/alarm-event-selector.model.mjs +1 -1
- package/esm2022/alarm-event-selector/custom-alarm-event-form/custom-alarm-event-form.component.mjs +1 -1
- package/esm2022/alarms/alarms-filter.component.mjs +3 -3
- package/esm2022/core/application/app-icon.component.mjs +4 -4
- package/esm2022/core/dashboard/dashboard-child-action.component.mjs +3 -3
- package/esm2022/core/dashboard/dashboard.module.mjs +17 -14
- package/esm2022/core/dashboard/index.mjs +4 -1
- package/esm2022/core/dashboard/widgets-dashboard.component.mjs +9 -9
- package/esm2022/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.mjs +11 -9
- package/esm2022/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.mjs +8 -7
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context-date-range.service.mjs +23 -0
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +70 -26
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context.model.mjs +1 -1
- package/esm2022/core/date-picker/date-picker.component.mjs +29 -14
- package/esm2022/core/date-picker/date-picker.module.mjs +9 -7
- package/esm2022/core/date-time-picker/close-date-picker.directive.mjs +4 -3
- package/esm2022/core/date-time-picker/date-time-picker.component.mjs +57 -29
- package/esm2022/core/date-time-picker/date-time-picker.module.mjs +11 -7
- package/esm2022/core/forms/forms.module.mjs +3 -3
- package/esm2022/core/forms/ip-range-input-list.component.mjs +5 -5
- package/esm2022/core/forms/required-input-placeholder.directive.mjs +4 -3
- package/esm2022/core/router/router.service.mjs +1 -1
- package/esm2022/core/time-interval/time-interval.component.mjs +3 -3
- package/esm2022/core/user/user-menu.service.mjs +57 -17
- package/esm2022/datapoint-explorer/c8y-ngx-components-datapoint-explorer.mjs +5 -0
- package/esm2022/datapoint-explorer/datapoint-explorer.module.mjs +65 -0
- package/esm2022/datapoint-explorer/index.mjs +2 -0
- package/esm2022/datapoint-explorer/view/c8y-ngx-components-datapoint-explorer-view.mjs +5 -0
- package/esm2022/datapoint-explorer/view/configuration/naming-dictionary.mjs +65 -0
- package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.component.mjs +169 -0
- package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.model.mjs +2 -0
- package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.service.mjs +40 -0
- package/esm2022/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.mjs +64 -0
- package/esm2022/datapoint-explorer/view/datapoint-explorer.component.mjs +279 -0
- package/esm2022/datapoint-explorer/view/datapoint-explorer.service.mjs +23 -0
- package/esm2022/datapoint-explorer/view/index.mjs +2 -0
- package/esm2022/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.mjs +48 -0
- package/esm2022/datapoint-selector/datapoint-attributes-form/datapoint-attributes-form.component.mjs +3 -3
- package/esm2022/datapoint-selector/datapoint-selector-list-item/datapoint-selector-list-item.component.mjs +3 -3
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component.mjs +3 -3
- package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +3 -3
- package/esm2022/device-list/add-smart-group.component.mjs +3 -3
- package/esm2022/echart/c8y-ngx-components-echart.mjs +5 -0
- package/esm2022/echart/chart-alerts/chart-alerts.component.mjs +16 -0
- package/esm2022/echart/charts.component.mjs +560 -0
- package/esm2022/echart/index.mjs +5 -0
- package/esm2022/echart/models/c8y-ngx-components-echart-models.mjs +5 -0
- package/esm2022/echart/models/chart.model.mjs +2 -0
- package/esm2022/echart/models/datapoints-graph-widget.model.mjs +17 -0
- package/esm2022/echart/models/index.mjs +4 -0
- package/esm2022/echart/models/svg-icons.model.mjs +22 -0
- package/esm2022/echart/services/chart-alarms.service.mjs +58 -0
- package/esm2022/echart/services/chart-events.service.mjs +44 -0
- package/esm2022/echart/services/chart-realtime.service.mjs +193 -0
- package/esm2022/echart/services/chart-types.service.mjs +102 -0
- package/esm2022/echart/services/custom-measurements.service.mjs +52 -0
- package/esm2022/echart/services/echarts-options.service.mjs +857 -0
- package/esm2022/echart/services/y-axis.service.mjs +150 -0
- package/esm2022/interval-picker/interval-picker.component.mjs +3 -3
- package/esm2022/interval-picker/interval-picker.model.mjs +1 -1
- package/esm2022/map/map.component.mjs +4 -1
- package/esm2022/report-dashboard/index.mjs +2 -1
- package/esm2022/time-context/c8y-ngx-components-time-context.mjs +5 -0
- package/esm2022/time-context/index.mjs +2 -0
- package/esm2022/time-context/time-context.component.mjs +217 -0
- package/esm2022/time-context/time-context.service.mjs +83 -0
- package/esm2022/tracking/tracking.component.mjs +5 -6
- package/esm2022/tracking/tracking.service.mjs +7 -3
- package/esm2022/translation-editor/lazy/translation-editor/translation-editor.component.mjs +6 -5
- package/esm2022/widgets/cockpit-exports/index.mjs +8 -1
- package/esm2022/widgets/definitions/datapoints-graph/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +5 -0
- package/esm2022/widgets/definitions/datapoints-graph/index.mjs +31 -0
- package/esm2022/widgets/definitions/index.mjs +3 -2
- package/esm2022/widgets/implementations/datapoints-graph/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +5 -0
- package/esm2022/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.mjs +239 -0
- package/esm2022/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.mjs +241 -0
- package/esm2022/widgets/implementations/datapoints-graph/index.mjs +3 -0
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +80 -28
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.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-datapoint-explorer-view.mjs +658 -0
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs +72 -0
- package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +4 -4
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +4 -4
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs +46 -0
- package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-echart.mjs +2023 -0
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-interval-picker.mjs +2 -2
- package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +3 -0
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-report-dashboard.mjs +1 -1
- package/fesm2022/c8y-ngx-components-time-context.mjs +300 -0
- package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-tracking.mjs +10 -7
- package/fesm2022/c8y-ngx-components-tracking.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +5 -4
- package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-cockpit-exports.mjs +7 -0
- package/fesm2022/c8y-ngx-components-widgets-cockpit-exports.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +38 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +467 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components.mjs +433 -281
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/interval-picker/interval-picker.component.d.ts.map +1 -1
- package/interval-picker/interval-picker.model.d.ts.map +1 -1
- package/locales/de.po +206 -279
- package/locales/es.po +206 -279
- package/locales/fr.po +206 -279
- package/locales/ja_JP.po +196 -279
- package/locales/ko.po +455 -444
- package/locales/locales.pot +200 -0
- package/locales/nl.po +206 -279
- package/locales/pl.po +206 -279
- package/locales/pt_BR.po +206 -279
- package/locales/zh_CN.po +450 -443
- package/locales/zh_TW.po +452 -445
- package/map/map.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/report-dashboard/index.d.ts +1 -0
- package/report-dashboard/index.d.ts.map +1 -1
- package/time-context/c8y-ngx-components-time-context.d.ts.map +1 -0
- package/time-context/index.d.ts +2 -0
- package/time-context/index.d.ts.map +1 -0
- package/time-context/time-context.component.d.ts +61 -0
- package/time-context/time-context.component.d.ts.map +1 -0
- package/time-context/time-context.service.d.ts +25 -0
- package/time-context/time-context.service.d.ts.map +1 -0
- package/tracking/tracking.component.d.ts.map +1 -1
- package/tracking/tracking.service.d.ts.map +1 -1
- package/translation-editor/lazy/translation-editor/translation-editor.component.d.ts.map +1 -1
- package/widgets/cockpit-exports/index.d.ts +6 -0
- package/widgets/cockpit-exports/index.d.ts.map +1 -1
- package/widgets/definitions/datapoints-graph/c8y-ngx-components-widgets-definitions-datapoints-graph.d.ts.map +1 -0
- package/widgets/definitions/datapoints-graph/index.d.ts +16 -0
- package/widgets/definitions/datapoints-graph/index.d.ts.map +1 -0
- package/widgets/definitions/index.d.ts +1 -0
- package/widgets/definitions/index.d.ts.map +1 -1
- package/widgets/implementations/datapoints-graph/c8y-ngx-components-widgets-implementations-datapoints-graph.d.ts.map +1 -0
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts +43 -0
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts.map +1 -0
- package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts +54 -0
- package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts.map +1 -0
- package/widgets/implementations/datapoints-graph/index.d.ts +3 -0
- package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Component, Injectable, signal, effect, EventEmitter, Input, Output, DestroyRef, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@c8y/ngx-components';
|
|
4
|
+
import { gettext, CoreModule, ContextRouteService, ClipboardService, ViewContext, AlertService, Permissions, CommonModule, FormsModule as FormsModule$1 } from '@c8y/ngx-components';
|
|
5
|
+
import * as i5$1 from '@c8y/ngx-components/alarm-event-selector';
|
|
6
|
+
import { AlarmEventSelectorModule } from '@c8y/ngx-components/alarm-event-selector';
|
|
7
|
+
import { TimeContextComponent } from '@c8y/ngx-components/time-context';
|
|
8
|
+
import * as i4$1 from '@c8y/ngx-components/datapoint-selector';
|
|
9
|
+
import { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';
|
|
10
|
+
import { ChartEventsService, ChartAlarmsService, ChartsComponent } from '@c8y/ngx-components/echart';
|
|
11
|
+
import * as i3 from '@angular/forms';
|
|
12
|
+
import { FormControl, FormGroup, ReactiveFormsModule, FormBuilder, FormsModule } from '@angular/forms';
|
|
13
|
+
import * as i4 from 'ngx-bootstrap/dropdown';
|
|
14
|
+
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
15
|
+
import * as i6 from 'ngx-bootstrap/tooltip';
|
|
16
|
+
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
17
|
+
import { PopoverModule } from 'ngx-bootstrap/popover';
|
|
18
|
+
import { BsModalService } from 'ngx-bootstrap/modal';
|
|
19
|
+
import * as i5 from '@angular/cdk/a11y';
|
|
20
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
21
|
+
import { merge, of } from 'rxjs';
|
|
22
|
+
import { map } from 'rxjs/operators';
|
|
23
|
+
import { ReportDashboardService, ReportDashboardModule } from '@c8y/ngx-components/report-dashboard';
|
|
24
|
+
import * as i3$1 from '@angular/common';
|
|
25
|
+
import * as i1$1 from '@c8y/ngx-components/context-dashboard';
|
|
26
|
+
import { ContextDashboardService } from '@c8y/ngx-components/context-dashboard';
|
|
27
|
+
import { DatapointsExportSelectorComponent } from '@c8y/ngx-components/datapoints-export-selector';
|
|
28
|
+
import { InventoryService } from '@c8y/client';
|
|
29
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
30
|
+
import { uniqueNamesGenerator } from 'unique-names-generator';
|
|
31
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
32
|
+
|
|
33
|
+
class SendAsWidgetToReportModal {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.reports = [];
|
|
36
|
+
this.result = new Promise((resolve, reject) => {
|
|
37
|
+
this._resolve = resolve;
|
|
38
|
+
this._reject = reject;
|
|
39
|
+
});
|
|
40
|
+
this.labels = { cancel: gettext('Cancel'), ok: gettext('Send') };
|
|
41
|
+
this.reportDashboardService = inject(ReportDashboardService);
|
|
42
|
+
}
|
|
43
|
+
async ngOnInit() {
|
|
44
|
+
this.reports = (await this.reportDashboardService.listReports({ pageSize: 2000 })).data;
|
|
45
|
+
if (this.reports.length > 0) {
|
|
46
|
+
this.form = this.initForm();
|
|
47
|
+
}
|
|
48
|
+
this.numberOfSelectedReports$ = merge(this.form.valueChanges, of(this.form.value)).pipe(map(value => Object.values(value).filter(Boolean).length));
|
|
49
|
+
}
|
|
50
|
+
save() {
|
|
51
|
+
this._resolve(this.form.value);
|
|
52
|
+
}
|
|
53
|
+
cancel() {
|
|
54
|
+
this._reject();
|
|
55
|
+
}
|
|
56
|
+
initForm() {
|
|
57
|
+
const controls = this.reports.reduce((acc, report) => ({
|
|
58
|
+
...acc,
|
|
59
|
+
[report.id]: new FormControl(false)
|
|
60
|
+
}), {});
|
|
61
|
+
return new FormGroup(controls);
|
|
62
|
+
}
|
|
63
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: SendAsWidgetToReportModal, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
64
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: SendAsWidgetToReportModal, isStandalone: true, selector: "c8y-apply-branding-to-app-modal", ngImport: i0, template: "<c8y-modal\n [title]=\"'Send as widget to reports' | translate\"\n [disabled]=\"!form || form.invalid\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [labels]=\"labels\"\n>\n <ng-container c8y-modal-title>\n <span c8yIcon=\"c8y-reports\"></span>\n </ng-container>\n\n <c8y-list-group\n class=\"m-b-0 no-border-last\"\n *ngIf=\"form\"\n [formGroup]=\"form\"\n >\n <c8y-li>\n <p\n class=\"text-center text-medium\"\n *ngIf=\"numberOfSelectedReports$ | async as numberOfReports; else noSelectedReports\"\n translate\n [translateParams]=\"{ numberOfReports: numberOfReports }\"\n ngNonBindable\n >\n {{ numberOfReports }} reports selected for widget\n </p>\n <ng-template #noSelectedReports>\n <p\n class=\"text-center text-medium\"\n translate\n >\n Select one or more reports to send the Data points graph widget with the current configuration\n </p>\n </ng-template>\n </c8y-li>\n <c8y-li *ngFor=\"let report of reports\">\n <c8y-li-checkbox\n [attr.data-cy]=\"'branding-apply-branding-to-app-checkbox-' + report.id\"\n [formControlName]=\"report.id\"\n ></c8y-li-checkbox>\n <c8y-li-icon class=\"p-l-0\">\n <i c8yIcon=\"{{ report.icon }}\"></i>\n </c8y-li-icon>\n <div class=\"text-truncate\" title=\"{{report.name}}\">{{ report.name }}</div>\n </c8y-li>\n </c8y-list-group>\n\n <c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"reports.length === 0\"\n ></c8y-ui-empty-state>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "component", type: i1.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "component", type: i1.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i1.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i1.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i1.ListItemCheckboxComponent, selector: "c8y-list-item-checkbox, c8y-li-checkbox", inputs: ["selected", "indeterminate", "disabled", "displayAsSwitch"], outputs: ["onSelect"] }, { kind: "ngmodule", type: ReportDashboardModule }] }); }
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: SendAsWidgetToReportModal, decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{ selector: 'c8y-apply-branding-to-app-modal', standalone: true, imports: [ReactiveFormsModule, CoreModule, ReportDashboardModule], template: "<c8y-modal\n [title]=\"'Send as widget to reports' | translate\"\n [disabled]=\"!form || form.invalid\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [labels]=\"labels\"\n>\n <ng-container c8y-modal-title>\n <span c8yIcon=\"c8y-reports\"></span>\n </ng-container>\n\n <c8y-list-group\n class=\"m-b-0 no-border-last\"\n *ngIf=\"form\"\n [formGroup]=\"form\"\n >\n <c8y-li>\n <p\n class=\"text-center text-medium\"\n *ngIf=\"numberOfSelectedReports$ | async as numberOfReports; else noSelectedReports\"\n translate\n [translateParams]=\"{ numberOfReports: numberOfReports }\"\n ngNonBindable\n >\n {{ numberOfReports }} reports selected for widget\n </p>\n <ng-template #noSelectedReports>\n <p\n class=\"text-center text-medium\"\n translate\n >\n Select one or more reports to send the Data points graph widget with the current configuration\n </p>\n </ng-template>\n </c8y-li>\n <c8y-li *ngFor=\"let report of reports\">\n <c8y-li-checkbox\n [attr.data-cy]=\"'branding-apply-branding-to-app-checkbox-' + report.id\"\n [formControlName]=\"report.id\"\n ></c8y-li-checkbox>\n <c8y-li-icon class=\"p-l-0\">\n <i c8yIcon=\"{{ report.icon }}\"></i>\n </c8y-li-icon>\n <div class=\"text-truncate\" title=\"{{report.name}}\">{{ report.name }}</div>\n </c8y-li>\n </c8y-list-group>\n\n <c8y-ui-empty-state\n [icon]=\"'c8y-reports'\"\n [title]=\"'There are no reports defined.' | translate\"\n [subtitle]=\"'Add a report first.' | translate\"\n *ngIf=\"reports.length === 0\"\n ></c8y-ui-empty-state>\n</c8y-modal>\n" }]
|
|
69
|
+
}] });
|
|
70
|
+
|
|
71
|
+
class CreateNewReportModalComponent {
|
|
72
|
+
constructor(contextDashboardService) {
|
|
73
|
+
this.contextDashboardService = contextDashboardService;
|
|
74
|
+
this.reportName = '';
|
|
75
|
+
this.labels = { cancel: gettext('Cancel'), ok: gettext('Send') };
|
|
76
|
+
this.result = new Promise((resolve, reject) => {
|
|
77
|
+
this._resolve = resolve;
|
|
78
|
+
this._reject = reject;
|
|
79
|
+
});
|
|
80
|
+
this.styling = {
|
|
81
|
+
themeClass: 'dashboard-theme-light',
|
|
82
|
+
headerClass: 'panel-title-regular'
|
|
83
|
+
};
|
|
84
|
+
this.DEFAULT_DASHBOARD_ICON = 'th';
|
|
85
|
+
this.DEFAULT_DASHBOARD_PRIORITY = 5000;
|
|
86
|
+
this.DEFAULT_DASHBOARD_MARGIN = 12;
|
|
87
|
+
}
|
|
88
|
+
async save() {
|
|
89
|
+
const dashboard = {
|
|
90
|
+
name: this.reportName,
|
|
91
|
+
icon: this.DEFAULT_DASHBOARD_ICON,
|
|
92
|
+
c8y_IsNavigatorNode: null,
|
|
93
|
+
priority: this.DEFAULT_DASHBOARD_PRIORITY,
|
|
94
|
+
description: '',
|
|
95
|
+
widgetMargin: this.DEFAULT_DASHBOARD_MARGIN,
|
|
96
|
+
classes: { [this.styling.headerClass]: true },
|
|
97
|
+
widgetClasses: { [this.styling.headerClass]: true }
|
|
98
|
+
};
|
|
99
|
+
try {
|
|
100
|
+
const { name, icon, c8y_IsNavigatorNode, priority, description } = dashboard;
|
|
101
|
+
const report = (await this.contextDashboardService.createReport({
|
|
102
|
+
name,
|
|
103
|
+
icon,
|
|
104
|
+
c8y_IsNavigatorNode,
|
|
105
|
+
priority,
|
|
106
|
+
description
|
|
107
|
+
})).data;
|
|
108
|
+
await this.contextDashboardService.create(dashboard, undefined, `${this.contextDashboardService.REPORT_PARTIAL_NAME}${report.id}`);
|
|
109
|
+
this._resolve(report);
|
|
110
|
+
}
|
|
111
|
+
catch (ex) {
|
|
112
|
+
this._reject(ex);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
cancel() {
|
|
116
|
+
this._reject();
|
|
117
|
+
}
|
|
118
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: CreateNewReportModalComponent, deps: [{ token: i1$1.ContextDashboardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
119
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: CreateNewReportModalComponent, isStandalone: true, selector: "c8y-create-new-report-modal", ngImport: i0, template: "<c8y-modal\n [title]=\"'Create new report with widget' | translate\"\n [headerClasses]=\"'dialog-header'\"\n [disabled]=\"reportName === ''\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [labels]=\"labels\"\n>\n <ng-container c8y-modal-title>\n <span c8yIcon=\"c8y-reports\"></span>\n </ng-container>\n\n <p class=\"text-center bg-component text-balance sticky-top p-l-24 p-r-24 p-t-8 p-b-8 separator-bottom\">\n {{' Create a new report with the Data points graph widget using the current configuration.' | translate}}\n </p>\n <div class=\"p-24 p-t-8\">\n <c8y-form-group>\n <label\n for=\"reportName\"\n translate\n >\n Report name\n </label>\n <input\n class=\"form-control\"\n id=\"reportName\"\n placeholder=\"{{ 'e.g. My data point Report' }}\"\n name=\"name\"\n type=\"text\"\n autocomplete=\"off\"\n required\n [(ngModel)]=\"reportName\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: i1.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "ngmodule", type: ReportDashboardModule }] }); }
|
|
120
|
+
}
|
|
121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: CreateNewReportModalComponent, decorators: [{
|
|
122
|
+
type: Component,
|
|
123
|
+
args: [{ selector: 'c8y-create-new-report-modal', standalone: true, imports: [ReactiveFormsModule, CoreModule, ReportDashboardModule], template: "<c8y-modal\n [title]=\"'Create new report with widget' | translate\"\n [headerClasses]=\"'dialog-header'\"\n [disabled]=\"reportName === ''\"\n (onDismiss)=\"cancel()\"\n (onClose)=\"save()\"\n [labels]=\"labels\"\n>\n <ng-container c8y-modal-title>\n <span c8yIcon=\"c8y-reports\"></span>\n </ng-container>\n\n <p class=\"text-center bg-component text-balance sticky-top p-l-24 p-r-24 p-t-8 p-b-8 separator-bottom\">\n {{' Create a new report with the Data points graph widget using the current configuration.' | translate}}\n </p>\n <div class=\"p-24 p-t-8\">\n <c8y-form-group>\n <label\n for=\"reportName\"\n translate\n >\n Report name\n </label>\n <input\n class=\"form-control\"\n id=\"reportName\"\n placeholder=\"{{ 'e.g. My data point Report' }}\"\n name=\"name\"\n type=\"text\"\n autocomplete=\"off\"\n required\n [(ngModel)]=\"reportName\"\n />\n <c8y-messages></c8y-messages>\n </c8y-form-group>\n </div>\n</c8y-modal>\n" }]
|
|
124
|
+
}], ctorParameters: () => [{ type: i1$1.ContextDashboardService }] });
|
|
125
|
+
|
|
126
|
+
class DataExplorerService {
|
|
127
|
+
constructor() {
|
|
128
|
+
this.inventory = inject(InventoryService);
|
|
129
|
+
}
|
|
130
|
+
async fetchReportDashboard(reportId) {
|
|
131
|
+
return (await this.inventory.list({
|
|
132
|
+
pageSize: 1,
|
|
133
|
+
query: `has('c8y_Dashboard!name!report_${reportId}')`
|
|
134
|
+
})).data[0];
|
|
135
|
+
}
|
|
136
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DataExplorerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
137
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DataExplorerService, providedIn: 'root' }); }
|
|
138
|
+
}
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DataExplorerService, decorators: [{
|
|
140
|
+
type: Injectable,
|
|
141
|
+
args: [{
|
|
142
|
+
providedIn: 'root'
|
|
143
|
+
}]
|
|
144
|
+
}] });
|
|
145
|
+
|
|
146
|
+
class WorkspaceConfigurationService {
|
|
147
|
+
constructor() {
|
|
148
|
+
this.LOCAL_STORAGE_KEY = 'c8y-configs';
|
|
149
|
+
this.LOCAL_STORAGE_DEFAULT_ID_KEY = 'c8y-default-config-id';
|
|
150
|
+
this.contextIdSignal = signal(null);
|
|
151
|
+
effect(() => {
|
|
152
|
+
const signalValue = this.contextIdSignal();
|
|
153
|
+
if (signalValue !== null) {
|
|
154
|
+
this.LOCAL_STORAGE_KEY = `c8y-configs-${signalValue}`;
|
|
155
|
+
this.LOCAL_STORAGE_DEFAULT_ID_KEY = `c8y-default-config-id-${signalValue}`;
|
|
156
|
+
}
|
|
157
|
+
if (signalValue == null) {
|
|
158
|
+
this.LOCAL_STORAGE_KEY = 'c8y-configs';
|
|
159
|
+
this.LOCAL_STORAGE_DEFAULT_ID_KEY = 'c8y-default-config-id';
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
getConfigurations() {
|
|
164
|
+
const configurations = localStorage.getItem(this.LOCAL_STORAGE_KEY);
|
|
165
|
+
return configurations ? JSON.parse(configurations) : [];
|
|
166
|
+
}
|
|
167
|
+
getDefaultConfigurationId() {
|
|
168
|
+
return localStorage.getItem(this.LOCAL_STORAGE_DEFAULT_ID_KEY);
|
|
169
|
+
}
|
|
170
|
+
saveConfigurations(configurations, id) {
|
|
171
|
+
localStorage.setItem(this.LOCAL_STORAGE_KEY, JSON.stringify(configurations));
|
|
172
|
+
localStorage.setItem(this.LOCAL_STORAGE_DEFAULT_ID_KEY, id);
|
|
173
|
+
}
|
|
174
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: WorkspaceConfigurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
175
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: WorkspaceConfigurationService, providedIn: 'root' }); }
|
|
176
|
+
}
|
|
177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: WorkspaceConfigurationService, decorators: [{
|
|
178
|
+
type: Injectable,
|
|
179
|
+
args: [{
|
|
180
|
+
providedIn: 'root'
|
|
181
|
+
}]
|
|
182
|
+
}], ctorParameters: () => [] });
|
|
183
|
+
|
|
184
|
+
const adjectives = [
|
|
185
|
+
'caffeinated',
|
|
186
|
+
'sleepy',
|
|
187
|
+
'hungry',
|
|
188
|
+
'puzzled',
|
|
189
|
+
'overexcited',
|
|
190
|
+
'daydreaming',
|
|
191
|
+
'chocolate-loving',
|
|
192
|
+
'coffee-powered',
|
|
193
|
+
'cookie-craving',
|
|
194
|
+
'disco-ready',
|
|
195
|
+
'weekend-mode',
|
|
196
|
+
'pizza-powered',
|
|
197
|
+
'nap-seeking',
|
|
198
|
+
'wifi-hunting',
|
|
199
|
+
'battery-hungry',
|
|
200
|
+
'donut-powered',
|
|
201
|
+
'tea-sipping',
|
|
202
|
+
'keyboard-loving',
|
|
203
|
+
'screen-staring',
|
|
204
|
+
'mouse-chasing',
|
|
205
|
+
'code-dreaming',
|
|
206
|
+
'pixel-perfect',
|
|
207
|
+
'bug-finding',
|
|
208
|
+
'zoom-tired',
|
|
209
|
+
'meeting-dodging',
|
|
210
|
+
'deadline-racing',
|
|
211
|
+
'coffee-seeking',
|
|
212
|
+
'sandwich-craving',
|
|
213
|
+
'debug-ready',
|
|
214
|
+
'rest-needing'
|
|
215
|
+
];
|
|
216
|
+
const nouns = [
|
|
217
|
+
'sensor',
|
|
218
|
+
'robot',
|
|
219
|
+
'thermostat',
|
|
220
|
+
'gateway',
|
|
221
|
+
'dashboard',
|
|
222
|
+
'widget',
|
|
223
|
+
'gadget',
|
|
224
|
+
'button',
|
|
225
|
+
'antenna',
|
|
226
|
+
'beacon',
|
|
227
|
+
'adapter',
|
|
228
|
+
'gizmo',
|
|
229
|
+
'hub',
|
|
230
|
+
'switch',
|
|
231
|
+
'chip',
|
|
232
|
+
'controller',
|
|
233
|
+
'display',
|
|
234
|
+
'terminal',
|
|
235
|
+
'processor',
|
|
236
|
+
'transmitter',
|
|
237
|
+
'receiver',
|
|
238
|
+
'pod',
|
|
239
|
+
'device',
|
|
240
|
+
'module',
|
|
241
|
+
'relay',
|
|
242
|
+
'node',
|
|
243
|
+
'bridge',
|
|
244
|
+
'screen',
|
|
245
|
+
'router',
|
|
246
|
+
'box'
|
|
247
|
+
];
|
|
248
|
+
|
|
249
|
+
class WorkspaceConfigComponent {
|
|
250
|
+
constructor() {
|
|
251
|
+
this.onConfigurationChange = new EventEmitter();
|
|
252
|
+
this.configurations = [];
|
|
253
|
+
this.activeConfigTooltip = gettext('Active configuration cannot be removed');
|
|
254
|
+
this.removeConfigTooltip = gettext('Remove configuration');
|
|
255
|
+
this.formBuilder = inject(FormBuilder);
|
|
256
|
+
this.workspaceConfigurationService = inject(WorkspaceConfigurationService);
|
|
257
|
+
this.contextRouteService = inject(ContextRouteService);
|
|
258
|
+
this.clipboardService = inject(ClipboardService);
|
|
259
|
+
this.activatedRoute = inject(ActivatedRoute);
|
|
260
|
+
this.router = inject(Router);
|
|
261
|
+
}
|
|
262
|
+
ngOnInit() {
|
|
263
|
+
this.initializeContextSourceId();
|
|
264
|
+
this.initializeConfigurations();
|
|
265
|
+
this.initWorkspaceForm();
|
|
266
|
+
}
|
|
267
|
+
ngOnChanges(changes) {
|
|
268
|
+
if (changes.updatedConfig && !changes.updatedConfig.firstChange) {
|
|
269
|
+
this.updateConfigurations();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
addConfig(duplicatedConfig) {
|
|
273
|
+
const name = uniqueNamesGenerator({
|
|
274
|
+
dictionaries: [adjectives, nouns]
|
|
275
|
+
});
|
|
276
|
+
const workspace = {
|
|
277
|
+
id: new Date().toISOString(),
|
|
278
|
+
label: name,
|
|
279
|
+
config: { datapoints: [], alarmsEventsConfigs: [] }
|
|
280
|
+
};
|
|
281
|
+
if (duplicatedConfig) {
|
|
282
|
+
workspace.config = duplicatedConfig;
|
|
283
|
+
}
|
|
284
|
+
this.currentConfiguration = { ...workspace };
|
|
285
|
+
this.configurations.unshift(workspace);
|
|
286
|
+
this.initWorkspaceForm();
|
|
287
|
+
this.workspaceConfigurationService.saveConfigurations(this.configurations, this.currentConfiguration.id);
|
|
288
|
+
this.onConfigurationChange.emit(this.currentConfiguration.config);
|
|
289
|
+
}
|
|
290
|
+
changeConfiguration(selected, configuration) {
|
|
291
|
+
if (!selected) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
this.currentConfiguration = configuration;
|
|
295
|
+
localStorage.setItem(this.workspaceConfigurationService.LOCAL_STORAGE_DEFAULT_ID_KEY, this.currentConfiguration.id);
|
|
296
|
+
this.onConfigurationChange.emit(configuration.config);
|
|
297
|
+
}
|
|
298
|
+
updateConfigurationLabel(configuration) {
|
|
299
|
+
this.configurations = this.configurations.map(c => c.id === configuration.id ? configuration : c);
|
|
300
|
+
this.workspaceConfigurationService.saveConfigurations(this.configurations, this.currentConfiguration?.id || '');
|
|
301
|
+
this.currentConfiguration = configuration;
|
|
302
|
+
this.onConfigurationChange.emit(configuration.config);
|
|
303
|
+
}
|
|
304
|
+
deleteConfiguration(configuration) {
|
|
305
|
+
this.configurations = this.configurations.filter(c => c.id !== configuration.id);
|
|
306
|
+
this.initWorkspaceForm();
|
|
307
|
+
this.workspaceConfigurationService.saveConfigurations(this.configurations, this.currentConfiguration?.id || '');
|
|
308
|
+
}
|
|
309
|
+
clearAll() {
|
|
310
|
+
this.configurations = [this.currentConfiguration];
|
|
311
|
+
this.initWorkspaceForm();
|
|
312
|
+
this.workspaceConfigurationService.saveConfigurations(this.configurations, this.currentConfiguration?.id || '');
|
|
313
|
+
}
|
|
314
|
+
async shareConfig(configuration) {
|
|
315
|
+
await this.clipboardService.writeText(JSON.stringify(configuration.config));
|
|
316
|
+
}
|
|
317
|
+
addConfigFromUrl(queryParams) {
|
|
318
|
+
this.addConfig();
|
|
319
|
+
const config = JSON.parse(queryParams.config);
|
|
320
|
+
this.onConfigurationChange.emit(config);
|
|
321
|
+
}
|
|
322
|
+
updateConfigurations() {
|
|
323
|
+
this.currentConfiguration.config = this.updatedConfig;
|
|
324
|
+
this.configurations = this.configurations.map(currentConfig => currentConfig.id === this.currentConfiguration.id ? this.currentConfiguration : currentConfig);
|
|
325
|
+
const queryParams = {
|
|
326
|
+
configId: this.currentConfiguration.id,
|
|
327
|
+
label: this.currentConfiguration.label,
|
|
328
|
+
config: JSON.stringify(this.updatedConfig)
|
|
329
|
+
};
|
|
330
|
+
this.workspaceConfigurationService.saveConfigurations(this.configurations, this.currentConfiguration.id);
|
|
331
|
+
this.router.navigate([], { queryParams });
|
|
332
|
+
}
|
|
333
|
+
initializeConfigurations() {
|
|
334
|
+
const configurations = this.workspaceConfigurationService.getConfigurations();
|
|
335
|
+
const defaultId = this.workspaceConfigurationService.getDefaultConfigurationId();
|
|
336
|
+
const queryParams = this.router.parseUrl(this.router.url).queryParams;
|
|
337
|
+
if (configurations.length) {
|
|
338
|
+
this.configurations = configurations;
|
|
339
|
+
this.currentConfiguration =
|
|
340
|
+
this.configurations.find(c => c.id === defaultId) || this.configurations[0];
|
|
341
|
+
this.onConfigurationChange.emit(this.currentConfiguration.config);
|
|
342
|
+
if (queryParams?.configId && !this.configurations.find(c => c.id === queryParams.configId)) {
|
|
343
|
+
this.addConfigFromUrl(queryParams);
|
|
344
|
+
}
|
|
345
|
+
else if (queryParams?.configId &&
|
|
346
|
+
this.configurations.find(c => c.id === queryParams.configId) &&
|
|
347
|
+
this.currentConfiguration.id !== queryParams.configId) {
|
|
348
|
+
this.currentConfiguration = this.configurations.find(c => c.id === queryParams.configId);
|
|
349
|
+
this.changeConfiguration(true, this.currentConfiguration);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (!this.currentConfiguration) {
|
|
353
|
+
if (Object.keys(queryParams).length === 0) {
|
|
354
|
+
this.addConfig();
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
this.addConfigFromUrl(queryParams);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
initWorkspaceForm() {
|
|
361
|
+
this.configurationsFormGroup = this.formBuilder.group({
|
|
362
|
+
configurations: this.formBuilder.array([])
|
|
363
|
+
});
|
|
364
|
+
this.patchForm();
|
|
365
|
+
}
|
|
366
|
+
patchForm() {
|
|
367
|
+
const control = this.configurationsFormGroup.controls['configurations'];
|
|
368
|
+
this.configurations.forEach(workspace => {
|
|
369
|
+
control.push(this.patchValues(workspace));
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
patchValues(workspace) {
|
|
373
|
+
return this.formBuilder.group({
|
|
374
|
+
label: [workspace.label],
|
|
375
|
+
config: [workspace.config],
|
|
376
|
+
id: [workspace.id]
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
initializeContextSourceId() {
|
|
380
|
+
const routeContext = this.contextRouteService.getContextData(this.activatedRoute);
|
|
381
|
+
if (!routeContext) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
const { context, contextData } = routeContext;
|
|
385
|
+
if ([ViewContext.Device, ViewContext.Group].includes(context)) {
|
|
386
|
+
this.workspaceConfigurationService.contextIdSignal.set(contextData?.id);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: WorkspaceConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
390
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: WorkspaceConfigComponent, isStandalone: true, selector: "c8y-workspace-config", inputs: { updatedConfig: "updatedConfig" }, outputs: { onConfigurationChange: "onConfigurationChange" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"dropdown\"\n #actionbar_dropdown=\"bs-dropdown\"\n [cdkTrapFocus]=\"actionbar_dropdown.isOpen\"\n dropdown\n [insideClick]=\"true\"\n>\n\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ currentConfiguration.label }}\"\n tooltip=\"{{ 'Selected configuration' | translate }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"current-configuration-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"list\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span class=\"text-12\">\n {{ 'Configuration' | translate }}\n </span>\n <span class=\"text-10 text-muted text-truncate\">\n {{ currentConfiguration.label }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n <div\n class=\"dropdown-menu dropdown-menu-wide dropdown-menu-action-bar\"\n *dropdownMenu\n >\n <div class=\"sticky-top separator-bottom p-t-8 p-b-8 p-l-16 p-r-16\">\n <p>\n <strong>{{ 'Data explorer configurations' | translate }}</strong>\n </p>\n <p>\n <small>{{ 'Easily switch and manage configurations.' | translate }}</small>\n </p>\n </div>\n <c8y-list-group class=\"no-border-last\">\n <form [formGroup]=\"configurationsFormGroup\">\n <div formArrayName=\"configurations\">\n <c8y-li\n class=\"p-0\"\n *ngFor=\"\n let configuration of configurationsFormGroup.controls.configurations['controls'];\n let i = index\n \"\n [dense]=\"true\"\n >\n <c8y-li-radio\n [selected]=\"configuration.value.id === currentConfiguration.id\"\n (onSelect)=\"changeConfiguration($event, configuration.value)\"\n ></c8y-li-radio>\n <div class=\"d-flex a-i-center gap-8\">\n <div\n class=\"flex-grow min-width-0\"\n [formGroupName]=\"i\"\n >\n <label\n class=\"editable\"\n [ngClass]=\"{\n updated:\n configuration.controls.label.touched && configuration.controls.label.dirty\n }\"\n >\n <input\n class=\"form-control\"\n [style.width.ch]=\"configuration.value.label || 25\"\n [attr.aria-label]=\"'Configuration label' | translate\"\n placeholder=\"{{ 'Configuration 1' | translate }}\"\n type=\"text\"\n autocomplete=\"off\"\n required\n formControlName=\"label\"\n (blur)=\"updateConfigurationLabel(configuration.value)\"\n />\n </label>\n </div>\n <div class=\"flex-nogrow d-flex gap-8\">\n <button\n class=\"btn-dot btn\"\n [attr.aria-label]=\"'Duplicate configuration' | translate\"\n tooltip=\"{{ 'Duplicate configuration' | translate }}\"\n placement=\"left\"\n (click)=\"addConfig(configuration.value.config)\"\n [delay]=\"500\"\n >\n <i c8yIcon=\"copy\"></i>\n </button>\n\n <button\n class=\"btn-dot btn btn-dot--danger\"\n [attr.aria-label]=\"'Remove configurations' | translate\"\n tooltip=\"{{\n (configuration.value.id === currentConfiguration.id\n ? activeConfigTooltip\n : removeConfigTooltip\n ) | translate\n }}\"\n placement=\"left\"\n [delay]=\"500\"\n (click)=\"$event.stopPropagation(); deleteConfiguration(configuration.value)\"\n [disabled]=\"configuration.value.id === currentConfiguration.id\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n </div>\n </c8y-li>\n </div>\n </form>\n </c8y-list-group>\n <div class=\"sticky-bottom separator-top\">\n <div class=\"d-flex p-l-16 p-r-16 p-t-8 p-b-8\">\n <button\n class=\"btn btn-danger btn-sm flex-grow\"\n (click)=\"clearAll()\"\n [disabled]=\"configurations.length < 2\"\n >\n <i [c8yIcon]=\"'delete'\"></i>\n {{ 'Delete all configurations' | translate }}\n </button>\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n type=\"button\"\n (click)=\"addConfig()\"\n >\n <i [c8yIcon]=\"'add-circle-outline'\"></i>\n {{ 'Add configuration' | translate }}\n </button>\n </div>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "component", type: i1.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i1.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i1.ListItemRadioComponent, selector: "c8y-list-item-radio, c8y-li-radio", inputs: ["selected", "name", "disabled", "value"], outputs: ["onSelect"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: i4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i5.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i6.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"] }] }); }
|
|
391
|
+
}
|
|
392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: WorkspaceConfigComponent, decorators: [{
|
|
393
|
+
type: Component,
|
|
394
|
+
args: [{ selector: 'c8y-workspace-config', standalone: true, imports: [CoreModule, BsDropdownModule, FormsModule, A11yModule, TooltipModule], template: "<div\n class=\"dropdown\"\n #actionbar_dropdown=\"bs-dropdown\"\n [cdkTrapFocus]=\"actionbar_dropdown.isOpen\"\n dropdown\n [insideClick]=\"true\"\n>\n\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ currentConfiguration.label }}\"\n tooltip=\"{{ 'Selected configuration' | translate }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"current-configuration-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"list\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span class=\"text-12\">\n {{ 'Configuration' | translate }}\n </span>\n <span class=\"text-10 text-muted text-truncate\">\n {{ currentConfiguration.label }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n <div\n class=\"dropdown-menu dropdown-menu-wide dropdown-menu-action-bar\"\n *dropdownMenu\n >\n <div class=\"sticky-top separator-bottom p-t-8 p-b-8 p-l-16 p-r-16\">\n <p>\n <strong>{{ 'Data explorer configurations' | translate }}</strong>\n </p>\n <p>\n <small>{{ 'Easily switch and manage configurations.' | translate }}</small>\n </p>\n </div>\n <c8y-list-group class=\"no-border-last\">\n <form [formGroup]=\"configurationsFormGroup\">\n <div formArrayName=\"configurations\">\n <c8y-li\n class=\"p-0\"\n *ngFor=\"\n let configuration of configurationsFormGroup.controls.configurations['controls'];\n let i = index\n \"\n [dense]=\"true\"\n >\n <c8y-li-radio\n [selected]=\"configuration.value.id === currentConfiguration.id\"\n (onSelect)=\"changeConfiguration($event, configuration.value)\"\n ></c8y-li-radio>\n <div class=\"d-flex a-i-center gap-8\">\n <div\n class=\"flex-grow min-width-0\"\n [formGroupName]=\"i\"\n >\n <label\n class=\"editable\"\n [ngClass]=\"{\n updated:\n configuration.controls.label.touched && configuration.controls.label.dirty\n }\"\n >\n <input\n class=\"form-control\"\n [style.width.ch]=\"configuration.value.label || 25\"\n [attr.aria-label]=\"'Configuration label' | translate\"\n placeholder=\"{{ 'Configuration 1' | translate }}\"\n type=\"text\"\n autocomplete=\"off\"\n required\n formControlName=\"label\"\n (blur)=\"updateConfigurationLabel(configuration.value)\"\n />\n </label>\n </div>\n <div class=\"flex-nogrow d-flex gap-8\">\n <button\n class=\"btn-dot btn\"\n [attr.aria-label]=\"'Duplicate configuration' | translate\"\n tooltip=\"{{ 'Duplicate configuration' | translate }}\"\n placement=\"left\"\n (click)=\"addConfig(configuration.value.config)\"\n [delay]=\"500\"\n >\n <i c8yIcon=\"copy\"></i>\n </button>\n\n <button\n class=\"btn-dot btn btn-dot--danger\"\n [attr.aria-label]=\"'Remove configurations' | translate\"\n tooltip=\"{{\n (configuration.value.id === currentConfiguration.id\n ? activeConfigTooltip\n : removeConfigTooltip\n ) | translate\n }}\"\n placement=\"left\"\n [delay]=\"500\"\n (click)=\"$event.stopPropagation(); deleteConfiguration(configuration.value)\"\n [disabled]=\"configuration.value.id === currentConfiguration.id\"\n >\n <i c8yIcon=\"minus-circle\"></i>\n </button>\n </div>\n </div>\n </c8y-li>\n </div>\n </form>\n </c8y-list-group>\n <div class=\"sticky-bottom separator-top\">\n <div class=\"d-flex p-l-16 p-r-16 p-t-8 p-b-8\">\n <button\n class=\"btn btn-danger btn-sm flex-grow\"\n (click)=\"clearAll()\"\n [disabled]=\"configurations.length < 2\"\n >\n <i [c8yIcon]=\"'delete'\"></i>\n {{ 'Delete all configurations' | translate }}\n </button>\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n type=\"button\"\n (click)=\"addConfig()\"\n >\n <i [c8yIcon]=\"'add-circle-outline'\"></i>\n {{ 'Add configuration' | translate }}\n </button>\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
395
|
+
}], propDecorators: { updatedConfig: [{
|
|
396
|
+
type: Input
|
|
397
|
+
}], onConfigurationChange: [{
|
|
398
|
+
type: Output
|
|
399
|
+
}] } });
|
|
400
|
+
|
|
401
|
+
class DatapointExplorerComponent {
|
|
402
|
+
#destroyRef;
|
|
403
|
+
constructor() {
|
|
404
|
+
this.config = { datapoints: [], alarmsEventsConfigs: [] };
|
|
405
|
+
this.alarms = [];
|
|
406
|
+
this.events = [];
|
|
407
|
+
this.datapointsOutOfSync = new Map();
|
|
408
|
+
this.hasAtLeastOneDatapointActive = true;
|
|
409
|
+
this.hasAtLeastOneAlarmActive = true;
|
|
410
|
+
this.isMarkedAreaEnabled = false;
|
|
411
|
+
this.alarmsOrEventsHaveNoMatchingDps = false;
|
|
412
|
+
this.canAddReport = false;
|
|
413
|
+
this.datapointSelectDefaultFormOptions = {
|
|
414
|
+
showRange: true,
|
|
415
|
+
showChart: true
|
|
416
|
+
};
|
|
417
|
+
this.#destroyRef = inject(DestroyRef);
|
|
418
|
+
this.dataExplorerService = inject(DataExplorerService);
|
|
419
|
+
this.formBuilder = inject(FormBuilder);
|
|
420
|
+
this.alertService = inject(AlertService);
|
|
421
|
+
this.bsModalService = inject(BsModalService);
|
|
422
|
+
this.permissions = inject(Permissions);
|
|
423
|
+
this.contextDashboardService = inject(ContextDashboardService);
|
|
424
|
+
this.activatedRoute = inject(ActivatedRoute);
|
|
425
|
+
this.contextRouteService = inject(ContextRouteService);
|
|
426
|
+
this.formGroup = this.initForm();
|
|
427
|
+
}
|
|
428
|
+
ngOnInit() {
|
|
429
|
+
this.contextAsset = this.initializeContextSourceId();
|
|
430
|
+
this.checkForMatchingDatapoints();
|
|
431
|
+
this.canAddReport = this.permissions.hasAnyRole([
|
|
432
|
+
Permissions.ROLE_INVENTORY_CREATE,
|
|
433
|
+
Permissions.ROLE_INVENTORY_ADMIN,
|
|
434
|
+
Permissions.ROLE_MANAGED_OBJECT_ADMIN,
|
|
435
|
+
Permissions.ROLE_MANAGED_OBJECT_CREATE
|
|
436
|
+
]);
|
|
437
|
+
this.formGroup.valueChanges
|
|
438
|
+
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
439
|
+
.subscribe(configChange => {
|
|
440
|
+
const { alarms, events, ...configValues } = configChange;
|
|
441
|
+
this.config = {
|
|
442
|
+
...configValues,
|
|
443
|
+
alarmsEventsConfigs: [...(alarms || []), ...(events || [])]
|
|
444
|
+
};
|
|
445
|
+
this.updateExportConfig();
|
|
446
|
+
this.checkForMatchingDatapoints();
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
onTimeContextChange(timeProps) {
|
|
450
|
+
const realtime = this.formGroup.controls.realtime.value;
|
|
451
|
+
if (timeProps.realtime !== realtime) {
|
|
452
|
+
this.formGroup.patchValue({ realtime: timeProps.realtime });
|
|
453
|
+
}
|
|
454
|
+
if (timeProps.realtime) {
|
|
455
|
+
if (timeProps.currentDateContextInterval !== this.formGroup.value.interval) {
|
|
456
|
+
this.formGroup.patchValue({ interval: timeProps.currentDateContextInterval });
|
|
457
|
+
}
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
this.formGroup.patchValue({
|
|
461
|
+
dateFrom: timeProps.currentDateContextFromDate,
|
|
462
|
+
dateTo: timeProps.currentDateContextToDate,
|
|
463
|
+
interval: timeProps.currentDateContextInterval,
|
|
464
|
+
aggregation: timeProps.aggregation || null
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
onConfigurationChange(config) {
|
|
468
|
+
if (config.dateFrom && config.dateTo) {
|
|
469
|
+
this.timeProps = {
|
|
470
|
+
dateFrom: new Date(config?.dateFrom),
|
|
471
|
+
dateTo: new Date(config?.dateTo),
|
|
472
|
+
interval: config?.interval,
|
|
473
|
+
realtime: config?.realtime,
|
|
474
|
+
aggregation: config?.realtime ? null : config?.aggregation
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
this.alarms = config.alarmsEventsConfigs.filter(ae => ae.timelineType === 'ALARM');
|
|
478
|
+
this.events = config.alarmsEventsConfigs.filter(ae => ae.timelineType === 'EVENT');
|
|
479
|
+
this.formGroup.patchValue({ alarms: this.alarms, events: this.events, ...config });
|
|
480
|
+
}
|
|
481
|
+
onSliderZoom(timeProps) {
|
|
482
|
+
this.formGroup.patchValue(timeProps);
|
|
483
|
+
this.timeProps = { ...timeProps, realtime: false };
|
|
484
|
+
}
|
|
485
|
+
updateTimeRangeOnRealtime(timeRange) {
|
|
486
|
+
this.formGroup.patchValue(timeRange, { emitEvent: false });
|
|
487
|
+
}
|
|
488
|
+
createNewReportWithWidget() {
|
|
489
|
+
const modal = this.bsModalService.show(CreateNewReportModalComponent, {
|
|
490
|
+
ignoreBackdropClick: true,
|
|
491
|
+
keyboard: false,
|
|
492
|
+
class: 'modal-sm'
|
|
493
|
+
});
|
|
494
|
+
const content = modal.content;
|
|
495
|
+
content.result
|
|
496
|
+
.then(async (report) => {
|
|
497
|
+
const reportDashboard = await this.dataExplorerService.fetchReportDashboard(report.id);
|
|
498
|
+
const widget = this.createWidgetConfig();
|
|
499
|
+
reportDashboard.c8y_Dashboard.children = { [widget.id]: widget };
|
|
500
|
+
await this.contextDashboardService.update(reportDashboard);
|
|
501
|
+
this.alertService.success(gettext('Report and widget created.'));
|
|
502
|
+
})
|
|
503
|
+
.catch(e => {
|
|
504
|
+
if (e) {
|
|
505
|
+
this.alertService.danger(gettext('Failed to create report and widget.'));
|
|
506
|
+
this.alertService.addServerFailure(e);
|
|
507
|
+
}
|
|
508
|
+
// else: modal was closed
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
sendAsWidgetToReport() {
|
|
512
|
+
const modal = this.bsModalService.show(SendAsWidgetToReportModal, {
|
|
513
|
+
ignoreBackdropClick: true,
|
|
514
|
+
keyboard: false,
|
|
515
|
+
class: 'modal-sm'
|
|
516
|
+
});
|
|
517
|
+
const content = modal.content;
|
|
518
|
+
content.result
|
|
519
|
+
.then(async (reports) => {
|
|
520
|
+
const selectedReports = Object.entries(reports).filter(([, value]) => value);
|
|
521
|
+
const reportPromises = selectedReports.map(async ([reportId]) => {
|
|
522
|
+
const reportDashboard = await this.dataExplorerService.fetchReportDashboard(reportId);
|
|
523
|
+
const widget = this.createWidgetConfig();
|
|
524
|
+
const children = reportDashboard.c8y_Dashboard.children || {};
|
|
525
|
+
reportDashboard.c8y_Dashboard.children = { ...children, [widget.id]: widget };
|
|
526
|
+
await this.contextDashboardService.update(reportDashboard);
|
|
527
|
+
});
|
|
528
|
+
await Promise.all(reportPromises);
|
|
529
|
+
this.alertService.success(gettext('Widget created.'));
|
|
530
|
+
})
|
|
531
|
+
.catch(e => {
|
|
532
|
+
if (e) {
|
|
533
|
+
this.alertService.danger(gettext('Failed to create widget.'));
|
|
534
|
+
this.alertService.addServerFailure(e);
|
|
535
|
+
}
|
|
536
|
+
// else: modal was closed
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
updateAlarmsAndEvents(alarmsEventsConfigs) {
|
|
540
|
+
this.alarms = alarmsEventsConfigs.filter(this.isAlarm);
|
|
541
|
+
this.events = alarmsEventsConfigs.filter(this.isEvent);
|
|
542
|
+
this.hasAtLeastOneAlarmActive = this.hasActiveAlarms(this.alarms);
|
|
543
|
+
}
|
|
544
|
+
handleDatapointOutOfSync(dpOutOfSync) {
|
|
545
|
+
const key = (dp) => dp.__target?.id + dp.fragment + dp.series;
|
|
546
|
+
const dpMatch = this.config.datapoints?.find(dp => key(dp) === key(dpOutOfSync));
|
|
547
|
+
if (!dpMatch) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
this.datapointsOutOfSync.set(dpMatch, true);
|
|
551
|
+
}
|
|
552
|
+
isAlarm(item) {
|
|
553
|
+
return item.timelineType === 'ALARM';
|
|
554
|
+
}
|
|
555
|
+
isEvent(item) {
|
|
556
|
+
return item.timelineType === 'EVENT';
|
|
557
|
+
}
|
|
558
|
+
hasActiveAlarms(alarms) {
|
|
559
|
+
return alarms.length > 0 && alarms.some(alarm => alarm.__active);
|
|
560
|
+
}
|
|
561
|
+
checkForMatchingDatapoints() {
|
|
562
|
+
const allMatch = this.config?.alarmsEventsConfigs?.every(ae => this.formGroup.value.datapoints?.some(dp => dp.__target?.id === ae.__target?.id));
|
|
563
|
+
queueMicrotask(() => {
|
|
564
|
+
this.alarmsOrEventsHaveNoMatchingDps = !allMatch;
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
updateExportConfig() {
|
|
568
|
+
const datapointDetails = this.config.datapoints
|
|
569
|
+
.filter(({ __active }) => __active)
|
|
570
|
+
.map(({ __target, fragment, series }) => ({
|
|
571
|
+
deviceName: __target.name,
|
|
572
|
+
source: __target.id,
|
|
573
|
+
valueFragmentSeries: series,
|
|
574
|
+
valueFragmentType: fragment
|
|
575
|
+
}));
|
|
576
|
+
if (datapointDetails.length === 0) {
|
|
577
|
+
this.exportConfig = null;
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
this.exportConfig = {
|
|
581
|
+
aggregation: this.config.aggregation,
|
|
582
|
+
dateFrom: new Date(this.config.dateFrom).toISOString(),
|
|
583
|
+
dateTo: new Date(this.config.dateTo).toISOString(),
|
|
584
|
+
datapointDetails: datapointDetails
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
initializeContextSourceId() {
|
|
589
|
+
const routeContext = this.contextRouteService.getContextData(this.activatedRoute);
|
|
590
|
+
if (!routeContext) {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
const { context, contextData } = routeContext;
|
|
594
|
+
if ([ViewContext.Device, ViewContext.Group].includes(context)) {
|
|
595
|
+
return contextData;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
createWidgetConfig() {
|
|
599
|
+
return {
|
|
600
|
+
name: 'Data points graph 2',
|
|
601
|
+
title: gettext('Data points graph 2'),
|
|
602
|
+
id: String(Math.random()).substr(2),
|
|
603
|
+
_width: 24,
|
|
604
|
+
_height: 5,
|
|
605
|
+
config: this.config
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
initForm() {
|
|
609
|
+
return this.formBuilder.group({
|
|
610
|
+
datapoints: [this.config.datapoints || []],
|
|
611
|
+
alarms: [this.alarms || []],
|
|
612
|
+
events: [this.events || []],
|
|
613
|
+
dateFrom: [this.config.dateFrom || null],
|
|
614
|
+
dateTo: [this.config.dateFrom || null],
|
|
615
|
+
interval: [this.config.interval || 'hours'],
|
|
616
|
+
aggregation: [this.config.aggregation || null],
|
|
617
|
+
realtime: [this.config.realtime || false],
|
|
618
|
+
displayMarkedLine: [true, []],
|
|
619
|
+
displayMarkedPoint: [true, []],
|
|
620
|
+
mergeMatchingDatapoints: [true, []],
|
|
621
|
+
showLabelAndUnit: [true, []],
|
|
622
|
+
showSlider: [true, []],
|
|
623
|
+
displayDateSelection: [false, []],
|
|
624
|
+
yAxisSplitLines: [false],
|
|
625
|
+
xAxisSplitLines: [false]
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DatapointExplorerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
629
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: DatapointExplorerComponent, isStandalone: true, selector: "c8y-datapoint-explorer", providers: [ChartEventsService, ChartAlarmsService], viewQueries: [{ propertyName: "chart", first: true, predicate: ["chart"], descendants: true }], ngImport: i0, template: "<c8y-title>{{ 'Data explorer' | translate }}</c8y-title>\n\n<c8y-time-context\n (contextChange)=\"onTimeContextChange($event)\"\n [changedDateContext]=\"timeProps\"\n></c8y-time-context>\n\n<c8y-action-bar-item [placement]=\"'left'\">\n <c8y-workspace-config\n [updatedConfig]=\"config\"\n (onConfigurationChange)=\"onConfigurationChange($event)\"\n ></c8y-workspace-config>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item placement=\"right\">\n <c8y-datapoints-export-selector [exportConfig]=\"exportConfig\"></c8y-datapoints-export-selector>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n>\n <button\n title=\"{{ 'Send as widget to report' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"sendAsWidgetToReport()\"\n [disabled]=\"config?.datapoints?.length === 0 || !canAddReport\"\n >\n <i c8yIcon=\"c8y-reports\"></i>\n <span>{{ 'Send as widget to report' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n>\n <button\n title=\"{{ 'Create a new report with widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"createNewReportWithWidget()\"\n [disabled]=\"config?.datapoints?.length === 0 || !canAddReport\"\n >\n <i c8yIcon=\"c8y-reports\"></i>\n <span>{{ 'Create a new report with widget' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"content-fullpage d-grid grid_col--auto-360 gap-24\">\n <div class=\"d-col gap-16\">\n <c8y-charts\n class=\"flex-grow data-point-explorer\"\n #chart\n [config]=\"config\"\n [alerts]=\"alerts\"\n (updateAlarmsAndEvents)=\"updateAlarmsAndEvents($event)\"\n (configChangeOnZoomOut)=\"onSliderZoom($event)\"\n (datapointOutOfSync)=\"handleDatapointOutOfSync($event)\"\n (timeRangeChangeOnRealtime)=\"updateTimeRangeOnRealtime($event)\"\n (isMarkedAreaEnabled)=\"isMarkedAreaEnabled = $event\"\n ></c8y-charts>\n <form\n class=\"m-l-48 m-r-48\"\n [formGroup]=\"formGroup\"\n >\n <div class=\"d-grid-md grid__col--4-4-4 gap-16\">\n <fieldset class=\"c8y-fieldset form-group-sm m-t-md-0 p-b-8\">\n <legend>{{ 'Axis' | translate }}</legend>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Y axis helper lines' | translate\"\n >\n <input\n name=\"yAxisSplitLines\"\n type=\"checkbox\"\n formControlName=\"yAxisSplitLines\"\n />\n <span></span>\n <span translate>Y-axis helper lines</span>\n </label>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'X axis helper lines' | translate\"\n >\n <input\n name=\"xAxisSplitLines\"\n type=\"checkbox\"\n formControlName=\"xAxisSplitLines\"\n />\n <span></span>\n <span translate>X-axis helper lines</span>\n </label>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Merge matching data points into single axis' | translate\"\n >\n <input\n name=\"mergeMatchingDatapoints\"\n type=\"checkbox\"\n formControlName=\"mergeMatchingDatapoints\"\n />\n <span></span>\n <span translate>Merge matching data points into single axis</span>\n </label>\n </fieldset>\n <fieldset class=\"c8y-fieldset form-group-sm m-t-md-0 p-b-8\">\n <legend>{{ 'Alarms & events' | translate }}</legend>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show vertical line when alarm occurs' | translate\"\n >\n <input\n name=\"displayMarkedLine\"\n type=\"checkbox\"\n formControlName=\"displayMarkedLine\"\n />\n <span></span>\n <span translate>Show vertical line on every occurrence</span>\n </label>\n\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show icon when alarm or event occurs' | translate\"\n >\n <input\n name=\"displayMarkedPoint\"\n type=\"checkbox\"\n formControlName=\"displayMarkedPoint\"\n />\n <span></span>\n <span>\n {{\n 'Show icon when triggered`When alarms and events occur the icon will be shown`'\n | translate\n }}\n </span>\n <button\n class=\"btn-dot m-l-8\"\n [attr.aria-label]=\"\n 'Some alarms or events have no matching data points. No icons will be shown for them.'\n | translate\n \"\n [tooltip]=\"\n 'Some alarms or events have no matching data points. No icons will be shown for them.'\n | translate\n \"\n container=\"body\"\n type=\"button\"\n *ngIf=\"alarmsOrEventsHaveNoMatchingDps\"\n (click)=\"$event.stopPropagation()\"\n [adaptivePosition]=\"false\"\n >\n <i\n class=\"text-info\"\n c8yIcon=\"info\"\n ></i>\n </button>\n </label>\n </fieldset>\n <fieldset class=\"c8y-fieldset form-group-sm m-t-md-0 p-b-8\">\n <legend>{{ 'Chart' | translate }}</legend>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show labels and units' | translate\"\n >\n <input\n name=\"showLabelAndUnit\"\n type=\"checkbox\"\n formControlName=\"showLabelAndUnit\"\n />\n <span></span>\n <span translate>Display labels and units on Y-axis</span>\n </label>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show slider' | translate\"\n >\n <input\n name=\"showSlider\"\n type=\"checkbox\"\n formControlName=\"showSlider\"\n />\n <span></span>\n <span translate>Show slider</span>\n </label>\n </fieldset>\n </div>\n </form>\n </div>\n <div class=\"card inner-scroll bg-level-1\">\n <form\n class=\"bg-inherit\"\n [formGroup]=\"formGroup\"\n >\n <c8y-datapoint-selection-list\n class=\"bg-inherit separator-top d-block\"\n name=\"datapoints\"\n [minActiveCount]=\"0\"\n [defaultFormOptions]=\"datapointSelectDefaultFormOptions\"\n [config]=\"{ contextAsset: contextAsset }\"\n formControlName=\"datapoints\"\n [allowDragAndDrop]=\"true\"\n ></c8y-datapoint-selection-list>\n\n <c8y-alarm-event-selection-list\n class=\"bg-inherit\"\n name=\"alarms\"\n formControlName=\"alarms\"\n [timelineType]=\"'ALARM'\"\n [datapoints]=\"config.datapoints\"\n ></c8y-alarm-event-selection-list>\n\n <c8y-alarm-event-selection-list\n class=\"bg-inherit\"\n name=\"events\"\n formControlName=\"events\"\n [timelineType]=\"'EVENT'\"\n [datapoints]=\"config.datapoints\"\n ></c8y-alarm-event-selection-list>\n </form>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: DatapointSelectorModule }, { kind: "component", type: i4$1.DatapointSelectionListComponent, selector: "c8y-datapoint-selection-list", inputs: ["actions", "allowDragAndDrop", "config", "defaultFormOptions", "maxActiveCount", "minActiveCount", "resolveContext", "listTitle"], outputs: ["isValid", "change"] }, { kind: "ngmodule", type: AlarmEventSelectorModule }, { kind: "component", type: i5$1.AlarmEventSelectionListComponent, selector: "c8y-alarm-event-selection-list", inputs: ["timelineType", "canRemove", "canEdit", "canDragAndDrop", "title", "addButtonLabel", "hideSource", "inline", "activeToggleAsSwitch", "omitProperties", "datapoints", "config"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i6.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: "ngmodule", type: PopoverModule }, { kind: "component", type: TimeContextComponent, selector: "c8y-time-context", inputs: ["changedDateContext", "controlsAvailable", "context"], outputs: ["contextChange"] }, { kind: "component", type: ChartsComponent, selector: "c8y-charts", inputs: ["config", "alerts"], outputs: ["configChangeOnZoomOut", "timeRangeChangeOnRealtime", "datapointOutOfSync", "updateAlarmsAndEvents", "isMarkedAreaEnabled"] }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "ngmodule", type: FormsModule$1 }, { kind: "ngmodule", type: A11yModule }, { kind: "component", type: DatapointsExportSelectorComponent, selector: "c8y-datapoints-export-selector", inputs: ["exportConfig"], outputs: ["isOpen"] }, { kind: "component", type: WorkspaceConfigComponent, selector: "c8y-workspace-config", inputs: ["updatedConfig"], outputs: ["onConfigurationChange"] }] }); }
|
|
630
|
+
}
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DatapointExplorerComponent, decorators: [{
|
|
632
|
+
type: Component,
|
|
633
|
+
args: [{ selector: 'c8y-datapoint-explorer', standalone: true, imports: [
|
|
634
|
+
CoreModule,
|
|
635
|
+
CommonModule,
|
|
636
|
+
DatapointSelectorModule,
|
|
637
|
+
AlarmEventSelectorModule,
|
|
638
|
+
TooltipModule,
|
|
639
|
+
PopoverModule,
|
|
640
|
+
TimeContextComponent,
|
|
641
|
+
ChartsComponent,
|
|
642
|
+
BsDropdownModule,
|
|
643
|
+
FormsModule$1,
|
|
644
|
+
A11yModule,
|
|
645
|
+
DatapointsExportSelectorComponent,
|
|
646
|
+
WorkspaceConfigComponent
|
|
647
|
+
], providers: [ChartEventsService, ChartAlarmsService], template: "<c8y-title>{{ 'Data explorer' | translate }}</c8y-title>\n\n<c8y-time-context\n (contextChange)=\"onTimeContextChange($event)\"\n [changedDateContext]=\"timeProps\"\n></c8y-time-context>\n\n<c8y-action-bar-item [placement]=\"'left'\">\n <c8y-workspace-config\n [updatedConfig]=\"config\"\n (onConfigurationChange)=\"onConfigurationChange($event)\"\n ></c8y-workspace-config>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item placement=\"right\">\n <c8y-datapoints-export-selector [exportConfig]=\"exportConfig\"></c8y-datapoints-export-selector>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n>\n <button\n title=\"{{ 'Send as widget to report' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"sendAsWidgetToReport()\"\n [disabled]=\"config?.datapoints?.length === 0 || !canAddReport\"\n >\n <i c8yIcon=\"c8y-reports\"></i>\n <span>{{ 'Send as widget to report' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n>\n <button\n title=\"{{ 'Create a new report with widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"createNewReportWithWidget()\"\n [disabled]=\"config?.datapoints?.length === 0 || !canAddReport\"\n >\n <i c8yIcon=\"c8y-reports\"></i>\n <span>{{ 'Create a new report with widget' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"content-fullpage d-grid grid_col--auto-360 gap-24\">\n <div class=\"d-col gap-16\">\n <c8y-charts\n class=\"flex-grow data-point-explorer\"\n #chart\n [config]=\"config\"\n [alerts]=\"alerts\"\n (updateAlarmsAndEvents)=\"updateAlarmsAndEvents($event)\"\n (configChangeOnZoomOut)=\"onSliderZoom($event)\"\n (datapointOutOfSync)=\"handleDatapointOutOfSync($event)\"\n (timeRangeChangeOnRealtime)=\"updateTimeRangeOnRealtime($event)\"\n (isMarkedAreaEnabled)=\"isMarkedAreaEnabled = $event\"\n ></c8y-charts>\n <form\n class=\"m-l-48 m-r-48\"\n [formGroup]=\"formGroup\"\n >\n <div class=\"d-grid-md grid__col--4-4-4 gap-16\">\n <fieldset class=\"c8y-fieldset form-group-sm m-t-md-0 p-b-8\">\n <legend>{{ 'Axis' | translate }}</legend>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Y axis helper lines' | translate\"\n >\n <input\n name=\"yAxisSplitLines\"\n type=\"checkbox\"\n formControlName=\"yAxisSplitLines\"\n />\n <span></span>\n <span translate>Y-axis helper lines</span>\n </label>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'X axis helper lines' | translate\"\n >\n <input\n name=\"xAxisSplitLines\"\n type=\"checkbox\"\n formControlName=\"xAxisSplitLines\"\n />\n <span></span>\n <span translate>X-axis helper lines</span>\n </label>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Merge matching data points into single axis' | translate\"\n >\n <input\n name=\"mergeMatchingDatapoints\"\n type=\"checkbox\"\n formControlName=\"mergeMatchingDatapoints\"\n />\n <span></span>\n <span translate>Merge matching data points into single axis</span>\n </label>\n </fieldset>\n <fieldset class=\"c8y-fieldset form-group-sm m-t-md-0 p-b-8\">\n <legend>{{ 'Alarms & events' | translate }}</legend>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show vertical line when alarm occurs' | translate\"\n >\n <input\n name=\"displayMarkedLine\"\n type=\"checkbox\"\n formControlName=\"displayMarkedLine\"\n />\n <span></span>\n <span translate>Show vertical line on every occurrence</span>\n </label>\n\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show icon when alarm or event occurs' | translate\"\n >\n <input\n name=\"displayMarkedPoint\"\n type=\"checkbox\"\n formControlName=\"displayMarkedPoint\"\n />\n <span></span>\n <span>\n {{\n 'Show icon when triggered`When alarms and events occur the icon will be shown`'\n | translate\n }}\n </span>\n <button\n class=\"btn-dot m-l-8\"\n [attr.aria-label]=\"\n 'Some alarms or events have no matching data points. No icons will be shown for them.'\n | translate\n \"\n [tooltip]=\"\n 'Some alarms or events have no matching data points. No icons will be shown for them.'\n | translate\n \"\n container=\"body\"\n type=\"button\"\n *ngIf=\"alarmsOrEventsHaveNoMatchingDps\"\n (click)=\"$event.stopPropagation()\"\n [adaptivePosition]=\"false\"\n >\n <i\n class=\"text-info\"\n c8yIcon=\"info\"\n ></i>\n </button>\n </label>\n </fieldset>\n <fieldset class=\"c8y-fieldset form-group-sm m-t-md-0 p-b-8\">\n <legend>{{ 'Chart' | translate }}</legend>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show labels and units' | translate\"\n >\n <input\n name=\"showLabelAndUnit\"\n type=\"checkbox\"\n formControlName=\"showLabelAndUnit\"\n />\n <span></span>\n <span translate>Display labels and units on Y-axis</span>\n </label>\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show slider' | translate\"\n >\n <input\n name=\"showSlider\"\n type=\"checkbox\"\n formControlName=\"showSlider\"\n />\n <span></span>\n <span translate>Show slider</span>\n </label>\n </fieldset>\n </div>\n </form>\n </div>\n <div class=\"card inner-scroll bg-level-1\">\n <form\n class=\"bg-inherit\"\n [formGroup]=\"formGroup\"\n >\n <c8y-datapoint-selection-list\n class=\"bg-inherit separator-top d-block\"\n name=\"datapoints\"\n [minActiveCount]=\"0\"\n [defaultFormOptions]=\"datapointSelectDefaultFormOptions\"\n [config]=\"{ contextAsset: contextAsset }\"\n formControlName=\"datapoints\"\n [allowDragAndDrop]=\"true\"\n ></c8y-datapoint-selection-list>\n\n <c8y-alarm-event-selection-list\n class=\"bg-inherit\"\n name=\"alarms\"\n formControlName=\"alarms\"\n [timelineType]=\"'ALARM'\"\n [datapoints]=\"config.datapoints\"\n ></c8y-alarm-event-selection-list>\n\n <c8y-alarm-event-selection-list\n class=\"bg-inherit\"\n name=\"events\"\n formControlName=\"events\"\n [timelineType]=\"'EVENT'\"\n [datapoints]=\"config.datapoints\"\n ></c8y-alarm-event-selection-list>\n </form>\n </div>\n</div>\n" }]
|
|
648
|
+
}], ctorParameters: () => [], propDecorators: { chart: [{
|
|
649
|
+
type: ViewChild,
|
|
650
|
+
args: ['chart']
|
|
651
|
+
}] } });
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Generated bundle index. Do not edit.
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
export { DatapointExplorerComponent };
|
|
658
|
+
//# sourceMappingURL=c8y-ngx-components-datapoint-explorer-view.mjs.map
|