bfg-common 1.5.577 → 1.5.578

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 (61) hide show
  1. package/components/common/vm/actions/add/Add.vue +886 -960
  2. package/components/common/vm/actions/add/New.vue +16 -54
  3. package/components/common/vm/actions/add/Old.vue +16 -55
  4. package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
  5. package/components/common/vm/actions/clone/Clone.vue +744 -816
  6. package/components/common/vm/actions/clone/new/New.vue +14 -50
  7. package/components/common/vm/actions/clone/old/Old.vue +16 -52
  8. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +14 -81
  9. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +7 -56
  10. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +8 -56
  11. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +211 -206
  12. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +225 -120
  13. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +220 -118
  14. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +66 -53
  15. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +139 -159
  16. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +8 -15
  17. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +8 -13
  18. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +62 -75
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +241 -149
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +3 -4
  21. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +2 -3
  22. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +62 -100
  23. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +6 -17
  24. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +6 -3
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +6 -3
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +17 -39
  27. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +6 -5
  28. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +6 -5
  29. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
  30. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +6 -93
  31. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +8 -60
  32. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +8 -58
  33. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +5 -69
  34. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +12 -32
  35. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +12 -33
  36. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +114 -132
  37. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +41 -6
  38. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +44 -6
  39. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +8 -23
  40. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +21 -31
  41. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +26 -34
  42. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +28 -34
  43. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +24 -30
  44. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +8 -112
  45. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
  46. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapNew.vue → New.vue} +6 -6
  47. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapOld.vue → Old.vue} +5 -5
  48. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +6 -7
  49. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +9 -27
  50. package/components/common/vm/actions/common/lib/models/interfaces.ts +58 -25
  51. package/components/common/vm/actions/common/select/options/New.vue +258 -258
  52. package/components/common/vm/actions/common/select/options/Old.vue +103 -103
  53. package/components/common/vm/actions/common/select/options/Options.vue +54 -54
  54. package/components/common/vm/actions/editSettings/EditSettings.vue +32 -90
  55. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +14 -41
  56. package/components/common/vm/actions/editSettings/new/New.vue +14 -41
  57. package/components/common/vm/actions/lib/models/interfaces.ts +4 -29
  58. package/components/common/vm/actions/lib/utils.ts +64 -36
  59. package/package.json +1 -1
  60. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordNew.vue → New.vue} +0 -0
  61. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordOld.vue → Old.vue} +0 -0
