bfg-common 1.3.230 → 1.3.232

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 (58) hide show
  1. package/assets/localization/local_be.json +3 -1
  2. package/assets/localization/local_en.json +3 -1
  3. package/assets/localization/local_hy.json +3 -1
  4. package/assets/localization/local_kk.json +3 -1
  5. package/assets/localization/local_ru.json +3 -1
  6. package/assets/localization/local_zh.json +3 -1
  7. package/assets/scss/common/normalize.scss +4 -0
  8. package/components/atoms/alert/Alert.vue +95 -95
  9. package/components/atoms/alert/Notification.vue +170 -170
  10. package/components/atoms/switch/Switch.vue +111 -111
  11. package/components/atoms/table/compact/Compact.vue +526 -526
  12. package/components/atoms/tooltip/Signpost.vue +225 -225
  13. package/components/common/diagramMain/lib/config/index.ts +24 -0
  14. package/components/common/diagramMain/lib/models/interfaces.ts +5 -5
  15. package/components/common/diagramMain/lib/models/types.ts +9 -1
  16. package/components/common/diagramMain/port/Port.vue +1 -1
  17. package/components/common/pages/Tasks.vue +120 -120
  18. package/components/common/recursionTree/RecursionTree.vue +203 -203
  19. package/components/common/vm/actions/add/Add.vue +575 -575
  20. package/components/common/vm/actions/clone/Clone.vue +518 -518
  21. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
  22. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +693 -693
  23. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +220 -220
  24. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +59 -59
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +294 -294
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +165 -165
  27. package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
  28. package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
  29. package/components/common/weekSelect/WeekSelect.vue +112 -112
  30. package/components/common/weekSelect/lib/config/options.ts +10 -10
  31. package/components/common/wizards/vm/migrate/Migrate.vue +9 -1
  32. package/components/common/wizards/vm/migrate/lib/models/interfaces.ts +4 -0
  33. package/components/common/wizards/vm/migrate/select/network/Network.vue +79 -6
  34. package/components/common/wizards/vm/migrate/select/network/table/{disk/Disk.vue → network/Network.vue} +19 -12
  35. package/components/common/wizards/vm/migrate/select/network/table/{disk → network}/lib/config/advancedTable.ts +6 -3
  36. package/components/common/wizards/vm/migrate/select/network/table/{disk → network}/lib/config/basicTable.ts +10 -7
  37. package/components/common/wizards/vm/migrate/select/network/table/{disk → network}/lib/config/tableKeys.ts +1 -1
  38. package/components/common/wizards/vm/migrate/select/network/table/{disk → network}/lib/models/types.ts +1 -1
  39. package/components/common/wizards/vm/migrate/select/network/table/useAt/UseAt.vue +53 -0
  40. package/components/common/wizards/vm/migrate/select/network/table/useAt/lib/config/tableKeys.ts +7 -0
  41. package/components/common/wizards/vm/migrate/select/network/table/useAt/lib/config/useAtTable.ts +47 -0
  42. package/components/common/wizards/vm/migrate/select/network/table/useAt/lib/models/interfaces.ts +1 -0
  43. package/components/common/wizards/vm/migrate/select/network/table/useAt/lib/models/types.ts +5 -0
  44. package/composables/useAppVersion.ts +21 -21
  45. package/composables/useEnvLanguage.ts +20 -20
  46. package/lib/utils/sendTask.ts +72 -72
  47. package/minify.js +146 -146
  48. package/package.json +1 -1
  49. package/public/spice-console/application/codec.js +257 -257
  50. package/public/spice-console/lib/rasterEngine.js +907 -907
  51. package/public/spice-console/network/spicechannel.js +369 -369
  52. package/store/main/lib/interfaces.ts +9 -9
  53. package/store/tasks/actions.ts +133 -133
  54. package/store/tasks/getters.ts +25 -25
  55. package/store/tasks/lib/models/interfaces.ts +18 -18
  56. package/store/tasks/mutations.ts +58 -58
  57. package/store/tasks/state.ts +16 -16
  58. /package/components/common/wizards/vm/migrate/select/network/table/{disk → network}/lib/models/interfaces.ts +0 -0
