bfg-common 1.5.323 → 1.5.326

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 (147) 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/assets/localization/local_be.json +2 -0
  7. package/assets/localization/local_en.json +2 -0
  8. package/assets/localization/local_hy.json +2 -0
  9. package/assets/localization/local_kk.json +2 -0
  10. package/assets/localization/local_ru.json +2 -0
  11. package/assets/localization/local_zh.json +2 -0
  12. package/components/atoms/TheIcon3.vue +50 -50
  13. package/components/atoms/collapse/CollapseNav.vue +170 -170
  14. package/components/atoms/collapse/CollapseNavItem.vue +226 -226
  15. package/components/atoms/nav/NavBar.vue +147 -147
  16. package/components/atoms/perPage/PerPage.vue +58 -58
  17. package/components/atoms/table/dataGrid/DataGrid.vue +1717 -1717
  18. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  19. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  20. package/components/atoms/tabs/VerticalTabs.vue +105 -105
  21. package/components/common/backup/storage/actions/add/lib/config/steps.ts +168 -168
  22. package/components/common/backup/storage/actions/add/steps/hostAccessibility/HostAccessibility.vue +52 -52
  23. package/components/common/backup/storage/actions/add/steps/readyComplete/ReadyComplete.vue +45 -45
  24. package/components/common/backup/storage/actions/delete/Delete.vue +65 -65
  25. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  26. package/components/common/context/lib/models/interfaces.ts +33 -33
  27. package/components/common/diagramMain/DiagramMain.vue +897 -897
  28. package/components/common/diagramMain/modals/lib/config/networkModal.ts +398 -398
  29. package/components/common/diagramMain/network/Network.vue +141 -141
  30. package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
  31. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewOld.vue +112 -112
  32. package/components/common/monitor/overview/OverviewOld.vue +139 -139
  33. package/components/common/monitor/overview/filters/lib/config/filterOptions.ts +100 -100
  34. package/components/common/pages/home/headline/Headline.vue +45 -45
  35. package/components/common/pages/home/headline/HeadlineOld.vue +42 -42
  36. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  37. package/components/common/pages/home/widgets/Widgets.vue +49 -49
  38. package/components/common/pages/home/widgets/WidgetsNew.vue +86 -86
  39. package/components/common/pages/home/widgets/WidgetsOld.vue +34 -34
  40. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  41. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  42. package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
  43. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  44. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  45. package/components/common/pages/packages/Packages.vue +208 -208
  46. package/components/common/pages/shortcuts/block/BlockOld.vue +68 -68
  47. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  48. package/components/common/recursionTree/RecursionTree.vue +223 -223
  49. package/components/common/select/button/ButtonDropdown.vue +112 -112
  50. package/components/common/spiceConsole/Drawer.vue +377 -377
  51. package/components/common/spiceConsole/SpiceConsole.vue +127 -127
  52. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  53. package/components/common/tools/Actions.vue +207 -207
  54. package/components/common/vm/actions/add/New.vue +647 -642
  55. package/components/common/vm/actions/add/Old.vue +388 -385
  56. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  57. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  58. package/components/common/vm/actions/add/folderTreeView/Old.vue +50 -50
  59. package/components/common/vm/actions/add/lib/config/steps.ts +22 -10
  60. package/components/common/vm/actions/clone/Clone.vue +823 -823
  61. package/components/common/vm/actions/clone/lib/config/steps.ts +291 -291
  62. package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +116 -116
  63. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +3 -0
  64. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +2 -0
  65. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +2 -0
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +321 -321
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +227 -227
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +100 -100
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +232 -232
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +168 -168
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +78 -78
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +50 -50
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipNew.vue +154 -154
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +307 -307
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +385 -385
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationOld.vue +85 -85
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +94 -94
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +205 -205
  86. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +66 -66
  87. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +62 -62
  88. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  89. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +76 -76
  90. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  91. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  92. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  93. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +84 -84
  94. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  95. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +154 -154
  96. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +155 -152
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +130 -128
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +113 -111
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  101. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  102. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  103. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +95 -83
  104. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +2 -1
  105. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +155 -154
  106. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  107. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapOld.vue +44 -44
  108. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  109. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  110. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  111. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  112. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +118 -118
  113. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  114. package/components/common/vm/actions/common/select/createType/lib/config/items.ts +48 -48
  115. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  116. package/components/common/vm/actions/common/select/name/Name.vue +174 -174
  117. package/components/common/vm/actions/common/select/options/Options.vue +6 -1
  118. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  119. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  120. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  121. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  122. package/components/common/vm/actions/editSettings/EditSettings.vue +242 -239
  123. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +2 -0
  124. package/components/common/vm/actions/editSettings/new/New.vue +2 -0
  125. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  126. package/components/common/vmt/actions/add/Add.vue +641 -641
  127. package/components/common/vmt/actions/add/lib/config/steps.ts +107 -107
  128. package/components/common/vmt/actions/add/lib/models/interfaces.ts +23 -23
  129. package/components/common/wizards/network/add/steps/SelectConnectionType.vue +104 -104
  130. package/components/common/wizards/network/add/steps/SelectedTargetDevice.vue +467 -467
  131. package/components/common/wizards/vm/migrate/Migrate.vue +349 -349
  132. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +220 -220
  133. package/components/common/wizards/vm/migrate/lib/config/steps.ts +157 -157
  134. package/components/common/wizards/vm/migrate/lib/validations.ts +68 -68
  135. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  136. package/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable.ts +91 -91
  137. package/composables/productNameLocal.ts +30 -30
  138. package/composables/useAppVersion.ts +21 -21
  139. package/package.json +1 -1
  140. package/plugins/date.ts +233 -233
  141. package/plugins/panelStates.ts +70 -70
  142. package/plugins/text.ts +59 -59
  143. package/public/spice-console/lib/images/bitmap.js +203 -203
  144. package/public/spice-console/network/spicechannel.js +387 -387
  145. package/store/main/mutations.ts +7 -7
  146. package/store/main/state.ts +7 -7
  147. package/store/tasks/mappers/recentTasks.ts +64 -64