@@ -1,103 +1,103 @@
1
- <template>
2
- <div class="select-options">
3
- <div :class="['checkbox', { disabled: props.isCreateTemplate }]">
4
- <input
5
- id="customize-os"
6
- v-model="modelValue"
7
- :disabled="props.isCreateTemplate"
8
- data-id="customize-os"
9
- type="checkbox"
10
- value="customize-os"
11
- />
12
- <label for="customize-os">{{
13
- localization.common.customizeTheOperatingSystem
14
- }}</label>
15
- </div>
16
- <div v-if="!props.isCreateTemplate" class="checkbox">
17
- <input
18
- id="customize-hardware"
19
- v-model="modelValue"
20
- data-id="customize-hardware"
21
- type="checkbox"
22
- value="customize-hardware"
23
- />
24
- <label for="customize-hardware">{{
25
- localization.common.customizeThisVirtualMachineHardware
26
- }}</label>
27
- </div>
28
- <div class="checkbox">
29
- <!-- :disabled="props.isCreateTemplate"-->
30
- <input
31
- id="power-on"
32
- v-model="modelValue"
33
- data-id="power-on"
34
- type="checkbox"
35
- value="power-on"
36
- />
37
- <label for="power-on">{{
38
- localization.common.powerOnVirtualMachineAfterCreation
39
- }}</label>
40
- </div>
41
- <div v-if="props.isCreateTemplate" class="checkbox">
42
- <!-- :disabled="props.isCreateTemplate"-->
43
- <input
44
- id="create-inked-clone"
45
- v-model="modelValue"
46
- data-id="create-inked-clone"
47
- type="checkbox"
48
- value="create-inked-clone"
49
- />
50
- <label for="create-inked-clone">{{
51
- localization.vmWizard.createLinkedClone
52
- }}</label>
53
-
54
- <input
55
- v-model="cloneCount"
56
- :disabled="!isLinkedClone"
57
- data-id="clone-count"
58
- type="number"
59
- class="ml-1"
60
- :min="0"
61
- :max="1000"
62
- />
63
- </div>
64
- </div>
65
- </template>
66
-
67
- <script setup lang="ts">
68
- import type { UI_I_Localization } from '~/lib/models/interfaces'
69
-
70
- const modelValue = defineModel<string[]>()
71
- const cloneCount = defineModel<number>('cloneCount')
72
-
73
- const props = withDefaults(
74
- defineProps<{
75
- isCreateTemplate?: boolean // TODO change
76
- }>(),
77
- {
78
- isCreateTemplate: undefined,
79
- }
80
- )
81
-
82
- const localization = computed<UI_I_Localization>(() => useLocal())
83
-
84
- const isLinkedClone = computed<boolean>(
85
- () => modelValue.value?.includes('create-inked-clone') || false
86
- )
87
- </script>
88
-
89
- <style scoped lang="scss">
90
- .select-options {
91
- padding: 12px 0 0;
92
-
93
- .disabled {
94
- input,
95
- label {
96
- cursor: not-allowed;
97
- }
98
- }
99
- .checkbox {
100
- margin: 6px 0;
101
- }
102
- }
103
- </style>
1
+ <template>
2
+ <div class="select-options">
3
+ <div :class="['checkbox', { disabled: props.isCreateTemplate }]">
4
+ <input
5
+ id="customize-os"
6
+ v-model="modelValue"
7
+ :disabled="props.isCreateTemplate"
8
+ data-id="customize-os"
9
+ type="checkbox"
10
+ value="customize-os"
11
+ />
12
+ <label for="customize-os">{{
13
+ localization.common.customizeTheOperatingSystem
14
+ }}</label>
15
+ </div>
16
+ <div v-if="!props.isCreateTemplate" class="checkbox">
17
+ <input
18
+ id="customize-hardware"
19
+ v-model="modelValue"
20
+ data-id="customize-hardware"
21
+ type="checkbox"
22
+ value="customize-hardware"
23
+ />
24
+ <label for="customize-hardware">{{
25
+ localization.common.customizeThisVirtualMachineHardware
26
+ }}</label>
27
+ </div>
28
+ <div class="checkbox">
29
+ <!-- :disabled="props.isCreateTemplate"-->
30
+ <input
31
+ id="power-on"
32
+ v-model="modelValue"
33
+ data-id="power-on"
34
+ type="checkbox"
35
+ value="power-on"
36
+ />
37
+ <label for="power-on">{{
38
+ localization.common.powerOnVirtualMachineAfterCreation
39
+ }}</label>
40
+ </div>
41
+ <div v-if="props.isCreateTemplate" class="checkbox">
42
+ <!-- :disabled="props.isCreateTemplate"-->
43
+ <input
44
+ id="create-inked-clone"
45
+ v-model="modelValue"
46
+ data-id="create-inked-clone"
47
+ type="checkbox"
48
+ value="create-inked-clone"
49
+ />
50
+ <label for="create-inked-clone">{{
51
+ localization.vmWizard.createLinkedClone
52
+ }}</label>
53
+
54
+ <input
55
+ v-model="cloneCount"
56
+ :disabled="!isLinkedClone"
57
+ data-id="clone-count"
58
+ type="number"
59
+ class="ml-1"
60
+ :min="0"
61
+ :max="1000"
62
+ />
63
+ </div>
64
+ </div>
65
+ </template>
66
+
67
+ <script setup lang="ts">
68
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
69
+
70
+ const modelValue = defineModel<string[]>()
71
+ const cloneCount = defineModel<number>('cloneCount')
72
+
73
+ const props = withDefaults(
74
+ defineProps<{
75
+ isCreateTemplate?: boolean // TODO change
76
+ }>(),
77
+ {
78
+ isCreateTemplate: undefined,
79
+ }
80
+ )
81
+
82
+ const localization = computed<UI_I_Localization>(() => useLocal())
83
+
84
+ const isLinkedClone = computed<boolean>(
85
+ () => modelValue.value?.includes('create-inked-clone') || false
86
+ )
87
+ </script>
88
+
89
+ <style scoped lang="scss">
90
+ .select-options {
91
+ padding: 12px 0 0;
92
+
93
+ .disabled {
94
+ input,
95
+ label {
96
+ cursor: not-allowed;
97
+ }
98
+ }
99
+ .checkbox {
100
+ margin: 6px 0;
101
+ }
102
+ }
103
+ </style>
@@ -1,54 +1,54 @@
1
- <template>
2
- <common-vm-actions-common-select-options-new
3
- v-if="isNewView"
4
- v-model="selectedOptions"
5
- v-model:clone-count="cloneCount"
6
- :is-create-template="props.isCreateTemplate"
7
- />
8
- <common-vm-actions-common-select-options-old
9
- v-else
10
- v-model="selectedOptions"
11
- v-model:clone-count="cloneCount"
12
- :is-create-template="props.isCreateTemplate"
13
- />
14
- </template>
15
-
16
- <script setup lang="ts">
17
- const props = withDefaults(
18
- defineProps<{
19
- isCreateTemplate?: boolean // TODO change
20
- }>(),
21
- {
22
- isCreateTemplate: undefined,
23
- }
24
- )
25
-
26
- const emits = defineEmits<{
27
- (event: 'change', value: string[]): void
28
- (event: 'change-count', value: number): void
29
- }>()
30
-
31
- const { $store }: any = useNuxtApp()
32
-
33
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
34
-
35
- const selectedOptions = ref<string[]>([])
36
- watch(selectedOptions, (newValue) => {
37
- emits('change', newValue)
38
- })
39
- const cloneCount = ref<number>(0) // For Deploy
40
- watch(cloneCount, (newValue) => {
41
- if (newValue < 0) {
42
- cloneCount.value = 0
43
- return
44
- }
45
- if (newValue > 1000) {
46
- cloneCount.value = 1000
47
- return
48
- }
49
-
50
- emits('change-count', newValue)
51
- })
52
- </script>
53
-
54
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <common-vm-actions-common-select-options-new
3
+ v-if="isNewView"
4
+ v-model="selectedOptions"
5
+ v-model:clone-count="cloneCount"
6
+ :is-create-template="props.isCreateTemplate"
7
+ />
8
+ <common-vm-actions-common-select-options-old
9
+ v-else
10
+ v-model="selectedOptions"
11
+ v-model:clone-count="cloneCount"
12
+ :is-create-template="props.isCreateTemplate"
13
+ />
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ const props = withDefaults(
18
+ defineProps<{
19
+ isCreateTemplate?: boolean // TODO change
20
+ }>(),
21
+ {
22
+ isCreateTemplate: undefined,
23
+ }
24
+ )
25
+
26
+ const emits = defineEmits<{
27
+ (event: 'change', value: string[]): void
28
+ (event: 'change-count', value: number): void
29
+ }>()
30
+
31
+ const { $store }: any = useNuxtApp()
32
+
33
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
34
+
35
+ const selectedOptions = ref<string[]>([])
36
+ watch(selectedOptions, (newValue) => {
37
+ emits('change', newValue)
38
+ })
39
+ const cloneCount = ref<number>(0) // For Deploy
40
+ watch(cloneCount, (newValue) => {
41
+ if (newValue < 0) {
42
+ cloneCount.value = 0
43
+ return
44
+ }
45
+ if (newValue > 1000) {
46
+ cloneCount.value = 1000
47
+ return
48
+ }
49
+
50
+ emits('change-count', newValue)
51
+ })
52
+ </script>
53
+
54
+ <style scoped lang="scss"></style>
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <common-vm-actions-edit-settings-new
3
3
  v-if="isNewView"