@@ -1,112 +1,112 @@
1
- <template>
2
- <div class="flex-align-center">
3
- <common-select-input
4
- v-model="selectedOption"
5
- :data="options"
6
- class="mr-1"
7
- />
8
-
9
- <div class="btn-group">
10
- <button
11
- v-for="item in tabs"
12
- :key="item"
13
- :class="['btn btn-sm btn-secondary', { 'btn-primary': item.isActive }]"
14
- :disabled="!isCustom"
15
- @click="onSelectDay(item.value)"
16
- >
17
- {{ item.text }}
18
- </button>
19
- </div>
20
- </div>
21
- </template>
22
-
23
- <script lang="ts" setup>
24
- import type { UI_I_Localization } from '~/lib/models/interfaces'
25
- import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
26
- import type { UI_I_TabItem } from '~/components/common/weekSelect/lib/models/interfaces'
27
- import { optionsFunc } from '~/components/common/weekSelect/lib/config/options'
28
-
29
- const localization = computed<UI_I_Localization>(() => useLocal())
30
-
31
- const model = defineModel<number[]>()
32
-
33
- const selectedOption = ref<number>(0)
34
- if (model.value.length === 2 && model.value.includes(6) && model.value.includes(0)) {
35
- selectedOption.value = 1
36
- } else if (model.value.length < 7) {
37
- selectedOption.value = 2
38
- }
39
-
40
- const options = ref<UI_I_SelectInputItem[]>(optionsFunc(localization.value))
41
-
42
- const isCustom = computed<boolean>(() => selectedOption.value === 2)
43
- const onSelectDay = (value: number): void => {
44
- const index = model.value?.indexOf(value)
45
- if (index === -1) {
46
- model.value.push(value)
47
- model.value.sort((a: number, b: number) => a - b)
48
- }
49
- else if (model.value.length > 1) {
50
- model.value = model.value?.filter((_: number, key: number) => key !== index)
51
- }
52
- }
53
-
54
- const tabs = computed<UI_I_TabItem[]>(() => {
55
- return [
56
- { text: localization.value.weekM, value: 1, isActive: checkIsActiveDay(1) },
57
- { text: localization.value.weekT, value: 2, isActive: checkIsActiveDay(2) },
58
- { text: localization.value.weekW, value: 3, isActive: checkIsActiveDay(3) },
59
- {
60
- text: localization.value.weekTh,
61
- value: 4,
62
- isActive: checkIsActiveDay(4),
63
- },
64
- { text: localization.value.weekF, value: 5, isActive: checkIsActiveDay(5) },
65
- { text: localization.value.weekS, value: 6, isActive: checkIsActiveDay(6) },
66
- {
67
- text: localization.value.weekSu,
68
- value: 0,
69
- isActive: checkIsActiveDay(0),
70
- },
71
- ]
72
- })
73
- const checkIsActiveDay = (value: number): boolean => {
74
- let result = false
75
- switch (selectedOption.value) {
76
- case 0:
77
- result = true
78
- break
79
- case 1:
80
- if (value === 6 || value === 0) result = true
81
- break
82
- default:
83
- result = !!model.value?.includes(value)
84
- break
85
- }
86
-
87
- return result
88
- }
89
- watch(
90
- tabs,
91
- (newValue: UI_I_TabItem[]) => {
92
- if (selectedOption.value === 2) return
93
-
94
- model.value = newValue.filter((tab) => tab.isActive).map((tab) => tab.value)
95
- },
96
- { immediate: true }
97
- )
98
- </script>
99
-
100
- <style lang="scss" scoped>
101
- :deep(.select::after) {
102
- top: 2px;
103
- right: -16px;
104
- }
105
- .btn-group {
106
- button {
107
- width: 24px;
108
- min-width: 24px;
109
- padding: 0;
110
- }
111
- }
112
- </style>
1
+ <template>
2
+ <div class="flex-align-center">
3
+ <common-select-input
4
+ v-model="selectedOption"
5
+ :data="options"
6
+ class="mr-1"
7
+ />
8
+
9
+ <div class="btn-group">
10
+ <button
11
+ v-for="item in tabs"
12
+ :key="item"
13
+ :class="['btn btn-sm btn-secondary', { 'btn-primary': item.isActive }]"
14
+ :disabled="!isCustom"
15
+ @click="onSelectDay(item.value)"
16
+ >
17
+ {{ item.text }}
18
+ </button>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script lang="ts" setup>
24
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
25
+ import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
26
+ import type { UI_I_TabItem } from '~/components/common/weekSelect/lib/models/interfaces'
27
+ import { optionsFunc } from '~/components/common/weekSelect/lib/config/options'
28
+
29
+ const localization = computed<UI_I_Localization>(() => useLocal())
30
+
31
+ const model = defineModel<number[]>()
32
+
33
+ const selectedOption = ref<number>(0)
34
+ if (model.value.length === 2 && model.value.includes(6) && model.value.includes(0)) {
35
+ selectedOption.value = 1
36
+ } else if (model.value.length < 7) {
37
+ selectedOption.value = 2
38
+ }
39
+
40
+ const options = ref<UI_I_SelectInputItem[]>(optionsFunc(localization.value))
41
+
42
+ const isCustom = computed<boolean>(() => selectedOption.value === 2)
43
+ const onSelectDay = (value: number): void => {
44
+ const index = model.value?.indexOf(value)
45
+ if (index === -1) {
46
+ model.value.push(value)
47
+ model.value.sort((a: number, b: number) => a - b)
48
+ }
49
+ else if (model.value.length > 1) {
50
+ model.value = model.value?.filter((_: number, key: number) => key !== index)
51
+ }
52
+ }
53
+
54
+ const tabs = computed<UI_I_TabItem[]>(() => {
55
+ return [
56
+ { text: localization.value.weekM, value: 1, isActive: checkIsActiveDay(1) },
57
+ { text: localization.value.weekT, value: 2, isActive: checkIsActiveDay(2) },
58
+ { text: localization.value.weekW, value: 3, isActive: checkIsActiveDay(3) },
59
+ {
60
+ text: localization.value.weekTh,
61
+ value: 4,
62
+ isActive: checkIsActiveDay(4),
63
+ },
64
+ { text: localization.value.weekF, value: 5, isActive: checkIsActiveDay(5) },
65
+ { text: localization.value.weekS, value: 6, isActive: checkIsActiveDay(6) },
66
+ {
67
+ text: localization.value.weekSu,
68
+ value: 0,
69
+ isActive: checkIsActiveDay(0),
70
+ },
71
+ ]
72
+ })
73
+ const checkIsActiveDay = (value: number): boolean => {
74
+ let result = false
75
+ switch (selectedOption.value) {
76
+ case 0:
77
+ result = true
78
+ break
79
+ case 1:
80
+ if (value === 6 || value === 0) result = true
81
+ break
82
+ default:
83
+ result = !!model.value?.includes(value)
84
+ break
85
+ }
86
+
87
+ return result
88
+ }
89
+ watch(
90
+ tabs,
91
+ (newValue: UI_I_TabItem[]) => {
92
+ if (selectedOption.value === 2) return
93
+
94
+ model.value = newValue.filter((tab) => tab.isActive).map((tab) => tab.value)
95
+ },
96
+ { immediate: true }
97
+ )
98
+ </script>
99
+
100
+ <style lang="scss" scoped>
101
+ :deep(.select::after) {
102
+ top: 2px;
103
+ right: -16px;
104
+ }
105
+ .btn-group {
106
+ button {
107
+ width: 24px;
108
+ min-width: 24px;
109
+ padding: 0;
110
+ }
111
+ }
112
+ </style>
@@ -1,10 +1,10 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
3
-
4
- export const optionsFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_SelectInputItem[] => [
7
- { label: localization.daily, value: 0 },
8
- { label: localization.weekly, value: 1 },
9
- { label: localization.custom, value: 2 },
10
- ]
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
3
+
4
+ export const optionsFunc = (
5
+ localization: UI_I_Localization
6
+ ): UI_I_SelectInputItem[] => [
7
+ { label: localization.daily, value: 0 },
8
+ { label: localization.weekly, value: 1 },
9
+ { label: localization.custom, value: 2 },
10
+ ]
@@ -53,7 +53,11 @@
53
53
  />
