bfg-common 1.4.799 → 1.4.801

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 (157) hide show
  1. package/assets/img/icons/icons-sprite-dark-1.svg +31 -14
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-4.svg +6 -1
  4. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  5. package/assets/img/icons/icons-sprite-light-1.svg +30 -13
  6. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  7. package/assets/img/icons/icons-sprite-light-4.svg +6 -1
  8. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  9. package/assets/localization/local_be.json +33 -8
  10. package/assets/localization/local_en.json +33 -8
  11. package/assets/localization/local_hy.json +33 -8
  12. package/assets/localization/local_kk.json +34 -9
  13. package/assets/localization/local_ru.json +43 -18
  14. package/assets/localization/local_zh.json +33 -8
  15. package/assets/scss/clarity/local_ar.json +6 -3
  16. package/assets/scss/common/icons/icons-1.scss +4 -4
  17. package/components/atoms/autocomplete/Autocomplete.vue +68 -12
  18. package/components/atoms/select/TheSelect.vue +10 -1
  19. package/components/atoms/table/dataGrid/DataGrid.vue +12 -4
  20. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +4 -1
  21. package/components/atoms/table/dataGrid/lib/utils/export.ts +13 -13
  22. package/components/atoms/tabs/VerticalTabs.vue +11 -6
  23. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  24. package/components/common/browse/lib/models/interfaces.ts +5 -5
  25. package/components/common/chartOptionsModal/counters/timespan/form/Form.vue +544 -544
  26. package/components/common/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +116 -116
  27. package/components/common/context/Context.vue +16 -4
  28. package/components/common/context/recursion/Recursion.vue +2 -1
  29. package/components/common/context/recursion/RecursionNew.vue +57 -31
  30. package/components/common/context/recursion/RecursionOld.vue +33 -19
  31. package/components/common/diagramMain/Header.vue +211 -211
  32. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  33. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  34. package/components/common/diagramMain/lib/models/types.ts +21 -21
  35. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  36. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  37. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  38. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  39. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  40. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  41. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  42. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  43. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  44. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +7 -7
  45. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  46. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  47. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  48. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  49. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  50. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  51. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  52. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  53. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  54. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  55. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  56. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  57. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  58. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  59. package/components/common/diagramMain/port/Ports.vue +47 -47
  60. package/components/common/feedback/Buttons.vue +2 -2
  61. package/components/common/feedback/Message.vue +1 -0
  62. package/components/common/feedback/VisitPortal.vue +5 -1
  63. package/components/common/graph/Graph.vue +5 -11
  64. package/components/common/graph/GraphNew.vue +71 -0
  65. package/components/common/graph/GraphOld.vue +31 -0
  66. package/components/common/layout/theHeader/feedback/new/New.vue +29 -14
  67. package/components/common/layout/theHeader/feedback/new/additionalDetails/AdditionalDetails.vue +34 -9
  68. package/components/common/layout/theHeader/feedback/new/additionalDetails/Headline.vue +17 -6
  69. package/components/common/layout/theHeader/feedback/new/description/Description.vue +1 -0
  70. package/components/common/layout/theHeader/feedback/new/email/Email.vue +1 -1
  71. package/components/common/layout/theHeader/feedback/new/subtitle/Subtitle.vue +22 -6
  72. package/components/common/layout/theHeader/feedback/new/tabs/Tabs.vue +17 -15
  73. package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePasswordNew.vue +1 -1
  74. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +3 -2
  75. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +1 -1
  76. package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +1 -1
  77. package/components/common/monitor/advanced/tools/chartOptionsModal/Notification.vue +7 -7
  78. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +95 -95
  79. package/components/common/monitor/overview/Overview.vue +14 -28
  80. package/components/common/monitor/overview/OverviewNew.vue +138 -0
  81. package/components/common/monitor/overview/OverviewOld.vue +137 -0
  82. package/components/common/monitor/overview/filters/Filters.vue +35 -103
  83. package/components/common/monitor/overview/filters/FiltersNew.vue +122 -0
  84. package/components/common/monitor/overview/filters/FiltersOld.vue +151 -0
  85. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +1 -1
  86. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +463 -456
  87. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +389 -387
  88. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +8 -0
  89. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/Counters.vue +94 -94
  90. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/Timespan.vue +66 -66
  91. package/components/common/pages/home/headline/Headline.vue +3 -2
  92. package/components/common/pages/home/headline/HeadlineNew.vue +1 -1
  93. package/components/common/pages/home/headline/HeadlineOld.vue +5 -0
  94. package/components/common/pages/home/widgets/vms/VmsNew.vue +1 -1
  95. package/components/common/pages/packages/Packages.vue +208 -0
  96. package/components/common/pages/packages/lib/config/actions.ts +59 -0
  97. package/components/common/pages/packages/lib/models/types.ts +8 -0
  98. package/components/common/pages/packages/tableView/TableView.vue +120 -0
  99. package/components/common/pages/packages/tableView/lib/config/configTable.ts +136 -0
  100. package/components/common/pages/packages/tableView/lib/config/tableKey.ts +14 -0
  101. package/components/common/pages/packages/tableView/lib/models/types.ts +12 -0
  102. package/components/common/pages/shortcuts/Shortcuts.vue +1 -1
  103. package/components/common/pages/tasks/Tasks.vue +23 -8
  104. package/components/common/pages/tasks/table/Table.vue +66 -16
  105. package/components/common/pages/tasks/table/errorInfo/ErrorInfo.vue +27 -10
  106. package/components/common/pages/tasks/table/expandDetails/ExpandDetails.vue +28 -12
  107. package/components/common/pages/tasks/table/lib/config/config.ts +11 -11
  108. package/components/common/portlets/customAttributes/Portlet.vue +4 -4
  109. package/components/common/portlets/tag/TagAddNew.vue +4 -4
  110. package/components/common/select/radio/RadioGroup.vue +3 -3
  111. package/components/common/selectLanguage/SelectLanguage.vue +29 -25
  112. package/components/common/selectLanguage/lib/config/config.ts +1 -0
  113. package/components/common/split/horizontal/HorizontalNew.vue +42 -24
  114. package/components/common/split/horizontal/HorizontalOld.vue +43 -13
  115. package/components/common/vm/actions/add/Add.vue +6 -1
  116. package/components/common/vm/actions/clone/Clone.vue +8 -3
  117. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +4 -0
  118. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +6 -4
  119. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +26 -10
  120. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +12 -4
  121. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +6 -3
  122. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +4 -2
  123. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +6 -4
  124. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +9 -3
  125. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +3 -2
  126. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +3 -2
  127. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +87 -24
  128. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +14 -8
  129. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +9 -7
  130. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +0 -4
  131. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +43 -12
  132. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +50 -25
  133. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +5 -7
  134. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoNew.vue +64 -28
  135. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +60 -19
  136. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +11 -4
  137. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +16 -1
  138. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridNew.vue +59 -8
  139. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +60 -7
  140. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +1 -1
  141. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionOld.vue +1 -1
  142. package/components/common/vm/actions/common/lib/config/capabilities.ts +1 -1
  143. package/components/common/vm/actions/editSettings/EditSettings.vue +4 -0
  144. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +2 -0
  145. package/components/common/vm/actions/editSettings/new/New.vue +2 -0
  146. package/components/common/wizards/datastore/add/Add.vue +4 -4
  147. package/components/common/wizards/datastore/add/lib/config/steps.ts +14 -14
  148. package/components/common/wizards/datastore/add/lib/validations.ts +9 -9
  149. package/components/common/wizards/datastore/add/nfs/Nfs.vue +6 -9
  150. package/components/common/wizards/vm/migrate/Migrate.vue +12 -12
  151. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +1 -1
  152. package/composables/useLocal.ts +3 -1
  153. package/composables/useLocalStorage.ts +1 -1
  154. package/lib/models/store/vm/interfaces.ts +11 -0
  155. package/lib/models/table/interfaces.ts +1 -0
  156. package/package.json +3 -3
  157. package/store/tasks/actions.ts +2 -1
