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