54
54
 
55
55
  <common-wizards-vm-migrate-select-network
56
- v-show="currentBlockId === 'select-networks'"
56
+ v-if="currentBlockId === 'select-networks'"
57
+ v-model:is-basic-network-mode="
58
+ dataFormLocal.selectNetwork.isShowNetworkBasic
59
+ "
60
+ v-model:network-data="dataFormLocal.selectNetwork.data"
57
61
  />
58
62
 
59
63
  <common-wizards-vm-migrate-select-priority
@@ -135,6 +139,10 @@ const connectedStorageIdOnVm = computed<string>(
135
139
  const dataFormLocal = ref<UI_I_CollectedDataFormLocal>({
136
140
  selectedComputeResource: null,
137
141
  selectStorage: null,
142
+ selectNetwork: {
143
+ isShowNetworkBasic: true,
144
+ data: null,
145
+ },
138
146
  selectedVMotionPriority: 'high',
139
147
  })
140
148
 
@@ -20,5 +20,9 @@ export interface UI_I_MigrateReadyBlockData extends UI_I_TableInfoItem {
20
20
  export interface UI_I_CollectedDataFormLocal {
21
21
  selectedComputeResource: UI_I_ComputeResourceDataLocal
22
22
  selectStorage: UI_I_SelectStorageReadyData
23
+ selectNetwork: {
24
+ isShowNetworkBasic: boolean
25
+ data: any // добавить интерфае потом
26
+ }
23
27
  selectedVMotionPriority: UI_T_SelectVMotionPriority
24
28
  }
@@ -1,15 +1,32 @@
1
1
  <template>
2
2
  <div class="select-network">
3
- <common-wizards-vm-migrate-select-network-table-disk
4
- v-model="selected"
3
+ <div class="select-network__text">
4
+ {{ selectNetworkHeadline }}
5
+ </div>
6
+
7
+ <common-wizards-vm-migrate-select-network-table-network
8
+ v-model="selectedSourceNetwork"
9
+ :key="uniqueKey"
10
+ :networks="dataNetwork"
5
11
  :type="tableType"
6
- :networks="[]"
12
+ @select-network="onSelectNetwork"
7
13
  />
8
14
 
15
+ <div
16
+ v-if="isShowNetworkBasic && selectedSourceNetwork"
17
+ class="select-network__matcher-details"
18
+ >
19
+ <span> {{ networkDetailsHeadline }} </span>
20
+
21
+ <common-wizards-vm-migrate-select-network-table-use-at
22
+ :networks="useAtTableData"
23
+ />
24
+ </div>
25
+
9
26
  <div class="vm-migrate-advanced-view-button">
10
27
  <button
11
28
  class="btn btn-sm migrate-network-advanced-btn"
12
- @click="isShowNetworkBasic = !isShowNetworkBasic"
29
+ @click="onClickSelectNetworkMode"
13
30
  >
14
31
  <span v-if="!isShowNetworkBasic"> &#x226A; </span>
15
32
  {{ buttonText }}
@@ -28,10 +45,13 @@
28
45
  <script lang="ts" setup>
29
46
  import type { UI_I_Localization } from '~/lib/models/interfaces'
30
47
 
48
+ const isShowNetworkBasic = defineModel<boolean>('isBasicNetworkMode')
49
+ const networkData = defineModel<any>('networkData')
50
+
31
51
  const localization = computed<UI_I_Localization>(() => useLocal())
32
52
 
33
- const selected = ref<number | null>(null)
34
- const isShowNetworkBasic = ref<boolean>(true)
53
+ const selectedSourceNetwork = ref<string | null>(null)
54
+ const uniqueKey = ref<number>(0)
35
55
 
36
56
  const buttonText = computed(
37
57
  () => localization.value[isShowNetworkBasic.value ? 'advanced' : 'basic']
@@ -40,10 +60,63 @@ const buttonText = computed(
40
60
  const tableType = computed<string>(() =>
41
61
  isShowNetworkBasic.value ? 'basic' : 'advanced'
42
62
  )
63
+
64
+ const selectNetworkHeadline = computed<string>(() => {
65
+ const { migrateNetworkingForAllAdapters, migrateNetworkingForEachAdapters } =
66
+ localization.value
67
+
68
+ return isShowNetworkBasic.value
69
+ ? migrateNetworkingForAllAdapters
70
+ : migrateNetworkingForEachAdapters
71
+ })
72
+ const networkDetailsHeadline = computed<string>(() =>
73
+ localization.value.networkIsInUseAt.replace(
74
+ '{ network }',
75
+ selectedSourceNetwork.value + ''
76
+ )
77
+ )
78
+
79
+ const dataNetwork = computed(() => {
80
+ return [
81
+ {
82
+ vm_name: 'vm-horizon-1',
83
+ network_adapter: 'Network adapter 1',
84
+ source_network: 'VM-VLAN105',
85
+ used_by: '1 VMs / 1 Network adapters',
86
+ destination_network: ['VM Network 1', 'VM-VLAN105', 'VM Network 2'],
87
+ },
88
+ ]
89
+ })
90
+
91
+ const useAtTableData = computed(() =>
92
+ dataNetwork.value.map((x) => {
93
+ return {
94
+ vm_name: x.vm_name,
95
+ network: x.source_network,
96
+ network_adapter: x.network_adapter,
97
+ }
98
+ })
99
+ )
100
+
101
+ const onClickSelectNetworkMode = (): void => {
102
+ uniqueKey.value++
103
+ isShowNetworkBasic.value = !isShowNetworkBasic.value
104
+ selectedSourceNetwork.value = ''
105
+ }
106
+ const onSelectNetwork = (data: any): void => {
107
+ networkData.value = data
108
+ }
43
109
  </script>
44
110
 
45
111
  <style lang="scss" scoped>
46
112
  .select-network {
113
+ margin-top: 10px;
114
+ &__text {
115
+ font-size: 12px;
116
+ }
117
+ &__matcher-details {
118
+ margin-top: 10px;
119
+ }
47
120
  .vm-migrate-advanced-view-button {
48
121
  text-align: end;
49
122
  }
@@ -10,6 +10,7 @@
10
10
  :total-items="bodyItems.length"
11
11
  :total-pages="1"
12
12
  class="select-network"
13
+ :off-select-by-row="props.type === 'advanced'"
13
14
  server-off
14
15
  hide-footer
15
16
  hide-page-size
@@ -20,6 +21,7 @@
20
21
  :id="item.data.id"
21
22
  v-model="item.data.value"
22
23
  :disabled="item.data.disabled"
24
+ @change="onSelect(item.data)"
23
25
  >
24
26
  <option
25
27
  v-for="option in item.data.option"
@@ -42,18 +44,18 @@ import type {
42
44
  UI_I_HeadItem,
43
45
  UI_I_BodyItem,
44
46
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
45
- import type { UI_T_MigrateSelectNetwork } from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/models/types'
46
- import * as basicTable from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/config/basicTable'
47
- import * as advancedTable from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/config/advancedTable'
47
+ import type { UI_T_MigrateSelectNetwork } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/types'
48
+ import * as basicTable from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/basicTable'
49
+ import * as advancedTable from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable'
48
50
 
49
51
  const props = defineProps<{
50
- modelValue: number | null
51
52
  networks: UI_T_MigrateSelectNetwork[]
52
53
  type: 'basic' | 'advanced'
53
54
  }>()
54
55
  const emits = defineEmits<{
55
- (event: 'update:model-value', value: number | null): void
56
+ (event: 'select-network', value: any): void
56
57
  }>()
58
+ const selectedNetworkLocal = defineModel<string | null>()
57
59
 
58
60
  const localization = computed<UI_I_Localization>(() => useLocal())
59
61
 
@@ -81,14 +83,19 @@ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
81
83
  return table[props.type].bodyItems(props.networks)
82
84
  })
83
85
 
84
- const selectedNetworkLocal = computed<number | null>({
85
- get() {
86
- return props.modelValue
87
- },
88
- set(newValue: number | null) {
89
- emits('update:model-value', newValue)
86
+ const onSelect = (data: any): void => {
87
+ emits('select-network', data)
88
+ }
89
+ watch(
90
+ () => props.type,
91
+ (newValue: 'basic' | 'advanced') => {
92
+ const tableData = bodyItems.value[0]
93
+ const itemKey = newValue === 'basic' ? 2 : 3
94
+ const data = tableData[itemKey].data
95
+ onSelect(data)
90
96
  },
91
- })
97
+ { deep: true, immediate: true }
98
+ )
92
99
  </script>
93
100
 
94
101
  <style lang="scss" scoped>
@@ -4,8 +4,8 @@ import type {
4
4
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
5
  import type { UI_I_Localization } from '~/lib/models/interfaces'
6
6
  import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
7
- import type { UI_I_MigrateSelectNetworkAdvancedItem } from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/models/interfaces'
8
- import { networkAdvancedTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/config/tableKeys'
7
+ import type { UI_I_MigrateSelectNetworkAdvancedItem } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
8
+ import { networkAdvancedTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/tableKeys'
9
9
 
10
10
  const getItems = (
11
11
  localization: UI_I_Localization
@@ -41,8 +41,11 @@ export const bodyItems = (
41
41
  (network: UI_I_MigrateSelectNetworkAdvancedItem, key: number) => {
42
42
  const data = {
43
43
  id: `${network.vm_name}-select`,
44
+ sourceNetwork: network.source_network,
44
45
  disabled: false,
45
- value: network.destination_network[0],
46
+ value: network.destination_network.find(
47
+ (item: string) => item === network.source_network
48
+ ),
46
49
  option: network.destination_network,
47
50
  }
48
51
 
@@ -4,8 +4,8 @@ import type {
4
4
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
5
  import type { UI_I_Localization } from '~/lib/models/interfaces'
6
6
  import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
7
- import type { UI_I_MigrateSelectNetworkBasicItem } from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/models/interfaces'
8
- import { networkBasicsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/config/tableKeys'
7
+ import type { UI_I_MigrateSelectNetworkBasicItem } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
8
+ import { networkBasicsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/tableKeys'
9
9
 
10
10
  const getItems = (
11
11
  localization: UI_I_Localization
@@ -36,11 +36,14 @@ export const bodyItems = (
36
36
  ): UI_I_BodyItem[][] => {
37
37
  const bodyItems: UI_I_BodyItem[][] = []
38
38
 
39
- data.forEach((network: UI_I_MigrateSelectNetworkBasicItem, key: number) => {
39
+ data.forEach((network: UI_I_MigrateSelectNetworkBasicItem) => {
40
40
  const data = {
41
41
  id: `${network.source_network}-select`,
42
+ sourceNetwork: network.source_network,
42
43
  disabled: false,
43
- value: network.destination_network[0],
44
+ value: network.destination_network.find(
45
+ (item) => item === network.source_network
46
+ ),
44
47
  option: network.destination_network,
45
48
  }
46
49
 
@@ -48,18 +51,18 @@ export const bodyItems = (
48
51
  {
49
52
  key: 'col0',
50
53
  text: network[networkBasicsTableItemKeys[0]],
51
- id: key,
54
+ id: network.source_network,
52
55
  },
53
56
  {
54
57
  key: 'col1',
55
58
  text: network[networkBasicsTableItemKeys[1]],
56
- id: key,
59
+ id: network.source_network,
57
60
  },
58
61
  {
59
62
  key: 'select',
60
63
  text: network[networkBasicsTableItemKeys[2]],
61
64
  data,
62
- id: key,
65
+ id: network.source_network,
63
66
  },
64
67
  ])
65
68
  })
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  UI_T_NetworkBasicsTableKeysTuple,
3
3
  UI_T_NetworkAdvancedTableKeysTuple,
4
- } from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/models/types'
4
+ } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/types'
5
5
 
6
6
  export const networkBasicsTableItemKeys: UI_T_NetworkBasicsTableKeysTuple = [
7
7
  'source_network',
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  UI_I_MigrateSelectNetworkBasicItem,
3
3
  UI_I_MigrateSelectNetworkAdvancedItem,
4
- } from '~/components/common/wizards/vm/migrate/select/network/table/disk/lib/models/interfaces'
4
+ } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
5
5
 
6
6
  export type UI_T_NetworkAdvancedTableKeysTuple = [
7
7
  'vm_name',
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div class="table-wrap">
3
+ <atoms-table-data-grid
4
+ :head-items="headItems"
5
+ :body-items="bodyItems"
6
+ :total-items="bodyItems.length"
7
+ :page-size="100"
8
+ :page="1"
9
+ :total-pages="1"
10
+ class="select-network"
11
+ server-off
12
+ off-select-by-row
13
+ hide-footer
14
+ hide-page-size
15
+ >
16
+ </atoms-table-data-grid>
17
+ </div>
18
+ </template>
19
+
20
+ <script lang="ts" setup>
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+ import type {
23
+ UI_I_HeadItem,
24
+ UI_I_BodyItem,
25
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
26
+ import * as table from '~/components/common/wizards/vm/migrate/select/network/table/useAt/lib/config/useAtTable'
27
+
28
+ const props = defineProps<{
29
+ networks: any[]
30
+ }>()
31
+
32
+ const localization = computed<UI_I_Localization>(() => useLocal())
33
+
34
+ const headItems = computed<UI_I_HeadItem[]>(() =>
35
+ table.headItems(localization.value)
36
+ )
37
+
38
+ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
39
+ return table.bodyItems(props.networks)
40
+ })
41
+ </script>
42
+
43
+ <style lang="scss" scoped>
44
+ .select-network {
45
+ :deep(.datagrid) {
46
+ margin-top: 0;
47
+ }
48
+ :deep(.datagrid-outer-wrapper) {
49
+ padding-top: 0;
50
+ //height: inherit;
51
+ }
52
+ }
53
+ </style>
@@ -0,0 +1,7 @@
1
+ import type { UI_T_NetworkUseAtTableKeysTuple } from '~/components/common/wizards/vm/migrate/select/network/table/useAt/lib/models/types'
2
+
3
+ export const useAtTableItemKeys: UI_T_NetworkUseAtTableKeysTuple = [
4
+ 'vm_name',
5
+ 'network_adapter',
6
+ 'network',
7
+ ]
@@ -0,0 +1,47 @@
1
+ import type {
2
+ UI_I_HeadItem,
3
+ UI_I_BodyItem,
4
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
6
+ import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
7
+ import { useAtTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/useAt/lib/config/tableKeys'
8
+
9
+ const getItems = (
10
+ localization: UI_I_Localization
11
+ ): [string, boolean, string, string][] => {
12
+ return [
13
+ [localization.vm, true, '33.3%', useAtTableItemKeys[0]],
14
+ [localization.networkAdapter, true, '33.3%', useAtTableItemKeys[1]],
15
+ [localization.network, true, '33.3%', useAtTableItemKeys[2]],
16
+ ]
17
+ }
18
+
19
+ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
20
+ return defaultSettings.defaultHeadItems(getItems(localization))
21
+ }
22
+
23
+ export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
24
+ const bodyItems: UI_I_BodyItem[][] = []
25
+
26
+ data.forEach((network: any, key: number) => {
27
+ bodyItems.push([
28
+ {
29
+ key: 'col0',
30
+ text: network[useAtTableItemKeys[0]],
31
+ id: key,
32
+ },
33
+ {
34
+ key: 'col1',
35
+ text: network[useAtTableItemKeys[1]],
36
+ id: key,
37
+ },
38
+ {
39
+ key: 'col2',
40
+ text: network[useAtTableItemKeys[2]],
41
+ data,
42
+ id: key,
43
+ },
44
+ ])
45
+ })
46
+ return bodyItems
47
+ }