@@ -1,239 +1,242 @@
1
- <template>
2
- <common-vm-actions-edit-settings-new
3
- v-if="isNewView"
4
- v-model:vm-name="vmName"
5
- v-model:vm-settings="vmSettingsLocal"
6
- :nodes="props.nodes"
7
- :files="props.files"
8
- :project="props.project"
9
- :loading="loadingLocal"
10
- :datastore="props.datastore"
11
- :is-datastore-loading="props.isDatastoreLoading"
12
- :networks-table="props.networksTable"
13
- :selected-nav-item="selectedNavItem"
14
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
15
- :error-validation-fields="props.errorValidationFields"
16
- :virtual-hardware-networks="virtualHardwareNetworksLocal"
17
- :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
18
- :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
19
- :state="props.state"
20
- :vm-name-old="props.vmSettings?.name"
21
- :passthrough-devices="props.passthroughDevices"
22
- :mediated-devices="props.mediatedDevices"
23
- :get-datastore-table-func="props.getDatastoreTableFunc"
24
- :customize-hardware-submit="customizeHardwareSubmit"
25
- @hide="emits('hide')"
26
- @validate="validateSendData"
27
- @update-vm="emits('update-vm')"
28
- @get-storage="emits('get-storage', $event)"
29
- @get-pci-devices="emits('get-pci-devices')"
30
- @change-boot-order="onChangeBootOrder"
31
- @get-networks-table="emits('get-networks-table', $event)"
32
- @get-folders-or-files="emits('get-folders-or-files', $event)"
33
- @show-datastore-child="emits('show-datastore-child', $event)"
34
- @get-active-device-child="emits('get-active-device-child', $event)"
35
- @change-customize-hardware="onChangeCustomizeHardware"
36
- />
37
- <common-vm-actions-edit-settings-old
38
- v-else
39
- v-model:vm-name="vmName"
40
- v-model:vm-settings="vmSettingsLocal"
41
- :nodes="props.nodes"
42
- :files="props.files"
43
- :project="props.project"
44
- :loading="loadingLocal"
45
- :datastore="props.datastore"
46
- :is-datastore-loading="props.isDatastoreLoading"
47
- :networks-table="props.networksTable"
48
- :selected-nav-item="selectedNavItem"
49
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
50
- :error-validation-fields="props.errorValidationFields"
51
- :virtual-hardware-networks="virtualHardwareNetworksLocal"
52
- :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
53
- :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
54
- :state="props.state"
55
- :vm-name-old="props.vmSettings?.name"
56
- :passthrough-devices="props.passthroughDevices"
57
- :mediated-devices="props.mediatedDevices"
58
- :get-datastore-table-func="props.getDatastoreTableFunc"
59
- :customize-hardware-submit="customizeHardwareSubmit"
60
- @hide="emits('hide')"
61
- @validate="validateSendData"
62
- @update-vm="emits('update-vm')"
63
- @get-storage="emits('get-storage', $event)"
64
- @get-pci-devices="emits('get-pci-devices')"
65
- @change-boot-order="onChangeBootOrder"
66
- @get-networks-table="emits('get-networks-table', $event)"
67
- @get-folders-or-files="emits('get-folders-or-files', $event)"
68
- @show-datastore-child="emits('show-datastore-child', $event)"
69
- @get-active-device-child="emits('get-active-device-child', $event)"
70
- @change-customize-hardware="onChangeCustomizeHardware"
71
- />
72
- </template>
73
-
74
- <script setup lang="ts">
75
- import type { UI_T_Project } from '~/lib/models/types'
76
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
77
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
78
- import type {
79
- UI_I_MediatedDevice,
80
- UI_I_PciDevice,
81
- UI_I_VmSettings,
82
- } from '~/lib/models/store/vm/interfaces'
83
- import type { UI_I_Localization } from '~/lib/models/interfaces'
84
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
85
- import type {
86
- UI_I_SendDataNewCdDvdDrive,
87
- UI_I_SendDataNewHardDisk,
88
- UI_I_SendDataNewNetwork,
89
- UI_I_SendDataCpu,
90
- UI_I_SendDataMemory,
91
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
92
- import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
93
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
94
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
95
- import type {
96
- UI_I_DatastoreTableItem,
97
- UI_I_FolderOrFileTreePayload,
98
- } from '~/lib/models/store/storage/interfaces'
99
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
100
- import type { UI_T_EditVmFinishFunc } from '~/components/common/vm/actions/editSettings/lib/models/types'
101
- import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
102
- import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils/capabilities'
103
-
104
- const props = defineProps<{
105
- project: UI_T_Project
106
- loading: boolean
107
- vmSettings: UI_I_VmSettings | null
108
- nodes: UI_I_FileTreeNode[]
109
- files: UI_I_FileTreeNode[]
110
- networksTable: UI_I_NetworkTableItem[]
111
- errorValidationFields: UI_I_ErrorValidationField<string>[]
112
- vmCpuHelpTextSecond: string
113
- vmId: string
114
- datastore: UI_I_DatastoreTableItem[]
115
- isDatastoreLoading: boolean
116
- validateSendDataFunc: UI_T_EditVmFinishFunc
117
- getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
118
- state?: string | number
119
- passthroughDevices?: UI_I_PciDevice[]
120
- mediatedDevices?: UI_I_MediatedDevice[]
121
- capabilities?: UI_I_Capabilities
122
- }>()
123
-
124
- const emits = defineEmits<{
125
- (event: 'hide'): void
126
- (event: 'update-vm'): void
127
- (event: 'get-storage', value: UI_I_TablePayload): void
128
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
129
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
130
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
131
- (event: 'get-networks-table', value: UI_I_TablePayload): void
132
- (event: 'get-pci-devices'): void
133
- }>()
134
-
135
- const { $store }: any = useNuxtApp()
136
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
137
-
138
- const localization = computed<UI_I_Localization>(() => useLocal())
139
-
140
- watch(
141
- () => props.capabilities,
142
- () => {
143
- if (props.capabilities) mapCapabilities(props.capabilities)
144
- },
145
- { deep: true, immediate: true }
146
- )
147
-
148
- const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
149
-
150
- const loadingLocal = ref<boolean>(false)
151
- watch(
152
- () => props.loading,
153
- (newValue: boolean) => {
154
- loadingLocal.value = newValue
155
- },
156
- { immediate: true }
157
- )
158
-
159
- const vmSettingsLocal = computed<UI_I_VmSettings | null>(() => props.vmSettings)
160
-
161
- const vmName = ref<string>(vmSettingsLocal.value?.name || '')
162
- watch(vmSettingsLocal, (newValue) => {
163
- vmName.value = newValue?.name || ''
164
- })
165
-
166
- const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
167
- const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
168
- null
169
- )
170
- const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
171
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
172
- virtualHardwareHardDisks.value = data[0]
173
- virtualHardwareCdDvdDrives.value = data[1]
174
- virtualHardwareNetworks.value = data[2]
175
- }
176
-
177
- const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
178
- const onChangeCustomizeHardware = (
179
- data: UI_I_SendDataCustomizeHardware
180
- ): void => {
181
- customizeHardware.value = data
182
- }
183
- const virtualHardwareHardDisksLocal = computed<
184
- UI_I_SendDataNewHardDisk[] | null
185
- >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
186
- const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
187
- () => customizeHardware.value?.virtualHardware?.networks || null
188
- )
189
- const virtualHardwareCdDvdDrivesLocal = computed<
190
- UI_I_SendDataNewCdDvdDrive[] | null
191
- >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
192
-
193
- const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
194
- () => customizeHardware.value?.virtualHardware?.cpu || null
195
- )
196
- const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
197
- () => customizeHardware.value?.virtualHardware?.memory || null
198
- )
199
-
200
- const customizeHardwareSubmit = ref<null | Function>(null)
201
- const checkCustomizeHardware = async (): Promise<boolean> => {
202
- return new Promise((resolve) => {
203
- customizeHardwareSubmit.value = (data: boolean) => {
204
- customizeHardwareSubmit.value = null
205
-
206
- resolve(data)
207
- }
208
- })
209
- }
210
-
211
- const validateSendData = async (): Promise<void> => {
212
- const isValid = await checkCustomizeHardware()
213
- if (!isValid) {
214
- return
215
- }
216
-
217
- loadingLocal.value = true
218
- props
219
- .validateSendDataFunc(
220
- vmSettingsLocal.value,
221
- virtualHardwareCpu.value,
222
- virtualHardwareMemory.value,
223
- customizeHardware.value,
224
- virtualHardwareNetworks.value,
225
- virtualHardwareHardDisks.value,
226
- virtualHardwareCdDvdDrives.value,
227
- vmName.value,
228
- localization.value,
229
- props.vmId
230
- )
231
- .then((data) => {
232
- loadingLocal.value = false
233
-
234
- !data && emits('update-vm')
235
- })
236
- }
237
- </script>
238
-
239
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <common-vm-actions-edit-settings-new
3
+ v-if="isNewView"
4
+ v-model:vm-name="vmName"
5
+ v-model:vm-settings="vmSettingsLocal"
6
+ :nodes="props.nodes"
7
+ :files="props.files"
8
+ :project="props.project"
9
+ :loading="loadingLocal"
10
+ :datastore="props.datastore"
11
+ :is-datastore-loading="props.isDatastoreLoading"
12
+ :networks-table="props.networksTable"
13
+ :selected-nav-item="selectedNavItem"
14
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
15
+ :error-validation-fields="props.errorValidationFields"
16
+ :virtual-hardware-networks="virtualHardwareNetworksLocal"
17
+ :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
18
+ :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
19
+ :state="props.state"
20
+ :vm-name-old="props.vmSettings?.name"
21
+ :passthrough-devices="props.passthroughDevices"
22
+ :mediated-devices="props.mediatedDevices"
23
+ :get-datastore-table-func="props.getDatastoreTableFunc"
24
+ :customize-hardware-submit="customizeHardwareSubmit"
25
+ :is-vmt="props.isVmt"
26
+ @hide="emits('hide')"
27
+ @validate="validateSendData"
28
+ @update-vm="emits('update-vm')"
29
+ @get-storage="emits('get-storage', $event)"
30
+ @get-pci-devices="emits('get-pci-devices')"
31
+ @change-boot-order="onChangeBootOrder"
32
+ @get-networks-table="emits('get-networks-table', $event)"
33
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
34
+ @show-datastore-child="emits('show-datastore-child', $event)"
35
+ @get-active-device-child="emits('get-active-device-child', $event)"
36
+ @change-customize-hardware="onChangeCustomizeHardware"
37
+ />
38
+ <common-vm-actions-edit-settings-old
39
+ v-else
40
+ v-model:vm-name="vmName"
41
+ v-model:vm-settings="vmSettingsLocal"
42
+ :nodes="props.nodes"
43
+ :files="props.files"
44
+ :project="props.project"
45
+ :loading="loadingLocal"
46
+ :datastore="props.datastore"
47
+ :is-datastore-loading="props.isDatastoreLoading"
48
+ :networks-table="props.networksTable"
49
+ :selected-nav-item="selectedNavItem"
50
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
51
+ :error-validation-fields="props.errorValidationFields"
52
+ :virtual-hardware-networks="virtualHardwareNetworksLocal"
53
+ :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
54
+ :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
55
+ :state="props.state"
56
+ :vm-name-old="props.vmSettings?.name"
57
+ :passthrough-devices="props.passthroughDevices"
58
+ :mediated-devices="props.mediatedDevices"
59
+ :get-datastore-table-func="props.getDatastoreTableFunc"
60
+ :customize-hardware-submit="customizeHardwareSubmit"
61
+ :is-vmt="props.isVmt"
62
+ @hide="emits('hide')"
63
+ @validate="validateSendData"
64
+ @update-vm="emits('update-vm')"
65
+ @get-storage="emits('get-storage', $event)"
66
+ @get-pci-devices="emits('get-pci-devices')"
67
+ @change-boot-order="onChangeBootOrder"
68
+ @get-networks-table="emits('get-networks-table', $event)"
69
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
70
+ @show-datastore-child="emits('show-datastore-child', $event)"
71
+ @get-active-device-child="emits('get-active-device-child', $event)"
72
+ @change-customize-hardware="onChangeCustomizeHardware"
73
+ />
74
+ </template>
75
+
76
+ <script setup lang="ts">
77
+ import type { UI_T_Project } from '~/lib/models/types'
78
+ import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
79
+ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
80
+ import type {
81
+ UI_I_MediatedDevice,
82
+ UI_I_PciDevice,
83
+ UI_I_VmSettings,
84
+ } 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
+ import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
95
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
96
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
97
+ import type {
98
+ UI_I_DatastoreTableItem,
99
+ UI_I_FolderOrFileTreePayload,
100
+ } from '~/lib/models/store/storage/interfaces'
101
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
102
+ 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'
104
+ import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils/capabilities'
105
+
106
+ const props = defineProps<{
107
+ project: UI_T_Project
108
+ loading: boolean
109
+ vmSettings: UI_I_VmSettings | null
110
+ nodes: UI_I_FileTreeNode[]
111
+ files: UI_I_FileTreeNode[]
112
+ networksTable: UI_I_NetworkTableItem[]
113
+ errorValidationFields: UI_I_ErrorValidationField<string>[]
114
+ vmCpuHelpTextSecond: string
115
+ vmId: string
116
+ datastore: UI_I_DatastoreTableItem[]
117
+ isDatastoreLoading: boolean
118
+ validateSendDataFunc: UI_T_EditVmFinishFunc
119
+ getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
120
+ state?: string | number
121
+ passthroughDevices?: UI_I_PciDevice[]
122
+ mediatedDevices?: UI_I_MediatedDevice[]
123
+ capabilities?: UI_I_Capabilities
124
+ isVmt?: boolean
125
+ }>()
126
+
127
+ const emits = defineEmits<{
128
+ (event: 'hide'): void
129
+ (event: 'update-vm'): void
130
+ (event: 'get-storage', value: UI_I_TablePayload): void
131
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
132
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
133
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
134
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
135
+ (event: 'get-pci-devices'): void
136
+ }>()
137
+
138
+ const { $store }: any = useNuxtApp()
139
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
140
+
141
+ const localization = computed<UI_I_Localization>(() => useLocal())
142
+
143
+ watch(
144
+ () => props.capabilities,
145
+ () => {
146
+ if (props.capabilities) mapCapabilities(props.capabilities)
147
+ },
148
+ { deep: true, immediate: true }
149
+ )
150
+
151
+ const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
152
+
153
+ const loadingLocal = ref<boolean>(false)
154
+ watch(
155
+ () => props.loading,
156
+ (newValue: boolean) => {
157
+ loadingLocal.value = newValue
158
+ },
159
+ { immediate: true }
160
+ )
161
+
162
+ const vmSettingsLocal = computed<UI_I_VmSettings | null>(() => props.vmSettings)
163
+
164
+ const vmName = ref<string>(vmSettingsLocal.value?.name || '')
165
+ watch(vmSettingsLocal, (newValue) => {
166
+ vmName.value = newValue?.name || ''
167
+ })
168
+
169
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
170
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
171
+ null
172
+ )
173
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
174
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
175
+ virtualHardwareHardDisks.value = data[0]
176
+ virtualHardwareCdDvdDrives.value = data[1]
177
+ virtualHardwareNetworks.value = data[2]
178
+ }
179
+
180
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
181
+ const onChangeCustomizeHardware = (
182
+ data: UI_I_SendDataCustomizeHardware
183
+ ): void => {
184
+ customizeHardware.value = data
185
+ }
186
+ const virtualHardwareHardDisksLocal = computed<
187
+ UI_I_SendDataNewHardDisk[] | null
188
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
189
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
190
+ () => customizeHardware.value?.virtualHardware?.networks || null
191
+ )
192
+ const virtualHardwareCdDvdDrivesLocal = computed<
193
+ UI_I_SendDataNewCdDvdDrive[] | null
194
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
195
+
196
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
197
+ () => customizeHardware.value?.virtualHardware?.cpu || null
198
+ )
199
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
200
+ () => customizeHardware.value?.virtualHardware?.memory || null
201
+ )
202
+
203
+ const customizeHardwareSubmit = ref<null | Function>(null)
204
+ const checkCustomizeHardware = async (): Promise<boolean> => {
205
+ return new Promise((resolve) => {
206
+ customizeHardwareSubmit.value = (data: boolean) => {
207
+ customizeHardwareSubmit.value = null
208
+
209
+ resolve(data)
210
+ }
211
+ })
212
+ }
213
+
214
+ const validateSendData = async (): Promise<void> => {
215
+ const isValid = await checkCustomizeHardware()
216
+ if (!isValid) {
217
+ return
218
+ }
219
+
220
+ loadingLocal.value = true
221
+ props
222
+ .validateSendDataFunc(
223
+ vmSettingsLocal.value,
224
+ virtualHardwareCpu.value,
225
+ virtualHardwareMemory.value,
226
+ customizeHardware.value,
227
+ virtualHardwareNetworks.value,
228
+ virtualHardwareHardDisks.value,
229
+ virtualHardwareCdDvdDrives.value,
230
+ vmName.value,
231
+ localization.value,
232
+ props.vmId
233
+ )
234
+ .then((data) => {
235
+ loadingLocal.value = false
236
+
237
+ !data && emits('update-vm')
238
+ })
239
+ }
240
+ </script>
241
+
242
+ <style scoped lang="scss"></style>
@@ -53,6 +53,7 @@
53
53
  :is-datastore-loading="props.isDatastoreLoading"