4
- v-model:vm-name="vmName"
5
- v-model:vm-settings="vmSettingsLocal"
4
+ v-model:vm-settings="model"
6
5
  :nodes="props.nodes"
7
6
  :files="props.files"
8
7
  :project="props.project"
@@ -13,32 +12,27 @@
13
12
  :selected-nav-item="selectedNavItem"
14
13
  :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
15
14
  :error-validation-fields="props.errorValidationFields"
16
- :virtual-hardware-networks="virtualHardwareNetworksLocal"
17
- :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
18
- :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
19
15
  :state="props.state"
20
- :vm-name-old="props.vmSettings?.name"
16
+ :vm-name-old="vmNameOld"
21
17
  :passthrough-devices="props.passthroughDevices"
22
18
  :mediated-devices="props.mediatedDevices"
23
19
  :get-datastore-table-func="props.getDatastoreTableFunc"
24
20
  :customize-hardware-submit="customizeHardwareSubmit"
25
21
  :is-vmt="props.isVmt"
22
+ :max-memory="maxMemory"
23
+ :cpu-models="cpuModels"
26
24
  @hide="emits('hide')"
27
25
  @validate="validateSendData"
28
- @update-vm="emits('update-vm')"
29
26
  @get-storage="emits('get-storage', $event)"
