bfg-common 1.4.9 → 1.4.10

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 (54) hide show
  1. package/assets/localization/local_be.json +0 -3
  2. package/assets/localization/local_en.json +0 -3
  3. package/assets/localization/local_hy.json +0 -3
  4. package/assets/localization/local_kk.json +0 -3
  5. package/assets/localization/local_ru.json +0 -3
  6. package/assets/localization/local_zh.json +2563 -2566
  7. package/components/atoms/modal/bySteps/BySteps.vue +253 -253
  8. package/components/common/browse/blocks/Title.vue +91 -91
  9. package/components/common/browse/blocks/info/Date.vue +21 -21
  10. package/components/common/context/recursion/Recursion.vue +86 -86
  11. package/components/common/context/recursion/RecursionNew.vue +198 -198
  12. package/components/common/context/recursion/RecursionOld.vue +212 -212
  13. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +1 -1
  14. package/components/common/pages/hardwareHealth/Graph.vue +84 -0
  15. package/components/common/pages/hardwareHealth/HardwareHealth.vue +62 -45
  16. package/components/common/pages/hardwareHealth/tableView/TableView.vue +10 -4
  17. package/components/common/pages/hardwareHealth/tableView/lib/config/sensorTable.ts +11 -7
  18. package/components/common/pages/hardwareHealth/tableView/lib/config/tableKeys.ts +7 -6
  19. package/components/common/pages/hardwareHealth/tableView/lib/models/interfaces.ts +0 -2
  20. package/components/common/pages/hardwareHealth/tableView/lib/models/types.ts +4 -9
  21. package/components/common/split/horizontal/HorizontalNew.vue +321 -321
  22. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +52 -52
  23. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Hv.vue +99 -99
  24. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +85 -85
  25. package/components/common/wizards/datastore/add/Add.vue +437 -437
  26. package/composables/productNameLocal.ts +30 -30
  27. package/lib/models/interfaces.ts +0 -1
  28. package/lib/models/types.ts +0 -1
  29. package/package.json +1 -1
  30. package/plugins/recursion.ts +311 -293
  31. package/public/spice-console/lib/images/bitmap.js +203 -203
  32. package/store/tasks/mappers/recentTasks.ts +45 -45
  33. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +0 -332
  34. package/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces.ts +0 -9
  35. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +0 -375
  36. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +0 -469
  37. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/Notification.vue +0 -30
  38. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/Actions.vue +0 -157
  39. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/SaveOptionsModal.vue +0 -81
  40. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/lib/utils/optionsActions.ts +0 -25
  41. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/Counters.vue +0 -89
  42. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/table/Table.vue +0 -174
  43. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/table/lib/config/tableConfig.ts +0 -89
  44. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/table/lib/models/types.ts +0 -5
  45. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/Timespan.vue +0 -64
  46. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/form/Form.vue +0 -539
  47. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +0 -115
  48. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/config/optionsMetrics.ts +0 -17
  49. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/interfaces.ts +0 -15
  50. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/lib/models/types.ts +0 -1
  51. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/metrics/Metrics.vue +0 -31
  52. package/components/common/pages/hardwareHealth/historyTestimony/tools/lib/config/toolbar.ts +0 -78
  53. package/components/common/pages/hardwareHealth/historyTestimony/tools/lib/models/interfaces.ts +0 -9
  54. package/components/common/pages/hardwareHealth/tableView/lib/config/historyTestimonyTable.ts +0 -128