@@ -1,456 +1,463 @@
1
- <template>
2
- <common-pages-hardware-health-history-testimony-tools
3
- v-model:selected-view="selectedView"
4
- v-model:selected-timespan-type="selectedTimespanType"
5
- :selected-chart-option-name="selectedChartOptionName"
6
- :is-show-chart-modal="isShowChartModal"
7
- :chart-title="props.powerData?.groupName || ''"
8
- :selected-metric="selectedMetric"
9
- :selected-power-counters-keys="selectedPowerCountersKeys"
10
- :power-selected-rows-local="powerSelectedRowsLocal"
11
- :selected-temperature-counters-keys="selectedTemperatureCountersKeys"
12
- :temperature-selected-rows-local="temperatureSelectedRowsLocal"
13
- :units-count="unitsCount"
14
- :power-counters-table-data="powerCountersTableData"
15
- :temperature-counters-table-data="temperatureCountersTableData"
16
- :language="props.language"
17
- :custom-date-from="customDateFrom"
18
- :custom-date-to="customDateTo"
19
- :custom-time-from="customTimeFrom"
20
- :custom-time-to="customTimeTo"
21
- :start-date="props.powerData?.pointStart || 0"
22
- :end-date="props.powerData?.pointEnd || 0"
23
- :timespan-period-type="timespanPeriodType"
24
- :valid-date-end="props.validDateEnd"
25
- :format-date="props.formatDate"
26
- @power-selected-rows-local="powerSelectedRowsLocal = $event"
27
- @temperature-selected-rows-local="temperatureSelectedRowsLocal = $event"
28
- @show-chart-modal="isShowChartModal = true"
29
- @hide-chart-modal="isShowChartModal = false"
30
- @update-tools="onUpdateTools"
31
- @delete-option="onDeleteOption"
32
- @submit-options="onSubmitOptions"
33
- @update-period-type="timespanPeriodType = $event"
34
- />
35
- <div
36
- ref="historyTestimonyGraph"
37
- :class="[
38
- `history-testimony-graph ${selectedView}`,
39
- { medium: isMediumSizeGraphsContainer },
40
- ]"
41
- >
42
- <div class="graph-container">
43
- <common-graph
44
- v-if="powerDataLocal && !props.powerLoading"
45
- :data="powerDataLocal"
46
- :update="updatePowerHelper"
47
- :chart="powerChart"
48
- :selected-row="selectedRowPower"
49
- />
50
- <div
51
- v-else-if="props.powerLoading"
52
- class="history-testimony-graph__loader-block"
53
- >
54
- <div class="spinner"></div>
55
- </div>
56
- <div v-else class="history-testimony-graph__empty-content"></div>
57
- </div>
58
- <div class="graph-container">
59
- <common-graph
60
- v-if="temperatureDataLocal && !props.temperatureLoading"
61
- :data="temperatureDataLocal"
62
- :update="updateTemperatureHelper"
63
- :chart="temperatureChart"
64
- :selected-row="selectedRowTemperature"
65
- />
66
- <div
67
- v-else-if="props.temperatureLoading"
68
- class="history-testimony-graph__loader-block"
69
- >
70
- <div class="spinner"></div>
71
- </div>
72
- <div v-else class="history-testimony-graph__empty-content"></div>
73
- </div>
74
- </div>
75
- </template>
76
-
77
- <script setup lang="ts">
78
- import { useElementSize } from '@vueuse/core'
79
- import { format } from 'date-fns'
80
- import type {
81
- I_SeriesLine,
82
- I_LineGraph,
83
- } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
84
- import { graphDataFunc } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
85
- import type { UI_I_OptionsForm } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/interfaces'
86
- import type { UI_I_Localization } from '~/lib/models/interfaces'
87
- import type { UI_T_Chart } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/types'
88
- import type { UI_I_HardwareHealthSensors } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
89
- import type {
90
- UI_I_HardwareHealthHistoryTestimonyTools,
91
- UI_I_HardwareHealthSensorsGraph,
92
- } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
93
- import type { UI_I_SensorsGraphPayload } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/models/interfaces'
94
- import { containerMediumSize } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/config/containerSizes'
95
-
96
- const emits = defineEmits<{
97
- (event: 'update-tools', value: UI_I_HardwareHealthHistoryTestimonyTools): void
98
- }>()
99
- const props = defineProps<{
100
- powerData: I_SeriesLine | null
101
- temperatureData: I_SeriesLine | null
102
- countersTableData: UI_I_HardwareHealthSensors[]
103
- language: string
104
- powerLoading: boolean
105
- temperatureLoading: boolean
106
- formattedDatetime: any
107
- isDarkMode: boolean
108
- getDateFormat: any
109
- mainSelectedRow: number[]
110
- validDateEnd: number
111
- formatDate: string
112
- }>()
113
- const selectedView = defineModel<string>('selectedView')
114
-
115
- const { $store }: any = useNuxtApp()
116
-
117
- const historyTestimonyGraph = ref<any>(null)
118
- const { width } = useElementSize(historyTestimonyGraph)
119
- const isMediumSizeGraphsContainer = computed<boolean>(
120
- () => width.value < containerMediumSize
121
- )
122
-
123
- // const historyTestimonyGraph = ref(null)
124
- // const contentWidth = ref<number>(
125
- // useElementSize(historyTestimonyGraph)?.width || 0
126
- // )
127
- // watch(contentWidth, (newValue) => {
128
- // if (newValue) {
129
- // updatePowerChart()
130
- // updateTemperatureChart()
131
- // }
132
- // if (!powerChart.value || !temperatureChart.value) return
133
- //
134
- // powerChart.value.setSize(1, powerChart.chartHeight)
135
- // temperatureChart.value.setSize(1, temperatureChart.chartHeight)
136
- //
137
- // setTimeout(() => {
138
- // powerChart.value.setSize(newValue, powerChart.chartHeight)
139
- // temperatureChart.value.setSize(newValue, temperatureChart.chartHeight)
140
- // }, 1000)
141
- // })
142
- // const isContentMediumSize = computed<boolean>(() => contentWidth.value <= 1200)
143
-
144
- const selectedChartOptionName = ref<string>('')
145
- const isShowChartModal = ref<boolean>(false)
146
- const selectedMetric = ref<UI_T_Chart>('power')
147
- const selectedPowerCountersKeys = ref<number[]>([])
148
- const selectedTemperatureCountersKeys = ref<number[]>([])
149
- const selectedTimespanType = ref<string>('')
150
- const customDateFrom = ref<string>('')
151
- const customDateTo = ref<string>('')
152
- const customTimeFrom = ref<string>('')
153
- const customTimeTo = ref<string>('')
154
-
155
- const selectedRowPower = ref<number[]>([])
156
- const selectedRowTemperature = ref<number[]>([])
157
- let powerCounters: UI_I_HardwareHealthSensors[] = []
158
- let temperatureCounters: UI_I_HardwareHealthSensors[] = []
159
- const updateAllSelectedSelectedRow = (): void => {
160
- selectedRowPower.value = []
161
- selectedRowTemperature.value = []
162
-
163
- if (!props.mainSelectedRow.length) return
164
-
165
- props.mainSelectedRow.forEach((key) => {
166
- const selectedItem = props.countersTableData[key]
167
- const category = selectedItem.category.toLowerCase()
168
-
169
- if (category === 'power') {
170
- const currentKey = powerCounters.findIndex(
171
- (item) => item.id === selectedItem.id
172
- )
173
- selectedRowPower.value.push(currentKey)
174
- } else if (category === 'temperature') {
175
- const currentKey = temperatureCounters.findIndex(
176
- (item) => item.id === selectedItem.id
177
- )
178
- selectedRowTemperature.value.push(currentKey)
179
- }
180
- })
181
- }
182
- watch(
183
- () => props.countersTableData,
184
- (newValue) => {
185
- powerCounters = newValue.filter(
186
- (item) => item.category.toLowerCase() === 'power'
187
- )
188
- temperatureCounters = newValue.filter(
189
- (item) => item.category.toLowerCase() === 'temperature'
190
- )
191
- },
192
- { deep: true, immediate: true }
193
- )
194
- watch(
195
- () => props.mainSelectedRow,
196
- () => {
197
- updateAllSelectedSelectedRow()
198
- },
199
- { deep: true, immediate: true }
200
- )
201
- watch(
202
- selectedView,
203
- () => {
204
- updateAllSelectedSelectedRow()
205
- },
206
- { deep: true }
207
- )
208
-
209
- const unitsCount = ref<number>(0)
210
- const powerCountersTableData = ref<UI_I_HardwareHealthSensorsGraph[]>([])
211
- const temperatureCountersTableData = ref<UI_I_HardwareHealthSensorsGraph[]>([])
212
- const powerSelectedRowsLocal = ref<UI_I_HardwareHealthSensorsGraph[]>([])
213
- const temperatureSelectedRowsLocal = ref<UI_I_HardwareHealthSensorsGraph[]>([])
214
-
215
- watch(
216
- () => props.countersTableData,
217
- (newValue) => {
218
- if (!newValue.length) return
219
-
220
- powerCountersTableData.value = []
221
- temperatureCountersTableData.value = []
222
-
223
- newValue.forEach((item, key) => {
224
- const newData: UI_I_HardwareHealthSensorsGraph = {
225
- id: key,
226
- name: item.name,
227
- description: item.category,
228
- measurement: '',
229
- units: '',
230
- nameEn: item.mainName || '',
231
- testId: `counters-table-${item.name}-item`,
232
- hidden: item.hidden,
233
- }
234
- if (item.category.toLowerCase() === 'power')
235
- powerCountersTableData.value.push(newData)
236
- else if (item.category.toLowerCase() === 'temperature')
237
- temperatureCountersTableData.value.push(newData)
238
- })
239
- },
240
- { immediate: true, deep: true }
241
- )
242
-
243
- const selectAllCounters = (): void => {
244
- if (!powerCountersTableData.value)
245
- setTimeout(() => {
246
- selectAllCounters()
247
- }, 2000)
248
- else {
249
- powerCountersTableData.value.forEach((item) => {
250
- selectedPowerCountersKeys.value.push(item.id)
251
- })
252
- temperatureCountersTableData.value.forEach((item) => {
253
- if (!item.hidden) selectedTemperatureCountersKeys.value.push(item.id)
254
- })
255
- }
256
- }
257
-
258
- onMounted(() => {
259
- selectAllCounters()
260
- })
261
-
262
- const localization = computed<UI_I_Localization>(() => useLocal())
263
-
264
- const powerDataLocal = ref<I_LineGraph | null>(null)
265
- const temperatureDataLocal = ref<I_LineGraph | null>(null)
266
- const updatePowerHelper = ref<number>(0)
267
- const updateTemperatureHelper = ref<number>(0)
268
- let dateFormat = ''
269
- const powerChart = ref<any>(null)
270
- const temperatureChart = ref<any>(null)
271
- const timespanPeriodType = ref<string>('last')
272
-
273
- const powerChartCallback = (newValue: any): void => {
274
- newValue && (powerChart.value = newValue)
275
- }
276
-
277
- const temperatureChartCallback = (newValue: any): void => {
278
- newValue && (temperatureChart.value = newValue)
279
- }
280
-
281
- const updatePowerChart = (): void => {
282
- if (!props.powerData) return
283
-
284
- powerDataLocal.value = graphDataFunc(
285
- props.powerData,
286
- props.isDarkMode,
287
- localization.value,
288
- () => {},
289
- false,
290
- false,
291
- true,
292
- 'spline',
293
- '',
294
- undefined,
295
- powerChartCallback,
296
- props.formattedDatetime,
297
- format,
298
- dateFormat
299
- )
300
-
301
- updatePowerHelper.value++
302
- }
303
-
304
- const updateTemperatureChart = (): void => {
305
- if (!props.temperatureData) return
306
-
307
- temperatureDataLocal.value = graphDataFunc(
308
- props.temperatureData,
309
- props.isDarkMode,
310
- localization.value,
311
- () => {},
312
- false,
313
- false,
314
- true,
315
- 'spline',
316
- '',
317
- undefined,
318
- temperatureChartCallback,
319
- props.formattedDatetime,
320
- format,
321
- dateFormat
322
- )
323
-
324
- updateTemperatureHelper.value++
325
- }
326
-
327
- watch(
328
- () => [props.powerData, props.isDarkMode, props.language],
329
- (newValue) => {
330
- dateFormat = props.getDateFormat(newValue[2])
331
- updatePowerChart()
332
- },
333
- { immediate: true, deep: true }
334
- )
335
-
336
- watch(
337
- () => [props.temperatureData, props.isDarkMode, props.language],
338
- (newValue) => {
339
- dateFormat = props.getDateFormat(newValue[2])
340
- updateTemperatureChart()
341
- },
342
- { immediate: true, deep: true }
343
- )
344
-
345
- const updateSelectedCountersKeys = (metricType: string): void => {
346
- if (metricType === 'power') {
347
- const newKeys: number[] = []
348
-
349
- powerSelectedRowsLocal.value.forEach((item) => {
350
- newKeys.push(item.id)
351
- })
352
- selectedPowerCountersKeys.value = newKeys
353
- } else if (metricType === 'temperature') {
354
- const newKeys: number[] = []
355
-
356
- temperatureSelectedRowsLocal.value.forEach((item) => {
357
- newKeys.push(item.id)
358
- })
359
- selectedTemperatureCountersKeys.value = newKeys
360
- }
361
- }
362
-
363
- const tools: UI_I_HardwareHealthHistoryTestimonyTools = {
364
- periodName: 'real_time',
365
- view: 'power',
366
- metricType: selectedMetric.value,
367
- period: [],
368
- }
369
-
370
- const onSubmitOptions = (data: UI_I_OptionsForm): void => {
371
- selectedTimespanType.value = data.periodName
372
- updateSelectedCountersKeys(data.metric)
373
- if (data.metric === 'power')
374
- $store.dispatch(
375
- 'monitor/A_GET_HARDWARE_HEALTH_HISTORY_TESTIMONY_POWER',
376
- data
377
- )
378
- if (data.metric === 'temperature')
379
- $store.dispatch(
380
- 'monitor/A_GET_HARDWARE_HEALTH_HISTORY_TESTIMONY_TEMPERATURE',
381
- data
382
- )
383
- }
384
-
385
- const onUpdateTools = (data: UI_I_SensorsGraphPayload): void => {
386
- const storageChartOptions = useLocalStorage(
387
- data.view + 'ChartOptionsSensors',
388
- undefined
389
- )
390
-
391
- selectedChartOptionName.value = ''
392
-
393
- if (storageChartOptions) {
394
- selectedChartOptionName.value = data.view
395
- } else {
396
- selectedMetric.value = 'power'
397
- }
398
-
399
- tools.periodName = data.periodName
400
- tools.view = data.view
401
- tools.period = data.period
402
- tools.metricType = data.metricType || selectedMetric.value
403
-
404
- emits('update-tools', tools)
405
- }
406
-
407
- const onDeleteOption = (): void => {}
408
- </script>
409
-
410
- <style scoped lang="scss">
411
- .history-testimony-graph {
412
- display: flex;
413
- align-items: center;
414
- grid-gap: 20px;
415
-
416
- &.medium {
417
- flex-direction: column;
418
-
419
- .graph-container {
420
- width: 100%;
421
- }
422
- }
423
- .graph-container {
424
- width: calc(50% - 10px);
425
- }
426
- &.power {
427
- & > div:nth-child(1) {
428
- width: 100%;
429
- }
430
- & > div:nth-child(2) {
431
- display: none;
432
- width: 0;
433
- }
434
- }
435
- &.temperature {
436
- & > div:nth-child(1) {
437
- display: none;
438
- width: 0;
439
- }
440
- & > div:nth-child(2) {
441
- width: 100%;
442
- }
443
- }
444
-
445
- &__loader-block {
446
- height: inherit;
447
- display: flex;
448
- justify-content: center;
449
- align-items: center;
450
- min-height: 300px;
451
- }
452
- &__empty-content {
453
- height: inherit;
454
- }
455
- }
456
- </style>
1
+ <template>
2
+ <common-pages-hardware-health-history-testimony-tools
3
+ v-model:selected-view="selectedView"
4
+ v-model:selected-timespan-type="selectedTimespanType"
5
+ :selected-chart-option-name="selectedChartOptionName"
6
+ :is-show-chart-modal="isShowChartModal"
7
+ :chart-title="props.powerData?.groupName || ''"
8
+ :selected-metric="selectedMetric"
9
+ :selected-chart-type="selectedChartType"
10
+ :selected-power-counters-keys="selectedPowerCountersKeys"
11
+ :power-selected-rows-local="powerSelectedRowsLocal"
12
+ :selected-temperature-counters-keys="selectedTemperatureCountersKeys"
13
+ :temperature-selected-rows-local="temperatureSelectedRowsLocal"
14
+ :units-count="unitsCount"
15
+ :power-counters-table-data="powerCountersTableData"
16
+ :temperature-counters-table-data="temperatureCountersTableData"
17
+ :language="props.language"
18
+ :custom-date-from="customDateFrom"
19
+ :custom-date-to="customDateTo"
20
+ :custom-time-from="customTimeFrom"
21
+ :custom-time-to="customTimeTo"
22
+ :start-date="props.powerData?.pointStart || 0"
23
+ :end-date="props.powerData?.pointEnd || 0"
24
+ :timespan-period-type="timespanPeriodType"
25
+ :valid-date-end="props.validDateEnd"
26
+ :format-date="props.formatDate"
27
+ @power-selected-rows-local="powerSelectedRowsLocal = $event"
28
+ @temperature-selected-rows-local="temperatureSelectedRowsLocal = $event"
29
+ @show-chart-modal="isShowChartModal = true"
30
+ @hide-chart-modal="isShowChartModal = false"
31
+ @update-tools="onUpdateTools"
32
+ @delete-option="onDeleteOption"
33
+ @submit-options="onSubmitOptions"
34
+ @update-period-type="timespanPeriodType = $event"
35
+ />
36
+ <div
37
+ ref="historyTestimonyGraph"
38
+ :class="[
39
+ `history-testimony-graph ${selectedView}`,
40
+ { medium: isMediumSizeGraphsContainer },
41
+ ]"
42
+ >
43
+ <div class="graph-container">
44
+ <common-graph
45
+ v-if="powerDataLocal && !props.powerLoading"
46
+ :data="powerDataLocal"
47
+ :update="updatePowerHelper"
48
+ :chart="powerChart"
49
+ :selected-row="selectedRowPower"
50
+ />
51
+ <div
52
+ v-else-if="props.powerLoading"
53
+ class="history-testimony-graph__loader-block"
54
+ >
55
+ <div class="spinner"></div>
56
+ </div>
57
+ <div v-else class="history-testimony-graph__empty-content"></div>
58
+ </div>
59
+ <div class="graph-container">
60
+ <common-graph
61
+ v-if="temperatureDataLocal && !props.temperatureLoading"
62
+ :data="temperatureDataLocal"
63
+ :update="updateTemperatureHelper"
64
+ :chart="temperatureChart"
65
+ :selected-row="selectedRowTemperature"
66
+ />
67
+ <div
68
+ v-else-if="props.temperatureLoading"
69
+ class="history-testimony-graph__loader-block"
70
+ >
71
+ <div class="spinner"></div>
72
+ </div>
73
+ <div v-else class="history-testimony-graph__empty-content"></div>
74
+ </div>
75
+ </div>
76
+ </template>
77
+
78
+ <script setup lang="ts">
79
+ import { useElementSize } from '@vueuse/core'
80
+ import { format } from 'date-fns'
81
+ import type {
82
+ I_SeriesLine,
83
+ I_LineGraph,
84
+ } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
85
+ import { graphDataFunc } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
86
+ import type { UI_I_OptionsForm } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/interfaces'
87
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
88
+ import type { UI_T_Chart } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/types'
89
+ import type { UI_I_HardwareHealthSensors } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
90
+ import type {
91
+ UI_I_HardwareHealthHistoryTestimonyTools,
92
+ UI_I_HardwareHealthSensorsGraph,
93
+ } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
94
+ import type { UI_I_SensorsGraphPayload } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/models/interfaces'
95
+ import { containerMediumSize } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/config/containerSizes'
96
+
97
+ const emits = defineEmits<{
98
+ (event: 'update-tools', value: UI_I_HardwareHealthHistoryTestimonyTools): void
99
+ }>()
100
+ const props = defineProps<{
101
+ powerData: I_SeriesLine | null
102
+ temperatureData: I_SeriesLine | null
103
+ countersTableData: UI_I_HardwareHealthSensors[]
104
+ language: string
105
+ powerLoading: boolean
106
+ temperatureLoading: boolean
107
+ formattedDatetime: any
108
+ isDarkMode: boolean
109
+ getDateFormat: any
110
+ mainSelectedRow: number[]
111
+ validDateEnd: number
112
+ formatDate: string
113
+ }>()
114
+ const selectedView = defineModel<string>('selectedView')
115
+
116
+ const { $store }: any = useNuxtApp()
117
+
118
+ const historyTestimonyGraph = ref<any>(null)
119
+ const { width } = useElementSize(historyTestimonyGraph)
120
+ const isMediumSizeGraphsContainer = computed<boolean>(
121
+ () => width.value < containerMediumSize
122
+ )
123
+
124
+ // const historyTestimonyGraph = ref(null)
125
+ // const contentWidth = ref<number>(
126
+ // useElementSize(historyTestimonyGraph)?.width || 0
127
+ // )
128
+ // watch(contentWidth, (newValue) => {
129
+ // if (newValue) {
130
+ // updatePowerChart()
131
+ // updateTemperatureChart()
132
+ // }
133
+ // if (!powerChart.value || !temperatureChart.value) return
134
+ //
135
+ // powerChart.value.setSize(1, powerChart.chartHeight)
136
+ // temperatureChart.value.setSize(1, temperatureChart.chartHeight)
137
+ //
138
+ // setTimeout(() => {
139
+ // powerChart.value.setSize(newValue, powerChart.chartHeight)
140
+ // temperatureChart.value.setSize(newValue, temperatureChart.chartHeight)
141
+ // }, 1000)
142
+ // })
143
+ // const isContentMediumSize = computed<boolean>(() => contentWidth.value <= 1200)
144
+
145
+ const selectedChartOptionName = ref<string>('')
146
+ const isShowChartModal = ref<boolean>(false)
147
+ const selectedMetric = ref<UI_T_Chart>('power')
148
+ const selectedPowerCountersKeys = ref<number[]>([])
149
+ const selectedTemperatureCountersKeys = ref<number[]>([])
150
+ const selectedTimespanType = ref<string>('')
151
+ const customDateFrom = ref<string>('')
152
+ const customDateTo = ref<string>('')
153
+ const customTimeFrom = ref<string>('')
154
+ const customTimeTo = ref<string>('')
155
+ const selectedChartType = ref<string>('spline')
156
+
157
+ const selectedRowPower = ref<number[]>([])
158
+ const selectedRowTemperature = ref<number[]>([])
159
+ let powerCounters: UI_I_HardwareHealthSensors[] = []
160
+ let temperatureCounters: UI_I_HardwareHealthSensors[] = []
161
+ const updateAllSelectedSelectedRow = (): void => {
162
+ selectedRowPower.value = []
163
+ selectedRowTemperature.value = []
164
+
165
+ if (!props.mainSelectedRow.length) return
166
+
167
+ props.mainSelectedRow.forEach((key) => {
168
+ const selectedItem = props.countersTableData[key]
169
+ const category = selectedItem.category.toLowerCase()
170
+
171
+ if (category === 'power') {
172
+ const currentKey = powerCounters.findIndex(
173
+ (item) => item.id === selectedItem.id
174
+ )
175
+ selectedRowPower.value.push(currentKey)
176
+ } else if (category === 'temperature') {
177
+ const currentKey = temperatureCounters.findIndex(
178
+ (item) => item.id === selectedItem.id
179
+ )
180
+ selectedRowTemperature.value.push(currentKey)
181
+ }
182
+ })
183
+ }
184
+ watch(
185
+ () => props.countersTableData,
186
+ (newValue) => {
187
+ powerCounters = newValue.filter(
188
+ (item) => item.category.toLowerCase() === 'power'
189
+ )
190
+ temperatureCounters = newValue.filter(
191
+ (item) => item.category.toLowerCase() === 'temperature'
192
+ )
193
+ },
194
+ { deep: true, immediate: true }
195
+ )
196
+ watch(
197
+ () => props.mainSelectedRow,
198
+ () => {
199
+ updateAllSelectedSelectedRow()
200
+ },
201
+ { deep: true, immediate: true }
202
+ )
203
+ watch(
204
+ selectedView,
205
+ () => {
206
+ updateAllSelectedSelectedRow()
207
+ },
208
+ { deep: true }
209
+ )
210
+
211
+ const unitsCount = ref<number>(0)
212
+ const powerCountersTableData = ref<UI_I_HardwareHealthSensorsGraph[]>([])
213
+ const temperatureCountersTableData = ref<UI_I_HardwareHealthSensorsGraph[]>([])
214
+ const powerSelectedRowsLocal = ref<UI_I_HardwareHealthSensorsGraph[]>([])
215
+ const temperatureSelectedRowsLocal = ref<UI_I_HardwareHealthSensorsGraph[]>([])
216
+
217
+ watch(
218
+ () => props.countersTableData,
219
+ (newValue) => {
220
+ if (!newValue.length) return
221
+
222
+ powerCountersTableData.value = []
223
+ temperatureCountersTableData.value = []
224
+
225
+ newValue.forEach((item, key) => {
226
+ const newData: UI_I_HardwareHealthSensorsGraph = {
227
+ id: key,
228
+ name: item.name,
229
+ description: item.category,
230
+ measurement: '',
231
+ units: '',
232
+ nameEn: item.mainName || '',
233
+ testId: `counters-table-${item.name}-item`,
234
+ hidden: item.hidden,
235
+ }
236
+ if (item.category.toLowerCase() === 'power')
237
+ powerCountersTableData.value.push(newData)
238
+ else if (item.category.toLowerCase() === 'temperature')
239
+ temperatureCountersTableData.value.push(newData)
240
+ })
241
+ },
242
+ { immediate: true, deep: true }
243
+ )
244
+
245
+ const selectAllCounters = (): void => {
246
+ if (!powerCountersTableData.value)
247
+ setTimeout(() => {
248
+ selectAllCounters()
249
+ }, 2000)
250
+ else {
251
+ powerCountersTableData.value.forEach((item) => {
252
+ selectedPowerCountersKeys.value.push(item.id)
253
+ })
254
+ temperatureCountersTableData.value.forEach((item) => {
255
+ if (!item.hidden) selectedTemperatureCountersKeys.value.push(item.id)
256
+ })
257
+ }
258
+ }
259
+
260
+ onMounted(() => {
261
+ selectAllCounters()
262
+ })
263
+
264
+ const localization = computed<UI_I_Localization>(() => useLocal())
265
+
266
+ const powerDataLocal = ref<I_LineGraph | null>(null)
267
+ const temperatureDataLocal = ref<I_LineGraph | null>(null)
268
+ const updatePowerHelper = ref<number>(0)
269
+ const updateTemperatureHelper = ref<number>(0)
270
+ let dateFormat = ''
271
+ const powerChart = ref<any>(null)
272
+ const temperatureChart = ref<any>(null)
273
+ const timespanPeriodType = ref<string>('last')
274
+
275
+ const powerChartCallback = (newValue: any): void => {
276
+ newValue && (powerChart.value = newValue)
277
+ }
278
+
279
+ const temperatureChartCallback = (newValue: any): void => {
280
+ newValue && (temperatureChart.value = newValue)
281
+ }
282
+
283
+ const updatePowerChart = (): void => {
284
+ if (!props.powerData) return
285
+
286
+ powerDataLocal.value = graphDataFunc(
287
+ props.powerData,
288
+ props.isDarkMode,
289
+ localization.value,
290
+ () => {},
291
+ false,
292
+ false,
293
+ true,
294
+ 'spline',
295
+ '',
296
+ undefined,
297
+ powerChartCallback,
298
+ props.formattedDatetime,
299
+ format,
300
+ dateFormat
301
+ )
302
+
303
+ updatePowerHelper.value++
304
+ }
305
+
306
+ const updateTemperatureChart = (): void => {
307
+ if (!props.temperatureData) return
308
+
309
+ temperatureDataLocal.value = graphDataFunc(
310
+ props.temperatureData,
311
+ props.isDarkMode,
312
+ localization.value,
313
+ () => {},
314
+ false,
315
+ false,
316
+ true,
317
+ 'spline',
318
+ '',
319
+ undefined,
320
+ temperatureChartCallback,
321
+ props.formattedDatetime,
322
+ format,
323
+ dateFormat
324
+ )
325
+
326
+ updateTemperatureHelper.value++
327
+ }
328
+
329
+ watch(
330
+ () => [props.powerData, props.isDarkMode, props.language],
331
+ (newValue) => {
332
+ dateFormat = props.getDateFormat(newValue[2])
333
+ updatePowerChart()
334
+ },
335
+ { immediate: true, deep: true }
336
+ )
337
+
338
+ watch(
339
+ () => [props.temperatureData, props.isDarkMode, props.language],
340
+ (newValue) => {
341
+ dateFormat = props.getDateFormat(newValue[2])
342
+ updateTemperatureChart()
343
+ },
344
+ { immediate: true, deep: true }
345
+ )
346
+
347
+ const updateSelectedCountersKeys = (metricType: string): void => {
348
+ if (metricType === 'power') {
349
+ const newKeys: number[] = []
350
+
351
+ powerSelectedRowsLocal.value.forEach((item) => {
352
+ newKeys.push(item.id)
353
+ })
354
+ selectedPowerCountersKeys.value = newKeys
355
+ } else if (metricType === 'temperature') {
356
+ const newKeys: number[] = []
357
+
358
+ temperatureSelectedRowsLocal.value.forEach((item) => {
359
+ newKeys.push(item.id)
360
+ })
361
+ selectedTemperatureCountersKeys.value = newKeys
362
+ }
363
+ }
364
+
365
+ const tools: UI_I_HardwareHealthHistoryTestimonyTools = {
366
+ periodName: 'real_time',
367
+ view: 'power',
368
+ metricType: selectedMetric.value,
369
+ period: [],
370
+ }
371
+
372
+ const onSubmitOptions = (data: UI_I_OptionsForm): void => {
373
+ selectedTimespanType.value = data.periodName
374
+ customDateFrom.value = data.dateFrom
375
+ customDateTo.value = data.dateTo
376
+ customTimeFrom.value = data.timeFrom
377
+ customTimeTo.value = data.timeTo
378
+ selectedChartType.value = data.chartType
379
+ updateSelectedCountersKeys(data.metric)
380
+ if (data.metric === 'power')
381
+ $store.dispatch(
382
+ 'monitor/A_GET_HARDWARE_HEALTH_HISTORY_TESTIMONY_POWER',
383
+ data
384
+ )
385
+ if (data.metric === 'temperature')
386
+ $store.dispatch(
387
+ 'monitor/A_GET_HARDWARE_HEALTH_HISTORY_TESTIMONY_TEMPERATURE',
388
+ data
389
+ )
390
+ }
391
+
392
+ const onUpdateTools = (data: UI_I_SensorsGraphPayload): void => {
393
+ const storageChartOptions = useLocalStorage(
394
+ data.view + 'ChartOptionsSensors',
395
+ undefined
396
+ )
397
+
398
+ selectedChartOptionName.value = ''
399
+
400
+ if (storageChartOptions) {
401
+ selectedChartOptionName.value = data.view
402
+ } else {
403
+ selectedMetric.value = 'power'
404
+ }
405
+
406
+ tools.periodName = data.periodName
407
+ tools.view = data.view
408
+ tools.period = data.period
409
+ tools.metricType = data.metricType || selectedMetric.value
410
+
411
+ emits('update-tools', tools)
412
+ }
413
+
414
+ const onDeleteOption = (): void => {}
415
+ </script>
416
+
417
+ <style scoped lang="scss">
418
+ .history-testimony-graph {
419
+ display: flex;
420
+ align-items: center;
421
+ grid-gap: 20px;
422
+
423
+ &.medium {
424
+ flex-direction: column;
425
+
426
+ .graph-container {
427
+ width: 100%;
428
+ }
429
+ }
430
+ .graph-container {
431
+ width: calc(50% - 10px);
432
+ }
433
+ &.power {
434
+ & > div:nth-child(1) {
435
+ width: 100%;
436
+ }
437
+ & > div:nth-child(2) {
438
+ display: none;
439
+ width: 0;
440
+ }
441
+ }
442
+ &.temperature {
443
+ & > div:nth-child(1) {
444
+ display: none;
445
+ width: 0;
446
+ }
447
+ & > div:nth-child(2) {
448
+ width: 100%;
449
+ }
450
+ }
451
+
452
+ &__loader-block {
453
+ height: inherit;
454
+ display: flex;
455
+ justify-content: center;
456
+ align-items: center;
457
+ min-height: 300px;
458
+ }
459
+ &__empty-content {
460
+ height: inherit;
461
+ }
462
+ }
463
+ </style>