54
54
  :customize-hardware-submit="props.customizeHardwareSubmit"
55
55
  is-edit
56
+ :is-vmt="props.isVmt"
56
57
  @get-storage="emits('get-storage', $event)"
57
58
  @get-folders-or-files="emits('get-folders-or-files', $event)"
58
59
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -118,6 +119,7 @@ const props = defineProps<{
118
119
  mediatedDevices?: any[]
119
120
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
120
121
  customizeHardwareSubmit?: null | Function
122
+ isVmt?: boolean
121
123
  }>()
122
124
 
123
125
  const emits = defineEmits<{
@@ -56,6 +56,7 @@
56
56
  :is-datastore-loading="props.isDatastoreLoading"
57
57
  :customize-hardware-submit="props.customizeHardwareSubmit"
58
58
  is-edit
59
+ :is-vmt="props.isVmt"
59
60
  @get-storage="emits('get-storage', $event)"
60
61
  @get-folders-or-files="emits('get-folders-or-files', $event)"
61
62
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -125,6 +126,7 @@ const props = defineProps<{
125
126
  mediatedDevices?: any[]
126
127
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
127
128
  customizeHardwareSubmit?: null | Function
129
+ isVmt?: boolean
128
130
  }>()
129
131
 
130
132
  const emits = defineEmits<{