bfg-common 1.6.74 → 1.6.75

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 (165) hide show
  1. package/assets/localization/local_be.json +272 -11
  2. package/assets/localization/local_en.json +291 -29
  3. package/assets/localization/local_hy.json +274 -13
  4. package/assets/localization/local_kk.json +272 -11
  5. package/assets/localization/local_ru.json +286 -25
  6. package/assets/localization/local_zh.json +273 -12
  7. package/assets/scss/common/global.scss +11 -0
  8. package/assets/scss/common/normalize.scss +3 -0
  9. package/assets/scss/common/theme.scss +2 -2
  10. package/components/atoms/stack/StackBlock.vue +1 -1
  11. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +2 -2
  12. package/components/atoms/tooltip/TooltipError.vue +3 -0
  13. package/components/common/adapterManager/AdapterManagerNew.vue +86 -0
  14. package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +1 -1
  15. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +0 -1
  16. package/components/common/adapterManager/ui/actions/bar/Bar.vue +2 -0
  17. package/components/common/adapterManager/ui/actions/bar/BarNew.vue +3 -2
  18. package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +1 -0
  19. package/components/common/certificate/CertificateInfo.vue +7 -1
  20. package/components/common/configure/physicalAdapters/PhysicalAdapters.vue +6 -0
  21. package/components/common/configure/physicalAdapters/PhysicalAdaptersNew.vue +219 -192
  22. package/components/common/configure/physicalAdapters/PhysicalAdaptersOld.vue +6 -4
  23. package/components/common/configure/physicalAdapters/buttons/Buttons.vue +1 -0
  24. package/components/common/configure/physicalAdapters/modals/edit/Edit.vue +26 -1
  25. package/components/common/configure/physicalAdapters/modals/edit/EditNew.vue +30 -1
  26. package/components/common/configure/physicalAdapters/modals/edit/lib/models/interfaces.ts +5 -0
  27. package/components/common/configure/physicalAdapters/modals/edit/lib/validations/validations.ts +19 -0
  28. package/components/common/configure/physicalAdapters/tableView/TableViewNew.vue +12 -1
  29. package/components/common/configure/physicalAdapters/tableView/lib/config/physicalAdaptersTableConfigNew.ts +21 -21
  30. package/components/common/configure/physicalAdapters/tableView/lib/config/settings.ts +12 -5
  31. package/components/common/configure/physicalAdapters/tableView/lib/models/interfaces.ts +4 -1
  32. package/components/common/diagramMain/Diagram.vue +169 -85
  33. package/components/common/diagramMain/DiagramMain.vue +40 -10
  34. package/components/common/diagramMain/header/Header.vue +49 -0
  35. package/components/common/diagramMain/header/HeaderNew.vue +155 -0
  36. package/components/common/diagramMain/{Header.vue → header/HeaderOld.vue} +78 -67
  37. package/components/common/diagramMain/modals/Modals.vue +4 -0
  38. package/components/common/diagramMain/modals/UnsavedChangesModal.vue +32 -0
  39. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +104 -102
  40. package/components/common/diagramMain/modals/editSettings/EditSettingsNew.vue +285 -0
  41. package/components/common/diagramMain/modals/editSettings/EditSettingsOld.vue +254 -0
  42. package/components/common/diagramMain/modals/editSettings/confirmTeamingSettingsModal/ConfirmTeamingSettingsModal.vue +31 -0
  43. package/components/common/diagramMain/modals/editSettings/confirmTeamingSettingsModal/ConfirmTeamingSettingsModalNew.vue +82 -0
  44. package/components/common/diagramMain/modals/editSettings/{ConfirmTeamingSettingsModal.vue → confirmTeamingSettingsModal/ConfirmTeamingSettingsModalOld.vue} +2 -5
  45. package/components/common/diagramMain/modals/editSettings/lib/config/config.ts +15 -0
  46. package/components/common/diagramMain/modals/editSettings/lib/models/interfaces.ts +6 -0
  47. package/components/common/diagramMain/modals/editSettings/lib/utils/utils.ts +177 -0
  48. package/components/common/diagramMain/modals/editSettings/modal/EditSettingsModal.vue +137 -0
  49. package/components/common/diagramMain/modals/editSettings/modal/EditSettingsModalNew.vue +91 -0
  50. package/components/common/diagramMain/modals/editSettings/{EditSettingsModal.vue → modal/EditSettingsModalOld.vue} +12 -51
  51. package/components/common/diagramMain/modals/editSettings/tabs/networkProperties/NetworkProperties.vue +158 -0
  52. package/components/common/diagramMain/modals/editSettings/tabs/networkProperties/NetworkPropertiesNew.vue +262 -0
  53. package/components/common/diagramMain/modals/editSettings/tabs/{NetworkProperties.vue → networkProperties/NetworkPropertiesOld.vue} +12 -113
  54. package/components/common/diagramMain/modals/editSettings/tabs/port/ipvFourSettings/IpvFourSettings.vue +192 -0
  55. package/components/common/diagramMain/modals/editSettings/tabs/port/ipvFourSettings/IpvFourSettingsNew.vue +388 -0
  56. package/components/common/diagramMain/modals/editSettings/tabs/port/{IpvFourSettings.vue → ipvFourSettings/IpvFourSettingsOld.vue} +11 -152
  57. package/components/common/diagramMain/modals/editSettings/tabs/port/portProperties/PortProperties.vue +139 -0
  58. package/components/common/diagramMain/modals/editSettings/tabs/port/portProperties/PortPropertiesNew.vue +286 -0
  59. package/components/common/diagramMain/modals/editSettings/tabs/port/{PortProperties.vue → portProperties/PortPropertiesOld.vue} +12 -103
  60. package/components/common/diagramMain/modals/editSettings/tabs/security/Security.vue +209 -0
  61. package/components/common/diagramMain/modals/editSettings/tabs/security/SecurityNew.vue +233 -0
  62. package/components/common/diagramMain/modals/editSettings/tabs/{Security.vue → security/SecurityOld.vue} +25 -48
  63. package/components/common/diagramMain/modals/editSettings/tabs/switchProperties/SwitchProperties.vue +128 -0
  64. package/components/common/diagramMain/modals/editSettings/tabs/switchProperties/SwitchPropertiesNew.vue +235 -0
  65. package/components/common/diagramMain/modals/editSettings/tabs/{SwitchProperties.vue → switchProperties/SwitchPropertiesOld.vue} +12 -89
  66. package/components/common/diagramMain/modals/editSettings/tabs/teamingFailover/TeamingFailover.vue +99 -0
  67. package/components/common/diagramMain/modals/editSettings/tabs/teamingFailover/TeamingFailoverNew.vue +319 -0
  68. package/components/common/diagramMain/modals/editSettings/tabs/{TeamingFailover.vue → teamingFailover/TeamingFailoverOld.vue} +11 -48
  69. package/components/common/diagramMain/modals/editSettings/tabs/trafficShaping/TrafficShaping.vue +173 -0
  70. package/components/common/diagramMain/modals/editSettings/tabs/trafficShaping/TrafficShapingNew.vue +348 -0
  71. package/components/common/diagramMain/modals/editSettings/tabs/{TrafficShaping.vue → trafficShaping/TrafficShapingOld.vue} +12 -134
  72. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +43 -2
  73. package/components/common/diagramMain/modals/lib/config/index.ts +2 -1
  74. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +1 -1
  75. package/components/common/diagramMain/modals/lib/utils/index.ts +34 -4
  76. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +2 -2
  77. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +1 -1
  78. package/components/common/diagramMain/skeleton/Header.vue +31 -0
  79. package/components/common/diagramMain/skeleton/Switch.vue +75 -0
  80. package/components/common/layout/theHeader/ThemeSwitch.vue +1 -1
  81. package/components/common/layout/theHeader/modals/reconnect/New.vue +38 -30
  82. package/components/common/layout/theHeader/userMenu/modals/changePassword/New.vue +8 -9
  83. package/components/common/layout/theHeader/userMenu/modals/preferences/New.vue +4 -0
  84. package/components/common/layout/theHeader/userMenu/modals/preferences/Old.vue +9 -2
  85. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +11 -7
  86. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +7 -1
  87. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions.ts +8 -5
  88. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +9 -5
  89. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions.ts +1 -1
  90. package/components/common/layout/theHeader/userMenu/modals/preferences/view/Old.vue +5 -9
  91. package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +9 -6
  92. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +3 -1
  93. package/components/common/modals/Rename.vue +3 -1
  94. package/components/common/noDataProvided/NoDataProvidedNew.vue +1 -1
  95. package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/config/table.ts +4 -4
  96. package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/lib/config/table.ts +4 -4
  97. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +184 -253
  98. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/ActionsNew.vue +1 -1
  99. package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +9 -0
  100. package/components/common/pages/scheduledTasks/table/new/New.vue +12 -10
  101. package/components/common/pages/tasks/Tasks.vue +4 -1
  102. package/components/common/pages/tasks/table/Table.vue +25 -23
  103. package/components/common/readyToComplete/New.vue +1 -0
  104. package/components/common/split/vertical/New.vue +42 -8
  105. package/components/common/split/vertical/Old.vue +31 -2
  106. package/components/common/split/vertical/Vertical.vue +4 -0
  107. package/components/common/tools/Actions.vue +7 -3
  108. package/components/common/tools/lib/models/interfaces.ts +1 -0
  109. package/components/common/vm/actions/add/New.vue +21 -6
  110. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +14 -1
  111. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/New.vue +5 -0
  112. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Old.vue +1 -0
  113. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/New.vue +1 -0
  114. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/New.vue +2 -0
  115. package/components/common/vm/actions/common/select/options/New.vue +14 -12
  116. package/components/common/vm/actions/common/select/options/Old.vue +16 -15
  117. package/components/common/vm/actions/common/select/storage/new/lib/config/table.ts +13 -15
  118. package/components/common/vm/actions/confirm/Confirm.vue +3 -0
  119. package/components/common/vm/actions/rename/Old.vue +1 -0
  120. package/components/common/vm/snapshots/DetailView.vue +6 -6
  121. package/components/common/wizards/datastore/add/New.vue +6 -0
  122. package/components/common/wizards/datastore/add/lib/config/steps.ts +1 -1
  123. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +1 -1
  124. package/components/common/wizards/datastore/add/steps/nameAndDevice/advancedOptions/New.vue +1 -1
  125. package/components/common/wizards/network/add/Add.vue +13 -2
  126. package/components/common/wizards/network/add/AddNew.vue +22 -26
  127. package/components/common/wizards/network/add/lib/config/initialData.ts +6 -4
  128. package/components/common/wizards/network/add/lib/config/steps.ts +1 -1
  129. package/components/common/wizards/network/add/lib/models/interfaces.ts +1 -0
  130. package/components/common/wizards/network/add/lib/utils/utils.ts +1 -1
  131. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsOld.vue +5 -1
  132. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsNew.vue +2 -8
  133. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsOld.vue +3 -0
  134. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesNew.vue +2 -8
  135. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesOld.vue +6 -2
  136. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +10 -3
  137. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceOld.vue +4 -0
  138. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectNetwork.vue +5 -1
  139. package/components/common/wizards/network/add/validations/common.ts +1 -1
  140. package/components/common/wizards/vm/migrate/New.vue +13 -3
  141. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +5 -0
  142. package/components/common/wizards/vm/migrate/lib/config/steps.ts +3 -2
  143. package/components/common/wizards/vm/migrate/steps/computeResource/New.vue +2 -1
  144. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/New.vue +40 -21
  145. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/clusterTable.ts +340 -0
  146. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/hostTable.ts +44 -14
  147. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/models/enums.ts +4 -0
  148. package/components/common/wizards/vm/migrate/steps/priority/New.vue +7 -2
  149. package/components/common/wizards/vm/migrate/steps/selectStorage/New.vue +22 -7
  150. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/New.vue +6 -0
  151. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/table/new/New.vue +4 -1
  152. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/batch/table/new/lib/config/datastoreTable.ts +12 -16
  153. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/New.vue +10 -5
  154. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/lib/config/diskTable.ts +16 -11
  155. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/old/lib/config/diskTable.ts +7 -1
  156. package/components/common/wizards/vm/migrate/steps/selectStorage/selectedPerDisk/New.vue +17 -10
  157. package/components/common/wizards/vm/migrate/steps/type/TypeNew.vue +1 -0
  158. package/components/common/wizards/vm/migrate/vmOrigin/New.vue +35 -15
  159. package/lib/models/store/tasks/enums.ts +3 -0
  160. package/lib/models/store/tasks/types.ts +7 -6
  161. package/package.json +2 -2
  162. package/plugins/directives.ts +3 -5
  163. package/public/spice-console/application/agent.js +18 -17
  164. package/store/tasks/actions.ts +26 -8
  165. package/store/tasks/mappers/recentTasks.ts +1 -0
