bfg-common 1.5.540 → 1.5.541

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 (124) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/common/backup/storage/actions/add/Add.vue +251 -251
  14. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  15. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  16. package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
  17. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  18. package/components/common/diagramMain/port/Port.vue +580 -580
  19. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  20. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  21. package/components/common/pages/backups/DetailView.vue +52 -52
  22. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  23. package/components/common/pages/backups/modals/Modals.vue +243 -243
  24. package/components/common/pages/backups/modals/createBackup/configuration/backupWindow/BackupWindow.vue +29 -29
  25. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +69 -69
  26. package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +38 -38
  27. package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
  28. package/components/common/pages/backups/modals/createBackup/lib/models/interfaces.ts +8 -8
  29. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  30. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  31. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  32. package/components/common/pages/backups/modals/restore/networks/Networks.vue +1 -0
  33. package/components/common/pages/hardwareHealth/tableView/lib/config/sensorTable.ts +1 -1
  34. package/components/common/pages/hardwareHealth/tableView/modal/SensorWarning.vue +1 -1
  35. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  36. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  37. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  38. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  39. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  40. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  41. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  42. package/components/common/select/radio/RadioGroup.vue +137 -137
  43. package/components/common/spiceConsole/Drawer.vue +420 -420
  44. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  45. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  46. package/components/common/tools/Actions.vue +207 -207
  47. package/components/common/tooltip/Help.vue +5 -0
  48. package/components/common/treeView/TreeView.vue +52 -52
  49. package/components/common/vm/actions/add/Add.vue +950 -949
  50. package/components/common/vm/actions/add/New.vue +690 -689
  51. package/components/common/vm/actions/add/Old.vue +402 -400
  52. package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
  53. package/components/common/vm/actions/clone/Clone.vue +809 -808
  54. package/components/common/vm/actions/clone/new/New.vue +457 -454
  55. package/components/common/vm/actions/clone/old/Old.vue +378 -378
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +368 -368
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +427 -427
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  65. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  66. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  67. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  68. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  69. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  70. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  71. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  72. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  73. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  74. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  75. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  76. package/components/common/vm/actions/common/select/storage/Old.vue +125 -132
  77. package/components/common/vm/actions/common/select/storage/Storage.vue +178 -167
  78. package/components/common/vm/actions/common/select/storage/new/New.vue +311 -330
  79. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  80. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  81. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  82. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  83. package/components/common/vm/actions/register/Register.vue +352 -352
  84. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  85. package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/Compatibility.vue +35 -31
  86. package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/New.vue +99 -98
  87. package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/Old.vue +53 -54
  88. package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/lib/models/enums.ts +1 -1
  89. package/components/common/wizards/common/compatibility/lib/models/types.ts +1 -0
  90. package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +86 -85
  91. package/components/common/wizards/common/steps/computeResource/New.vue +93 -92
  92. package/components/common/wizards/common/steps/computeResource/Old.vue +103 -102
  93. package/components/common/wizards/common/steps/name/Name.vue +178 -178
  94. package/components/common/wizards/common/steps/name/New.vue +221 -221
  95. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  96. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  97. package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
  98. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  99. package/components/common/wizards/datastore/add/Add.vue +228 -228
  100. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  101. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  102. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +205 -195
  103. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  104. package/components/common/wizards/vm/migrate/select/storage/Storage.vue +1 -1
  105. package/composables/useAppVersion.ts +21 -21
  106. package/composables/useLocal.ts +6 -6
  107. package/composables/useLocalCommon.ts +39 -39
  108. package/package.json +1 -1
  109. package/plugins/console.ts +21 -21
  110. package/plugins/date.ts +233 -233
  111. package/plugins/mouse.ts +21 -21
  112. package/plugins/panelStates.ts +70 -70
  113. package/plugins/text.ts +59 -59
  114. package/public/spice-console/application/clientgui.js +854 -854
  115. package/public/spice-console/application/packetfactory.js +211 -211
  116. package/public/spice-console/application/virtualmouse.js +147 -147
  117. package/public/spice-console/lib/images/bitmap.js +203 -203
  118. package/public/spice-console/network/spicechannel.js +440 -440
  119. package/public/spice-console/process/cursorprocess.js +121 -121
  120. package/public/spice-console/process/inputprocess.js +227 -227
  121. package/public/spice-console/process/mainprocess.js +210 -210
  122. package/public/spice-console/run.js +210 -210
  123. package/store/main/mutations.ts +7 -7
  124. package/store/main/state.ts +7 -7
