bfg-common 1.4.732 → 1.4.733
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/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +2 -0
- package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +2 -0
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +502 -494
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
:is-show-chart-modal="isShowChartModal"
|
|
7
7
|
:chart-title="props.powerData?.groupName || ''"
|
|
8
8
|
:selected-metric="selectedMetric"
|
|
9
|
+
:selected-chart-type="selectedChartType"
|
|
9
10
|
:selected-power-counters-keys="selectedPowerCountersKeys"
|
|
10
11
|
:power-selected-rows-local="powerSelectedRowsLocal"
|
|
11
12
|
:selected-temperature-counters-keys="selectedTemperatureCountersKeys"
|
|
@@ -151,6 +152,7 @@ const customDateFrom = ref<string>('')
|
|
|
151
152
|
const customDateTo = ref<string>('')
|
|
152
153
|
const customTimeFrom = ref<string>('')
|
|
153
154
|
const customTimeTo = ref<string>('')
|
|
155
|
+
const selectedChartType = ref<string>('spline')
|
|
154
156
|
|
|
155
157
|
const selectedRowPower = ref<number[]>([])
|
|
156
158
|
const selectedRowTemperature = ref<number[]>([])
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
v-if="props.isShowChartModal"
|
|
66
66
|
:selected-chart-option-name="props.selectedChartOptionName"
|
|
67
67
|
:selected-metric="props.selectedMetric"
|
|
68
|
+
:selected-chart-type="props.selectedChartType"
|
|
68
69
|
:power-selected-rows-local="props.powerSelectedRowsLocal"
|
|
69
70
|
:temperature-selected-rows-local="props.temperatureSelectedRowsLocal"
|
|
70
71
|
:selected-power-counters-keys="props.selectedPowerCountersKeys"
|
|
@@ -113,6 +114,7 @@ const props = defineProps<{
|
|
|
113
114
|
isShowChartModal: boolean
|
|
114
115
|
chartTitle: string
|
|
115
116
|
selectedMetric: UI_T_Chart
|
|
117
|
+
selectedChartType: string
|
|
116
118
|
selectedPowerCountersKeys: number[]
|
|
117
119
|
powerSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
|
|
118
120
|
selectedTemperatureCountersKeys: number[]
|
|
@@ -1,494 +1,502 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="chart-options-modal">
|
|
3
|
-
<atoms-modal
|
|
4
|
-
width="1150px"
|
|
5
|
-
:show="true"
|
|
6
|
-
:title="localization.inventoryMonitor.chartOptions"
|
|
7
|
-
:disabled-submit="isDisabledSubmit"
|
|
8
|
-
@hide="onHide"
|
|
9
|
-
@submit="onSubmit"
|
|
10
|
-
>
|
|
11
|
-
<template #modalBody>
|
|
12
|
-
<common-monitor-advanced-tools-chart-options-modal-notification
|
|
13
|
-
v-show="isShowAlerts"
|
|
14
|
-
:alerts="alerts"
|
|
15
|
-
@remove="onRemoveAlerts"
|
|
16
|
-
/>
|
|
17
|
-
<div>
|
|
18
|
-
<common-pages-hardware-health-history-testimony-tools-chart-options-modal-actions
|
|
19
|
-
:is-disabled-save="!currentSelectedRows.length"
|
|
20
|
-
:options-names="optionsNames"
|
|
21
|
-
:selected-chart-option-name="localSelectedChartOptionName"
|
|
22
|
-
@save="onSaveOptions"
|
|
23
|
-
@check-validation="checkValidations"
|
|
24
|
-
@select-local-option-name="onSelectLocalOptionName"
|
|
25
|
-
@delete-chart-name="onDeleteChartName"
|
|
26
|
-
/>
|
|
27
|
-
|
|
28
|
-
<div class="horizontal-flex-container chart-options-content">
|
|
29
|
-
<common-pages-hardware-health-history-testimony-tools-chart-options-modal-metrics
|
|
30
|
-
v-model:selected-metric="selectedMetric"
|
|
31
|
-
:metrics-items="metricsItems"
|
|
32
|
-
/>
|
|
33
|
-
<common-pages-hardware-health-history-testimony-tools-chart-options-modal-counters
|
|
34
|
-
:chart="selectedMetric"
|
|
35
|
-
:selected-power-keys="localSelectedPowerCountersKeys"
|
|
36
|
-
:selected-temperature-keys="localSelectedTemperatureCountersKeys"
|
|
37
|
-
:power-counters-table-data="props.powerCountersTableData"
|
|
38
|
-
:temperature-counters-table-data="
|
|
39
|
-
props.temperatureCountersTableData
|
|
40
|
-
"
|
|
41
|
-
:language="props.language"
|
|
42
|
-
:selected-chart-type="localSelectedChartType"
|
|
43
|
-
:selected-timespan-type="localSelectedTimespanType"
|
|
44
|
-
:units-count="localUnitsCount"
|
|
45
|
-
:period-type="localTimespanPeriodType"
|
|
46
|
-
:selected-custom-time="localCustomTime"
|
|
47
|
-
:custom-date-from="props.customDateFrom"
|
|
48
|
-
:custom-date-to="props.customDateTo"
|
|
49
|
-
:custom-time-from="props.customTimeFrom"
|
|
50
|
-
:custom-time-to="props.customTimeTo"
|
|
51
|
-
:valid-date-end="props.validDateEnd"
|
|
52
|
-
@select-power-row="onSelectPowerRow"
|
|
53
|
-
@select-temperature-row="onSelectTemperatureRow"
|
|
54
|
-
@update-chart-type="selectedChartTypeLocal = $event"
|
|
55
|
-
@update-custom-time="localCustomTime = $event"
|
|
56
|
-
@update-timespan-type="timespanType = $event"
|
|
57
|
-
@update-unit-count="unitCount = $event"
|
|
58
|
-
@update-period-type="localTimespanPeriodType = $event"
|
|
59
|
-
@update-custom-date-from="onUpdateCustomDateFrom"
|
|
60
|
-
@update-custom-date-to="onUpdateCustomDateTo"
|
|
61
|
-
@update-custom-time-from="onUpdateCustomTimeFrom"
|
|
62
|
-
@update-custom-time-to="onUpdateCustomTimeTo"
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
|
-
</atoms-modal>
|
|
68
|
-
</div>
|
|
69
|
-
</template>
|
|
70
|
-
|
|
71
|
-
<script setup lang="ts">
|
|
72
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
73
|
-
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
74
|
-
import type { UI_T_Chart } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/types'
|
|
75
|
-
import type { UI_I_OptionsForm } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/interfaces'
|
|
76
|
-
import type { UI_I_HardwareHealthSensorsGraph } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
|
|
77
|
-
import { metricsFunc } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/config/optionsMetrics'
|
|
78
|
-
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
79
|
-
import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
|
|
80
|
-
import { getCurrentOptionsStorageFunc } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/config/toolbar'
|
|
81
|
-
|
|
82
|
-
const props = defineProps<{
|
|
83
|
-
selectedChartOptionName: string
|
|
84
|
-
selectedMetric: UI_T_Chart
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(event: '
|
|
106
|
-
(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(event: 'update-
|
|
116
|
-
(event: 'update-
|
|
117
|
-
(event: 'update-
|
|
118
|
-
(event: 'update-
|
|
119
|
-
(event: '
|
|
120
|
-
(event: '
|
|
121
|
-
(event: '
|
|
122
|
-
(event: 'update-custom-date-
|
|
123
|
-
(event: 'update-custom-
|
|
124
|
-
(event: 'update-custom-time-
|
|
125
|
-
(event: '
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
() =>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
() =>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
() =>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
if (
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
if (
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
)
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
)
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.chart-options-content {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="chart-options-modal">
|
|
3
|
+
<atoms-modal
|
|
4
|
+
width="1150px"
|
|
5
|
+
:show="true"
|
|
6
|
+
:title="localization.inventoryMonitor.chartOptions"
|
|
7
|
+
:disabled-submit="isDisabledSubmit"
|
|
8
|
+
@hide="onHide"
|
|
9
|
+
@submit="onSubmit"
|
|
10
|
+
>
|
|
11
|
+
<template #modalBody>
|
|
12
|
+
<common-monitor-advanced-tools-chart-options-modal-notification
|
|
13
|
+
v-show="isShowAlerts"
|
|
14
|
+
:alerts="alerts"
|
|
15
|
+
@remove="onRemoveAlerts"
|
|
16
|
+
/>
|
|
17
|
+
<div>
|
|
18
|
+
<common-pages-hardware-health-history-testimony-tools-chart-options-modal-actions
|
|
19
|
+
:is-disabled-save="!currentSelectedRows.length"
|
|
20
|
+
:options-names="optionsNames"
|
|
21
|
+
:selected-chart-option-name="localSelectedChartOptionName"
|
|
22
|
+
@save="onSaveOptions"
|
|
23
|
+
@check-validation="checkValidations"
|
|
24
|
+
@select-local-option-name="onSelectLocalOptionName"
|
|
25
|
+
@delete-chart-name="onDeleteChartName"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<div class="horizontal-flex-container chart-options-content">
|
|
29
|
+
<common-pages-hardware-health-history-testimony-tools-chart-options-modal-metrics
|
|
30
|
+
v-model:selected-metric="selectedMetric"
|
|
31
|
+
:metrics-items="metricsItems"
|
|
32
|
+
/>
|
|
33
|
+
<common-pages-hardware-health-history-testimony-tools-chart-options-modal-counters
|
|
34
|
+
:chart="selectedMetric"
|
|
35
|
+
:selected-power-keys="localSelectedPowerCountersKeys"
|
|
36
|
+
:selected-temperature-keys="localSelectedTemperatureCountersKeys"
|
|
37
|
+
:power-counters-table-data="props.powerCountersTableData"
|
|
38
|
+
:temperature-counters-table-data="
|
|
39
|
+
props.temperatureCountersTableData
|
|
40
|
+
"
|
|
41
|
+
:language="props.language"
|
|
42
|
+
:selected-chart-type="localSelectedChartType"
|
|
43
|
+
:selected-timespan-type="localSelectedTimespanType"
|
|
44
|
+
:units-count="localUnitsCount"
|
|
45
|
+
:period-type="localTimespanPeriodType"
|
|
46
|
+
:selected-custom-time="localCustomTime"
|
|
47
|
+
:custom-date-from="props.customDateFrom"
|
|
48
|
+
:custom-date-to="props.customDateTo"
|
|
49
|
+
:custom-time-from="props.customTimeFrom"
|
|
50
|
+
:custom-time-to="props.customTimeTo"
|
|
51
|
+
:valid-date-end="props.validDateEnd"
|
|
52
|
+
@select-power-row="onSelectPowerRow"
|
|
53
|
+
@select-temperature-row="onSelectTemperatureRow"
|
|
54
|
+
@update-chart-type="selectedChartTypeLocal = $event"
|
|
55
|
+
@update-custom-time="localCustomTime = $event"
|
|
56
|
+
@update-timespan-type="timespanType = $event"
|
|
57
|
+
@update-unit-count="unitCount = $event"
|
|
58
|
+
@update-period-type="localTimespanPeriodType = $event"
|
|
59
|
+
@update-custom-date-from="onUpdateCustomDateFrom"
|
|
60
|
+
@update-custom-date-to="onUpdateCustomDateTo"
|
|
61
|
+
@update-custom-time-from="onUpdateCustomTimeFrom"
|
|
62
|
+
@update-custom-time-to="onUpdateCustomTimeTo"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
</atoms-modal>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
73
|
+
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
74
|
+
import type { UI_T_Chart } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/types'
|
|
75
|
+
import type { UI_I_OptionsForm } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/interfaces'
|
|
76
|
+
import type { UI_I_HardwareHealthSensorsGraph } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
|
|
77
|
+
import { metricsFunc } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/config/optionsMetrics'
|
|
78
|
+
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
79
|
+
import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
|
|
80
|
+
import { getCurrentOptionsStorageFunc } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/config/toolbar'
|
|
81
|
+
|
|
82
|
+
const props = defineProps<{
|
|
83
|
+
selectedChartOptionName: string
|
|
84
|
+
selectedMetric: UI_T_Chart
|
|
85
|
+
selectedChartType: string
|
|
86
|
+
selectedPowerCountersKeys: number[]
|
|
87
|
+
powerSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
|
|
88
|
+
selectedTemperatureCountersKeys: number[]
|
|
89
|
+
temperatureSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
|
|
90
|
+
unitsCount: number
|
|
91
|
+
powerCountersTableData: UI_I_HardwareHealthSensorsGraph[]
|
|
92
|
+
temperatureCountersTableData: UI_I_HardwareHealthSensorsGraph[]
|
|
93
|
+
language: string
|
|
94
|
+
selectedTimespanType: string
|
|
95
|
+
customDateFrom: string
|
|
96
|
+
customDateTo: string
|
|
97
|
+
customTimeFrom: string
|
|
98
|
+
customTimeTo: string
|
|
99
|
+
timespanPeriodType: string
|
|
100
|
+
validDateEnd: number
|
|
101
|
+
formatDate: string
|
|
102
|
+
}>()
|
|
103
|
+
|
|
104
|
+
const emits = defineEmits<{
|
|
105
|
+
(event: 'hide'): void
|
|
106
|
+
(event: 'select-metric-local', value: string): void
|
|
107
|
+
(
|
|
108
|
+
event: 'power-selected-rows-local',
|
|
109
|
+
value: UI_I_HardwareHealthSensorsGraph[]
|
|
110
|
+
): void
|
|
111
|
+
(
|
|
112
|
+
event: 'temperature-selected-rows-local',
|
|
113
|
+
value: UI_I_HardwareHealthSensorsGraph[]
|
|
114
|
+
): void
|
|
115
|
+
(event: 'update-chart-type', value: string): void
|
|
116
|
+
(event: 'update-timespan-type', value: string): void
|
|
117
|
+
(event: 'update-unit-count', value: number): void
|
|
118
|
+
(event: 'update-period-type', value: string): void
|
|
119
|
+
(event: 'update-custom-time', value: string): void
|
|
120
|
+
(event: 'delete-option'): void
|
|
121
|
+
(event: 'save-option-name'): void
|
|
122
|
+
(event: 'update-custom-date-from', value: string): void
|
|
123
|
+
(event: 'update-custom-date-to', value: string): void
|
|
124
|
+
(event: 'update-custom-time-from', value: string): void
|
|
125
|
+
(event: 'update-custom-time-to', value: string): void
|
|
126
|
+
(event: 'submit-options', value: UI_I_OptionsForm): void
|
|
127
|
+
}>()
|
|
128
|
+
|
|
129
|
+
const routeType = '' + useRoute().params.type
|
|
130
|
+
|
|
131
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
132
|
+
|
|
133
|
+
const localCustomDateFrom = ref<string>('')
|
|
134
|
+
const onUpdateCustomDateFrom = (value: string): void => {
|
|
135
|
+
localCustomDateFrom.value = value
|
|
136
|
+
}
|
|
137
|
+
const localCustomDateTo = ref<string>('')
|
|
138
|
+
const onUpdateCustomDateTo = (value: string): void => {
|
|
139
|
+
localCustomDateTo.value = value
|
|
140
|
+
}
|
|
141
|
+
const localCustomTimeFrom = ref<string>('')
|
|
142
|
+
const onUpdateCustomTimeFrom = (value: string): void => {
|
|
143
|
+
localCustomTimeFrom.value = value
|
|
144
|
+
}
|
|
145
|
+
const localCustomTimeTo = ref<string>('')
|
|
146
|
+
const onUpdateCustomTimeTo = (value: string): void => {
|
|
147
|
+
localCustomTimeTo.value = value
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const metricsItems = computed<UI_I_VerticalTabs[]>(() =>
|
|
151
|
+
metricsFunc(localization.value)
|
|
152
|
+
)
|
|
153
|
+
const selectedMetric = ref<UI_T_Chart>(
|
|
154
|
+
props.selectedMetric || '' + metricsItems.value[0]?.value
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
const localSelectedPowerCountersKeys = ref<number[]>([])
|
|
158
|
+
watch(
|
|
159
|
+
() => props.selectedPowerCountersKeys,
|
|
160
|
+
(newValue) => {
|
|
161
|
+
localSelectedPowerCountersKeys.value = newValue
|
|
162
|
+
},
|
|
163
|
+
{ immediate: true, deep: true }
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
const localSelectedTemperatureCountersKeys = ref<number[]>([])
|
|
167
|
+
watch(
|
|
168
|
+
() => props.selectedTemperatureCountersKeys,
|
|
169
|
+
(newValue) => {
|
|
170
|
+
localSelectedTemperatureCountersKeys.value = newValue
|
|
171
|
+
},
|
|
172
|
+
{ immediate: true, deep: true }
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
const localSelectedChartType = ref<string>('')
|
|
176
|
+
watch(
|
|
177
|
+
() => props.selectedChartType,
|
|
178
|
+
(newValue) => {
|
|
179
|
+
localSelectedChartType.value = newValue
|
|
180
|
+
},
|
|
181
|
+
{ immediate: true }
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
const localSelectedTimespanType = ref<string>('')
|
|
185
|
+
watch(
|
|
186
|
+
() => props.selectedTimespanType,
|
|
187
|
+
(newValue) => {
|
|
188
|
+
localSelectedTimespanType.value = newValue
|
|
189
|
+
},
|
|
190
|
+
{ immediate: true }
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
const localUnitsCount = ref<number>(0)
|
|
194
|
+
watch(
|
|
195
|
+
() => props.unitsCount,
|
|
196
|
+
(newValue) => {
|
|
197
|
+
localUnitsCount.value = newValue
|
|
198
|
+
},
|
|
199
|
+
{ immediate: true }
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
const localTimespanPeriodType = ref<string>('')
|
|
203
|
+
watch(
|
|
204
|
+
() => props.timespanPeriodType,
|
|
205
|
+
(newValue) => {
|
|
206
|
+
localTimespanPeriodType.value = newValue
|
|
207
|
+
},
|
|
208
|
+
{ immediate: true }
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
const localCustomTime = ref<string>('')
|
|
212
|
+
|
|
213
|
+
const isShowAlerts = ref<boolean>(false)
|
|
214
|
+
const alerts = ref<string[]>([])
|
|
215
|
+
|
|
216
|
+
const onRemoveAlerts = (): void => {
|
|
217
|
+
isShowAlerts.value = false
|
|
218
|
+
alerts.value = []
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const onHide = (): void => {
|
|
222
|
+
emits('hide')
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const onSelectPowerRow = (data: UI_I_HardwareHealthSensorsGraph[]): void => {
|
|
226
|
+
emits('power-selected-rows-local', data)
|
|
227
|
+
}
|
|
228
|
+
const onSelectTemperatureRow = (
|
|
229
|
+
data: UI_I_HardwareHealthSensorsGraph[]
|
|
230
|
+
): void => {
|
|
231
|
+
emits('temperature-selected-rows-local', data)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const currentSelectedRows = computed<UI_I_HardwareHealthSensorsGraph[]>(() => {
|
|
235
|
+
let result: UI_I_HardwareHealthSensorsGraph[] = []
|
|
236
|
+
|
|
237
|
+
switch (selectedMetric.value) {
|
|
238
|
+
case 'power':
|
|
239
|
+
result = props.powerSelectedRowsLocal
|
|
240
|
+
break
|
|
241
|
+
case 'temperature':
|
|
242
|
+
result = props.temperatureSelectedRowsLocal
|
|
243
|
+
break
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return result
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
const selectedChartTypeLocal = ref<string>('')
|
|
250
|
+
|
|
251
|
+
const checkValidations = (): boolean => {
|
|
252
|
+
const checkDateResult = checkDateFunc(
|
|
253
|
+
localization.value,
|
|
254
|
+
localCustomDateFrom.value,
|
|
255
|
+
localCustomDateTo.value,
|
|
256
|
+
localCustomTimeFrom.value,
|
|
257
|
+
localCustomTimeTo.value,
|
|
258
|
+
props.validDateEnd,
|
|
259
|
+
props.formatDate
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
if (isDisabledSubmit.value) {
|
|
263
|
+
alerts.value = [localization.value.inventoryMonitor.noCountersSelected]
|
|
264
|
+
isShowAlerts.value = true
|
|
265
|
+
return false
|
|
266
|
+
} else if (
|
|
267
|
+
timespanType.value === 'custom_interval' &&
|
|
268
|
+
localTimespanPeriodType.value === 'period' &&
|
|
269
|
+
checkDateResult !== '' &&
|
|
270
|
+
typeof checkDateResult === 'string'
|
|
271
|
+
) {
|
|
272
|
+
alerts.value = [checkDateResult]
|
|
273
|
+
isShowAlerts.value = true
|
|
274
|
+
return false
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return true
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const localSelectedChartOptionName = ref<string>('')
|
|
281
|
+
watch(
|
|
282
|
+
() => props.selectedChartOptionName,
|
|
283
|
+
(newValue) => {
|
|
284
|
+
localSelectedChartOptionName.value = newValue
|
|
285
|
+
},
|
|
286
|
+
{ immediate: true }
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
const selectedLocalOptionName = ref<string>('')
|
|
290
|
+
|
|
291
|
+
const currentFieldsByArray = (
|
|
292
|
+
data: UI_I_HardwareHealthSensorsGraph[]
|
|
293
|
+
): string => {
|
|
294
|
+
const result: string[] = []
|
|
295
|
+
data.forEach((item) => {
|
|
296
|
+
result.push(item.nameEn)
|
|
297
|
+
})
|
|
298
|
+
return result.join('>>')
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const onSubmit = (): void => {
|
|
302
|
+
if (!checkValidations()) return
|
|
303
|
+
|
|
304
|
+
if (['select_options', 'default'].includes(selectedLocalOptionName.value))
|
|
305
|
+
selectedLocalOptionName.value = 'custom'
|
|
306
|
+
|
|
307
|
+
onSaveOptions(selectedLocalOptionName.value)
|
|
308
|
+
|
|
309
|
+
const currentFields = currentFieldsByArray(currentSelectedRows.value)
|
|
310
|
+
|
|
311
|
+
const validPeriod = getValidDateByOptionFunc(
|
|
312
|
+
timespanType.value,
|
|
313
|
+
null,
|
|
314
|
+
unitCount.value,
|
|
315
|
+
localCustomTime.value
|
|
316
|
+
)
|
|
317
|
+
if (
|
|
318
|
+
timespanType.value === 'custom_interval' &&
|
|
319
|
+
localTimespanPeriodType.value === 'period'
|
|
320
|
+
) {
|
|
321
|
+
const checkDateResult = checkDateFunc(
|
|
322
|
+
localization.value,
|
|
323
|
+
localCustomDateFrom.value,
|
|
324
|
+
localCustomDateTo.value,
|
|
325
|
+
localCustomTimeFrom.value,
|
|
326
|
+
localCustomTimeTo.value,
|
|
327
|
+
props.validDateEnd,
|
|
328
|
+
props.formatDate
|
|
329
|
+
)
|
|
330
|
+
if (Array.isArray(checkDateResult)) {
|
|
331
|
+
validPeriod[0] = checkDateResult[0]
|
|
332
|
+
validPeriod[1] = checkDateResult[1]
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const savedObject = {
|
|
337
|
+
fields: currentFields,
|
|
338
|
+
optionName: selectedLocalOptionName.value,
|
|
339
|
+
metric: selectedMetric.value,
|
|
340
|
+
periodName: timespanType.value,
|
|
341
|
+
periodType: localTimespanPeriodType.value,
|
|
342
|
+
unitCount: unitCount.value,
|
|
343
|
+
localTimespanType: localCustomTime.value,
|
|
344
|
+
dateFrom: localCustomDateFrom.value,
|
|
345
|
+
timeFrom: localCustomTimeFrom.value,
|
|
346
|
+
dateTo: localCustomDateTo.value,
|
|
347
|
+
timeTo: localCustomTimeTo.value,
|
|
348
|
+
chartType: selectedChartTypeLocal.value,
|
|
349
|
+
period: validPeriod,
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
emits('update-period-type', savedObject.periodType)
|
|
353
|
+
emits('submit-options', savedObject)
|
|
354
|
+
onHide()
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const timespanType = ref<string>('')
|
|
358
|
+
const unitCount = ref<number>(1)
|
|
359
|
+
|
|
360
|
+
const optionsNames = ref<string[]>([])
|
|
361
|
+
|
|
362
|
+
const onSaveOptions = (name: string): void => {
|
|
363
|
+
const counters = currentSelectedRows.value.map((item) => {
|
|
364
|
+
return {
|
|
365
|
+
id: item.id,
|
|
366
|
+
name: item.nameEn,
|
|
367
|
+
}
|
|
368
|
+
})
|
|
369
|
+
let chartType = 'line_graph'
|
|
370
|
+
if (selectedChartTypeLocal.value === 'spline') chartType = 'line_graph'
|
|
371
|
+
else if (selectedChartTypeLocal.value === 'area') chartType = 'stacked_graph'
|
|
372
|
+
|
|
373
|
+
const saveOptionsData = {
|
|
374
|
+
routeType,
|
|
375
|
+
chartType,
|
|
376
|
+
counters,
|
|
377
|
+
metric: selectedMetric.value,
|
|
378
|
+
timespan: {
|
|
379
|
+
periodType: localTimespanPeriodType.value,
|
|
380
|
+
units: localCustomTime.value,
|
|
381
|
+
unitsCount: unitCount.value,
|
|
382
|
+
type: timespanType.value,
|
|
383
|
+
},
|
|
384
|
+
}
|
|
385
|
+
useLocalStorage(`${name}ChartOptionsSensors`, saveOptionsData)
|
|
386
|
+
optionsNames.value = getCurrentOptionsStorageFunc()
|
|
387
|
+
localSelectedChartOptionName.value = name
|
|
388
|
+
emits('save-option-name')
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const setSelectOptions = (): void => {
|
|
392
|
+
selectedMetric.value = props.selectedMetric || metricsItems.value[0]?.value
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const setDefaultOptions = (): void => {
|
|
396
|
+
selectedMetric.value = metricsItems.value[0]?.value
|
|
397
|
+
localSelectedPowerCountersKeys.value = []
|
|
398
|
+
localSelectedTemperatureCountersKeys.value = []
|
|
399
|
+
localSelectedChartType.value = 'spline'
|
|
400
|
+
localSelectedTimespanType.value = ''
|
|
401
|
+
localUnitsCount.value = 0
|
|
402
|
+
localTimespanPeriodType.value = ''
|
|
403
|
+
localCustomTime.value = ''
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const setCustomOptions = (name: string): void => {
|
|
407
|
+
const selectedValue = useLocalStorage(name + 'ChartOptionsSensors', undefined)
|
|
408
|
+
|
|
409
|
+
if (selectedValue.routeType !== routeType) return
|
|
410
|
+
|
|
411
|
+
let currentChartType = ''
|
|
412
|
+
if (selectedValue.chartType === 'line_graph') currentChartType = 'spline'
|
|
413
|
+
else if (selectedValue.chartType === 'stacked_graph')
|
|
414
|
+
currentChartType = 'area'
|
|
415
|
+
|
|
416
|
+
selectedMetric.value = selectedValue.metric
|
|
417
|
+
if (selectedMetric.value === 'power')
|
|
418
|
+
localSelectedPowerCountersKeys.value = selectedValue.counters.map(
|
|
419
|
+
(item) => item.id
|
|
420
|
+
)
|
|
421
|
+
if (selectedMetric.value === 'temperature')
|
|
422
|
+
localSelectedTemperatureCountersKeys.value = selectedValue.counters.map(
|
|
423
|
+
(item) => item.id
|
|
424
|
+
)
|
|
425
|
+
localSelectedChartType.value = currentChartType
|
|
426
|
+
localSelectedTimespanType.value = selectedValue.timespan.type
|
|
427
|
+
localUnitsCount.value = selectedValue.timespan.unitsCount
|
|
428
|
+
localTimespanPeriodType.value = selectedValue.timespan.periodType
|
|
429
|
+
localCustomTime.value = selectedValue.timespan.units
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const onSelectLocalOptionName = (name: string): void => {
|
|
433
|
+
selectedLocalOptionName.value = name
|
|
434
|
+
|
|
435
|
+
if (optionsNames.value.includes(name)) setCustomOptions(name)
|
|
436
|
+
else if (name === 'default') setDefaultOptions()
|
|
437
|
+
else if (name === 'select_options') setSelectOptions()
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
watch(
|
|
441
|
+
localSelectedChartOptionName,
|
|
442
|
+
(newValue) => {
|
|
443
|
+
if (!newValue) return
|
|
444
|
+
|
|
445
|
+
setCustomOptions(newValue)
|
|
446
|
+
},
|
|
447
|
+
{ immediate: true }
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
const onDeleteChartName = (name: string): void => {
|
|
451
|
+
window.localStorage.removeItem(name + 'ChartOptionsSensors')
|
|
452
|
+
optionsNames.value = getCurrentOptionsStorageFunc()
|
|
453
|
+
setSelectOptions()
|
|
454
|
+
emits('delete-option')
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const isDisabledSubmit = computed<boolean>(
|
|
458
|
+
() => !currentSelectedRows.value.length
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
watch(
|
|
462
|
+
selectedMetric,
|
|
463
|
+
(newValue) => {
|
|
464
|
+
emits('select-metric-local', newValue)
|
|
465
|
+
},
|
|
466
|
+
{ immediate: true }
|
|
467
|
+
)
|
|
468
|
+
|
|
469
|
+
onMounted(() => {
|
|
470
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType)
|
|
471
|
+
})
|
|
472
|
+
</script>
|
|
473
|
+
|
|
474
|
+
<style scoped lang="scss">
|
|
475
|
+
.chart-options-modal {
|
|
476
|
+
.loader-on :deep(.modal-body) {
|
|
477
|
+
display: flex;
|
|
478
|
+
align-items: center;
|
|
479
|
+
justify-content: center;
|
|
480
|
+
}
|
|
481
|
+
:deep(.modal-title) {
|
|
482
|
+
text-transform: capitalize;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
#loader {
|
|
486
|
+
min-height: 90px;
|
|
487
|
+
text-align: center;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.chart-options-content {
|
|
491
|
+
display: flex;
|
|
492
|
+
flex-direction: row;
|
|
493
|
+
flex-basis: 90%;
|
|
494
|
+
overflow-y: hidden;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
@media (max-width: 1024px) {
|
|
498
|
+
.chart-options-content {
|
|
499
|
+
flex-direction: column !important;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
</style>
|