@@ -1,212 +1,212 @@
1
- <template>
2
- <ul class="context-wrap">
3
- <span v-if="props.isLoading">
4
- <atoms-loader-pre-loader
5
- id="loader"
6
- class="absolute-center context-menu__loading"
7
- :show="true"
8
- />
9
- </span>
10
- <li
11
- v-for="(item, key) in props.items"
12
- :key="key"
13
- :class="[
14
- 'menu-item',
15
- { disabled: item.disabled || isLoading },
16
- { 'item-header': item.isHeader },
17
- { 'has-border-top': item.hasBorderTop },
18
- ]"
19
- @mouseenter="emits('toggle-items', [item, true, $event])"
20
- @mouseleave="emits('toggle-items', [item, false, $event])"
21
- >
22
- <span
23
- class="context-link"
24
- :data-id="`${item.testId}-context-link`"
25
- @mousedown="emits('select-item', item)"
26
- >
27
- <span :class="['context-icon', item.iconClassName]" />
28
- <span class="menu-item-text">{{ item.name }}</span>
29
- <span v-if="item.items.length" class="arrow-icon" />
30
- <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
31
- </span>
32
-
33
- <div class="context-children">
34
- <common-context-recursion
35
- v-show="item.isShowItems"
36
- :action-loading="props.actionLoading"
37
- :class="[{ 'child-show': item.isShowItems }]"
38
- :items="item.items"
39
- @select-item="emits('select-item', $event)"
40
- />
41
- </div>
42
- </li>
43
- </ul>
44
- </template>
45
-
46
- <script setup lang="ts">
47
- import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
48
- import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
49
-
50
- const props = defineProps<{
51
- items: UI_I_ContextMenuItem[]
52
- actionLoading: string | null
53
- isLoading: boolean
54
- testId?: string
55
- }>()
56
-
57
- const emits = defineEmits<{
58
- (event: 'select-item', value: UI_I_ContextMenuItem): void
59
- (
60
- event: 'toggle-items',
61
- value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
62
- ): void
63
- }>()
64
- </script>
65
-
66
- <style scoped lang="scss">
67
- .loader-wrapper {
68
- width: 100%;
69
- height: 100%;
70
- z-index: 100;
71
- }
72
-
73
- .context-menu__loading {
74
- :deep(.spinner) {
75
- width: 45px;
76
- height: 45px;
77
- min-width: 45px;
78
- min-height: 45px;
79
- z-index: 1000;
80
- }
81
- }
82
- .context-wrap {
83
- width: auto;
84
- max-width: 400px;
85
- background: var(--global-bg-color);
86
- border-radius: 0;
87
- color: #333;
88
- border: 1px solid var(--context-menu-border-color);
89
- user-select: none;
90
- list-style: none;
91
- max-height: 100vh;
92
- overflow-y: auto;
93
-
94
- .menu-item {
95
- position: relative;
96
- color: #565656;
97
- border-bottom: 1px solid transparent;
98
- cursor: pointer;
99
- padding: 5px 0 3px;
100
-
101
- &.has-border-top {
102
- border-top: 1px solid var(--context-menu-inset-border-color);
103
- }
104
-
105
- &.item-header {
106
- font-size: 11px;
107
- background-color: var(--context-menu-item-header-color);
108
- cursor: default;
109
- }
110
- &:not(.item-header):not(.disabled):hover {
111
- background-color: var(--context-menu-hover-bg-color);
112
- color: #454545;
113
- border-bottom: 1px solid var(--context-menu-hover-border-color);
114
- }
115
- &.disabled {
116
- opacity: 0.5;
117
- user-select: none;
118
- cursor: default;
119
- }
120
- &.left {
121
- :deep(.context-children) {
122
- left: 0;
123
- background: red;
124
-
125
- .context-wrap {
126
- transform: translateX(-100%);
127
- left: auto;
128
- }
129
- }
130
- }
131
-
132
- .context-link {
133
- position: relative;
134
- overflow: hidden;
135
- text-overflow: ellipsis;
136
- white-space: nowrap;
137
- display: flex;
138
- align-items: center;
139
- user-select: none;
140
- padding: 3px 20px 4px 10px;
141
-
142
- .menu-item-text {
143
- flex: 1 1 0;
144
- }
145
-
146
- .context-icon {
147
- display: inline-block;
148
- margin: -2px 4px 0 0;
149
- vertical-align: middle;
150
- width: 18px;
151
- height: 18px;
152
- }
153
-
154
- .arrow-icon {
155
- position: absolute;
156
- top: 50%;
157
- margin-top: -8px;
158
- right: 4px;
159
- background-image: url('assets/img/icons/sprite.png');
160
- display: inline-block;
161
- width: 16px;
162
- height: 16px;
163
- overflow: hidden;
164
- background-repeat: no-repeat;
165
- font-size: 0;
166
- line-height: 0;
167
- text-align: center;
168
- transform: rotate(90deg);
169
- }
170
-
171
- .shortcut {
172
- padding-left: 10px;
173
- }
174
- }
175
-
176
- .context-children {
177
- position: absolute;
178
- top: 0;
179
- left: 100%;
180
-
181
- .context-wrap {
182
- position: fixed;
183
- }
184
- }
185
- }
186
- }
187
- .context-menu__loading {
188
- :deep(.spinner) {
189
- width: 45px;
190
- height: 45px;
191
- min-width: 45px;
192
- min-height: 45px;
193
- z-index: 1000;
194
- }
195
- }
196
- </style>
197
- <style>
198
- :root {
199
- --context-menu-hover-bg-color: #e8e8e8;
200
- --context-menu-border-color: #949494;
201
- --context-menu-inset-border-color: #d4d5d6;
202
- --context-menu-item-header-color: #eceff2;
203
- --context-menu-hover-border-color: #666;
204
- }
205
- :root.dark-theme {
206
- --context-menu-hover-bg-color: #324f61;
207
- --context-menu-border-color: #495865;
208
- --context-menu-inset-border-color: #485764;
209
- --context-menu-item-header-color: #29414e;
210
- --context-menu-hover-border-color: #fff;
211
- }
212
- </style>
1
+ <template>
2
+ <ul class="context-wrap">
3
+ <span v-if="props.isLoading">
4
+ <atoms-loader-pre-loader
5
+ id="loader"
6
+ class="absolute-center context-menu__loading"
7
+ :show="true"
8
+ />
9
+ </span>
10
+ <li
11
+ v-for="(item, key) in props.items"
12
+ :key="key"
13
+ :class="[
14
+ 'menu-item',
15
+ { disabled: item.disabled || isLoading },
16
+ { 'item-header': item.isHeader },
17
+ { 'has-border-top': item.hasBorderTop },
18
+ ]"
19
+ @mouseenter="emits('toggle-items', [item, true, $event])"
20
+ @mouseleave="emits('toggle-items', [item, false, $event])"
21
+ >
22
+ <span
23
+ class="context-link"
24
+ :data-id="`${item.testId}-context-link`"
25
+ @mousedown="emits('select-item', item)"
26
+ >
27
+ <span :class="['context-icon', item.iconClassName]" />
28
+ <span class="menu-item-text">{{ item.name }}</span>
29
+ <span v-if="item.items.length" class="arrow-icon" />
30
+ <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
31
+ </span>
32
+
33
+ <div class="context-children">
34
+ <common-context-recursion
35
+ v-show="item.isShowItems"
36
+ :action-loading="props.actionLoading"
37
+ :class="[{ 'child-show': item.isShowItems }]"
38
+ :items="item.items"
39
+ @select-item="emits('select-item', $event)"
40
+ />
41
+ </div>
42
+ </li>
43
+ </ul>
44
+ </template>
45
+
46
+ <script setup lang="ts">
47
+ import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
48
+ import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
49
+
50
+ const props = defineProps<{
51
+ items: UI_I_ContextMenuItem[]
52
+ actionLoading: string | null
53
+ isLoading: boolean
54
+ testId?: string
55
+ }>()
56
+
57
+ const emits = defineEmits<{
58
+ (event: 'select-item', value: UI_I_ContextMenuItem): void
59
+ (
60
+ event: 'toggle-items',
61
+ value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
62
+ ): void
63
+ }>()
64
+ </script>
65
+
66
+ <style scoped lang="scss">
67
+ .loader-wrapper {
68
+ width: 100%;
69
+ height: 100%;
70
+ z-index: 100;
71
+ }
72
+
73
+ .context-menu__loading {
74
+ :deep(.spinner) {
75
+ width: 45px;
76
+ height: 45px;
77
+ min-width: 45px;
78
+ min-height: 45px;
79
+ z-index: 1000;
80
+ }
81
+ }
82
+ .context-wrap {
83
+ width: auto;
84
+ max-width: 400px;
85
+ background: var(--global-bg-color);
86
+ border-radius: 0;
87
+ color: #333;
88
+ border: 1px solid var(--context-menu-border-color);
89
+ user-select: none;
90
+ list-style: none;
91
+ max-height: 100vh;
92
+ overflow-y: auto;
93
+
94
+ .menu-item {
95
+ position: relative;
96
+ color: #565656;
97
+ border-bottom: 1px solid transparent;
98
+ cursor: pointer;
99
+ padding: 5px 0 3px;
100
+
101
+ &.has-border-top {
102
+ border-top: 1px solid var(--context-menu-inset-border-color);
103
+ }
104
+
105
+ &.item-header {
106
+ font-size: 11px;
107
+ background-color: var(--context-menu-item-header-color);
108
+ cursor: default;
109
+ }
110
+ &:not(.item-header):not(.disabled):hover {
111
+ background-color: var(--context-menu-hover-bg-color);
112
+ color: #454545;
113
+ border-bottom: 1px solid var(--context-menu-hover-border-color);
114
+ }
115
+ &.disabled {
116
+ opacity: 0.5;
117
+ user-select: none;
118
+ cursor: default;
119
+ }
120
+ &.left {
121
+ :deep(.context-children) {
122
+ left: 0;
123
+ background: red;
124
+
125
+ .context-wrap {
126
+ transform: translateX(-100%);
127
+ left: auto;
128
+ }
129
+ }
130
+ }
131
+
132
+ .context-link {
133
+ position: relative;
134
+ overflow: hidden;
135
+ text-overflow: ellipsis;
136
+ white-space: nowrap;
137
+ display: flex;
138
+ align-items: center;
139
+ user-select: none;
140
+ padding: 3px 20px 4px 10px;
141
+
142
+ .menu-item-text {
143
+ flex: 1 1 0;
144
+ }
145
+
146
+ .context-icon {
147
+ display: inline-block;
148
+ margin: -2px 4px 0 0;
149
+ vertical-align: middle;
150
+ width: 18px;
151
+ height: 18px;
152
+ }
153
+
154
+ .arrow-icon {
155
+ position: absolute;
156
+ top: 50%;
157
+ margin-top: -8px;
158
+ right: 4px;
159
+ background-image: url('assets/img/icons/sprite.png');
160
+ display: inline-block;
161
+ width: 16px;
162
+ height: 16px;
163
+ overflow: hidden;
164
+ background-repeat: no-repeat;
165
+ font-size: 0;
166
+ line-height: 0;
167
+ text-align: center;
168
+ transform: rotate(90deg);
169
+ }
170
+
171
+ .shortcut {
172
+ padding-left: 10px;
173
+ }
174
+ }
175
+
176
+ .context-children {
177
+ position: absolute;
178
+ top: 0;
179
+ left: 100%;
180
+
181
+ .context-wrap {
182
+ position: fixed;
183
+ }
184
+ }
185
+ }
186
+ }
187
+ .context-menu__loading {
188
+ :deep(.spinner) {
189
+ width: 45px;
190
+ height: 45px;
191
+ min-width: 45px;
192
+ min-height: 45px;
193
+ z-index: 1000;
194
+ }
195
+ }
196
+ </style>
197
+ <style>
198
+ :root {
199
+ --context-menu-hover-bg-color: #e8e8e8;
200
+ --context-menu-border-color: #949494;
201
+ --context-menu-inset-border-color: #d4d5d6;
202
+ --context-menu-item-header-color: #eceff2;
203
+ --context-menu-hover-border-color: #666;
204
+ }
205
+ :root.dark-theme {
206
+ --context-menu-hover-bg-color: #324f61;
207
+ --context-menu-border-color: #495865;
208
+ --context-menu-inset-border-color: #485764;
209
+ --context-menu-item-header-color: #29414e;
210
+ --context-menu-hover-border-color: #fff;
211
+ }
212
+ </style>
@@ -1,6 +1,6 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
2
  import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