30
27
  @get-pci-devices="emits('get-pci-devices')"
31
- @change-boot-order="onChangeBootOrder"
32
28
  @get-networks-table="emits('get-networks-table', $event)"
33
29
  @get-folders-or-files="emits('get-folders-or-files', $event)"
34
30
  @show-datastore-child="emits('show-datastore-child', $event)"
35
31
  @get-active-device-child="emits('get-active-device-child', $event)"
36
- @change-customize-hardware="onChangeCustomizeHardware"
37
32
  />
38
33
  <common-vm-actions-edit-settings-old
39
34
  v-else
40
- v-model:vm-name="vmName"
41
- v-model:vm-settings="vmSettingsLocal"
35
+ v-model:vm-settings="model"
42
36
  :nodes="props.nodes"
43
37
  :files="props.files"
44
38
  :project="props.project"
@@ -49,27 +43,23 @@
49
43
  :selected-nav-item="selectedNavItem"
50
44
  :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
51
45
  :error-validation-fields="props.errorValidationFields"
52
- :virtual-hardware-networks="virtualHardwareNetworksLocal"
53
- :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
54
- :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
55
46
  :state="props.state"
56
- :vm-name-old="props.vmSettings?.name"
47
+ :vm-name-old="vmNameOld"
57
48
  :passthrough-devices="props.passthroughDevices"
58
49
  :mediated-devices="props.mediatedDevices"
59
50
  :get-datastore-table-func="props.getDatastoreTableFunc"
60
51
  :customize-hardware-submit="customizeHardwareSubmit"
61
52
  :is-vmt="props.isVmt"
53
+ :max-memory="maxMemory"
54
+ :cpu-models="cpuModels"
62
55
  @hide="emits('hide')"
63
56
  @validate="validateSendData"
64
- @update-vm="emits('update-vm')"
65
57
  @get-storage="emits('get-storage', $event)"
66
58
  @get-pci-devices="emits('get-pci-devices')"
67
- @change-boot-order="onChangeBootOrder"
68
59
  @get-networks-table="emits('get-networks-table', $event)"
69
60
  @get-folders-or-files="emits('get-folders-or-files', $event)"
70
61
  @show-datastore-child="emits('show-datastore-child', $event)"
71
62
  @get-active-device-child="emits('get-active-device-child', $event)"
72
- @change-customize-hardware="onChangeCustomizeHardware"
73
63
  />
74
64
  </template>
75
65
 
@@ -80,17 +70,7 @@ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interface
80
70
  import type {
81
71
  UI_I_MediatedDevice,
82
72
  UI_I_PciDevice,
83
- UI_I_VmSettings,
84
73
  } from '~/lib/models/store/vm/interfaces'
