bfg-common 1.5.398 → 1.5.400

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 (137) 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/scss/common/icons/icons-6.scss +4 -4
  7. package/components/atoms/TheIcon3.vue +50 -50
  8. package/components/atoms/collapse/CollapseNav.vue +170 -170
  9. package/components/atoms/collapse/CollapseNavItem.vue +226 -226
  10. package/components/atoms/nav/NavBar.vue +159 -159
  11. package/components/atoms/perPage/PerPage.vue +58 -58
  12. package/components/atoms/table/dataGrid/DataGrid.vue +1717 -1717
  13. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  14. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  15. package/components/atoms/tabs/VerticalTabs.vue +105 -105
  16. package/components/common/backup/storage/actions/add/lib/config/steps.ts +168 -168
  17. package/components/common/backup/storage/actions/add/steps/hostAccessibility/HostAccessibility.vue +52 -52
  18. package/components/common/backup/storage/actions/add/steps/readyComplete/ReadyComplete.vue +45 -45
  19. package/components/common/backup/storage/actions/delete/Delete.vue +65 -65
  20. package/components/common/browse/blocks/Container.vue +234 -234
  21. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  22. package/components/common/context/lib/models/interfaces.ts +33 -33
  23. package/components/common/diagramMain/modals/lib/config/networkModal.ts +398 -398
  24. package/components/common/diagramMain/network/Network.vue +141 -141
  25. package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
  26. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewOld.vue +112 -112
  27. package/components/common/monitor/overview/OverviewOld.vue +139 -139
  28. package/components/common/pages/home/headline/Headline.vue +45 -45
  29. package/components/common/pages/home/headline/HeadlineOld.vue +42 -42
  30. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  31. package/components/common/pages/home/widgets/Widgets.vue +49 -49
  32. package/components/common/pages/home/widgets/WidgetsNew.vue +88 -88
  33. package/components/common/pages/home/widgets/WidgetsOld.vue +36 -36
  34. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  35. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  36. package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
  37. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  38. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  39. package/components/common/pages/packages/Packages.vue +208 -208
  40. package/components/common/pages/shortcuts/block/BlockOld.vue +68 -68
  41. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  42. package/components/common/recursionTree/RecursionTree.vue +223 -223
  43. package/components/common/select/button/ButtonDropdown.vue +112 -112
  44. package/components/common/select/radio/RadioGroup.vue +137 -137
  45. package/components/common/spiceConsole/Drawer.vue +381 -381
  46. package/components/common/spiceConsole/SpiceConsole.vue +127 -127
  47. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  48. package/components/common/tools/Actions.vue +207 -207
  49. package/components/common/vm/actions/add/Old.vue +388 -388
  50. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  51. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  52. package/components/common/vm/actions/add/folderTreeView/Old.vue +50 -50
  53. package/components/common/vm/actions/clone/Clone.vue +823 -823
  54. package/components/common/vm/actions/clone/lib/config/steps.ts +291 -291
  55. package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +116 -116
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +321 -321
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +227 -227
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +100 -100
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +232 -232
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +168 -168
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +78 -78
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +50 -50
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipNew.vue +154 -154
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +155 -155
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +307 -307
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +385 -385
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationOld.vue +85 -85
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +94 -94
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +205 -205
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +66 -66
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +62 -62
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +76 -76
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +84 -84
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  86. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +154 -154
  87. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  88. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +155 -155
  89. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +130 -130
  90. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +113 -113
  91. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  92. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  93. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  94. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +95 -95
  95. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +155 -155
  96. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapOld.vue +44 -44
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  101. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  102. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +143 -143
  103. package/components/common/vm/actions/common/select/computeResource/New.vue +184 -184
  104. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +131 -131
  105. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  106. package/components/common/vm/actions/common/select/createType/lib/config/items.ts +48 -48
  107. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  108. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  109. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  110. package/components/common/vm/actions/common/select/storage/Storage.vue +155 -155
  111. package/components/common/vm/actions/common/select/storage/new/New.vue +300 -300
  112. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  113. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  114. package/components/common/vm/actions/editSettings/EditSettings.vue +242 -242
  115. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  116. package/components/common/vmt/actions/add/lib/models/interfaces.ts +23 -23
  117. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  118. package/components/common/wizards/network/add/steps/SelectConnectionType.vue +104 -104
  119. package/components/common/wizards/network/add/steps/SelectedTargetDevice.vue +467 -467
  120. package/components/common/wizards/vm/migrate/Migrate.vue +349 -349
  121. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +220 -220
  122. package/components/common/wizards/vm/migrate/lib/config/steps.ts +157 -157
  123. package/components/common/wizards/vm/migrate/lib/validations.ts +68 -68
  124. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  125. package/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable.ts +91 -91
  126. package/components/common/wizards/vm/migrate/select/type/lib/config/typeOptions.ts +45 -45
  127. package/composables/productNameLocal.ts +30 -30
  128. package/composables/useAppVersion.ts +21 -21
  129. package/package.json +1 -1
  130. package/plugins/date.ts +233 -233
  131. package/plugins/panelStates.ts +70 -70
  132. package/plugins/text.ts +59 -59
  133. package/public/spice-console/lib/images/bitmap.js +203 -203
  134. package/public/spice-console/network/spicechannel.js +390 -390
  135. package/store/main/mutations.ts +7 -7
  136. package/store/main/state.ts +7 -7
  137. package/store/tasks/mappers/recentTasks.ts +64 -64