3
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
4
4
 
5
5
  export const timespanFunc = (
6
6
  localization: UI_I_Localization
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <div class="hardware-health-graph">
3
+ <common-graph
4
+ v-if="dataLocal && !props.loading"
5
+ :data="dataLocal"
6
+ :update="updateHelper"
7
+ />
8
+ <div v-else-if="props.loading" class="graphic-loader-block">
9
+ <div class="spinner"></div>
10
+ </div>
11
+ <div v-else class="empty-content"></div>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import { format } from 'date-fns'
17
+ import type { I_SeriesLine } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
18
+ import type { I_LineGraph } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
19
+ import { graphDataFunc } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
20
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
21
+
22
+ const props = defineProps<{
23
+ data: I_SeriesLine | null
24
+ loading: boolean
25
+ formattedDatetime: any
26
+ isDarkMode: boolean
27
+ getDateFormat: any
28
+ language: string
29
+ }>()
30
+
31
+ const localization = computed<UI_I_Localization>(() => useLocal())
32
+
33
+ const dataLocal = ref<I_LineGraph | null>(null)
34
+ const updateHelper = ref<number>(0)
35
+ let dateFormat = ''
36
+
37
+ const updateChart = (): void => {
38
+ if (!props.data) return
39
+
40
+ dataLocal.value = graphDataFunc(
41
+ props.data,
42
+ props.isDarkMode,
43
+ localization.value,
44
+ () => {},
45
+ false,
46
+ false,
47
+ true,
48
+ 'spline',
49
+ '',
50
+ undefined,
51
+ () => {},
52
+ props.formattedDatetime,
53
+ format,
54
+ dateFormat
55
+ )
56
+
57
+ updateHelper.value++
58
+ }
59
+
60
+ watch(
61
+ () => [props.data, props.isDarkMode, props.language],
62
+ (newValue) => {
63
+ dateFormat = props.getDateFormat(newValue[2])
64
+ updateChart()
65
+ },
66
+ { immediate: true, deep: true }
67
+ )
68
+ </script>
69
+
70
+ <style scoped lang="scss">
71
+ .hardware-health-graph {
72
+ height: 300px;
73
+
74
+ .graphic-loader-block {
75
+ height: inherit;
76
+ display: flex;
77
+ justify-content: center;
78
+ align-items: center;
79
+ }
80
+ .empty-content {
81
+ height: inherit;
82
+ }
83
+ }
84
+ </style>
@@ -37,69 +37,60 @@
37
37
 
38
38
  <common-pages-hardware-health-tools-panel :selected-tab="activeTab" />
39
39
 
40
- <div
41
- :class="[
42
- 'bottom-container',
43
- { 'history-testimony': activeTab === 'history-testimony' },
44
- ]"
45
- >
46
- <common-pages-hardware-health-history-testimony-graph
47
- v-if="activeTab === 'history-testimony'"
48
- :power-data="props.historyTestimonyPower"
49
- :temperature-data="props.historyTestimonyTemperature"
50
- :counters-table-data="hardwareHealth"
51
- :language="props.language"
52
- :power-loading="props.loadingPowerData"
53
- :temperature-loading="props.loadingTemperatureData"
54
- :formatted-datetime="props.formattedDatetime"
55
- :is-dark-mode="props.isDarkMode"
56
- :get-date-format="props.getDateFormat"
57
- :main-selected-row="selectedRow"
58
- />
59
-
60
- <common-pages-hardware-health-table-view
61
- :key="uniqueKey"
62
- v-model:selected="selectedRow"
63
- :data-table="hardwareHealth"
64
- :total-items="hardwareHealth.length"
65
- :total-pages="1"
66
- :table-mode="activeTab"
67
- :loading="props.loading"
68
- />
69
- </div>
40
+ <common-pages-hardware-health-graph
41
+ v-if="activeTab === 'history-testimony'"
42
+ :data="props.historyTestimony"
43
+ :loading="props.loadingHistoryTestimony"
44
+ :is-dark-mode="props.isDarkMode"
45
+ :formatted-datetime="props.formattedDatetime"
46
+ :get-date-format="props.getDateFormat"
47
+ :language="props.language"
48
+ />
49
+
50
+ <common-pages-hardware-health-table-view
51
+ :key="uniqueKey"
52
+ v-model:selected="selectedRow"
53
+ :data-table="hardwareHealth"
54
+ :total-items="hardwareHealth.length"
55
+ :total-pages="1"
56
+ :table-mode="activeTab"
57
+ :loading="props.loading"
58
+ />
70
59
  </div>
