@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.
Files changed (183) hide show
  1. package/core/aggregation/aggregation.model.d.ts.map +1 -0
  2. package/core/aggregation/aggregation.service.d.ts +44 -0
  3. package/core/aggregation/aggregation.service.d.ts.map +1 -0
  4. package/core/aggregation/index.d.ts +3 -0
  5. package/core/aggregation/index.d.ts.map +1 -0
  6. package/core/common/index.d.ts +0 -2
  7. package/core/common/index.d.ts.map +1 -1
  8. package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts +2 -2
  9. package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts.map +1 -1
  10. package/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.d.ts +1 -1
  11. package/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.d.ts.map +1 -1
  12. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +1 -1
  13. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
  14. package/core/i18n/pattern-messages.data.d.ts +18 -0
  15. package/core/i18n/pattern-messages.data.d.ts.map +1 -1
  16. package/core/index.d.ts +1 -0
  17. package/core/index.d.ts.map +1 -1
  18. package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts +54 -42
  19. package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts.map +1 -1
  20. package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.d.ts +28 -8
  21. package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.d.ts.map +1 -1
  22. package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.d.ts +3 -52
  23. package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.d.ts.map +1 -1
  24. package/datapoints-export-selector/datapoints-export-selector.model.d.ts +5 -14
  25. package/datapoints-export-selector/datapoints-export-selector.model.d.ts.map +1 -1
  26. package/device-grid/device-grid.component.d.ts.map +1 -1
  27. package/device-grid/device-grid.service.d.ts +2 -0
  28. package/device-grid/device-grid.service.d.ts.map +1 -1
  29. package/esm2022/alarms/alarms-type-filter.component.mjs +3 -3
  30. package/esm2022/core/aggregation/aggregation.model.mjs +46 -0
  31. package/esm2022/core/aggregation/aggregation.service.mjs +76 -0
  32. package/esm2022/core/aggregation/index.mjs +3 -0
  33. package/esm2022/core/common/index.mjs +1 -3
  34. package/esm2022/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.mjs +2 -2
  35. package/esm2022/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.mjs +2 -2
  36. package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +4 -4
  37. package/esm2022/core/i18n/pattern-messages.data.mjs +19 -1
  38. package/esm2022/core/index.mjs +2 -1
  39. package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.mjs +166 -164
  40. package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.mjs +82 -48
  41. package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.mjs +5 -95
  42. 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
  43. package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +3 -3
  44. package/esm2022/datapoints-export-selector/datapoints-export-selector.model.mjs +1 -9
  45. package/esm2022/device-grid/device-grid.component.mjs +3 -3
  46. package/esm2022/device-grid/device-grid.service.mjs +16 -1
  47. package/esm2022/device-list/add-smart-group.component.mjs +3 -3
  48. package/esm2022/interval-picker/interval-picker.model.mjs +5 -1
  49. package/esm2022/operations/bulk-operation-list-item/bulk-operation-list-item.service.mjs +5 -4
  50. package/esm2022/operations/operation-details/operation-details.module.mjs +7 -7
  51. package/esm2022/operations/operations-list/device-control.feature.mjs +20 -0
  52. package/esm2022/operations/operations-list/index.mjs +4 -3
  53. package/esm2022/operations/operations-list/operations-list-item.component.mjs +11 -9
  54. package/esm2022/operations/operations-list/operations-list.component.mjs +15 -10
  55. package/esm2022/operations/operations-list/operations-list.module.mjs +16 -41
  56. package/esm2022/operations/operations-list/operations-list.service.mjs +4 -3
  57. package/esm2022/operations/operations.module.mjs +21 -14
  58. package/esm2022/operations/shared/operations.service.mjs +4 -3
  59. package/esm2022/services/index.mjs +14 -3
  60. package/esm2022/services/service-command-tab/c8y-ngx-components-services-service-command-tab.mjs +5 -0
  61. package/esm2022/services/service-command-tab/index.mjs +3 -0
  62. package/esm2022/services/service-command-tab/service-command-tab.component.mjs +33 -0
  63. package/esm2022/services/service-command-tab/service-command.feature.mjs +14 -0
  64. package/esm2022/services/services-device-tab/index.mjs +9 -3
  65. package/esm2022/services/services-device-tab/services-device-tab.component.mjs +3 -4
  66. package/esm2022/services/services-device-tab/services-device-tab.guard.mjs +2 -2
  67. package/esm2022/services/services-device-tab/services.breadcrumb-factory.mjs +13 -1
  68. package/esm2022/services/services.module.mjs +4 -2
  69. package/esm2022/services/shared/c8y-ngx-components-services-shared.mjs +5 -0
  70. package/esm2022/services/shared/index.mjs +3 -0
  71. package/esm2022/services/shared/service-command.service.mjs +118 -0
  72. package/esm2022/services/shared/services.model.mjs +23 -0
  73. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.mjs +25 -41
  74. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.mjs +3 -3
  75. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.mjs +55 -49
  76. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.mjs +25 -73
  77. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-widget.model.mjs +20 -20
  78. package/esm2022/widgets/implementations/datapoints-table/datapoints-table.service.mjs +19 -19
  79. package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
  80. package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
  81. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +248 -308
  82. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  83. package/fesm2022/c8y-ngx-components-device-grid.mjs +17 -2
  84. package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
  85. package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
  86. package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
  87. package/fesm2022/c8y-ngx-components-interval-picker.mjs +5 -1
  88. package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
  89. package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs +3 -2
  90. package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs.map +1 -1
  91. package/fesm2022/c8y-ngx-components-operations-operation-details.mjs +5 -5
  92. package/fesm2022/c8y-ngx-components-operations-operation-details.mjs.map +1 -1
  93. package/fesm2022/c8y-ngx-components-operations-operations-list.mjs +57 -52
  94. package/fesm2022/c8y-ngx-components-operations-operations-list.mjs.map +1 -1
  95. package/fesm2022/c8y-ngx-components-operations-shared.mjs +3 -2
  96. package/fesm2022/c8y-ngx-components-operations-shared.mjs.map +1 -1
  97. package/fesm2022/c8y-ngx-components-operations.mjs +42 -35
  98. package/fesm2022/c8y-ngx-components-operations.mjs.map +1 -1
  99. package/fesm2022/c8y-ngx-components-services-service-command-tab.mjs +49 -0
  100. package/fesm2022/c8y-ngx-components-services-service-command-tab.mjs.map +1 -0
  101. package/fesm2022/c8y-ngx-components-services-shared.mjs +145 -0
  102. package/fesm2022/c8y-ngx-components-services-shared.mjs.map +1 -0
  103. package/fesm2022/c8y-ngx-components-services.mjs +20 -113
  104. package/fesm2022/c8y-ngx-components-services.mjs.map +1 -1
  105. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +1075 -1253
  106. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
  107. package/fesm2022/c8y-ngx-components.mjs +136 -76
  108. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  109. package/interval-picker/interval-picker.model.d.ts +6 -0
  110. package/interval-picker/interval-picker.model.d.ts.map +1 -1
  111. package/locales/de.po +52 -41
  112. package/locales/es.po +52 -41
  113. package/locales/fr.po +51 -40
  114. package/locales/ja_JP.po +53 -43
  115. package/locales/ko.po +51 -34
  116. package/locales/locales.pot +42 -31
  117. package/locales/nl.po +52 -41
  118. package/locales/pl.po +52 -40
  119. package/locales/pt_BR.po +51 -40
  120. package/locales/zh_CN.po +50 -33
  121. package/locales/zh_TW.po +50 -33
  122. package/operations/bulk-operation-list-item/bulk-operation-list-item.service.d.ts +2 -2
  123. package/operations/bulk-operation-list-item/bulk-operation-list-item.service.d.ts.map +1 -1
  124. package/operations/operation-details/operation-details.module.d.ts +1 -1
  125. package/operations/operations-list/device-control.feature.d.ts +4 -0
  126. package/operations/operations-list/device-control.feature.d.ts.map +1 -0
  127. package/operations/operations-list/index.d.ts +3 -2
  128. package/operations/operations-list/index.d.ts.map +1 -1
  129. package/operations/operations-list/operations-list-item.component.d.ts +1 -1
  130. package/operations/operations-list/operations-list-item.component.d.ts.map +1 -1
  131. package/operations/operations-list/operations-list.component.d.ts +3 -1
  132. package/operations/operations-list/operations-list.component.d.ts.map +1 -1
  133. package/operations/operations-list/operations-list.module.d.ts +3 -9
  134. package/operations/operations-list/operations-list.module.d.ts.map +1 -1
  135. package/operations/operations.module.d.ts +1 -2
  136. package/operations/operations.module.d.ts.map +1 -1
  137. package/package.json +1 -1
  138. package/services/index.d.ts +13 -2
  139. package/services/index.d.ts.map +1 -1
  140. package/services/service-command-tab/c8y-ngx-components-services-service-command-tab.d.ts.map +1 -0
  141. package/services/service-command-tab/index.d.ts +3 -0
  142. package/services/service-command-tab/index.d.ts.map +1 -0
  143. package/services/service-command-tab/service-command-tab.component.d.ts +12 -0
  144. package/services/service-command-tab/service-command-tab.component.d.ts.map +1 -0
  145. package/services/service-command-tab/service-command.feature.d.ts +3 -0
  146. package/services/service-command-tab/service-command.feature.d.ts.map +1 -0
  147. package/services/services-device-tab/index.d.ts +8 -2
  148. package/services/services-device-tab/index.d.ts.map +1 -1
  149. package/services/services-device-tab/services-device-tab.component.d.ts +2 -2
  150. package/services/services-device-tab/services-device-tab.component.d.ts.map +1 -1
  151. package/services/services-device-tab/services.breadcrumb-factory.d.ts.map +1 -1
  152. package/services/services.module.d.ts.map +1 -1
  153. package/services/shared/c8y-ngx-components-services-shared.d.ts.map +1 -0
  154. package/services/shared/index.d.ts +3 -0
  155. package/services/shared/index.d.ts.map +1 -0
  156. package/services/{services-device-tab → shared}/service-command.service.d.ts +10 -7
  157. package/services/shared/service-command.service.d.ts.map +1 -0
  158. package/services/shared/services.model.d.ts +31 -0
  159. package/services/shared/services.model.d.ts.map +1 -0
  160. package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts +3 -5
  161. package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts.map +1 -1
  162. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts +7 -2
  163. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts.map +1 -1
  164. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.d.ts +7 -27
  165. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.d.ts.map +1 -1
  166. package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts +4 -3
  167. package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts.map +1 -1
  168. package/widgets/implementations/datapoints-table/datapoints-table.service.d.ts +5 -5
  169. package/widgets/implementations/datapoints-table/datapoints-table.service.d.ts.map +1 -1
  170. package/core/common/aggregation/aggregation.model.d.ts.map +0 -1
  171. package/core/common/aggregation/aggregation.service.d.ts +0 -17
  172. package/core/common/aggregation/aggregation.service.d.ts.map +0 -1
  173. package/esm2022/core/common/aggregation/aggregation.model.mjs +0 -46
  174. package/esm2022/core/common/aggregation/aggregation.service.mjs +0 -34
  175. package/esm2022/services/services-device-tab/service-command.service.mjs +0 -113
  176. package/esm2022/services/services-device-tab/service-device-tab.model.mjs +0 -2
  177. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.mjs +0 -124
  178. package/services/services-device-tab/service-command.service.d.ts.map +0 -1
  179. package/services/services-device-tab/service-device-tab.model.d.ts +0 -11
  180. package/services/services-device-tab/service-device-tab.model.d.ts.map +0 -1
  181. package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.d.ts +0 -56
  182. package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.d.ts.map +0 -1
  183. /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, aggregationType, BearerAuthFromSessionStorage, FetchClient, Client, PasswordStrength, QueriesUtil, InventoryService, UserService, ApplicationService, TenantService, AlarmService, Service } from '@c8y/client';
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