@@ -1,330 +1,311 @@
1
- <template>
2
- <div :class="['select-storage', { 'in-wizard': isInWizard }]">
3
- <Teleport v-if="!props.hideAlert" to="#storage-alert-wrapper">
4
- <ui-alert
5
- v-show="props.errors.length"
6
- :messages="props.errors"
7
- :items="props.errors"
8
- status="alert-danger"
9
- test-id="storage-alert"
10
- size="md"
11
- @hide="emits('remove-error')"
12
- />
13
- </Teleport>
14
-
15
- <div class="table-wrap">
16
- <ui-data-table
17
- :data="data"
18
- :options="tableOptionsLocal"
19
- :loading="props.isDatastoreLoading"
20
- :default-layout="false"
21
- :texts="tableTexts"
22
- :skeleton="skeletonData"
23
- test-id="select-storage-data-table"
24
- server-off
25
- size="sm"
26
- @select-row="onSelectRow"
27
- >
28
- <template v-if="!props.isInWizard" #skeleton-header>
29
- <div class="flex justify-between items-center">
30
- <ui-skeleton-item width="80" height="20" />
31
- <ui-skeleton-item width="88" height="22" border-radius="6px" />
32
- </div>
33
- </template>
34
- <template v-if="!props.isInWizard" #insteadOfTitleActions>
35
- <h3 class="storage-count">
36
- {{ storageCount }}
37
- </h3>
38
- </template>
39
- <template #name="{ item }">
40
- <ui-icon
41
- name="datastores"
42
- width="18"
43
- height="18"
44
- class="mr-1 row-datastores-icon"
45
- />
46
- {{ item.text }}
47
- </template>
48
- <template #state="{ item }">
49
- <ui-chip :color="item.data.color" size="sm" rounded>
50
- <ui-icon :name="item.data.iconClassName" width="12" height="12" />
51
- {{ item.data.text }}
52
- </ui-chip>
53
- </template>
54
- </ui-data-table>
55
- </div>
56
-
57
- <div v-if="!props.hideCompatibility" class="compatibility-wrap">
58
- <p class="compatibility">
59
- {{ localization.inventorySummary.compatibility }}
60
- </p>
61
- <div class="compatibility-message flex-align-start">
62
- <ui-skeleton-item v-if="loading" width="160px" height="16px" />
63
- <template v-else>
64
- <template v-if="props.selectedStorage">
65
- <ui-icon
66
- name="success-fill"
67
- width="16"
68
- height="16"
69
- class="icon-compatibility-alert"
70
- />
71
- <span class="compatibility-message-description">{{
72
- localization.common.compatibilityChecksSucceeded
73
- }}</span>
74
- </template>
75
- <template v-else>
76
- <!-- <ui-icon name="error" width="16" height="16" />-->
77
- <span class="compatibility-message-description empty">{{
78
- localization.vmWizard.noStorageSelected
79
- }}</span>
80
- </template>
81
- </template>
82
- </div>
83
- </div>
84
- </div>
85
- </template>
86
-
87
- <script setup lang="ts">
88
- import type {
89
- UI_I_DataTableOptions,
90
- UI_I_DataTableSkeleton,
91
- } from 'bfg-uikit/components/ui/dataTable/models/interfaces'
92
- import type {
93
- UI_I_DataTable,
94
- UI_I_TableTexts,
95
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
96
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
97
- import type { UI_I_Localization } from '~/lib/models/interfaces'
98
- import {
99
- tableBodyFunc,
100
- tableDataFunc,
101
- tableOptions,
102
- } from '~/components/common/vm/actions/common/select/storage/new/lib/config/table'
103
- import { tableTextsFunc } from '~/lib/config/uiTable'
104
-
105
- const selectedRow = defineModel<number | null>('selectedRow')
106
-
107
- const props = withDefaults(
108
- defineProps<{
109
- datastore: UI_I_DatastoreTableItem[]
110
- isDatastoreLoading: boolean
111
- errors: string[]
112
- selectedStorage: UI_I_DatastoreTableItem | null
113
- hideCompatibility?: boolean
114
- hideAlert?: boolean
115
- isInWizard?: boolean
116
- tableOptions?: UI_I_DataTableOptions
117
- }>(),
118
- {
119
- hideCompatibility: undefined,
120
- hideAlert: undefined,
121
- isInWizard: undefined,
122
- tableOptions: undefined,
123
- }
124
- )
125
- const emits = defineEmits<{
126
- (event: 'remove-error'): void
127
- (event: 'change-storage', value: number): void
128
- }>()
129
-
130
- const tableOptionsLocal = computed<UI_I_DataTableOptions>(
131
- () => props.tableOptions || tableOptions
132
- )
133
-
134
- const localization = computed<UI_I_Localization>(() => useLocal())
135
-
136
- const tableTexts = computed<UI_I_TableTexts>(() =>
137
- tableTextsFunc(localization.value)
138
- )
139
-
140
- const storageCount = computed<string>(() =>
141
- localization.value.vmWizard.storageCount.replace(
142
- '{0}',
143
- data.value.body.length.toString()
144
- )
145
- )
146
- // const loading = ref<boolean>(true)
147
- const data = ref<UI_I_DataTable>(tableDataFunc(localization.value))
148
-
149
- watch(
150
- () => props.datastore,
151
- (newValue: UI_I_DatastoreTableItem[]) => {
152
- // loading.value = true
153
-
154
- // if (!newValue.length || data.value.body.length) return
155
-
156
- data.value.body = tableBodyFunc(
157
- newValue,
158
- localization.value,
159
- selectedRow.value
160
- )
161
-
162
- // loading.value = false
163
- },
164
- { immediate: true, deep: true }
165
- // { deep: true }
166
- )
167
-
168
- watch(selectedRow, (newValue) => {
169
- if (newValue && props.datastore.length) {
170
- data.value.body = tableBodyFunc(
171
- props.datastore,
172
- localization.value,
173
- newValue
174
- )
175
- }
176
- })
177
-
178
- const onSelectRow = (selectedData: UI_I_DataTable): void => {
179
- const selectedId = selectedData[0]?.data[0]?.data.id
180
- const selectedItemIndex = props.datastore.findIndex(
181
- (item) => item.id === selectedId
182
- )
183
-
184
- emits('change-storage', selectedItemIndex)
185
- }
186
-
187
- const skeletonData = ref<UI_I_DataTableSkeleton>({
188
- columnsCount: 5,
189
- headColumns: [],
190
- bodyColumns: [],
191
- })
192
- </script>
193
-
194
- <style>
195
- :root {
196
- --select-storage-border-color: #e9ebed;
197
- --select-storage-bg-color: #ffffff;
198
- --select-storage-title-color: #4d5d69;
199
- --select-storage-compatibility-bg-color: #ffffff;
200
- --select-storage-compatibility-description-color: #4d5d69;
201
- --select-storage-compatibility-empty-description-color: #9da6ad;
202
- --select-storage-compatibility-table-column-button-hover-bg: #f6f7f8;
203
- --select-storage-compatibility-table-column-button-active-hover-bg: #f0f8fd;
204
- }
205
- :root.dark-theme {
206
- --select-storage-border-color: #e9ebed1f;
207
- --select-storage-bg-color: var(--wizard-right-bg);
208
- --select-storage-title-color: #e9eaec;
209
- --select-storage-compatibility-bg-color: #1b2a371f;
210
- --select-storage-compatibility-description-color: #e9eaec;
211
- --select-storage-compatibility-empty-description-color: #9da6ad;
212
- --select-storage-compatibility-table-column-button-hover-bg: linear-gradient(
213
- 0deg,
214
- rgba(233, 234, 236, 0.04) 0%,
215
- rgba(233, 234, 236, 0.04) 100%
216
- ),
217
- rgba(27, 42, 55, 0.24);
218
- --select-storage-compatibility-table-column-button-active-hover-bg: linear-gradient(
219
- 0deg,
220
- rgba(43, 162, 222, 0.08) 0%,
221
- rgba(43, 162, 222, 0.08) 100%
222
- ),
223
- rgba(27, 42, 55, 0.24);
224
- }
225
- </style>
226
- <style scoped lang="scss">
227
- //:root.dark-theme {
228
- // .select-storage {
229
- // &.in-wizard {
230
- // :deep(.column-manager-button) {
231
- // &:hover {
232
- // background: #b8bcc10a;
233
- // }
234
- // &.active:hover {
235
- // background-color: #2785b614;
236
- // }
237
- // }
238
- // }
239
- // }
240
- //}
241
- .select-storage {
242
- padding-top: 12px;
243
- //padding-bottom: 16px;
244
-
245
- :deep(.title-sm) {
246
- font-size: 12px;
247
- }
248
-
249
- :deep(.table-container.default-layout) {
250
- box-shadow: unset;
251
- padding: 0;
252
- }
253
- .storage-count {
254
- font-size: 16px;
255
- font-weight: 500;
256
- color: var(--select-storage-title-color);
257
- }
258
-
259
- :deep(.column-manager-button) {
260
- span {
261
- font-size: 12px;
262
- font-weight: 500;
263
- }
264
- //&:not(.active):hover {
265
- // background-color: var(
266
- // --select-storage-compatibility-table-column-button-hover-bg
267
- // );
268
- // color: var(--btn-table-manager-color);
269
- //}
270
- //&.active:hover {
271
- // background-color: var(
272
- // --select-storage-compatibility-table-column-button-active-hover-bg
273
- // );
274
- //}
275
- }
276
-
277
- &:not(.in-wizard) {
278
- :deep(.bottom-grid-content) {
279
- border: 1px solid var(--select-storage-border-color);
280
- border-radius: 8px;
281
- padding: 12px;
282
- //background-color: var(--select-storage-bg-color);
283
- }
284
- :deep(.select-row-item) {
285
- background-color: var(--select-storage-bg-color);
286
- }
287
- }
288
-
289
- :deep(.table-title-actions-container) {
290
- justify-content: flex-start;
291
- }
292
- :deep(.table-container .table-title) {
293
- margin-bottom: 12px;
294
- }
295
-
296
- .compatibility-wrap {
297
- margin-top: 24px;
298
-
299
- .compatibility {
300
- font-size: 16px;
301
- font-weight: 500;
302
- color: var(--select-storage-title-color);
303
- margin-bottom: 16px;
304
- }
305
- .compatibility-message {
306
- border-radius: 8px;
307
- border: 1px solid var(--select-storage-border-color);
308
- padding: 12px;
309
- background-color: var(--select-storage-compatibility-bg-color);
310
- gap: 10px;
311
-
312
- .icon-compatibility-alert {
313
- min-width: 16px;
314
- min-height: 16px;
315
- }
316
- .compatibility-message-description {
317
- font-size: 13px;
318
- color: var(--select-storage-compatibility-description-color);
319
-
320
- &.empty {
321
- color: var(--select-storage-compatibility-empty-description-color);
322
- }
323
- }
324
- }
325
- }
326
- .row-datastores-icon {
327
- min-width: 18px;
328
- }
329
- }
330
- </style>
1
+ <template>
2
+ <div :class="['select-storage', { 'in-wizard': isInWizard }]">
3
+ <Teleport v-if="!props.hideAlert" to="#storage-alert-wrapper">
4
+ <ui-alert
5
+ v-show="props.errors.length"
6
+ :messages="props.errors"
7
+ :items="props.errors"
8
+ status="alert-danger"
9
+ test-id="storage-alert"
10
+ size="md"
11
+ @hide="emits('remove-error')"
12
+ />
13
+ </Teleport>
14
+
15
+ <div class="table-wrap">
16
+ <ui-data-table
17
+ :data="data"
18
+ :options="tableOptionsLocal"
19
+ :loading="props.isDatastoreLoading"
20
+ :default-layout="false"
21
+ :texts="tableTexts"
22
+ :skeleton="skeletonData"
23
+ test-id="select-storage-data-table"
24
+ server-off
25
+ size="sm"
26
+ @select-row="onSelectRow"
27
+ >
28
+ <template v-if="!props.isInWizard" #skeleton-header>
29
+ <div class="flex justify-between items-center">
30
+ <ui-skeleton-item width="80" height="20" />
31
+ <ui-skeleton-item width="88" height="22" border-radius="6px" />
32
+ </div>
33
+ </template>
34
+ <template v-if="!props.isInWizard" #insteadOfTitleActions>
35
+ <h3 class="storage-count">
36
+ {{ storageCount }}
37
+ </h3>
38
+ </template>
39
+ <template #name="{ item }">
40
+ <ui-icon
41
+ name="datastores"
42
+ width="18"
43
+ height="18"
44
+ class="mr-1 row-datastores-icon"
45
+ />
46
+ {{ item.text }}
47
+ </template>
48
+ <template #state="{ item }">
49
+ <ui-chip :color="item.data.color" size="sm" rounded>
50
+ <ui-icon :name="item.data.iconClassName" width="12" height="12" />
51
+ {{ item.data.text }}
52
+ </ui-chip>
53
+ </template>
54
+ </ui-data-table>
55
+ </div>
56
+
57
+ <common-wizards-common-compatibility
58
+ v-if="!props.hideCompatibility"
59
+ :status="props.compatibility[0]"
60
+ :text="props.compatibility[1]"
61
+ :loading="props.isDatastoreLoading"
62
+ />
63
+ </div>
64
+ </template>
65
+
66
+ <script setup lang="ts">
67
+ import type {
68
+ UI_I_DataTableOptions,
69
+ UI_I_DataTableSkeleton,
70
+ } from 'bfg-uikit/components/ui/dataTable/models/interfaces'
71
+ import type {
72
+ UI_I_DataTable,
73
+ UI_I_TableTexts,
74
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
75
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
76
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
77
+ import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
78
+ import {
79
+ tableBodyFunc,
80
+ tableDataFunc,
81
+ tableOptions,
82
+ } from '~/components/common/vm/actions/common/select/storage/new/lib/config/table'
83
+ import { tableTextsFunc } from '~/lib/config/uiTable'
84
+
85
+ const selectedRow = defineModel<number | null>('selectedRow')
86
+
87
+ const props = withDefaults(
88
+ defineProps<{
89
+ datastore: UI_I_DatastoreTableItem[]
90
+ isDatastoreLoading: boolean
91
+ errors: string[]
92
+ selectedStorage: UI_I_DatastoreTableItem | null
93
+ compatibility: [UI_T_CompatibilityStatus, string]
94
+ hideCompatibility?: boolean
95
+ hideAlert?: boolean
96
+ isInWizard?: boolean
97
+ tableOptions?: UI_I_DataTableOptions
98
+ }>(),
99
+ {
100
+ hideCompatibility: undefined,
101
+ hideAlert: undefined,
102
+ isInWizard: undefined,
103
+ tableOptions: undefined,
104
+ }
105
+ )
106
+ const emits = defineEmits<{
107
+ (event: 'remove-error'): void
108
+ (event: 'change-storage', value: number): void
109
+ }>()
110
+
111
+ const tableOptionsLocal = computed<UI_I_DataTableOptions>(
112
+ () => props.tableOptions || tableOptions
113
+ )
114
+
115
+ const localization = computed<UI_I_Localization>(() => useLocal())
116
+
117
+ const tableTexts = computed<UI_I_TableTexts>(() =>
118
+ tableTextsFunc(localization.value)
119
+ )
120
+
121
+ const storageCount = computed<string>(() =>
122
+ localization.value.vmWizard.storageCount.replace(
123
+ '{0}',
124
+ data.value.body.length.toString()
125
+ )
126
+ )
127
+ // const loading = ref<boolean>(true)
128
+ const data = ref<UI_I_DataTable>(tableDataFunc(localization.value))
129
+
130
+ watch(
131
+ () => props.datastore,
132
+ (newValue: UI_I_DatastoreTableItem[]) => {
133
+ // loading.value = true
134
+
135
+ // if (!newValue.length || data.value.body.length) return
136
+
137
+ data.value.body = tableBodyFunc(
138
+ newValue,
139
+ localization.value,
140
+ selectedRow.value
141
+ )
142
+
143
+ // loading.value = false
144
+ },
145
+ { immediate: true, deep: true }
146
+ // { deep: true }
147
+ )
148
+
149
+ watch(selectedRow, (newValue) => {
150
+ if (newValue && props.datastore.length) {
151
+ data.value.body = tableBodyFunc(
152
+ props.datastore,
153
+ localization.value,
154
+ newValue
155
+ )
156
+ }
157
+ })
158
+
159
+ const onSelectRow = (selectedData: UI_I_DataTable): void => {
160
+ const selectedId = selectedData[0]?.data[0]?.data.id
161
+ const selectedItemIndex = props.datastore.findIndex(
162
+ (item) => item.id === selectedId
163
+ )
164
+
165
+ emits('change-storage', selectedItemIndex)
166
+ }
167
+
168
+ const skeletonData = ref<UI_I_DataTableSkeleton>({
169
+ columnsCount: 5,
170
+ headColumns: [],
171
+ bodyColumns: [],
172
+ })
173
+ </script>
174
+
175
+ <style>
176
+ :root {
177
+ --select-storage-border-color: #e9ebed;
178
+ --select-storage-bg-color: #ffffff;
179
+ --select-storage-title-color: #4d5d69;
180
+ --select-storage-compatibility-bg-color: #ffffff;
181
+ --select-storage-compatibility-description-color: #4d5d69;
182
+ --select-storage-compatibility-empty-description-color: #9da6ad;
183
+ --select-storage-compatibility-table-column-button-hover-bg: #f6f7f8;
184
+ --select-storage-compatibility-table-column-button-active-hover-bg: #f0f8fd;
185
+ }
186
+ :root.dark-theme {
187
+ --select-storage-border-color: #e9ebed1f;
188
+ --select-storage-bg-color: var(--wizard-right-bg);
189
+ --select-storage-title-color: #e9eaec;
190
+ --select-storage-compatibility-bg-color: #1b2a371f;
191
+ --select-storage-compatibility-description-color: #e9eaec;
192
+ --select-storage-compatibility-empty-description-color: #9da6ad;
193
+ --select-storage-compatibility-table-column-button-hover-bg: linear-gradient(
194
+ 0deg,
195
+ rgba(233, 234, 236, 0.04) 0%,
196
+ rgba(233, 234, 236, 0.04) 100%
197
+ ),
198
+ rgba(27, 42, 55, 0.24);
199
+ --select-storage-compatibility-table-column-button-active-hover-bg: linear-gradient(
200
+ 0deg,
201
+ rgba(43, 162, 222, 0.08) 0%,
202
+ rgba(43, 162, 222, 0.08) 100%
203
+ ),
204
+ rgba(27, 42, 55, 0.24);
205
+ }
206
+ </style>
207
+ <style scoped lang="scss">
208
+ //:root.dark-theme {
209
+ // .select-storage {
210
+ // &.in-wizard {
211
+ // :deep(.column-manager-button) {
212
+ // &:hover {
213
+ // background: #b8bcc10a;
214
+ // }
215
+ // &.active:hover {
216
+ // background-color: #2785b614;
217
+ // }
218
+ // }
219
+ // }
220
+ // }
221
+ //}
222
+ .select-storage {
223
+ padding-top: 12px;
224
+ //padding-bottom: 16px;
225
+
226
+ :deep(.title-sm) {
227
+ font-size: 12px;
228
+ }
229
+
230
+ :deep(.table-container.default-layout) {
231
+ box-shadow: unset;
232
+ padding: 0;
233
+ }
234
+ .storage-count {
235
+ font-size: 16px;
236
+ font-weight: 500;
237
+ color: var(--select-storage-title-color);
238
+ }
239
+
240
+ :deep(.column-manager-button) {
241
+ span {
242
+ font-size: 12px;
243
+ font-weight: 500;
244
+ }
245
+ //&:not(.active):hover {
246
+ // background-color: var(
247
+ // --select-storage-compatibility-table-column-button-hover-bg
248
+ // );
249
+ // color: var(--btn-table-manager-color);
250
+ //}
251
+ //&.active:hover {
252
+ // background-color: var(
253
+ // --select-storage-compatibility-table-column-button-active-hover-bg
254
+ // );
255
+ //}
256
+ }
257
+
258
+ &:not(.in-wizard) {
259
+ :deep(.bottom-grid-content) {
260
+ border: 1px solid var(--select-storage-border-color);
261
+ border-radius: 8px;
262
+ padding: 12px;
263
+ //background-color: var(--select-storage-bg-color);
264
+ }
265
+ :deep(.select-row-item) {
266
+ background-color: var(--select-storage-bg-color);
267
+ }
268
+ }
269
+
270
+ :deep(.table-title-actions-container) {
271
+ justify-content: flex-start;
272
+ }
273
+ :deep(.table-container .table-title) {
274
+ margin-bottom: 12px;
275
+ }
276
+
277
+ .compatibility-wrap {
278
+ margin-top: 24px;
279
+
280
+ .compatibility {
281
+ font-size: 16px;
282
+ font-weight: 500;
283
+ color: var(--select-storage-title-color);
284
+ margin-bottom: 16px;
285
+ }
286
+ .compatibility-message {
287
+ border-radius: 8px;
288
+ border: 1px solid var(--select-storage-border-color);
289
+ padding: 12px;
290
+ background-color: var(--select-storage-compatibility-bg-color);
291
+ gap: 10px;
292
+
293
+ .icon-compatibility-alert {
294
+ min-width: 16px;
295
+ min-height: 16px;
296
+ }
297
+ .compatibility-message-description {
298
+ font-size: 13px;
299
+ color: var(--select-storage-compatibility-description-color);
300
+
301
+ &.empty {
302
+ color: var(--select-storage-compatibility-empty-description-color);
303
+ }
304
+ }
305
+ }
306
+ }
307
+ .row-datastores-icon {
308
+ min-width: 18px;
309
+ }
310
+ }
311
+ </style>
@@ -1,6 +1,6 @@
1
- export interface UI_I_StatusData {
2
- iconClassName: string
3
- color: string
4
- isState: boolean
5
- text: string
1
+ export interface UI_I_StatusData {
2
+ iconClassName: string
3
+ color: string
4
+ isState: boolean
5
+ text: string
6
6
  }