@@ -1,242 +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
- :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>
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>
@@ -1,88 +1,88 @@
1
- <template>
2
- <div class="skeleton-wrap">
3
- <div class="tabs">
4
- <ui-skeleton-item width="64px" height="16px" />
5
- <ui-skeleton-item width="64px" height="16px" />
6
- </div>
7
- <div class="actions">
8
- <ui-skeleton-item width="80px" height="16px" />
9
- <ui-skeleton-item width="152px" height="32px" border-radius="6px" />
10
- </div>
11
- <div class="stack-block-wrap">
12
- <div class="stack-block">
13
- <div class="stack-label flex-1">
14
- <ui-skeleton-item width="16px" height="16px" border-radius="50%" />
15
- <ui-skeleton-item height="16px" />
16
- </div>
17
- <div class="stack-value flex-1">
18
- <ui-skeleton-item width="102px" height="32px" border-radius="8px" />
19
- </div>
20
- </div>
21
-
22
- <div v-for="item in 2" :key="item" class="stack-block">
23
- <div class="stack-label flex-1">
24
- <ui-skeleton-item width="16px" height="16px" border-radius="50%" />
25
- <ui-skeleton-item height="16px" />
26
- </div>
27
- <div class="stack-value flex-1">
28
- <ui-skeleton-item width="102px" height="32px" border-radius="8px" />
29
- <ui-skeleton-item width="80px" height="32px" border-radius="8px" />
30
- </div>
31
- </div>
32
-
33
- <div v-for="item in 5" :key="item" class="stack-block">
34
- <div class="stack-label flex-1">
35
- <ui-skeleton-item width="16px" height="16px" border-radius="50%" />
36
- <ui-skeleton-item height="16px" />
37
- </div>
38
- <div class="stack-value flex-1">
39
- <ui-skeleton-item width="196px" height="32px" border-radius="8px" />
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- </template>
45
-
46
- <script setup lang="ts"></script>
47
-
48
- <style scoped lang="scss">
49
- .skeleton-wrap {
50
- padding: 0 32px;
51
-
52
- .tabs {
53
- display: flex;
54
- align-items: center;
55
- gap: 32px;
56
- padding: 8px 0 12px;
57
- border-bottom: 1px solid var(--divider-color);
58
- }
59
-
60
- .actions {
61
- display: flex;
62
- align-items: center;
63
- justify-content: space-between;
64
- margin: 12px 0;
65
- }
66
-
67
- .stack-block-wrap {
68
- display: grid;
69
- grid-gap: 12px;
70
-
71
- .stack-block {
72
- display: flex;
73
- align-items: center;
74
- gap: 12px;
75
- padding: 8px 12px;
76
- background: var(--stack-block-bg-color);
77
- border-radius: 6px;
78
-
79
- .stack-label,
80
- .stack-value {
81
- display: flex;
82
- align-items: center;
83
- gap: 8px;
84
- }
85
- }
86
- }
87
- }
88
- </style>
1
+ <template>
2
+ <div class="skeleton-wrap">
3
+ <div class="tabs">
4
+ <ui-skeleton-item width="64px" height="16px" />
5
+ <ui-skeleton-item width="64px" height="16px" />
6
+ </div>
7
+ <div class="actions">
8
+ <ui-skeleton-item width="80px" height="16px" />
9
+ <ui-skeleton-item width="152px" height="32px" border-radius="6px" />
10
+ </div>
11
+ <div class="stack-block-wrap">
12
+ <div class="stack-block">
13
+ <div class="stack-label flex-1">
14
+ <ui-skeleton-item width="16px" height="16px" border-radius="50%" />
15
+ <ui-skeleton-item height="16px" />
16
+ </div>
17
+ <div class="stack-value flex-1">
18
+ <ui-skeleton-item width="102px" height="32px" border-radius="8px" />
19
+ </div>
20
+ </div>
21
+
22
+ <div v-for="item in 2" :key="item" class="stack-block">
23
+ <div class="stack-label flex-1">
24
+ <ui-skeleton-item width="16px" height="16px" border-radius="50%" />
25
+ <ui-skeleton-item height="16px" />
26
+ </div>
27
+ <div class="stack-value flex-1">
28
+ <ui-skeleton-item width="102px" height="32px" border-radius="8px" />
29
+ <ui-skeleton-item width="80px" height="32px" border-radius="8px" />
30
+ </div>
31
+ </div>
32
+
33
+ <div v-for="item in 5" :key="item" class="stack-block">
34
+ <div class="stack-label flex-1">
35
+ <ui-skeleton-item width="16px" height="16px" border-radius="50%" />
36
+ <ui-skeleton-item height="16px" />
37
+ </div>
38
+ <div class="stack-value flex-1">
39
+ <ui-skeleton-item width="196px" height="32px" border-radius="8px" />
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </template>
45
+
46
+ <script setup lang="ts"></script>
47
+
48
+ <style scoped lang="scss">
49
+ .skeleton-wrap {
50
+ padding: 0 32px;
51
+
52
+ .tabs {
53
+ display: flex;
54
+ align-items: center;
55
+ gap: 32px;
56
+ padding: 8px 0 12px;
57
+ border-bottom: 1px solid var(--divider-color);
58
+ }
59
+
60
+ .actions {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: space-between;
64
+ margin: 12px 0;
65
+ }
66
+
67
+ .stack-block-wrap {
68
+ display: grid;
69
+ grid-gap: 12px;
70
+
71
+ .stack-block {
72
+ display: flex;
73
+ align-items: center;
74
+ gap: 12px;
75
+ padding: 8px 12px;
76
+ background: var(--stack-block-bg-color);
77
+ border-radius: 6px;
78
+
79
+ .stack-label,
80
+ .stack-value {
81
+ display: flex;
82
+ align-items: center;
83
+ gap: 8px;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ </style>