71
60
  </template>
72
61
 
73
62
  <script lang="ts" setup>
74
63
  import type { I_SeriesLine } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
75
64
  import type { UI_I_Localization } from '~/lib/models/interfaces'
76
- import type { UI_T_DateFormat } from '~/lib/models/plugins/date/types'
77
- import type { UI_I_HardwareHealthSensors } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
78
65
  import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
79
- import type { UI_I_StorageSensorsAlert } from '~/components/common/pages/hardwareHealth/lib/models/interfaces'
80
66
  import type { UI_T_HardwareHealthTabMode } from '~/components/common/pages/hardwareHealth/lib/models/types'
67
+ import type { UI_I_StorageSensorsAlert } from '~/components/common/pages/hardwareHealth/lib/models/interfaces'
68
+ import type { UI_I_HardwareHealthSensors } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
69
+ import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
81
70
  import { hardwareHealthTabsFunc } from '~/components/common/pages/hardwareHealth/lib/config/tabsPannel'
82
71
 
83
72
  const props = defineProps<{
84
73
  data: UI_I_HardwareHealthSensors[]
85
74
  loading: boolean
86
- historyTestimonyPower: I_SeriesLine | null
87
- historyTestimonyTemperature: I_SeriesLine | null
88
- loadingPowerData: boolean
89
- loadingTemperatureData: boolean
75
+ historyTestimony: I_SeriesLine | null
76
+ loadingHistoryTestimony: boolean
90
77
  isDarkMode: boolean
91
78
  formattedDatetime: any
92
- getDateFormat: UI_T_DateFormat
79
+ getDateFormat: any
93
80
  language: string
94
81
  }>()
