@c8y/ngx-components 1021.49.12 → 1021.51.1
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/core/aggregation/aggregation.model.d.ts.map +1 -0
- package/core/aggregation/aggregation.service.d.ts +44 -0
- package/core/aggregation/aggregation.service.d.ts.map +1 -0
- package/core/aggregation/index.d.ts +3 -0
- package/core/aggregation/index.d.ts.map +1 -0
- package/core/common/index.d.ts +0 -2
- package/core/common/index.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts +2 -2
- package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.d.ts +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
- package/core/i18n/pattern-messages.data.d.ts +18 -0
- package/core/i18n/pattern-messages.data.d.ts.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts +54 -42
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.d.ts +28 -8
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.d.ts +3 -52
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector.model.d.ts +5 -14
- package/datapoints-export-selector/datapoints-export-selector.model.d.ts.map +1 -1
- package/device-grid/device-grid.component.d.ts.map +1 -1
- package/device-grid/device-grid.service.d.ts +2 -0
- package/device-grid/device-grid.service.d.ts.map +1 -1
- package/esm2022/alarms/alarms-type-filter.component.mjs +3 -3
- package/esm2022/core/aggregation/aggregation.model.mjs +46 -0
- package/esm2022/core/aggregation/aggregation.service.mjs +76 -0
- package/esm2022/core/aggregation/index.mjs +3 -0
- package/esm2022/core/common/index.mjs +1 -3
- package/esm2022/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.mjs +2 -2
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.mjs +2 -2
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +4 -4
- package/esm2022/core/i18n/pattern-messages.data.mjs +19 -1
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.mjs +166 -164
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.mjs +82 -48
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.mjs +5 -95
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component.mjs +3 -3
- package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +3 -3
- package/esm2022/datapoints-export-selector/datapoints-export-selector.model.mjs +1 -9
- package/esm2022/device-grid/device-grid.component.mjs +3 -3
- package/esm2022/device-grid/device-grid.service.mjs +16 -1
- package/esm2022/device-list/add-smart-group.component.mjs +3 -3
- package/esm2022/interval-picker/interval-picker.model.mjs +5 -1
- package/esm2022/operations/bulk-operation-list-item/bulk-operation-list-item.service.mjs +5 -4
- package/esm2022/operations/operation-details/operation-details.module.mjs +7 -7
- package/esm2022/operations/operations-list/device-control.feature.mjs +20 -0
- package/esm2022/operations/operations-list/index.mjs +4 -3
- package/esm2022/operations/operations-list/operations-list-item.component.mjs +11 -9
- package/esm2022/operations/operations-list/operations-list.component.mjs +15 -10
- package/esm2022/operations/operations-list/operations-list.module.mjs +16 -41
- package/esm2022/operations/operations-list/operations-list.service.mjs +4 -3
- package/esm2022/operations/operations.module.mjs +21 -14
- package/esm2022/operations/shared/operations.service.mjs +4 -3
- package/esm2022/services/index.mjs +14 -3
- package/esm2022/services/service-command-tab/c8y-ngx-components-services-service-command-tab.mjs +5 -0
- package/esm2022/services/service-command-tab/index.mjs +3 -0
- package/esm2022/services/service-command-tab/service-command-tab.component.mjs +33 -0
- package/esm2022/services/service-command-tab/service-command.feature.mjs +14 -0
- package/esm2022/services/services-device-tab/index.mjs +9 -3
- package/esm2022/services/services-device-tab/services-device-tab.component.mjs +3 -4
- package/esm2022/services/services-device-tab/services-device-tab.guard.mjs +2 -2
- package/esm2022/services/services-device-tab/services.breadcrumb-factory.mjs +13 -1
- package/esm2022/services/services.module.mjs +4 -2
- package/esm2022/services/shared/c8y-ngx-components-services-shared.mjs +5 -0
- package/esm2022/services/shared/index.mjs +3 -0
- package/esm2022/services/shared/service-command.service.mjs +118 -0
- package/esm2022/services/shared/services.model.mjs +23 -0
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.mjs +25 -41
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.mjs +3 -3
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.mjs +55 -49
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.mjs +25 -73
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-widget.model.mjs +20 -20
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table.service.mjs +19 -19
- package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +248 -308
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-grid.mjs +17 -2
- package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-interval-picker.mjs +5 -1
- package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs +3 -2
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-operation-details.mjs +5 -5
- package/fesm2022/c8y-ngx-components-operations-operation-details.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-operations-list.mjs +57 -52
- package/fesm2022/c8y-ngx-components-operations-operations-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-shared.mjs +3 -2
- package/fesm2022/c8y-ngx-components-operations-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations.mjs +42 -35
- package/fesm2022/c8y-ngx-components-operations.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-services-service-command-tab.mjs +49 -0
- package/fesm2022/c8y-ngx-components-services-service-command-tab.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-services-shared.mjs +145 -0
- package/fesm2022/c8y-ngx-components-services-shared.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-services.mjs +20 -113
- package/fesm2022/c8y-ngx-components-services.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +1075 -1253
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +136 -76
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/interval-picker/interval-picker.model.d.ts +6 -0
- package/interval-picker/interval-picker.model.d.ts.map +1 -1
- package/locales/de.po +52 -41
- package/locales/es.po +52 -41
- package/locales/fr.po +51 -40
- package/locales/ja_JP.po +53 -43
- package/locales/ko.po +51 -34
- package/locales/locales.pot +42 -31
- package/locales/nl.po +52 -41
- package/locales/pl.po +52 -40
- package/locales/pt_BR.po +51 -40
- package/locales/zh_CN.po +50 -33
- package/locales/zh_TW.po +50 -33
- package/operations/bulk-operation-list-item/bulk-operation-list-item.service.d.ts +2 -2
- package/operations/bulk-operation-list-item/bulk-operation-list-item.service.d.ts.map +1 -1
- package/operations/operation-details/operation-details.module.d.ts +1 -1
- package/operations/operations-list/device-control.feature.d.ts +4 -0
- package/operations/operations-list/device-control.feature.d.ts.map +1 -0
- package/operations/operations-list/index.d.ts +3 -2
- package/operations/operations-list/index.d.ts.map +1 -1
- package/operations/operations-list/operations-list-item.component.d.ts +1 -1
- package/operations/operations-list/operations-list-item.component.d.ts.map +1 -1
- package/operations/operations-list/operations-list.component.d.ts +3 -1
- package/operations/operations-list/operations-list.component.d.ts.map +1 -1
- package/operations/operations-list/operations-list.module.d.ts +3 -9
- package/operations/operations-list/operations-list.module.d.ts.map +1 -1
- package/operations/operations.module.d.ts +1 -2
- package/operations/operations.module.d.ts.map +1 -1
- package/package.json +1 -1
- package/services/index.d.ts +13 -2
- package/services/index.d.ts.map +1 -1
- package/services/service-command-tab/c8y-ngx-components-services-service-command-tab.d.ts.map +1 -0
- package/services/service-command-tab/index.d.ts +3 -0
- package/services/service-command-tab/index.d.ts.map +1 -0
- package/services/service-command-tab/service-command-tab.component.d.ts +12 -0
- package/services/service-command-tab/service-command-tab.component.d.ts.map +1 -0
- package/services/service-command-tab/service-command.feature.d.ts +3 -0
- package/services/service-command-tab/service-command.feature.d.ts.map +1 -0
- package/services/services-device-tab/index.d.ts +8 -2
- package/services/services-device-tab/index.d.ts.map +1 -1
- package/services/services-device-tab/services-device-tab.component.d.ts +2 -2
- package/services/services-device-tab/services-device-tab.component.d.ts.map +1 -1
- package/services/services-device-tab/services.breadcrumb-factory.d.ts.map +1 -1
- package/services/services.module.d.ts.map +1 -1
- package/services/shared/c8y-ngx-components-services-shared.d.ts.map +1 -0
- package/services/shared/index.d.ts +3 -0
- package/services/shared/index.d.ts.map +1 -0
- package/services/{services-device-tab → shared}/service-command.service.d.ts +10 -7
- package/services/shared/service-command.service.d.ts.map +1 -0
- package/services/shared/services.model.d.ts +31 -0
- package/services/shared/services.model.d.ts.map +1 -0
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts +3 -5
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts +7 -2
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.d.ts +7 -27
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts +4 -3
- package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table.service.d.ts +5 -5
- package/widgets/implementations/datapoints-table/datapoints-table.service.d.ts.map +1 -1
- package/core/common/aggregation/aggregation.model.d.ts.map +0 -1
- package/core/common/aggregation/aggregation.service.d.ts +0 -17
- package/core/common/aggregation/aggregation.service.d.ts.map +0 -1
- package/esm2022/core/common/aggregation/aggregation.model.mjs +0 -46
- package/esm2022/core/common/aggregation/aggregation.service.mjs +0 -34
- package/esm2022/services/services-device-tab/service-command.service.mjs +0 -113
- package/esm2022/services/services-device-tab/service-device-tab.model.mjs +0 -2
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.mjs +0 -124
- package/services/services-device-tab/service-command.service.d.ts.map +0 -1
- package/services/services-device-tab/service-device-tab.model.d.ts +0 -11
- package/services/services-device-tab/service-device-tab.model.d.ts.map +0 -1
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.d.ts +0 -56
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.d.ts.map +0 -1
- /package/core/{common/aggregation → aggregation}/aggregation.model.d.ts +0 -0
|
@@ -8,7 +8,7 @@ import { castArray, flatten, uniq, sortBy, groupBy, camelCase, isEqual, isUndefi
|
|
|
8
8
|
import { merge, of, defer, combineLatest, race, isObservable, from, Subject, BehaviorSubject, NEVER, Observable, firstValueFrom, map as map$1, distinctUntilChanged as distinctUntilChanged$1, fromEvent, pipe, throwError, concat, EMPTY, timer, fromEventPattern, startWith as startWith$1, switchMap as switchMap$1, takeUntil as takeUntil$1, empty, forkJoin, ReplaySubject, interval, shareReplay as shareReplay$1, mergeMap as mergeMap$1 } from 'rxjs';
|
|
9
9
|
import { map, distinctUntilChanged, filter, startWith, switchMap, take, shareReplay, scan, debounceTime, share, takeUntil, tap, catchError, first as first$1, retryWhen, delay, concatMap, debounce, sample, withLatestFrom, mergeMap, every as every$1, toArray, merge as merge$1, expand, skip, mapTo, finalize, reduce as reduce$1, combineLatestWith } from 'rxjs/operators';
|
|
10
10
|
import * as i1 from '@c8y/client';
|
|
11
|
-
import { ApplicationAvailability, OperationStatus, TenantLoginOptionType, UserManagementSource, GrantType, ApplicationType,
|
|
11
|
+
import { ApplicationAvailability, OperationStatus, TenantLoginOptionType, UserManagementSource, GrantType, ApplicationType, BearerAuthFromSessionStorage, FetchClient, Client, PasswordStrength, QueriesUtil, InventoryService, UserService, ApplicationService, TenantService, AlarmService, aggregationType, Service } from '@c8y/client';
|
|
12
12
|
import { __decorate, __metadata } from 'tslib';
|
|
13
13
|
import * as i1$3 from '@angular/router';
|
|
14
14
|
import { NavigationEnd, RouterModule as RouterModule$1, ActivationEnd, NavigationStart, PRIMARY_OUTLET, ActivatedRoute, ActivationStart, ChildActivationEnd, ROUTES, Router, NavigationCancel, NavigationError } from '@angular/router';
|
|
@@ -33,8 +33,6 @@ import { compare, coerce } from 'semver';
|
|
|
33
33
|
import saveAs$1, { saveAs } from 'file-saver';
|
|
34
34
|
import * as i1$2 from '@angular/platform-browser';
|
|
35
35
|
import { BlobReader, ZipReader, BlobWriter, ZipWriter } from '@zip.js/zip.js';
|
|
36
|
-
import * as i20 from '@c8y/ngx-components/interval-picker';
|
|
37
|
-
import { TimeSpanInMs, INTERVALS, INTERVAL_TITLES, IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';
|
|
38
36
|
import * as i1$7 from 'ngx-bootstrap/collapse';
|
|
39
37
|
import { CollapseModule } from 'ngx-bootstrap/collapse';
|
|
40
38
|
import * as i1$4 from 'ngx-bootstrap/modal';
|
|
@@ -63,6 +61,8 @@ import { TextFieldModule } from '@angular/cdk/text-field';
|
|
|
63
61
|
import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
|
|
64
62
|
import * as i5$2 from '@angular/cdk/drag-drop';
|
|
65
63
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
64
|
+
import * as i20 from '@c8y/ngx-components/interval-picker';
|
|
65
|
+
import { TimeSpanInMs, INTERVAL_VALUES, INTERVALS, INTERVAL_TITLES, IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';
|
|
66
66
|
import * as i9 from '@angular/cdk/table';
|
|
67
67
|
import { CdkTable, CdkHeaderCell, CdkTableModule } from '@angular/cdk/table';
|
|
68
68
|
import * as i19 from 'ngx-bootstrap/pagination';
|
|
@@ -2418,6 +2418,12 @@ const MESSAGES_CORE_I18N = {
|
|
|
2418
2418
|
id: '$1'
|
|
2419
2419
|
}
|
|
2420
2420
|
},
|
|
2421
|
+
'^RESTART (.+?)$': {
|
|
2422
|
+
gettext: gettext$1('RESTART`verb, action` {{service}}'),
|
|
2423
|
+
placeholders: {
|
|
2424
|
+
service: '$1'
|
|
2425
|
+
}
|
|
2426
|
+
},
|
|
2421
2427
|
'^Retrieve configuration snapshot from device (.+?)$': {
|
|
2422
2428
|
gettext: gettext$1('Retrieve configuration snapshot from device {{deviceName}}'),
|
|
2423
2429
|
placeholders: {
|
|
@@ -2533,9 +2539,21 @@ const MESSAGES_CORE_I18N = {
|
|
|
2533
2539
|
name: '$1'
|
|
2534
2540
|
}
|
|
2535
2541
|
},
|
|
2542
|
+
'^START (.+?)$': {
|
|
2543
|
+
gettext: gettext$1('START`verb, action` {{service}}'),
|
|
2544
|
+
placeholders: {
|
|
2545
|
+
service: '$1'
|
|
2546
|
+
}
|
|
2547
|
+
},
|
|
2536
2548
|
'^Started container$': {
|
|
2537
2549
|
gettext: gettext$1('Container started.')
|
|
2538
2550
|
},
|
|
2551
|
+
'^STOP (.+?)$': {
|
|
2552
|
+
gettext: gettext$1('STOP`verb, action` {{service}}'),
|
|
2553
|
+
placeholders: {
|
|
2554
|
+
service: '$1'
|
|
2555
|
+
}
|
|
2556
|
+
},
|
|
2539
2557
|
'^Successfully assigned (.+) to (.+)$': {
|
|
2540
2558
|
gettext: gettext$1('"{{imageName}}" assigned to "{{address}}".'),
|
|
2541
2559
|
placeholders: {
|
|
@@ -9073,79 +9091,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
9073
9091
|
args: [{ providedIn: 'root' }]
|
|
9074
9092
|
}] });
|
|
9075
9093
|
|
|
9076
|
-
const AGGREGATIONS = [
|
|
9077
|
-
{ id: null, title: gettext$1('None') },
|
|
9078
|
-
{ id: aggregationType.MINUTELY, title: gettext$1('Minutely') },
|
|
9079
|
-
{ id: aggregationType.HOURLY, title: gettext$1('Hourly') },
|
|
9080
|
-
{ id: aggregationType.DAILY, title: gettext$1('Daily') }
|
|
9081
|
-
];
|
|
9082
|
-
const AGGREGATION_LIMITS = {
|
|
9083
|
-
MINUTELY_LIMIT: TimeSpanInMs.MINUTE * 10,
|
|
9084
|
-
HOURLY_LIMIT: TimeSpanInMs.DAY * 1,
|
|
9085
|
-
DAILY_LIMIT: TimeSpanInMs.DAY * 4
|
|
9086
|
-
};
|
|
9087
|
-
const AGGREGATION_ICONS = {
|
|
9088
|
-
undefined: 'line-chart',
|
|
9089
|
-
MINUTELY: 'hourglass',
|
|
9090
|
-
HOURLY: 'clock-o',
|
|
9091
|
-
DAILY: 'calendar-o'
|
|
9092
|
-
};
|
|
9093
|
-
const AGGREGATION_TEXTS = {
|
|
9094
|
-
disabled: gettext$1('No aggregation with realtime enabled'),
|
|
9095
|
-
undefined: gettext$1('No aggregation'),
|
|
9096
|
-
MINUTELY: gettext$1('Minutely aggregation'),
|
|
9097
|
-
HOURLY: gettext$1('Hourly aggregation'),
|
|
9098
|
-
DAILY: gettext$1('Daily aggregation')
|
|
9099
|
-
};
|
|
9100
|
-
const AGGREGATION_VALUES = {
|
|
9101
|
-
none: 'NONE',
|
|
9102
|
-
minutely: aggregationType.MINUTELY,
|
|
9103
|
-
hourly: aggregationType.HOURLY,
|
|
9104
|
-
daily: aggregationType.DAILY
|
|
9105
|
-
};
|
|
9106
|
-
const AGGREGATION_VALUES_ARR = [
|
|
9107
|
-
AGGREGATION_VALUES.none,
|
|
9108
|
-
AGGREGATION_VALUES.minutely,
|
|
9109
|
-
AGGREGATION_VALUES.hourly,
|
|
9110
|
-
AGGREGATION_VALUES.daily
|
|
9111
|
-
];
|
|
9112
|
-
const AGGREGATION_LABELS = {
|
|
9113
|
-
NONE: AGGREGATIONS[0].title,
|
|
9114
|
-
[aggregationType.MINUTELY]: AGGREGATIONS[1].title,
|
|
9115
|
-
[aggregationType.HOURLY]: AGGREGATIONS[2].title,
|
|
9116
|
-
[aggregationType.DAILY]: AGGREGATIONS[3].title
|
|
9117
|
-
};
|
|
9118
|
-
|
|
9119
|
-
class AggregationService {
|
|
9120
|
-
/**
|
|
9121
|
-
* Determines which aggregation options should be disabled based on the time range between two dates.
|
|
9122
|
-
* It calculates the time difference and checks against predefined time spans to decide if daily,
|
|
9123
|
-
* hourly, or minutely aggregations should be disabled.
|
|
9124
|
-
*
|
|
9125
|
-
* @param dateFrom - The start date of the time range, as a `Date` object or an ISO date string.
|
|
9126
|
-
* @param dateTo - The end date of the time range, as a `Date` object or an ISO date string.
|
|
9127
|
-
* @returns An `AggregationOptionStatus` object indicating the disabled state of each aggregation option.
|
|
9128
|
-
*/
|
|
9129
|
-
getDisabledAggregationOptions(dateFrom, dateTo) {
|
|
9130
|
-
const fromDate = typeof dateFrom === 'string' ? new Date(dateFrom) : dateFrom;
|
|
9131
|
-
const toDate = typeof dateTo === 'string' ? new Date(dateTo) : dateTo;
|
|
9132
|
-
const timeRangeInMs = toDate.valueOf() - fromDate.valueOf();
|
|
9133
|
-
const disabledAggregationOptions = {};
|
|
9134
|
-
disabledAggregationOptions[AGGREGATION_VALUES.daily] = timeRangeInMs <= TimeSpanInMs.DAY;
|
|
9135
|
-
disabledAggregationOptions[AGGREGATION_VALUES.hourly] = timeRangeInMs <= TimeSpanInMs.HOUR;
|
|
9136
|
-
disabledAggregationOptions[AGGREGATION_VALUES.minutely] = timeRangeInMs <= TimeSpanInMs.MINUTE;
|
|
9137
|
-
return disabledAggregationOptions;
|
|
9138
|
-
}
|
|
9139
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9140
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, providedIn: 'root' }); }
|
|
9141
|
-
}
|
|
9142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, decorators: [{
|
|
9143
|
-
type: Injectable,
|
|
9144
|
-
args: [{
|
|
9145
|
-
providedIn: 'root'
|
|
9146
|
-
}]
|
|
9147
|
-
}] });
|
|
9148
|
-
|
|
9149
9094
|
/**
|
|
9150
9095
|
* A service which allows to display alerts.
|
|
9151
9096
|
*/
|
|
@@ -28188,6 +28133,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
28188
28133
|
args: [{ selector: 'c8y-widget-auto-refresh-context-icon-bar', template: "<span class=\"m-l-auto d-flex\">\n <button\n class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n [attr.aria-label]=\"globalAutoRefreshTooltip | translate\"\n [tooltip]=\"globalAutoRefreshTooltip | translate\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"c8y-widget-auto-refresh-context-icon-bar--global-refresh-context-indicator\"\n >\n <span class=\"tag tag--info chip\">\n <i c8yIcon=\"refresh\"></i>\n {{ 'Auto refresh' | translate }}\n </span>\n </button>\n</span>\n" }]
|
|
28189
28134
|
}] });
|
|
28190
28135
|
|
|
28136
|
+
const AGGREGATIONS = [
|
|
28137
|
+
{ id: null, title: gettext$1('None') },
|
|
28138
|
+
{ id: aggregationType.MINUTELY, title: gettext$1('Minutely') },
|
|
28139
|
+
{ id: aggregationType.HOURLY, title: gettext$1('Hourly') },
|
|
28140
|
+
{ id: aggregationType.DAILY, title: gettext$1('Daily') }
|
|
28141
|
+
];
|
|
28142
|
+
const AGGREGATION_LIMITS = {
|
|
28143
|
+
MINUTELY_LIMIT: TimeSpanInMs.MINUTE * 10,
|
|
28144
|
+
HOURLY_LIMIT: TimeSpanInMs.DAY * 1,
|
|
28145
|
+
DAILY_LIMIT: TimeSpanInMs.DAY * 4
|
|
28146
|
+
};
|
|
28147
|
+
const AGGREGATION_ICONS = {
|
|
28148
|
+
undefined: 'line-chart',
|
|
28149
|
+
MINUTELY: 'hourglass',
|
|
28150
|
+
HOURLY: 'clock-o',
|
|
28151
|
+
DAILY: 'calendar-o'
|
|
28152
|
+
};
|
|
28153
|
+
const AGGREGATION_TEXTS = {
|
|
28154
|
+
disabled: gettext$1('No aggregation with realtime enabled'),
|
|
28155
|
+
undefined: gettext$1('No aggregation'),
|
|
28156
|
+
MINUTELY: gettext$1('Minutely aggregation'),
|
|
28157
|
+
HOURLY: gettext$1('Hourly aggregation'),
|
|
28158
|
+
DAILY: gettext$1('Daily aggregation')
|
|
28159
|
+
};
|
|
28160
|
+
const AGGREGATION_VALUES = {
|
|
28161
|
+
none: 'NONE',
|
|
28162
|
+
minutely: aggregationType.MINUTELY,
|
|
28163
|
+
hourly: aggregationType.HOURLY,
|
|
28164
|
+
daily: aggregationType.DAILY
|
|
28165
|
+
};
|
|
28166
|
+
const AGGREGATION_VALUES_ARR = [
|
|
28167
|
+
AGGREGATION_VALUES.none,
|
|
28168
|
+
AGGREGATION_VALUES.minutely,
|
|
28169
|
+
AGGREGATION_VALUES.hourly,
|
|
28170
|
+
AGGREGATION_VALUES.daily
|
|
28171
|
+
];
|
|
28172
|
+
const AGGREGATION_LABELS = {
|
|
28173
|
+
NONE: AGGREGATIONS[0].title,
|
|
28174
|
+
[aggregationType.MINUTELY]: AGGREGATIONS[1].title,
|
|
28175
|
+
[aggregationType.HOURLY]: AGGREGATIONS[2].title,
|
|
28176
|
+
[aggregationType.DAILY]: AGGREGATIONS[3].title
|
|
28177
|
+
};
|
|
28178
|
+
|
|
28191
28179
|
class WidgetTimeContextIconBar {
|
|
28192
28180
|
constructor() {
|
|
28193
28181
|
this.AGGREGATION_ICONS = AGGREGATION_ICONS;
|
|
@@ -28493,6 +28481,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
28493
28481
|
args: ['attr.style']
|
|
28494
28482
|
}] } });
|
|
28495
28483
|
|
|
28484
|
+
class AggregationService {
|
|
28485
|
+
constructor() {
|
|
28486
|
+
this.AGGREGATION_MAP = {
|
|
28487
|
+
[INTERVAL_VALUES.minutes]: AGGREGATION_VALUES.none,
|
|
28488
|
+
[INTERVAL_VALUES.hours]: AGGREGATION_VALUES.minutely,
|
|
28489
|
+
[INTERVAL_VALUES.days]: AGGREGATION_VALUES.hourly
|
|
28490
|
+
};
|
|
28491
|
+
}
|
|
28492
|
+
/**
|
|
28493
|
+
* Determines which aggregation options should be disabled based on the time range between two dates.
|
|
28494
|
+
* It calculates the time difference and checks against predefined time spans to decide if daily,
|
|
28495
|
+
* hourly, or minutely aggregations should be disabled.
|
|
28496
|
+
*
|
|
28497
|
+
* @param dateFrom - The start date of the time range, as a `Date` object or an ISO date string.
|
|
28498
|
+
* @param dateTo - The end date of the time range, as a `Date` object or an ISO date string.
|
|
28499
|
+
* @returns An `AggregationOptionStatus` object indicating the disabled state of each aggregation option.
|
|
28500
|
+
*/
|
|
28501
|
+
getDisabledAggregationOptions(dateFrom, dateTo) {
|
|
28502
|
+
const fromDate = typeof dateFrom === 'string' ? new Date(dateFrom) : dateFrom;
|
|
28503
|
+
const toDate = typeof dateTo === 'string' ? new Date(dateTo) : dateTo;
|
|
28504
|
+
const timeRangeInMs = toDate.valueOf() - fromDate.valueOf();
|
|
28505
|
+
const disabledAggregationOptions = {};
|
|
28506
|
+
disabledAggregationOptions[AGGREGATION_VALUES.daily] = timeRangeInMs <= TimeSpanInMs.DAY;
|
|
28507
|
+
disabledAggregationOptions[AGGREGATION_VALUES.hourly] = timeRangeInMs <= TimeSpanInMs.HOUR;
|
|
28508
|
+
disabledAggregationOptions[AGGREGATION_VALUES.minutely] = timeRangeInMs <= TimeSpanInMs.MINUTE;
|
|
28509
|
+
return disabledAggregationOptions;
|
|
28510
|
+
}
|
|
28511
|
+
/**
|
|
28512
|
+
* Determines the new aggregation value based on the current value and disabled options.
|
|
28513
|
+
*
|
|
28514
|
+
* Goal is to switch to the next available aggregation option if the current one is disabled.
|
|
28515
|
+
* - If the current option is disabled, sets the control to the first available (non-disabled) option based on the following order:
|
|
28516
|
+
* - If the current value is `DAILY`, it switches to `HOURLY` if it's not disabled, otherwise to `MINUTELY` if `HOURLY` is also disabled.
|
|
28517
|
+
* - If the current value is `HOURLY`, it switches to `MINUTELY` if it's not disabled.
|
|
28518
|
+
* - If all options are disabled, it sets the value to `NONE`.
|
|
28519
|
+
*
|
|
28520
|
+
* @param currentValue - The current aggregation option.
|
|
28521
|
+
* @param disabledOptions - An object containing disabled options.
|
|
28522
|
+
* @returns The new aggregation option.
|
|
28523
|
+
*/
|
|
28524
|
+
determineFirstNewAvailableAggregationValue(currentValue, disabledOptions) {
|
|
28525
|
+
const { daily, hourly, minutely, none } = AGGREGATION_VALUES;
|
|
28526
|
+
if (!disabledOptions[currentValue]) {
|
|
28527
|
+
return currentValue; // Return the current value if it's not disabled
|
|
28528
|
+
}
|
|
28529
|
+
if (currentValue === daily) {
|
|
28530
|
+
return !disabledOptions[hourly] ? hourly : !disabledOptions[minutely] ? minutely : none;
|
|
28531
|
+
}
|
|
28532
|
+
if (currentValue === hourly) {
|
|
28533
|
+
return !disabledOptions[minutely] ? minutely : none;
|
|
28534
|
+
}
|
|
28535
|
+
return none; // Fallback to 'none' if all else fails
|
|
28536
|
+
}
|
|
28537
|
+
/**
|
|
28538
|
+
* Determines the aggregation value based on the provided interval.
|
|
28539
|
+
*
|
|
28540
|
+
* @param interval - The time range interval.
|
|
28541
|
+
* @returns The corresponding aggregation value.
|
|
28542
|
+
*/
|
|
28543
|
+
determineAggregationValue(interval) {
|
|
28544
|
+
return this.AGGREGATION_MAP[interval] || AGGREGATION_VALUES.daily;
|
|
28545
|
+
}
|
|
28546
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
28547
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, providedIn: 'root' }); }
|
|
28548
|
+
}
|
|
28549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: AggregationService, decorators: [{
|
|
28550
|
+
type: Injectable,
|
|
28551
|
+
args: [{
|
|
28552
|
+
providedIn: 'root'
|
|
28553
|
+
}]
|
|
28554
|
+
}] });
|
|
28555
|
+
|
|
28496
28556
|
/**
|
|
28497
28557
|
* A service which can be used, to emit data on a dashboard level.
|
|
28498
28558
|
* Each Widget Dashboard gets an own instance of this service provided
|