bfg-common 1.5.701 → 1.5.702

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 (31) hide show
  1. package/assets/localization/local_be.json +2 -1
  2. package/assets/localization/local_en.json +2 -1
  3. package/assets/localization/local_hy.json +2 -1
  4. package/assets/localization/local_kk.json +2 -1
  5. package/assets/localization/local_ru.json +3 -2
  6. package/assets/localization/local_zh.json +2 -1
  7. package/components/common/layout/theHeader/modals/reconnect/ReconnectOld.vue +2 -0
  8. package/components/common/monitor/advanced/graphView/GraphView.vue +151 -151
  9. package/components/common/monitor/advanced/tools/Tools.vue +313 -313
  10. package/components/common/pages/files/lib/models/enums.ts +10 -0
  11. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +394 -394
  12. package/components/common/pages/hardwareHealth/tableView/TableView.vue +202 -202
  13. package/components/common/pages/hardwareHealth/tableView/lib/config/sensorTable.ts +165 -165
  14. package/components/common/vm/actions/common/customizeHardware/virtualHardware/New.vue +0 -9
  15. package/components/common/vm/actions/common/customizeHardware/virtualHardware/Old.vue +6 -13
  16. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +0 -26
  17. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces.ts +3 -1
  18. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/New.vue +7 -4
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +9 -56
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/Old.vue +5 -8
  21. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +1 -3
  22. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/New.vue +2 -2
  23. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/Old.vue +2 -2
  24. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +1 -1
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/New.vue +1 -2
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/Old.vue +1 -2
  27. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/New.vue +1 -1
  28. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +1 -1
  29. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/Old.vue +1 -1
  30. package/package.json +1 -1
  31. package/store/main/getters.ts +7 -7