85
- import type { UI_I_Localization } from '~/lib/models/interfaces'
86
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
87
- import type {
88
- UI_I_SendDataNewCdDvdDrive,
89
- UI_I_SendDataNewHardDisk,
90
- UI_I_SendDataNewNetwork,
91
- UI_I_SendDataCpu,
92
- UI_I_SendDataMemory,
93
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
94
74
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
95
75
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
96
76
  import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
@@ -98,20 +78,25 @@ import type {
98
78
  UI_I_DatastoreTableItem,
99
79
  UI_I_FolderOrFileTreePayload,
100
80
  } from '~/lib/models/store/storage/interfaces'
101
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
102
81
  import type { UI_T_EditVmFinishFunc } from '~/components/common/vm/actions/editSettings/lib/models/types'
103
- import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
82
+ import type {
83
+ UI_I_Capabilities,
84
+ UI_I_CreateVmData,
85
+ } from '~/components/common/vm/actions/common/lib/models/interfaces'
86
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
104
87
  import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils/capabilities'
88
+ import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
89
+
90
+ const model = defineModel<UI_I_CreateVmData>({ required: true })
105
91
 
106
92
  const props = withDefaults(
107
93
  defineProps<{
108
94
  project: UI_T_Project
109
95
  loading: boolean
110
- vmSettings: UI_I_VmSettings | null
111
96
  nodes: UI_I_FileTreeNode[]
112
97
  files: UI_I_FileTreeNode[]
113
98
  networksTable: UI_I_NetworkTableItem[]
114
- errorValidationFields: UI_I_ErrorValidationField<string>[]
99
+ errorValidationFields: UI_I_ErrorValidationField[]
115
100
  vmCpuHelpTextSecond: string
116
101
  vmId: string
117
102
  datastore: UI_I_DatastoreTableItem[]
@@ -148,7 +133,7 @@ const emits = defineEmits<{
148
133
  const { $store }: any = useNuxtApp()
149
134
  const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
150
135
 
151
- const localization = computed<UI_I_Localization>(() => useLocal())
136
+ const vmNameOld = computed<string>(() => model.value?.name || '')
152
137
 
153
138
  watch(
154
139
  () => props.capabilities,
@@ -158,6 +143,9 @@ watch(
158
143
  { deep: true, immediate: true }
159
144
  )
160
145
 
146
+ const cpuModels = ref<UI_I_OptionItem[]>(capabilities.value.cpuModels)
147
+ const maxMemory = ref<number>(capabilities.value.maxMemory)
148
+
161
149
  const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
162
150
 
163
151
  const loadingLocal = ref<boolean>(false)
@@ -169,45 +157,12 @@ watch(
169
157
  { immediate: true }
170
158
  )
171
159
 
172
- const vmSettingsLocal = computed<UI_I_VmSettings | null>(() => props.vmSettings)
173
-
174
- const vmName = ref<string>(vmSettingsLocal.value?.name || '')
175
- watch(vmSettingsLocal, (newValue) => {
176
- vmName.value = newValue?.name || ''
177
- })
178
-
179
- const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
180
- const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
181
- null
182
- )
183
- const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
184
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
185
- virtualHardwareHardDisks.value = data[0]
186
- virtualHardwareCdDvdDrives.value = data[1]
187
- virtualHardwareNetworks.value = data[2]
188
- }
189
-
190
- const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
191
- const onChangeCustomizeHardware = (
192
- data: UI_I_SendDataCustomizeHardware
193
- ): void => {
194
- customizeHardware.value = data
195
- }
196
- const virtualHardwareHardDisksLocal = computed<
197
- UI_I_SendDataNewHardDisk[] | null
198
- >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
199
- const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
200
- () => customizeHardware.value?.virtualHardware?.networks || null
201
- )
202
- const virtualHardwareCdDvdDrivesLocal = computed<
203
- UI_I_SendDataNewCdDvdDrive[] | null
204
- >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
205
-
206
- const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
207
- () => customizeHardware.value?.virtualHardware?.cpu || null
208
- )
209
- const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
210
- () => customizeHardware.value?.virtualHardware?.memory || null
160
+ watch(
161
+ model,
162
+ (newValue) => {
163
+ console.log(newValue, 11111111111)
164
+ },
165
+ { deep: true }
211
166
  )
212
167
 
213
168
  const customizeHardwareSubmit = ref<null | Function>(null)
@@ -228,24 +183,11 @@ const validateSendData = async (): Promise<void> => {
228
183
  }
229
184
 
230
185
  loadingLocal.value = true
231
- props
232
- .validateSendDataFunc(
233
- vmSettingsLocal.value,
234
- virtualHardwareCpu.value,
235
- virtualHardwareMemory.value,
236
- customizeHardware.value,
237
- virtualHardwareNetworks.value,
238
- virtualHardwareHardDisks.value,
239
- virtualHardwareCdDvdDrives.value,
240
- vmName.value,
241
- localization.value,
242
- props.vmId
243
- )
244
- .then((data) => {
245
- loadingLocal.value = false
246
-
247
- !data && emits('update-vm')
248
- })
186
+ props.validateSendDataFunc(model.value, props.vmId).then((data) => {
187
+ loadingLocal.value = false
188
+
189
+ !data && emits('update-vm')
190
+ })
249
191
  }
250
192
  </script>
251
193
 
@@ -17,29 +17,19 @@
17
17
  />
18
18
  <div v-if="vmSettings" class="vm-context">
19
19
  <common-vm-actions-common-customize-hardware
20
- v-model:vm-name="vmName"
21
- v-model:guest-machine-type="vmSettings.guestMachineType"
22
- v-model:guest-os-family="vmSettings.guestOsFamily"
23
- v-model:guest-os-version="vmSettings.guestOsVersion"
20
+ v-model="vmSettings"
24
21
  :project="props.project"
25
22
  :storage="vmSettings.storage"