95
82
 
83
+ const emits = defineEmits<{
84
+ (event: 'update-chart-data', value: string): void
85
+ }>()
86
+
96
87
  const localization = computed<UI_I_Localization>(() => useLocal())
97
88
  const { $store }: any = useNuxtApp()
98
89
 
99
90
  const activeTab = ref<UI_T_HardwareHealthTabMode>('sensor')
100
91
  const uniqueKey = ref<number>(0)
101
92
 
102
- const selectedRow = ref<number[]>([])
93
+ const selectedRow = ref<UI_T_SelectedRow>([])
103
94
 
104
95
  const hardwareHealthTabs = computed<UI_I_CollapseNavItem[]>(() =>
105
96
  hardwareHealthTabsFunc(localization.value)
@@ -160,10 +151,42 @@ const generateAlertTextWithLink = computed<UI_I_StorageSensorsAlert>(() => {
160
151
  }
161
152
  })
162
153
 
154
+ const updateChartData = (isSendAll: boolean = false): void => {
155
+ const selectedNames: string[] = []
156
+ hardwareHealth.value.forEach((item, key) => {
157
+ if (isSendAll) {
158
+ if (['power', 'temperature'].includes(item.category.toLowerCase()))
159
+ selectedNames.push(item.name)
160
+ } else if (
161
+ ['power', 'temperature'].includes(item.category.toLowerCase()) &&
162
+ selectedRow.value.includes(key)
163
+ ) {
164
+ selectedNames.push(item.name)
165
+ }
166
+ })
167
+ emits('update-chart-data', selectedNames.join(','))
168
+ }
169
+
170
+ watch(selectedRow, (newValue) => {
171
+ newValue.length &&
172
+ activeTab.value === 'history-testimony' &&
173
+ updateChartData()
174
+ })
175
+
163
176
  watch(activeTab, () => {
164
177
  uniqueKey.value++
165
178
  })
166
179
 
180
+ watch(
181
+ [hardwareHealth, activeTab],
182
+ (newValue) => {
183
+ newValue[0].length &&
184
+ newValue[1] === 'history-testimony' &&
185
+ updateChartData(true)
186
+ },
187
+ { immediate: true }
188
+ )
189
+
167
190
  onMounted(() => {
168
191
  $store.dispatch('main/A_CONTINUE_GLOBAL_REFRESH', 'hardwareHealth')
169
192
  })
@@ -183,11 +206,5 @@ onUnmounted(() => {
183
206
  margin-top: 0;
184
207
  }
185
208
  }
186
- .bottom-container {
187
- &.history-testimony {
188
- overflow: hidden;
189
- overflow-y: auto;
190
- }
191
- }
192
209
  }
193
210
  </style>