@@ -1,394 +1,394 @@
1
- <template>
2
- <div class="horizontal-flex-container">
3
- <div class="chart-title-content">
4
- <client-only>
5
- <span v-if="props.chartTitle" class="chart-title"
6
- >{{ props.chartTitle }},</span
7
- >
8
- <span v-if="chartTitleDate" class="chart-title uppercase">{{
9
- chartTitleDate
10
- }}</span>
11
- </client-only>
12
- </div>
13
- <div class="horizontal-flex-container">
14
- <label for="periodSelect" class="label-select"
15
- >{{ localization.inventoryMonitor.period }}:</label
16
- >
17
- <div class="select">
18
- <select
19
- id="periodSelect"
20
- v-model="selectedPeriod"
21
- data-id="period-select"
22
- @change="onUpdateTools"
23
- >
24
- <option
25
- v-for="(item, index) in periodOptions"
26
- :key="index"
27
- :value="item.value"
28
- >
29
- {{ item.text }}
30
- </option>
31
- </select>
32
- </div>
33
- <a
34
- id="chart-options-button"
35
- class="chart-options-button"
36
- data-id="show-chart-options-button"
37
- @click="onShowChartOptions"
38
- >{{ localization.inventoryMonitor.chartOptions }}</a
39
- >
40
- </div>
41
- <div class="view-select-label horizontal-flex-container">
42
- <label for="viewSelect" class="label-select"
43
- >{{ localization.common.view }}:</label
44
- >
45
- <div class="select">
46
- <select
47
- id="viewSelect"
48
- v-model="selectedView"
49
- data-id="view-select"
50
- @change="onUpdateTools"
51
- >
52
- <option
53
- v-for="(item, index) in viewOptions"
54
- :key="index"
55
- :value="item.value"
56
- >
57
- {{ item.text }}
58
- </option>
59
- </select>
60
- </div>
61
- </div>
62
- </div>
63
-
64
- <common-pages-hardware-health-history-testimony-tools-chart-options-modal
65
- v-if="props.isShowChartModal"
66
- :selected-chart-option-name="props.selectedChartOptionName"
67
- :selected-metric="props.selectedMetric"
68
- :selected-chart-type="props.selectedChartType"
69
- :power-selected-rows-local="props.powerSelectedRowsLocal"
70
- :temperature-selected-rows-local="props.temperatureSelectedRowsLocal"
71
- :selected-power-counters-keys="props.selectedPowerCountersKeys"
72
- :selected-temperature-counters-keys="props.selectedTemperatureCountersKeys"
73
- :units-count="props.unitsCount"
74
- :power-counters-table-data="props.powerCountersTableData"
75
- :temperature-counters-table-data="props.temperatureCountersTableData"
76
- :language="props.language"
77
- :selected-timespan-type="props.selectedTimespanType"
78
- :custom-date-from="props.customDateFrom"
79
- :custom-date-to="props.customDateTo"
80
- :custom-time-from="props.customTimeFrom"
81
- :custom-time-to="props.customTimeTo"
82
- :timespan-period-type="props.timespanPeriodType"
83
- :valid-date-end="props.validDateEnd"
84
- :format-date="props.formatDate"
85
- @save-option-name="onSaveOptionName"
86
- @delete-option="emits('delete-option')"
87
- @power-selected-rows-local="emits('power-selected-rows-local', $event)"
88
- @update-period-type="emits('update-period-type', $event)"
89
- @temperature-selected-rows-local="
90
- emits('temperature-selected-rows-local', $event)
91
- "
92
- @submit-options="emits('submit-options', $event)"
93
- @hide="onHideChartModal"
94
- />
95
- </template>
96
-
97
- <script setup lang="ts">
98
- import type { UI_I_Localization } from '~/lib/models/interfaces'
99
- import type { UI_I_HardwareHealthSensorsGraph } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
100
- import type { UI_I_SensorsGraphPayload } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/models/interfaces'
101
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
102
- import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
103
- import type { UI_T_Chart } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/types'
104
- import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
105
- import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
106
- import {
107
- getCurrentOptionsStorageFunc,
108
- periodFunc,
109
- viewFunc,
110
- } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/config/toolbar'
111
-
112
- const props = defineProps<{
113
- selectedChartOptionName: string
114
- isShowChartModal: boolean
115
- chartTitle: string
116
- selectedMetric: UI_T_Chart
117
- selectedChartType: string
118
- selectedPowerCountersKeys: number[]
119
- powerSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
120
- selectedTemperatureCountersKeys: number[]
121
- temperatureSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
122
- unitsCount: number
123
- powerCountersTableData: UI_I_HardwareHealthSensorsGraph[]
124
- temperatureCountersTableData: UI_I_HardwareHealthSensorsGraph[]
125
- language: string
126
- customDateFrom: string
127
- customDateTo: string
128
- customTimeFrom: string
129
- customTimeTo: string
130
- selectedTimespanType: string
131
- startDate: number
132
- endDate: number
133
- timespanPeriodType: string
134
- validDateEnd: number
135
- formatDate: string
136
- }>()
137
- const selectedView = defineModel<string>('selectedView')
138
-
139
- const emits = defineEmits<{
140
- (event: 'show-chart-modal'): void
141
- (event: 'hide-chart-modal'): void
142
- (event: 'update-tools', value: UI_I_SensorsGraphPayload): void
143
- (event: 'exporting', value: string): void
144
- (event: 'open-advanced-page'): void
145
- (event: 'select-metric-local', value: string): void
146
- (
147
- event: 'power-selected-rows-local',
148
- value: UI_I_HardwareHealthSensorsGraph[]
149
- ): void
150
- (
151
- event: 'temperature-selected-rows-local',
152
- value: UI_I_HardwareHealthSensorsGraph[]
153
- ): void
154
- (event: 'update-chart-type', value: string): void
155
- (event: 'update-timespan-type', value: string): void
156
- (event: 'update-unit-count', value: number): void
157
- (event: 'update-period-type', value: string): void
158
- (event: 'update-custom-time', value: string): void
159
- (event: 'delete-option'): void
160
- (event: 'update-custom-date-from', value: string): void
161
- (event: 'update-custom-date-to', value: string): void
162
- (event: 'update-custom-time-from', value: string): void
163
- (event: 'update-custom-time-to', value: string): void
164
- (event: 'submit-options', value: UI_I_OptionsForm): void
165
- (event: 'update:selected-timespan-type', value: string): void
166
- }>()
167
-
168
- const localization = computed<UI_I_Localization>(() => useLocal())
169
-
170
- const { $store, $formattedDatetime }: any = useNuxtApp()
171
-
172
- const updateTimeFormatAndInterfaceLang = computed<number>(
173
- () => $store.getters['main/getUpdateTimeFormatAndInterfaceLang']
174
- )
175
-
176
- const periodOptions = computed<UI_I_OptionItem[]>(() =>
177
- periodFunc(localization.value, props.selectedTimespanType)
178
- )
179
- const selectedPeriod = computed<string>({
180
- get() {
181
- return props.selectedTimespanType || periodOptions.value[0].value
182
- },
183
- set(newValue) {
184
- emits('update:selected-timespan-type', newValue)
185
- },
186
- })
187
-
188
- const optionsNames = ref<string[]>([])
189
-
190
- const viewOptions = computed<UI_I_OptionItem[]>(() =>
191
- viewFunc(localization.value, optionsNames.value)
192
- )
193
-
194
- watch(
195
- () => props.selectedChartOptionName,
196
- (newValue) => {
197
- let currentValue = ''
198
-
199
- if (newValue) currentValue = newValue
200
- else if (
201
- selectedView.value &&
202
- optionsNames.value.includes(selectedView.value)
203
- )
204
- currentValue = selectedView.value
205
- else currentValue = selectedView.value || viewOptions.value[0]?.value
206
-
207
- selectedView.value = currentValue
208
- },
209
- { immediate: true }
210
- )
211
-
212
- const onHideChartModal = (): void => {
213
- emits('hide-chart-modal')
214
- }
215
-
216
- const onUpdateTools = (): void => {
217
- const periodValue = selectedPeriod.value
218
- const viewValue = selectedView.value
219
- const selectedValue = useLocalStorage(
220
- viewValue + 'ChartOptionsSensors',
221
- undefined
222
- )
223
-
224
- const fields = selectedValue
225
- ? selectedValue.counters.map((item) => item.name).join(', ')
226
- : ''
227
- const validPeriodData = getValidDateByOptionFunc(
228
- periodValue,
229
- selectedValue,
230
- props.unitsCount,
231
- null
232
- )
233
-
234
- const period = [
235
- Math.round(validPeriodData[0] / 1000),
236
- Math.round(validPeriodData[1] / 1000),
237
- ]
238
-
239
- if (
240
- periodValue === 'custom_interval' &&
241
- props.timespanPeriodType === 'period'
242
- ) {
243
- const checkDateResult = checkDateFunc(
244
- localization.value,
245
- props.customDateFrom,
246
- props.customDateTo,
247
- props.customTimeFrom,
248
- props.customTimeTo,
249
- props.validDateEnd,
250
- props.formatDate
251
- )
252
- if (Array.isArray(checkDateResult)) {
253
- period[0] = Math.round(checkDateResult[0] / 1000)
254
- period[1] = Math.round(checkDateResult[1] / 1000)
255
- }
256
- }
257
-
258
- const tools: UI_I_SensorsGraphPayload = {
259
- fields,
260
- period,
261
- periodName: periodValue,
262
- view: viewValue,
263
- }
264
- if (selectedValue.metric) tools.metricType = selectedValue.metric
265
-
266
- emits('update-timespan-type', selectedPeriod.value)
267
- emits('update-tools', tools)
268
- }
269
-
270
- const chartTitleDate = computed<string>(() => {
271
- if (!props.startDate || !updateTimeFormatAndInterfaceLang.value) return ''
272
-
273
- const start = $formattedDatetime(props.startDate, { hasSeconds: true })
274
- const end = $formattedDatetime(props.endDate, { hasSeconds: true })
275
- return `${start} - ${end}`
276
- })
277
-
278
- const onShowChartOptions = (): void => {
279
- emits('show-chart-modal')
280
- }
281
-
282
- const onSaveOptionName = (): void => {
283
- optionsNames.value = getCurrentOptionsStorageFunc()
284
- }
285
-
286
- onMounted(() => {
287
- optionsNames.value = getCurrentOptionsStorageFunc()
288
- onUpdateTools()
289
- })
290
- </script>
291
-
292
- <style scoped lang="scss">
293
- .horizontal-flex-container {
294
- display: flex;
295
- flex-direction: row;
296
- align-items: center;
297
- line-height: 20px;
298
- flex-shrink: 0;
299
-
300
- .chart-title-content {
301
- overflow: hidden;
302
- text-overflow: ellipsis;
303
- }
304
-
305
- .select select {
306
- height: 20px;
307
- margin: 5px;
308
- color: var(--global-font-color);
309
- }
310
- .single-option {
311
- margin-left: 5px;
312
- }
313
-
314
- .chart-title {
315
- color: var(--global-font-color);
316
- text-overflow: ellipsis;
317
- white-space: nowrap;
318
- overflow: hidden;
319
- margin: 6px;
320
- font-weight: 700;
321
- text-transform: capitalize;
322
-
323
- &.uppercase {
324
- text-transform: uppercase;
325
- }
326
- }
327
-
328
- .view-select-label {
329
- margin-left: auto;
330
- padding-right: 7px;
331
- padding-left: 7px;
332
- text-overflow: ellipsis;
333
- white-space: nowrap;
334
- align-items: center;
335
- }
336
-
337
- .chart-options-button {
338
- margin-left: 5px;
339
- text-overflow: ellipsis;
340
- white-space: nowrap;
341
- text-transform: capitalize;
342
- color: var(--dropdown-item-color);
343
- cursor: pointer;
344
- }
345
-
346
- .chart-action-bar {
347
- white-space: nowrap;
348
-
349
- .menu-item {
350
- padding-right: 4px;
351
- display: inline-block;
352
- list-style: none;
353
- vertical-align: middle;
354
-
355
- &:last-child {
356
- padding-right: 0;
357
- }
358
-
359
- .item-link {
360
- padding: 4px;
361
- line-height: 22px;
362
- border: 1px solid transparent;
363
- display: inline-block;
364
-
365
- &:hover {
366
- text-decoration: none;
367
- background-color: #e9f6fd;
368
- border: 1px solid #c7e9ff;
369
- }
370
-
371
- .icon {
372
- width: 16px;
373
- height: 16px;
374
- display: block;
375
- min-width: 16px;
376
- min-height: 16px;
377
- background-size: 100% auto;
378
- }
379
- }
380
-
381
- :deep(.dropdown-menu) {
382
- min-width: auto;
383
- padding: 0;
384
- }
385
- :deep(.user-menu-large) {
386
- padding: 0;
387
- }
388
- :deep(.angle-icon) {
389
- display: none;
390
- }
391
- }
392
- }
393
- }
394
- </style>
1
+ <template>
2
+ <div class="horizontal-flex-container">
3
+ <div class="chart-title-content">
4
+ <client-only>
5
+ <span v-if="props.chartTitle" class="chart-title"
6
+ >{{ props.chartTitle }},</span
7
+ >
8
+ <span v-if="chartTitleDate" class="chart-title uppercase">{{
9
+ chartTitleDate
10
+ }}</span>
11
+ </client-only>
12
+ </div>
13
+ <div class="horizontal-flex-container">
14
+ <label for="periodSelect" class="label-select"
15
+ >{{ localization.inventoryMonitor.period }}:</label
16
+ >
17
+ <div class="select">
18
+ <select
19
+ id="periodSelect"
20
+ v-model="selectedPeriod"
21
+ data-id="period-select"
22
+ @change="onUpdateTools"
23
+ >
24
+ <option
25
+ v-for="(item, index) in periodOptions"
26
+ :key="index"
27
+ :value="item.value"
28
+ >
29
+ {{ item.text }}
30
+ </option>
31
+ </select>
32
+ </div>
33
+ <a
34
+ id="chart-options-button"
35
+ class="chart-options-button"
36
+ data-id="show-chart-options-button"
37
+ @click="onShowChartOptions"
38
+ >{{ localization.inventoryMonitor.chartOptions }}</a
39
+ >
40
+ </div>
41
+ <div class="view-select-label horizontal-flex-container">
42
+ <label for="viewSelect" class="label-select"
43
+ >{{ localization.common.view }}:</label
44
+ >
45
+ <div class="select">
46
+ <select
47
+ id="viewSelect"
48
+ v-model="selectedView"
49
+ data-id="view-select"
50
+ @change="onUpdateTools"
51
+ >
52
+ <option
53
+ v-for="(item, index) in viewOptions"
54
+ :key="index"
55
+ :value="item.value"
56
+ >
57
+ {{ item.text }}
58
+ </option>
59
+ </select>
60
+ </div>
61
+ </div>
62
+ </div>
63
+
64
+ <common-pages-hardware-health-history-testimony-tools-chart-options-modal
65
+ v-if="props.isShowChartModal"
66
+ :selected-chart-option-name="props.selectedChartOptionName"
67
+ :selected-metric="props.selectedMetric"
68
+ :selected-chart-type="props.selectedChartType"
69
+ :power-selected-rows-local="props.powerSelectedRowsLocal"
70
+ :temperature-selected-rows-local="props.temperatureSelectedRowsLocal"
71
+ :selected-power-counters-keys="props.selectedPowerCountersKeys"
72
+ :selected-temperature-counters-keys="props.selectedTemperatureCountersKeys"
73
+ :units-count="props.unitsCount"
74
+ :power-counters-table-data="props.powerCountersTableData"
75
+ :temperature-counters-table-data="props.temperatureCountersTableData"
76
+ :language="props.language"
77
+ :selected-timespan-type="props.selectedTimespanType"
78
+ :custom-date-from="props.customDateFrom"
79
+ :custom-date-to="props.customDateTo"
80
+ :custom-time-from="props.customTimeFrom"
81
+ :custom-time-to="props.customTimeTo"
82
+ :timespan-period-type="props.timespanPeriodType"
83
+ :valid-date-end="props.validDateEnd"
84
+ :format-date="props.formatDate"
85
+ @save-option-name="onSaveOptionName"
86
+ @delete-option="emits('delete-option')"
87
+ @power-selected-rows-local="emits('power-selected-rows-local', $event)"
88
+ @update-period-type="emits('update-period-type', $event)"
89
+ @temperature-selected-rows-local="
90
+ emits('temperature-selected-rows-local', $event)
91
+ "
92
+ @submit-options="emits('submit-options', $event)"
93
+ @hide="onHideChartModal"
94
+ />
95
+ </template>
96
+
97
+ <script setup lang="ts">
98
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
99
+ import type { UI_I_HardwareHealthSensorsGraph } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
100
+ import type { UI_I_SensorsGraphPayload } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/models/interfaces'
101
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
102
+ import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
103
+ import type { UI_T_Chart } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/types'
104
+ import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
105
+ import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
106
+ import {
107
+ getCurrentOptionsStorageFunc,
108
+ periodFunc,
109
+ viewFunc,
110
+ } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/config/toolbar'
111
+
112
+ const props = defineProps<{
113
+ selectedChartOptionName: string
114
+ isShowChartModal: boolean
115
+ chartTitle: string
116
+ selectedMetric: UI_T_Chart
117
+ selectedChartType: string
118
+ selectedPowerCountersKeys: number[]
119
+ powerSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
120
+ selectedTemperatureCountersKeys: number[]
121
+ temperatureSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
122
+ unitsCount: number
123
+ powerCountersTableData: UI_I_HardwareHealthSensorsGraph[]
124
+ temperatureCountersTableData: UI_I_HardwareHealthSensorsGraph[]
125
+ language: string
126
+ customDateFrom: string
127
+ customDateTo: string
128
+ customTimeFrom: string
129
+ customTimeTo: string
130
+ selectedTimespanType: string
131
+ startDate: number
132
+ endDate: number
133
+ timespanPeriodType: string
134
+ validDateEnd: number
135
+ formatDate: string
136
+ }>()
137
+ const selectedView = defineModel<string>('selectedView')
138
+
139
+ const emits = defineEmits<{
140
+ (event: 'show-chart-modal'): void
141
+ (event: 'hide-chart-modal'): void
142
+ (event: 'update-tools', value: UI_I_SensorsGraphPayload): void
143
+ (event: 'exporting', value: string): void
144
+ (event: 'open-advanced-page'): void
145
+ (event: 'select-metric-local', value: string): void
146
+ (
147
+ event: 'power-selected-rows-local',
148
+ value: UI_I_HardwareHealthSensorsGraph[]
149
+ ): void
150
+ (
151
+ event: 'temperature-selected-rows-local',
152
+ value: UI_I_HardwareHealthSensorsGraph[]
153
+ ): void
154
+ (event: 'update-chart-type', value: string): void
155
+ (event: 'update-timespan-type', value: string): void
156
+ (event: 'update-unit-count', value: number): void
157
+ (event: 'update-period-type', value: string): void
158
+ (event: 'update-custom-time', value: string): void
159
+ (event: 'delete-option'): void
160
+ (event: 'update-custom-date-from', value: string): void
161
+ (event: 'update-custom-date-to', value: string): void
162
+ (event: 'update-custom-time-from', value: string): void
163
+ (event: 'update-custom-time-to', value: string): void
164
+ (event: 'submit-options', value: UI_I_OptionsForm): void
165
+ (event: 'update:selected-timespan-type', value: string): void
166
+ }>()
167
+
168
+ const localization = computed<UI_I_Localization>(() => useLocal())
169
+
170
+ const { $store, $formattedDatetime }: any = useNuxtApp()
171
+
172
+ const updateTimeFormatAndInterfaceLang = computed<number>(
173
+ () => $store.getters['main/getUpdateTimeFormatAndInterfaceLang']
174
+ )
175
+
176
+ const periodOptions = computed<UI_I_OptionItem[]>(() =>
177
+ periodFunc(localization.value, props.selectedTimespanType)
178
+ )
179
+ const selectedPeriod = computed<string>({
180
+ get() {
181
+ return props.selectedTimespanType || periodOptions.value[0].value
182
+ },
183
+ set(newValue) {
184
+ emits('update:selected-timespan-type', newValue)
185
+ },
186
+ })
187
+
188
+ const optionsNames = ref<string[]>([])
189
+
190
+ const viewOptions = computed<UI_I_OptionItem[]>(() =>
191
+ viewFunc(localization.value, optionsNames.value)
192
+ )
193
+
194
+ watch(
195
+ () => props.selectedChartOptionName,
196
+ (newValue) => {
197
+ let currentValue = ''
198
+
199
+ if (newValue) currentValue = newValue
200
+ else if (
201
+ selectedView.value &&
202
+ optionsNames.value.includes(selectedView.value)
203
+ )
204
+ currentValue = selectedView.value
205
+ else currentValue = selectedView.value || viewOptions.value[0]?.value
206
+
207
+ selectedView.value = currentValue
208
+ },
209
+ { immediate: true }
210
+ )
211
+
212
+ const onHideChartModal = (): void => {
213
+ emits('hide-chart-modal')
214
+ }
215
+
216
+ const onUpdateTools = (): void => {
217
+ const periodValue = selectedPeriod.value
218
+ const viewValue = selectedView.value
219
+ const selectedValue = useLocalStorage(
220
+ viewValue + 'ChartOptionsSensors',
221
+ undefined
222
+ )
223
+
224
+ const fields = selectedValue
225
+ ? selectedValue.counters.map((item) => item.name).join(', ')
226
+ : ''
227
+ const validPeriodData = getValidDateByOptionFunc(
228
+ periodValue,
229
+ selectedValue,
230
+ props.unitsCount,
231
+ null
232
+ )
233
+
234
+ const period = [
235
+ Math.round(validPeriodData[0] / 1000),
236
+ Math.round(validPeriodData[1] / 1000),
237
+ ]
238
+
239
+ if (
240
+ periodValue === 'custom_interval' &&
241
+ props.timespanPeriodType === 'period'
242
+ ) {
243
+ const checkDateResult = checkDateFunc(
244
+ localization.value,
245
+ props.customDateFrom,
246
+ props.customDateTo,
247
+ props.customTimeFrom,
248
+ props.customTimeTo,
249
+ props.validDateEnd,
250
+ props.formatDate
251
+ )
252
+ if (Array.isArray(checkDateResult)) {
253
+ period[0] = Math.round(checkDateResult[0] / 1000)
254
+ period[1] = Math.round(checkDateResult[1] / 1000)
255
+ }
256
+ }
257
+
258
+ const tools: UI_I_SensorsGraphPayload = {
259
+ fields,
260
+ period,
261
+ periodName: periodValue,
262
+ view: viewValue,
263
+ }
264
+ if (selectedValue.metric) tools.metricType = selectedValue.metric
265
+
266
+ emits('update-timespan-type', selectedPeriod.value)
267
+ emits('update-tools', tools)
268
+ }
269
+
270
+ const chartTitleDate = computed<string>(() => {
271
+ if (!props.startDate || !updateTimeFormatAndInterfaceLang.value) return ''
272
+
273
+ const start = $formattedDatetime(props.startDate, { hasSeconds: true })
274
+ const end = $formattedDatetime(props.endDate, { hasSeconds: true })
275
+ return `${start} - ${end}`
276
+ })
277
+
278
+ const onShowChartOptions = (): void => {
279
+ emits('show-chart-modal')
280
+ }
281
+
282
+ const onSaveOptionName = (): void => {
283
+ optionsNames.value = getCurrentOptionsStorageFunc()
284
+ }
285
+
286
+ onMounted(() => {
287
+ optionsNames.value = getCurrentOptionsStorageFunc()
288
+ onUpdateTools()
289
+ })
290
+ </script>
291
+
292
+ <style scoped lang="scss">
293
+ .horizontal-flex-container {
294
+ display: flex;
295
+ flex-direction: row;
296
+ align-items: center;
297
+ line-height: 20px;
298
+ flex-shrink: 0;
299
+
300
+ .chart-title-content {
301
+ overflow: hidden;
302
+ text-overflow: ellipsis;
303
+ }
304
+
305
+ .select select {
306
+ height: 20px;
307
+ margin: 5px;
308
+ color: var(--global-font-color);
309
+ }
310
+ .single-option {
311
+ margin-left: 5px;
312
+ }
313
+
314
+ .chart-title {
315
+ color: var(--global-font-color);
316
+ text-overflow: ellipsis;
317
+ white-space: nowrap;
318
+ overflow: hidden;
319
+ margin: 6px;
320
+ font-weight: 700;
321
+ text-transform: capitalize;
322
+
323
+ &.uppercase {
324
+ text-transform: uppercase;
325
+ }
326
+ }
327
+
328
+ .view-select-label {
329
+ margin-left: auto;
330
+ padding-right: 7px;
331
+ padding-left: 7px;
332
+ text-overflow: ellipsis;
333
+ white-space: nowrap;
334
+ align-items: center;
335
+ }
336
+
337
+ .chart-options-button {
338
+ margin-left: 5px;
339
+ text-overflow: ellipsis;
340
+ white-space: nowrap;
341
+ text-transform: capitalize;
342
+ color: var(--dropdown-item-color);
343
+ cursor: pointer;
344
+ }
345
+
346
+ .chart-action-bar {
347
+ white-space: nowrap;
348
+
349
+ .menu-item {
350
+ padding-right: 4px;
351
+ display: inline-block;
352
+ list-style: none;
353
+ vertical-align: middle;
354
+
355
+ &:last-child {
356
+ padding-right: 0;
357
+ }
358
+
359
+ .item-link {
360
+ padding: 4px;
361
+ line-height: 22px;
362
+ border: 1px solid transparent;
363
+ display: inline-block;
364
+
365
+ &:hover {
366
+ text-decoration: none;
367
+ background-color: #e9f6fd;
368
+ border: 1px solid #c7e9ff;
369
+ }
370
+
371
+ .icon {
372
+ width: 16px;
373
+ height: 16px;
374
+ display: block;
375
+ min-width: 16px;
376
+ min-height: 16px;
377
+ background-size: 100% auto;
378
+ }
379
+ }
380
+
381
+ :deep(.dropdown-menu) {
382
+ min-width: auto;
383
+ padding: 0;
384
+ }
385
+ :deep(.user-menu-large) {
386
+ padding: 0;
387
+ }
388
+ :deep(.angle-icon) {
389
+ display: none;
390
+ }
391
+ }
392
+ }
393
+ }
394
+ </style>