26
- :hard-disks-for-boot-options="props.virtualHardwareHardDisks"
27
- :cd-dvd-drives-for-boot-options="props.virtualHardwareCdDvdDrives"
28
- :networks-for-boot-options="props.virtualHardwareNetworks"
29
- :cd-dvd-drives="vmSettings.cdDvdDrives"
30
- :hard-disks="vmSettings.hardDisks"
31
- :networks="vmSettings.networks"
32
- :max-cpus="vmSettings.maxCpus"
33
- :max-memory="vmSettings.maxMemory"
34
- :cpu-models="vmSettings.cpuModels"
35
- :cpu="vmSettings.cpu"
36
- :memory="vmSettings.memory"
37
- :video-card="vmSettings.videoCard"
38
- :usb-controller="vmSettings.usbController"
39
- :pci-devices="vmSettings.pciDevices"
40
- :selected-nav-item="selectedNavItem"
41
- :hard-disks-for-edit="vmSettings.hardDisks"
23
+ :cd-dvd-drives="vmSettings.disk_devices.filter((disk) => disk.device_type === 'cdrom')"
24
+ :hard-disks="vmSettings.disk_devices.filter((disk) => disk.device_type !== 'cdrom')"
25
+ :max-memory="props.maxMemory"
26
+ :cpu-models="props.cpuModels"
27
+ :video-card="vmSettings.video_card"
28
+ :usb-controller="vmSettings.usb_controllers"
29
+ :pci-devices="vmSettings.passthrough_pci_devices"
30
+ :hard-disks-for-edit="vmSettings.disk_devices.filter((disk) => disk.device_type !== 'cdrom')"
42
31
  :options="vmSettings.options"
32
+ :selected-nav-item="props.selectedNavItem"
43
33
  :nodes="props.nodes"
44
34
  :files="props.files"
45
35
  :networks-table="props.networksTable"
@@ -60,8 +50,6 @@
60
50
  @show-datastore-child="emits('show-datastore-child', $event)"
61
51
  @get-networks-table="emits('get-networks-table', $event)"
62
52
  @get-pci-devices="emits('get-pci-devices')"
63
- @change-boot-order="emits('change-boot-order', $event)"
64
- @send-data="emits('change-customize-hardware', $event)"
65
53
  />
66
54
  </div>
67
55
  </template>
@@ -78,12 +66,6 @@ import type {
78
66
  UI_I_VmSettings,
79
67
  } from '~/lib/models/store/vm/interfaces'
80
68
  import type { UI_I_Localization } from '~/lib/models/interfaces'
81
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
82
- import type {
83
- UI_I_SendDataNewCdDvdDrive,
84
- UI_I_SendDataNewHardDisk,
85
- UI_I_SendDataNewNetwork,
86
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
87
69
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
88
70
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
89
71
  import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
@@ -91,9 +73,7 @@ import type {
91
73
  UI_I_DatastoreTableItem,
92
74
  UI_I_FolderOrFileTreePayload,
93
75
  } from '~/lib/models/store/storage/interfaces'
94
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
95
-
96
- const vmName = defineModel<string>('vmName', { required: true })
76
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
97
77
 
98
78
  const vmSettings = defineModel<UI_I_VmSettings | null>('vmSettings', {
99
79
  required: true,
@@ -110,10 +90,9 @@ const props = withDefaults(
110
90
  networksTable: UI_I_NetworkTableItem[]
111
91
  selectedNavItem: UI_T_SelectedNavItem
112
92
  vmCpuHelpTextSecond: string
113
- errorValidationFields: UI_I_ErrorValidationField<string>[]
114
- virtualHardwareNetworks: UI_I_SendDataNewNetwork[] | null
115
- virtualHardwareHardDisks: UI_I_SendDataNewHardDisk[] | null
116
- virtualHardwareCdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
93
+ errorValidationFields: UI_I_ErrorValidationField[]
94
+ maxMemory: number
95
+ cpuModels: UI_I_OptionItem[]
117
96
  state?: string | number
118
97
  vmNameOld?: string
119
98
  passthroughDevices?: UI_I_PciDevice[]
@@ -136,18 +115,12 @@ const props = withDefaults(
136
115
  const emits = defineEmits<{
137
116
  (event: 'hide'): void
138
117
  (event: 'validate'): void
139
- (event: 'update-vm'): void
140
118
  (event: 'get-storage', value: UI_I_TablePayload): void
141
119
  (event: 'get-pci-devices'): void
142
- (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
143
120
  (event: 'get-networks-table', value: UI_I_TablePayload): void
144
121
  (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
145
122
  (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
146
123
  (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
147
- (
148
- event: 'change-customize-hardware',
149
- value: UI_I_SendDataCustomizeHardware
150
- ): void
151
124
  }>()
152
125
 
153
126
  const localization = computed<UI_I_Localization>(() => useLocal())