@@ -46,7 +46,7 @@ import type {
46
46
  UI_I_DataTable,
47
47
  UI_I_DataTableHeader,
48
48
  UI_I_DataTableBody,
49
- UI_I_TableTexts
49
+ UI_I_TableTexts,
50
50
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/lib/models/interfaces'
51
51
  import type { UI_I_Localization } from '~/lib/models/interfaces'
52
52
  import type {
@@ -147,6 +147,10 @@ const onSelectNetwork = (): void => {
147
147
  <style scoped lang="scss">
148
148
  :deep(.table-container) {
149
149
  padding: 8px 32px !important;
150
+
151
+ .column-manager-button span {
152
+ font-weight: 500;
153
+ }
150
154
  }
151
155
 
152
156
  .row-container {
@@ -21,7 +21,7 @@ export const checkVlanId = (
21
21
  vlanId: string,
22
22
  localization: UI_I_Localization
23
23
  ): boolean =>
24
- vlanId !== `${localization.common.none} (0)` &&
24
+ vlanId !== `${localization.common.none2} (0)` &&
25
25
  vlanId !== `${localization.common.all} (4095)` &&
26
26
  (isIntegerNumberInRange(vlanId, 0, 4095) || vlanId.trim() === '')
27
27
 
@@ -187,8 +187,13 @@
187
187
  >
188
188
  <template #subTitle>
189
189
  <div ref="subTitleBlock6">
190
- <div class="subtitle-block">
190
+ <div class="subtitle-block flex-row items-start">
191
191
  <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
192
+
193
+ <common-wizards-vm-migrate-vm-origin
194
+ v-if="props.vmOrigin"
195
+ :vm-origin="props.vmOrigin"
196
+ />
192
197
  </div>
193
198
  </div>
194
199
  </template>
@@ -207,8 +212,13 @@
207
212
  >
208
213
  <template #subTitle>
209
214
  <div ref="subTitleBlock7">
210
- <div class="subtitle-block">
215
+ <div class="subtitle-block flex-row items-start">
211
216
  <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
217
+
218
+ <common-wizards-vm-migrate-vm-origin
219
+ v-if="props.vmOrigin"
220
+ :vm-origin="props.vmOrigin"
221
+ />
212
222
  </div>
213
223
  </div>
214
224
  </template>
@@ -293,7 +303,7 @@ const texts = computed<UI_I_WizardTexts>(() => ({
293
303
  back: localization.value.common.backCap,
294
304
  processing: localization.value.common.processing,
295
305
  next: localization.value.common.next,
296
- finish: localization.value.common.create,
306
+ finish: localization.value.common.migrate,
297
307
  incompleteTitle: localization.value.common.incompleteProcess,
298
308
  incompleteMessage: localization.value.common.incompleteProcessMessage,
299
309
  incompleteCancel: localization.value.common.cancel,
@@ -26,6 +26,7 @@ const migrateOnlyStorageDataView = (
26
26
  label: localization.common.storage,
27
27
  value: storage?.name,
28
28
  permissions: ['batch-configure'],
29
+ iconClassName: 'vsphere-icon-datastore',
29
30
  },
30
31
  {
31
32
  label: localization.common.diskFormat,
@@ -124,6 +125,7 @@ const storageDetailsFunc = (
124
125
  label: localization.common.virtualMachine,
125
126
  value: name,
126
127
  permissions: ['batch-configure', 'configure-disk'],
128
+ iconClassName: 'vsphere-icon-vm',
127
129
  },
128
130
  ]
129
131
 
@@ -148,6 +150,7 @@ const storageDetailsFunc = (
148
150
  label: localization.common[key],
149
151
  value: value.name,
150
152
  permissions: [],
153
+ iconClassName: `vsphere-icon-${key}`,
151
154
  })
152
155
  }
153
156
  })
@@ -165,6 +168,7 @@ const storageDetailsFunc = (
165
168
  label: localization.common.host,
166
169
  value: '', //selectedComputeResource.selectedNode.name,
167
170
  permissions: [],
171
+ iconClassName: 'vsphere-icon-host',
168
172
  },
169
173
  {
170
174
  label: localization.migrateVm.migrationStrategy,
@@ -176,6 +180,7 @@ const storageDetailsFunc = (
176
180
  label: localization.common.networks,
177
181
  value: setSelectNetworkDataView(localization, form),
178
182
  permissions: [],
183
+ iconClassName: 'vsphere-icon-network',
179
184
  },
180
185
  ]
181
186
  const storageResult = migrateOnlyStorageDataView(localization, form, name)
@@ -30,7 +30,8 @@ export const stepsFunc = (
30
30
  {
31
31
  id: dynamicSteps.selectMigrationType,
32
32
  title: localization.common.selectMigrationType,
33
- subTitle: localization.migrateVm.changeComputeResourceStorageVirtualMachine,
33
+ subTitle:
34
+ localization.migrateVm.changeComputeResourceStorageVirtualMachine,
34
35
  status: UI_E_WIZARD_STATUS[!isScheduledTasks ? 'SELECTED' : 'INACTIVE'],
35
36
  fields: {},
36
37
  isValid: true,
@@ -99,7 +100,7 @@ export const stepsFunc = (
99
100
  {
100
101
  id: dynamicSteps.readyComplete,
101
102
  title: localization.common.readyComplete,
102
- subTitle: '',
103
+ subTitle: localization.migrateVm.reviewDetailsBeforeVmMigrated,
103
104
  status: UI_E_WIZARD_STATUS.INACTIVE,
104
105
  fields: {},
105
106
  isValid: true,
@@ -88,8 +88,9 @@ const onTabChange = (name: keyof UI_I_SelectedTableDataKeys): void => {
88
88
  @import 'assets/scss/common/mixins';
89
89
  .compute-resource {
90
90
  @include flex($dir: column);
91
- top: 16px;
92
91
  height: inherit;
92
+ margin-top: 16px;
93
+ margin-bottom: 16px;
93
94
  .tree-view-wrap {
94
95
  max-height: 250px;
95
96
  min-height: 200px;
@@ -2,7 +2,7 @@
2
2
  <div class="device-table-container">
3
3
  <ui-data-table
4
4
  :data="data"
5
- :options="options"
5
+ :options="tableConfig.options"
6
6
  :loading="props.isLoading"
7
7
  :total-pages="props.totalPages"
8
8
  :total-items="props.totalItems"
@@ -52,8 +52,8 @@
52
52
  >
53
53
  <ui-icon
54
54
  :name="item.data.icon"
55
- width="14px"
56
- height="14px"
55
+ width="12px"
56
+ height="12px"
57
57
  class="chip-icon"
58
58
  ></ui-icon>
59
59
  {{ item.text }}
@@ -79,13 +79,10 @@ import type {
79
79
  UI_I_TableTexts,
80
80
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
81
81
  import type { UI_I_DataTableSkeleton } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
82
- import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
82
+ import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/steps/selectStorage/lib/models/types'
83
83
  import type { UI_T_ComputeResourceTableItem } from '~/components/common/wizards/vm/migrate/steps/computeResource/lib/models/types'
84
- import {
85
- options,
86
- getHeaderDataFunc,
87
- getBodyDataFunc,
88
- } from '~/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/hostTable'
84
+ import * as hostTable from '~/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/hostTable'
85
+ import * as clusterTable from '~/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/config/clusterTable'
89
86
 
90
87
  const selectedDataLocal = defineModel<number | null>({ required: true })
91
88
  const props = defineProps<{
@@ -120,15 +117,33 @@ const tableSkeleton = ref<UI_I_DataTableSkeleton>({
120
117
  withoutPagination: true,
121
118
  })
122
119
 
120
+ const tableTitleMap = {
121
+ host: localization.value.common.hosts,
122
+ cluster: localization.value.common.clusters,
123
+ } as const
124
+ const tableConfigMap = {
125
+ host: hostTable,
126
+ cluster: clusterTable,
127
+ } as const
128
+
129
+ const tableConfig = computed(
130
+ () => tableConfigMap[props.type as keyof typeof tableConfigMap]
131
+ )
132
+
123
133
  const data = computed<UI_I_DataTable>(() => ({
124
- id: 'compute-resource-host-table',
125
- title: `${localization.value.common.hosts} (${props.totalItems})`,
134
+ id: `compute-resource-${props.type}-table`,
135
+ title: tableDataTitle.value,
126
136
  header: deviceHeadItems.value,
127
137
  body: deviceBodyItems.value,
128
138
  }))
129
-
139
+ const tableDataTitle = computed<string>(
140
+ () =>
141
+ `${tableTitleMap[props.type as keyof typeof tableConfigMap]} (${
142
+ props.totalItems
143
+ })`
144
+ )
130
145
  const deviceHeadItems = computed<UI_I_DataTableHeader[]>(() =>
131
- getHeaderDataFunc(localization.value)
146
+ tableConfig.value.getHeaderDataFunc(localization.value)
132
147
  )
133
148
 
134
149
  const deviceBodyItems = ref<UI_I_DataTableBody[]>([])
@@ -140,19 +155,22 @@ watch(
140
155
  return
141
156
  }
142
157
 
143
- deviceBodyItems.value = getBodyDataFunc(newValue, localization.value)
158
+ deviceBodyItems.value = tableConfig.value.getBodyDataFunc(
159
+ newValue,
160
+ localization.value
161
+ )
144
162
  },
145
163
  { deep: true, immediate: true }
146
164
  )
147
165
 
148
166
  const onSelectRow = (value: UI_I_DataTableBody[]): void => {
149
- selectedDataLocal.value = value?.[0].row
167
+ selectedDataLocal.value = value?.[0].row as number
150
168
  }
151
169
  </script>
152
170
 
153
171
  <style lang="scss" scoped>
154
172
  .device-table-container {
155
- margin: 20px 0 24px;
173
+ margin: 16px 0 24px;
156
174
  :deep(.column-manager-button.sm span) {
157
175
  font-weight: 500;
158
176
  }
@@ -169,15 +187,15 @@ const onSelectRow = (value: UI_I_DataTableBody[]): void => {
169
187
  }
170
188
  .progress {
171
189
  &-line {
172
- height: 12px;
190
+ height: 10px;
173
191
  width: 100%;
174
- background: #e9ebed8f;
192
+ background: var(--progress-bar-bg);
175
193
  border-radius: 6px;
176
194
 
177
195
  &-fill {
178
- height: 12px;
179
- min-width: 12px;
180
- background: #008fd6;
196
+ height: 10px;
197
+ min-width: 10px;
198
+ background: var(--progress-bar);
181
199
  border-radius: 6px;
182
200
  }
183
201
  }
@@ -185,6 +203,7 @@ const onSelectRow = (value: UI_I_DataTableBody[]): void => {
185
203
  &-text {
186
204
  width: 53px;
187
205
  min-width: 53px;
206
+ font-size: 12px;
188
207
  margin-left: 8px;
189
208
  text-align: right;
190
209
 
@@ -0,0 +1,340 @@
1
+ import type {
2
+ UI_I_DataTableBody,
3
+ UI_I_DataTableOptions,
4
+ UI_I_DataTableHeader,
5
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
6
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
7
+ import type { UI_I_ClusterTableItem } from '~/components/common/wizards/vm/migrate/steps/computeResource/tableView/lib/models/interfaces'
8
+ // import {
9
+ // UI_E_DeviceStatus,
10
+ // UI_E_DeviceStatusChipColor,
11
+ // UI_E_DeviceStatusIcon,
12
+ // } from '~/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/models/enums'
13
+
14
+ // // Маппинг для статусов
15
+ // const STATUS_MAPPING = {
16
+ // [UI_E_DeviceStatus.Unknown]: {
17
+ // icon: UI_E_DeviceStatusIcon.HelpIcon,
18
+ // chipColor: UI_E_DeviceStatusChipColor.Primary,
19
+ // },
20
+ // [UI_E_DeviceStatus.Supported]: {
21
+ // icon: UI_E_DeviceStatusIcon.StatusCheck,
22
+ // chipColor: UI_E_DeviceStatusChipColor.Green,
23
+ // },
24
+ // [UI_E_DeviceStatus.NotSupported]: {
25
+ // icon: UI_E_DeviceStatusIcon.Close,
26
+ // chipColor: UI_E_DeviceStatusChipColor.Red,
27
+ // },
28
+ // }
29
+
30
+ export const getHeaderDataFunc = (
31
+ localization: UI_I_Localization
32
+ ): UI_I_DataTableHeader[] => [
33
+ {
34
+ col: 'col0',
35
+ colName: 'name',
36
+ text: localization.common.name,
37
+ isSortable: true,
38
+ sort: 'asc',
39
+ width: '180px',
40
+ show: true,
41
+ filter: false,
42
+ },
43
+ {
44
+ col: 'col1',
45
+ colName: 'available_cpu',
46
+ text: localization.common.availableCpu,
47
+ isSortable: true,
48
+ sort: 'asc',
49
+ width: '96px',
50
+ show: true,
51
+ filter: false,
52
+ },
53
+ {
54
+ col: 'col2',
55
+ colName: 'available_memory',
56
+ text: localization.common.availableMemory,
57
+ isSortable: true,
58
+ sort: 'asc',
59
+ width: '96px',
60
+ show: true,
61
+ filter: false,
62
+ },
63
+ {
64
+ col: 'col3',
65
+ colName: 'available_storage',
66
+ text: localization.common.availableStorage,
67
+ isSortable: true,
68
+ sort: 'asc',
69
+ width: '96px',
70
+ show: true,
71
+ filter: false,
72
+ },
73
+ {
74
+ col: 'col4',
75
+ colName: 'drs',
76
+ text: localization.common.vSphere_DRS,
77
+ isSortable: true,
78
+ sort: 'asc',
79
+ width: '96px',
80
+ show: true,
81
+ filter: false,
82
+ },
83
+ {
84
+ col: 'col5',
85
+ colName: 'ha',
86
+ text: localization.common.vSphere_HA,
87
+ isSortable: true,
88
+ sort: 'asc',
89
+ width: '96px',
90
+ show: true,
91
+ filter: false,
92
+ },
93
+ {
94
+ col: 'col6',
95
+ colName: 'total_cpu',
96
+ text: localization.common.totalCpu,
97
+ isSortable: true,
98
+ sort: 'asc',
99
+ width: '96px',
100
+ show: true,
101
+ filter: false,
102
+ },
103
+ {
104
+ col: 'col7',
105
+ colName: 'total_memory',
106
+ text: localization.common.totalMemory,
107
+ isSortable: true,
108
+ sort: 'asc',
109
+ width: '96px',
110
+ show: true,
111
+ filter: false,
112
+ },
113
+ {
114
+ col: 'col8',
115
+ colName: 'total_storage',
116
+ text: localization.common.totalStorage,
117
+ isSortable: true,
118
+ sort: 'asc',
119
+ width: '96px',
120
+ show: true,
121
+ filter: false,
122
+ },
123
+ {
124
+ col: 'col9',
125
+ colName: 'vms',
126
+ text: localization.common.vms,
127
+ isSortable: true,
128
+ sort: 'asc',
129
+ width: '96px',
130
+ show: true,
131
+ filter: false,
132
+ },
133
+ {
134
+ col: 'col10',
135
+ colName: 'hosts',
136
+ text: localization.common.hosts,
137
+ isSortable: true,
138
+ sort: 'asc',
139
+ width: '96px',
140
+ show: true,
141
+ filter: false,
142
+ },
143
+ {
144
+ col: 'col11',
145
+ colName: 'cpus',
146
+ text: localization.common.cpus,
147
+ isSortable: true,
148
+ sort: 'asc',
149
+ width: '96px',
150
+ show: true,
151
+ filter: false,
152
+ },
153
+ {
154
+ col: 'col12',
155
+ colName: 'datastores',
156
+ text: localization.common.datastores,
157
+ isSortable: true,
158
+ sort: 'asc',
159
+ width: '96px',
160
+ show: true,
161
+ filter: false,
162
+ },
163
+ {
164
+ col: 'col13',
165
+ colName: 'vsan',
166
+ text: localization.common.vSAN,
167
+ isSortable: true,
168
+ sort: 'asc',
169
+ width: '96px',
170
+ show: true,
171
+ filter: false,
172
+ },
173
+ {
174
+ col: 'col14',
175
+ colName: 'vc',
176
+ text: localization.common.vc,
177
+ isSortable: true,
178
+ sort: 'asc',
179
+ width: '96px',
180
+ show: true,
181
+ filter: false,
182
+ },
183
+ {
184
+ col: 'col15',
185
+ colName: 'evc_cpu_mode',
186
+ text: localization.common.evcCpuMode,
187
+ isSortable: true,
188
+ sort: 'asc',
189
+ width: '96px',
190
+ show: true,
191
+ filter: false,
192
+ },
193
+ {
194
+ col: 'col16',
195
+ colName: 'evc_graphics_mode',
196
+ text: localization.common.evcGraphicsMode,
197
+ isSortable: true,
198
+ sort: 'asc',
199
+ width: '96px',
200
+ show: true,
201
+ filter: false,
202
+ },
203
+ ]
204
+ export const options: UI_I_DataTableOptions = {
205
+ perPageOptions: [{ text: '10', value: 100, default: true }],
206
+ isSelectable: true,
207
+ selectType: 'radio',
208
+ showPagination: false,
209
+ showPageInfo: false,
210
+ isSortable: true,
211
+ server: true,
212
+ isResizable: true,
213
+ showSelectedRows: false,
214
+ showColumnManager: true,
215
+ inModal: true,
216
+ inBlock: false,
217
+ // isFocusable: false,
218
+ // showPaginationOnTop: false,
219
+ // showSearch: false,
220
+ // withActions: false,
221
+ // showExport: false,
222
+ // withCollapse: false,
223
+ }
224
+
225
+ export const getBodyDataFunc = (
226
+ bodyData: UI_I_ClusterTableItem[],
227
+ _localization: UI_I_Localization
228
+ ): UI_I_DataTableBody[] => {
229
+ const { $binary }: any = useNuxtApp()
230
+
231
+ return bodyData.map((cluster, index: number) => {
232
+ // const statusKey = host.state
233
+ // ? UI_E_DeviceStatus.Unknown
234
+ // : UI_E_DeviceStatus.Supported
235
+ // const statusData = {
236
+ // ...STATUS_MAPPING[statusKey],
237
+ // testId: `${host.name}-${index}-status`,
238
+ // }
239
+
240
+ return {
241
+ row: index,
242
+ collapse: false,
243
+ isHiddenCollapse: false,
244
+ collapseToggle: false,
245
+
246
+ data: [
247
+ {
248
+ key: 'icon',
249
+ col: 'col0',
250
+ text: cluster.name,
251
+ data: {
252
+ iconClassName: 'vsphere-icon-cluster',
253
+ },
254
+ testId: `migrate-cluster-table-item-${index}`,
255
+ },
256
+
257
+ {
258
+ col: 'col1',
259
+ text: $binary.roundHz(cluster.available_cpu),
260
+ testId: `migrate-cluster-table-item-${index}`,
261
+ },
262
+ {
263
+ col: 'col2',
264
+ text: $binary.round(cluster.available_memory),
265
+ testId: `migrate-cluster-table-item-${index}`,
266
+ },
267
+ {
268
+ col: 'col3',
269
+ text: $binary.round(cluster.available_storage),
270
+ testId: `migrate-cluster-table-item-${index}`,
271
+ },
272
+ {
273
+ col: 'col4',
274
+ text: cluster.drs,
275
+ testId: `migrate-cluster-table-item-${index}`,
276
+ },
277
+ {
278
+ col: 'col5',
279
+ text: cluster.ha,
280
+ testId: `migrate-cluster-table-item-${index}`,
281
+ },
282
+ {
283
+ col: 'col6',
284
+ text: $binary.roundHz(cluster.total_cpu),
285
+ testId: `migrate-cluster-table-item-${index}`,
286
+ },
287
+ {
288
+ col: 'col7',
289
+ text: $binary.round(cluster.total_memory),
290
+ testId: `migrate-cluster-table-item-${index}`,
291
+ },
292
+ {
293
+ col: 'col8',
294
+ text: $binary.round(cluster.total_storage),
295
+ testId: `migrate-cluster-table-item-${index}`,
296
+ },
297
+ {
298
+ col: 'col9',
299
+ text: cluster.vms,
300
+ testId: `migrate-cluster-table-item-${index}`,
301
+ },
302
+ {
303
+ col: 'col10',
304
+ text: cluster.hosts,
305
+ testId: `migrate-cluster-table-item-${index}`,
306
+ },
307
+ {
308
+ col: 'col11',
309
+ text: cluster.cpus,
310
+ testId: `migrate-cluster-table-item-${index}`,
311
+ },
312
+ {
313
+ col: 'col12',
314
+ text: cluster.datastores,
315
+ testId: `migrate-cluster-table-item-${index}`,
316
+ },
317
+ {
318
+ col: 'col13',
319
+ text: cluster.vsan,
320
+ testId: `migrate-cluster-table-item-${index}`,
321
+ },
322
+ {
323
+ col: 'col14',
324
+ text: cluster.vc,
325
+ testId: `migrate-cluster-table-item-${index}`,
326
+ },
327
+ {
328
+ col: 'col15',
329
+ text: cluster.evc_cpu_mode,
330
+ testId: `migrate-cluster-table-item-${index}`,
331
+ },
332
+ {
333
+ col: 'col16',
334
+ text: cluster.evc_graphics_mode,
335
+ testId: `migrate-cluster-table-item-${index}`,
336
+ },
337
+ ],
338
+ }
339
+ })
340
+ }