bfg-common 1.2.198 → 1.2.200
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.
- package/assets/localization/local_be.json +3 -1
- package/assets/localization/local_en.json +3 -1
- package/assets/localization/local_hy.json +3 -1
- package/assets/localization/local_kk.json +3 -1
- package/assets/localization/local_ru.json +3 -1
- package/assets/localization/local_zh.json +3 -1
- package/assets/scss/common/icons/icons-2.scss +222 -222
- package/components/atoms/switch/Switch.vue +107 -107
- package/components/atoms/wizard/utils/utils.ts +538 -486
- package/components/common/BadBrowser.vue +114 -114
- package/components/common/adapterManager/AddAdapterWarningModal.vue +82 -82
- package/components/common/adapterManager/NoActiveAdaptersModal.vue +62 -62
- package/components/common/adapterManager/NoConnectedActiveAdaptersModal.vue +62 -62
- package/components/common/browse/blocks/Title.vue +66 -66
- package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +202 -202
- package/components/common/diagramMain/modals/remove/RemoveModal.vue +226 -226
- package/components/common/feedback/Feedback.vue +261 -261
- package/components/common/feedback/VisitPortal.vue +53 -53
- package/components/common/help/navbar/left/utils/constructAccordion.ts +27 -27
- package/components/common/recursionTree/RecursionTree.vue +201 -201
- package/components/common/vm/actions/add/Add.vue +525 -785
- package/components/common/vm/actions/add/utils.ts +0 -105
- package/components/common/vm/actions/clone/Clone.vue +545 -545
- package/components/common/vm/actions/clone/select/options/Options.vue +65 -65
- package/components/common/vm/actions/clone/utils.ts +43 -43
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +109 -109
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +234 -234
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +316 -316
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/config/memoryOptions.ts +35 -35
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/Reservation.vue +235 -235
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +197 -197
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +51 -51
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +253 -253
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +55 -55
- package/components/common/vm/actions/common/select/name/Name.vue +5 -10
- package/components/common/vm/actions/common/select/storage/Storage.vue +4 -6
- package/components/common/vm/actions/common/select/storage/config/config.ts +154 -154
- package/components/common/vm/utils/powerActions.ts +55 -55
- package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +54 -54
- package/components/layout/theHeader/utils/localization.ts +32 -32
- package/composables/useLocal.ts +38 -38
- package/minify.js +146 -146
- package/models/interfaces.ts +49 -49
- package/models/store/interfaces.ts +37 -37
- package/models/store/storage/interfaces.ts +32 -32
- package/models/store/types.ts +43 -43
- package/modules/fixContentBuild/utils/methods.ts +114 -114
- package/package.json +1 -1
- package/public/spice-console/application/codec.js +257 -257
- package/public/spice-console/lib/rasterEngine.js +907 -907
- package/public/spice-console/network/spicechannel.js +369 -369
- package/utils/contentBuild.ts +34 -34
- package/utils/sendTask.ts +77 -77
- package/components/common/vm/actions/addOld/Add.vue +0 -690
- package/components/common/vm/actions/addOld/FolderTreeView.vue +0 -83
- package/components/common/vm/actions/addOld/utils.ts +0 -118
- package/components/common/vm/actions/common/select/name/NameOld.vue +0 -215
- package/components/common/vm/actions/common/select/storage/StorageOld.vue +0 -194
|
@@ -1,505 +1,248 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="add-vm">
|
|
3
|
-
<atoms-
|
|
4
|
-
|
|
5
|
-
:
|
|
6
|
-
:selected-scheme="selectedScheme"
|
|
7
|
-
:is-loading="wizard.wizardLoader.status"
|
|
8
|
-
:loader-messages="wizard.wizardLoader.messages"
|
|
3
|
+
<atoms-modal-by-steps
|
|
4
|
+
test-id="add-vm-wizard"
|
|
5
|
+
:show="true"
|
|
9
6
|
:title="localization.newVirtualMachine2"
|
|
10
|
-
:
|
|
11
|
-
:
|
|
12
|
-
|
|
7
|
+
:step-items="stepItems"
|
|
8
|
+
:step-position="stepPosition"
|
|
9
|
+
:loading="loading"
|
|
10
|
+
@change-step="onChangeStep"
|
|
13
11
|
@hide="onHideModal"
|
|
14
|
-
@submit="onFinish"
|
|
15
12
|
>
|
|
16
|
-
<template #modalBody
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
13
|
+
<template #modalBody>
|
|
14
|
+
<div class="add-vm-context">
|
|
15
|
+
<div class="context-title-wrap">
|
|
16
|
+
<p>{{ stepSubTitle }}</p>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<common-vm-actions-common-select-create-type
|
|
20
|
+
v-show="stepPosition === 0"
|
|
21
|
+
:import-from-v-m-warev-sphere="props.importFromVMWarevSphere"
|
|
22
|
+
@next="onNext"
|
|
23
|
+
/>
|
|
24
|
+
<common-vm-actions-common-select-name
|
|
25
|
+
v-show="stepPosition === 1"
|
|
26
|
+
:show="stepPosition === 1"
|
|
27
|
+
:name-form-submit="nameFormSubmit"
|
|
28
|
+
:project="props.project"
|
|
29
|
+
:data-center="props.dataCenter"
|
|
30
|
+
@submit="onChangeNameAndNext(...$event)"
|
|
31
|
+
@check-name="emits('check-name', $event)"
|
|
32
|
+
@loading="loading = $event"
|
|
33
|
+
/>
|
|
34
|
+
<common-vm-actions-common-select-compute-resource
|
|
35
|
+
v-if="props.project === 'sphere'"
|
|
36
|
+
v-show="stepPosition === 2"
|
|
37
|
+
v-model="vmForm.computeResource"
|
|
38
|
+
:compute-resource-submit="computeResourceSubmit"
|
|
39
|
+
:data-center="vmForm.dataCenter"
|
|
40
|
+
:compute-resource="props.computeResource"
|
|
41
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
42
|
+
@submit="changeComputeResourceAndNext"
|
|
43
|
+
@get-compute-resource-tree="
|
|
44
|
+
emits('get-compute-resource-tree', $event)
|
|
45
|
+
"
|
|
46
|
+
@show-compute-resource-tree="
|
|
47
|
+
emits('show-compute-resource-tree', $event)
|
|
48
|
+
"
|
|
49
|
+
@select-compute-resource-tree="onSelectComputeResourceTree"
|
|
50
|
+
@clear-compute-resource-tree="
|
|
51
|
+
emits('clear-compute-resource-tree', $event)
|
|
52
|
+
"
|
|
53
|
+
/>
|
|
54
|
+
<common-vm-actions-common-select-storage
|
|
55
|
+
v-show="
|
|
56
|
+
props.project === 'sphere'
|
|
57
|
+
? stepPosition === 3
|
|
58
|
+
: stepPosition === 2
|
|
59
|
+
"
|
|
60
|
+
:storage-submit="storageSubmit"
|
|
61
|
+
:datastore="props.datastore"
|
|
62
|
+
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
63
|
+
@submit="onChangeStorageAndNext"
|
|
64
|
+
/>
|
|
65
|
+
<common-vm-actions-common-select-compatibility
|
|
66
|
+
v-show="
|
|
67
|
+
props.project === 'sphere'
|
|
68
|
+
? stepPosition === 4
|
|
69
|
+
: stepPosition === 3
|
|
70
|
+
"
|
|
71
|
+
:options="compatibility"
|
|
72
|
+
:error-validation-fields="props.errorValidationFields"
|
|
73
|
+
@change="onChangeCompatibility"
|
|
74
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
75
|
+
/>
|
|
76
|
+
<common-vm-actions-common-select-os
|
|
77
|
+
v-show="
|
|
78
|
+
props.project === 'sphere'
|
|
79
|
+
? stepPosition === 5
|
|
80
|
+
: stepPosition === 4
|
|
81
|
+
"
|
|
82
|
+
:families-options="guestOsFamilies"
|
|
83
|
+
:versions-options="guestOsVersions"
|
|
84
|
+
:machine-types-options="machineTypes"
|
|
85
|
+
:error-validation-fields="props.errorValidationFields"
|
|
86
|
+
@change="onChangeOs"
|
|
87
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
88
|
+
/>
|
|
89
|
+
<common-vm-actions-common-customize-hardware
|
|
90
|
+
v-show="
|
|
91
|
+
props.project === 'sphere'
|
|
92
|
+
? stepPosition === 6
|
|
93
|
+
: stepPosition === 5
|
|
94
|
+
"
|
|
95
|
+
:vm-name="vmForm.name"
|
|
96
|
+
:guest-machine-type="vmForm.guestMachineType"
|
|
97
|
+
:guest-os-family="vmForm.guestOsFamily"
|
|
98
|
+
:guest-os-version="vmForm.guestOsVersion"
|
|
99
|
+
:storage="vmForm.storage"
|
|
100
|
+
:hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
|
|
101
|
+
:cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
|
|
102
|
+
:networks-for-boot-options="virtualHardwareNetworksLocal"
|
|
103
|
+
:cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
|
|
104
|
+
:customize-hardware-submit="customizeHardwareSubmit"
|
|
105
|
+
:max-cpus="maxCpus"
|
|
106
|
+
:max-memory="maxMemory"
|
|
107
|
+
:cpu-models="cpuModels"
|
|
108
|
+
:selected-nav-item="selectedNavItem"
|
|
109
|
+
:nodes="props.nodes"
|
|
110
|
+
:files="props.files"
|
|
111
|
+
:networks-table="props.networksTable"
|
|
112
|
+
:error-validation-fields="props.errorValidationFields"
|
|
113
|
+
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
114
|
+
:datastore="props.datastore"
|
|
115
|
+
:vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
|
|
116
|
+
:passthrough-devices="props.passthroughDevices"
|
|
117
|
+
@change-boot-order="onChangeBootOrder"
|
|
118
|
+
@send-data="onChangeCustomizeHardware"
|
|
119
|
+
@get-storage="emits('get-storage', $event)"
|
|
120
|
+
@get-folders-or-files="emits('get-folders-or-files', $event)"
|
|
121
|
+
@get-active-device-child="emits('get-active-device-child', $event)"
|
|
122
|
+
@show-datastore-child="emits('show-datastore-child', $event)"
|
|
123
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
124
|
+
@get-networks-table="emits('get-networks-table', $event)"
|
|
125
|
+
@get-pci-devices="emits('get-pci-devices')"
|
|
126
|
+
@next="onNext(true)"
|
|
127
|
+
/>
|
|
128
|
+
<common-vm-actions-common-ready-to-complete
|
|
129
|
+
v-if="
|
|
130
|
+
props.project === 'sphere'
|
|
131
|
+
? stepPosition === 7
|
|
132
|
+
: stepPosition === 6
|
|
133
|
+
"
|
|
134
|
+
:ready-complete-table-info="props.readyCompleteTableInfo"
|
|
135
|
+
/>
|
|
136
|
+
|
|
137
|
+
<span
|
|
138
|
+
v-if="
|
|
139
|
+
props.project === 'sphere' ? stepPosition > 4 : stepPosition > 3
|
|
140
|
+
"
|
|
141
|
+
class="vm-hardware-version"
|
|
142
|
+
>{{ compatibilityInfo }}</span
|
|
143
|
+
>
|
|
144
|
+
</div>
|
|
118
145
|
</template>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
<!-- "-->
|
|
177
|
-
<!-- :storage-submit="storageSubmit"-->
|
|
178
|
-
<!-- :datastore="props.datastore"-->
|
|
179
|
-
<!-- :get-datastore-table-func="props.getDatastoreTableFunc"-->
|
|
180
|
-
<!-- @submit="onChangeStorageAndNext"-->
|
|
181
|
-
<!-- />-->
|
|
182
|
-
<!-- <common-vm-actions-common-select-compatibility-->
|
|
183
|
-
<!-- v-show="-->
|
|
184
|
-
<!-- props.project === 'sphere'-->
|
|
185
|
-
<!-- ? stepPosition === 4-->
|
|
186
|
-
<!-- : stepPosition === 3-->
|
|
187
|
-
<!-- "-->
|
|
188
|
-
<!-- :options="compatibility"-->
|
|
189
|
-
<!-- :error-validation-fields="props.errorValidationFields"-->
|
|
190
|
-
<!-- @change="onChangeCompatibility"-->
|
|
191
|
-
<!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
|
|
192
|
-
<!-- />-->
|
|
193
|
-
<!-- <common-vm-actions-common-select-os-->
|
|
194
|
-
<!-- v-show="-->
|
|
195
|
-
<!-- props.project === 'sphere'-->
|
|
196
|
-
<!-- ? stepPosition === 5-->
|
|
197
|
-
<!-- : stepPosition === 4-->
|
|
198
|
-
<!-- "-->
|
|
199
|
-
<!-- :families-options="guestOsFamilies"-->
|
|
200
|
-
<!-- :versions-options="guestOsVersions"-->
|
|
201
|
-
<!-- :machine-types-options="machineTypes"-->
|
|
202
|
-
<!-- :error-validation-fields="props.errorValidationFields"-->
|
|
203
|
-
<!-- @change="onChangeOs"-->
|
|
204
|
-
<!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
|
|
205
|
-
<!-- />-->
|
|
206
|
-
<!-- <common-vm-actions-common-customize-hardware-->
|
|
207
|
-
<!-- v-show="-->
|
|
208
|
-
<!-- props.project === 'sphere'-->
|
|
209
|
-
<!-- ? stepPosition === 6-->
|
|
210
|
-
<!-- : stepPosition === 5-->
|
|
211
|
-
<!-- "-->
|
|
212
|
-
<!-- :vm-name="vmForm.name"-->
|
|
213
|
-
<!-- :guest-machine-type="vmForm.guestMachineType"-->
|
|
214
|
-
<!-- :guest-os-family="vmForm.guestOsFamily"-->
|
|
215
|
-
<!-- :guest-os-version="vmForm.guestOsVersion"-->
|
|
216
|
-
<!-- :storage="vmForm.storage"-->
|
|
217
|
-
<!-- :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"-->
|
|
218
|
-
<!-- :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"-->
|
|
219
|
-
<!-- :networks-for-boot-options="virtualHardwareNetworksLocal"-->
|
|
220
|
-
<!-- :cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"-->
|
|
221
|
-
<!-- :customize-hardware-submit="customizeHardwareSubmit"-->
|
|
222
|
-
<!-- :max-cpus="maxCpus"-->
|
|
223
|
-
<!-- :max-memory="maxMemory"-->
|
|
224
|
-
<!-- :cpu-models="cpuModels"-->
|
|
225
|
-
<!-- :selected-nav-item="selectedNavItem"-->
|
|
226
|
-
<!-- :nodes="props.nodes"-->
|
|
227
|
-
<!-- :files="props.files"-->
|
|
228
|
-
<!-- :networks-table="props.networksTable"-->
|
|
229
|
-
<!-- :error-validation-fields="props.errorValidationFields"-->
|
|
230
|
-
<!-- :get-datastore-table-func="props.getDatastoreTableFunc"-->
|
|
231
|
-
<!-- :datastore="props.datastore"-->
|
|
232
|
-
<!-- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"-->
|
|
233
|
-
<!-- :passthrough-devices="props.passthroughDevices"-->
|
|
234
|
-
<!-- @change-boot-order="onChangeBootOrder"-->
|
|
235
|
-
<!-- @send-data="onChangeCustomizeHardware"-->
|
|
236
|
-
<!-- @get-storage="emits('get-storage', $event)"-->
|
|
237
|
-
<!-- @get-folders-or-files="emits('get-folders-or-files', $event)"-->
|
|
238
|
-
<!-- @get-active-device-child="emits('get-active-device-child', $event)"-->
|
|
239
|
-
<!-- @show-datastore-child="emits('show-datastore-child', $event)"-->
|
|
240
|
-
<!-- @remove-error-by-title="emits('remove-error-by-title', $event)"-->
|
|
241
|
-
<!-- @get-networks-table="emits('get-networks-table', $event)"-->
|
|
242
|
-
<!-- @get-pci-devices="emits('get-pci-devices')"-->
|
|
243
|
-
<!-- @next="onNext(true)"-->
|
|
244
|
-
<!-- />-->
|
|
245
|
-
<!-- <common-vm-actions-common-ready-to-complete-->
|
|
246
|
-
<!-- v-if="-->
|
|
247
|
-
<!-- props.project === 'sphere'-->
|
|
248
|
-
<!-- ? stepPosition === 7-->
|
|
249
|
-
<!-- : stepPosition === 6-->
|
|
250
|
-
<!-- "-->
|
|
251
|
-
<!-- :ready-complete-table-info="props.readyCompleteTableInfo"-->
|
|
252
|
-
<!-- />-->
|
|
253
|
-
|
|
254
|
-
<!-- <span-->
|
|
255
|
-
<!-- v-if="-->
|
|
256
|
-
<!-- props.project === 'sphere' ? stepPosition > 4 : stepPosition > 3-->
|
|
257
|
-
<!-- "-->
|
|
258
|
-
<!-- class="vm-hardware-version"-->
|
|
259
|
-
<!-- >{{ compatibilityInfo }}</span-->
|
|
260
|
-
<!-- >-->
|
|
261
|
-
<!-- </div>-->
|
|
262
|
-
<!-- </template>-->
|
|
263
|
-
|
|
264
|
-
<!-- <template #modalFooter>-->
|
|
265
|
-
<!-- <div class="flex-align-center flex-space-between w-100">-->
|
|
266
|
-
<!-- <div class="power-on-by-default-wrap">-->
|
|
267
|
-
<!-- <template-->
|
|
268
|
-
<!-- v-if="-->
|
|
269
|
-
<!-- props.project === 'sphere'-->
|
|
270
|
-
<!-- ? stepPosition === 7-->
|
|
271
|
-
<!-- : stepPosition === 6-->
|
|
272
|
-
<!-- "-->
|
|
273
|
-
<!-- >-->
|
|
274
|
-
<!-- <input-->
|
|
275
|
-
<!-- id="power-on-by-default"-->
|
|
276
|
-
<!-- v-model="isPowerOnByDefault"-->
|
|
277
|
-
<!-- type="checkbox"-->
|
|
278
|
-
<!-- />-->
|
|
279
|
-
<!-- <label for="power-on-by-default" class="label-text-normal">{{-->
|
|
280
|
-
<!-- localization.powerOnByDefault-->
|
|
281
|
-
<!-- }}</label>-->
|
|
282
|
-
<!-- </template>-->
|
|
283
|
-
<!-- </div>-->
|
|
284
|
-
<!-- <div class="flex-align-center">-->
|
|
285
|
-
<!-- <button-->
|
|
286
|
-
<!-- id="vm-wizard-cancel-button"-->
|
|
287
|
-
<!-- class="btn btn-link"-->
|
|
288
|
-
<!-- @click="onHideModal"-->
|
|
289
|
-
<!-- >-->
|
|
290
|
-
<!-- {{ localization.cancel }}-->
|
|
291
|
-
<!-- </button>-->
|
|
292
|
-
<!-- <button-->
|
|
293
|
-
<!-- v-show="stepPosition > 0"-->
|
|
294
|
-
<!-- id="vm-wizard-back-button"-->
|
|
295
|
-
<!-- class="btn btn-outline"-->
|
|
296
|
-
<!-- @click="onBack"-->
|
|
297
|
-
<!-- >-->
|
|
298
|
-
<!-- {{ localization.back }}-->
|
|
299
|
-
<!-- </button>-->
|
|
300
|
-
<!-- <button-->
|
|
301
|
-
<!-- v-if="stepPosition === stepItems.length - 1"-->
|
|
302
|
-
<!-- id="vm-wizard-finish-button"-->
|
|
303
|
-
<!-- class="btn btn-success"-->
|
|
304
|
-
<!-- @click="onFinish"-->
|
|
305
|
-
<!-- >-->
|
|
306
|
-
<!-- {{ localization.finish }}-->
|
|
307
|
-
<!-- </button>-->
|
|
308
|
-
<!-- <button-->
|
|
309
|
-
<!-- v-else-->
|
|
310
|
-
<!-- id="vm-wizard-next-button"-->
|
|
311
|
-
<!-- class="btn btn-primary"-->
|
|
312
|
-
<!-- @click="onNext(false)"-->
|
|
313
|
-
<!-- >-->
|
|
314
|
-
<!-- {{ localization.next }}-->
|
|
315
|
-
<!-- </button>-->
|
|
316
|
-
<!-- </div>-->
|
|
317
|
-
<!-- </div>-->
|
|
318
|
-
<!-- </template>-->
|
|
319
|
-
<!-- </atoms-modal-by-steps>-->
|
|
146
|
+
|
|
147
|
+
<template #modalFooter>
|
|
148
|
+
<div class="flex-align-center flex-space-between w-100">
|
|
149
|
+
<div class="power-on-by-default-wrap">
|
|
150
|
+
<template
|
|
151
|
+
v-if="
|
|
152
|
+
props.project === 'sphere'
|
|
153
|
+
? stepPosition === 7
|
|
154
|
+
: stepPosition === 6
|
|
155
|
+
"
|
|
156
|
+
>
|
|
157
|
+
<input
|
|
158
|
+
id="power-on-by-default"
|
|
159
|
+
v-model="isPowerOnByDefault"
|
|
160
|
+
type="checkbox"
|
|
161
|
+
/>
|
|
162
|
+
<label for="power-on-by-default" class="label-text-normal">{{
|
|
163
|
+
localization.powerOnByDefault
|
|
164
|
+
}}</label>
|
|
165
|
+
</template>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="flex-align-center">
|
|
168
|
+
<button
|
|
169
|
+
id="vm-wizard-cancel-button"
|
|
170
|
+
class="btn btn-link"
|
|
171
|
+
@click="onHideModal"
|
|
172
|
+
>
|
|
173
|
+
{{ localization.cancel }}
|
|
174
|
+
</button>
|
|
175
|
+
<button
|
|
176
|
+
v-show="stepPosition > 0"
|
|
177
|
+
id="vm-wizard-back-button"
|
|
178
|
+
class="btn btn-outline"
|
|
179
|
+
@click="onBack"
|
|
180
|
+
>
|
|
181
|
+
{{ localization.back }}
|
|
182
|
+
</button>
|
|
183
|
+
<button
|
|
184
|
+
v-if="stepPosition === stepItems.length - 1"
|
|
185
|
+
id="vm-wizard-finish-button"
|
|
186
|
+
class="btn btn-success"
|
|
187
|
+
@click="onFinish"
|
|
188
|
+
>
|
|
189
|
+
{{ localization.finish }}
|
|
190
|
+
</button>
|
|
191
|
+
<button
|
|
192
|
+
v-else
|
|
193
|
+
id="vm-wizard-next-button"
|
|
194
|
+
class="btn btn-primary"
|
|
195
|
+
@click="onNext(false)"
|
|
196
|
+
>
|
|
197
|
+
{{ localization.next }}
|
|
198
|
+
</button>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</template>
|
|
202
|
+
</atoms-modal-by-steps>
|
|
320
203
|
</div>
|
|
321
204
|
</template>
|
|
322
205
|
|
|
323
206
|
<script setup lang="ts">
|
|
324
|
-
import
|
|
325
|
-
import
|
|
326
|
-
import
|
|
327
|
-
import
|
|
328
|
-
import
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
} from '~/models/
|
|
337
|
-
import
|
|
338
|
-
|
|
207
|
+
import { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
208
|
+
import { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
|
|
209
|
+
import { API_UI_I_Error, UI_I_TablePayload } from '~/models/store/interfaces'
|
|
210
|
+
import { UI_I_FolderOrFileTreePayload } from '~/models/store/storage/interfaces'
|
|
211
|
+
import { UI_I_FileTreeNode } from '~/components/models/interfaces'
|
|
212
|
+
import { UI_I_Localization, UI_I_ArbitraryObject } from '~/models/interfaces'
|
|
213
|
+
import {
|
|
214
|
+
UI_I_VmForm,
|
|
215
|
+
UI_I_VmFormCash,
|
|
216
|
+
} from '~/components/common/vm/actions/common/models/interfaces'
|
|
217
|
+
import { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/models/interfaces'
|
|
218
|
+
import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
|
|
219
|
+
import { UI_I_OsChange } from '~/components/common/vm/actions/common/select/models/interfaces'
|
|
220
|
+
import {
|
|
221
|
+
UI_I_SendDataCpu,
|
|
222
|
+
UI_I_SendDataMemory,
|
|
223
|
+
UI_I_SendDataNewCdDvdDrive,
|
|
224
|
+
UI_I_SendDataNewHardDisk,
|
|
225
|
+
UI_I_SendDataNewNetwork,
|
|
226
|
+
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/models/interfaces'
|
|
227
|
+
import {
|
|
339
228
|
UI_T_AddVmFinishFunc,
|
|
340
229
|
UI_T_SelectedNavItem,
|
|
341
230
|
} from '~/components/common/vm/actions/common/models/types'
|
|
342
|
-
import
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
} from '~/
|
|
348
|
-
import
|
|
349
|
-
import {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
])
|
|
357
|
-
// Procurator
|
|
358
|
-
// wizard.selectedScheme = [0, 1, 4, 5, 6, 8, 9]
|
|
359
|
-
// Sphere
|
|
360
|
-
const wasCompleted = computed<boolean>(() => wizard.wasCompleted())
|
|
361
|
-
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
362
|
-
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
363
|
-
|
|
364
|
-
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
|
365
|
-
// wizard.isLastStep()
|
|
366
|
-
// ? wizard.changeSteps(value, finalValidationFunc)
|
|
367
|
-
// : wizard.changeSteps(value, validationFunc)
|
|
368
|
-
wizard.changeSteps(value, validationFunc)
|
|
369
|
-
}
|
|
370
|
-
const validationFunc = async (
|
|
371
|
-
value: UI_I_WizardStep[],
|
|
372
|
-
currentStep: UI_I_WizardStep,
|
|
373
|
-
nextStep: UI_I_WizardStep
|
|
374
|
-
): Promise<UI_I_ValidationReturn> => {
|
|
375
|
-
let stepHasError = false
|
|
376
|
-
let stepShouldStop = {
|
|
377
|
-
ifOnCurrentStep: false,
|
|
378
|
-
ifFromAnyStep: false,
|
|
379
|
-
stoppageStepId: -1,
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
wizard.setLoader(true)
|
|
383
|
-
if (
|
|
384
|
-
wizard.isValidateForStep(1, currentStep.id, nextStep.id) ||
|
|
385
|
-
wizard.isValidateForStep(2, currentStep.id, nextStep.id)
|
|
386
|
-
) {
|
|
387
|
-
let nameValidation: any = {}
|
|
388
|
-
|
|
389
|
-
nameValidation = await checkName(value)
|
|
390
|
-
console.log(nameValidation, 111)
|
|
391
|
-
|
|
392
|
-
value = nameValidation.value
|
|
393
|
-
stepHasError = stepHasError || nameValidation.stepHasError
|
|
394
|
-
if (stepHasError) stepShouldStop.stoppageStepId = 1
|
|
395
|
-
} else if (wizard.isValidateForStep(4, currentStep.id, nextStep.id)) {
|
|
396
|
-
let storageValidation: any = {}
|
|
397
|
-
|
|
398
|
-
storageValidation = await checkStorage(value)
|
|
399
|
-
console.log(storageValidation, 222)
|
|
400
|
-
|
|
401
|
-
value = storageValidation.value
|
|
402
|
-
|
|
403
|
-
stepShouldStop = storageValidation.stepShouldStop
|
|
404
|
-
|
|
405
|
-
stepHasError = stepHasError || storageValidation.stepHasError
|
|
406
|
-
if (stepHasError) stepShouldStop.stoppageStepId = 4
|
|
407
|
-
}
|
|
408
|
-
wizard.setLoader(false)
|
|
409
|
-
|
|
410
|
-
console.log(777, {
|
|
411
|
-
newValue: value,
|
|
412
|
-
stepHasError,
|
|
413
|
-
stepShouldStop,
|
|
414
|
-
})
|
|
415
|
-
return {
|
|
416
|
-
newValue: value,
|
|
417
|
-
stepHasError,
|
|
418
|
-
stepShouldStop,
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
const checkName = async (
|
|
422
|
-
value: UI_I_WizardStep[],
|
|
423
|
-
): Promise<any> => {
|
|
424
|
-
let stepHasError = false
|
|
425
|
-
|
|
426
|
-
return new Promise((resolve) => {
|
|
427
|
-
nameFormSubmit.value = (isValid: boolean) => {
|
|
428
|
-
if (!isValid) {
|
|
429
|
-
stepHasError = wizard.setValidation(1, 'name', {
|
|
430
|
-
fieldMessage: '',
|
|
431
|
-
alertMessage: '',
|
|
432
|
-
})
|
|
433
|
-
}
|
|
231
|
+
import {
|
|
232
|
+
UI_I_OptionItem,
|
|
233
|
+
UI_I_VerticalStepItem,
|
|
234
|
+
} from '~/components/atoms/models/interfaces'
|
|
235
|
+
import { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
236
|
+
import { UI_I_ConfigurePciDevicesTable } from '~/models/store/host/interfaces'
|
|
237
|
+
import { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/models/types'
|
|
238
|
+
import { UI_T_Project } from '~/models/types'
|
|
239
|
+
import { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
240
|
+
import { capabilities } from '~/components/common/vm/actions/common/config/capabilities'
|
|
241
|
+
import {
|
|
242
|
+
stepItemsFunc,
|
|
243
|
+
subTitleFunc,
|
|
244
|
+
} from '~/components/common/vm/actions/add/utils'
|
|
434
245
|
|
|
435
|
-
resolve({
|
|
436
|
-
value,
|
|
437
|
-
stepHasError,
|
|
438
|
-
})
|
|
439
|
-
}
|
|
440
|
-
})
|
|
441
|
-
}
|
|
442
|
-
const checkStorage = async (
|
|
443
|
-
value: UI_I_WizardStep[],
|
|
444
|
-
): Promise<any> => {
|
|
445
|
-
let stepHasError = false
|
|
446
|
-
|
|
447
|
-
return new Promise((resolve) => {
|
|
448
|
-
storageSubmit.value = (isValid: boolean) => {
|
|
449
|
-
if (!isValid) {
|
|
450
|
-
stepHasError = wizard.setValidation(4, 'storage', {
|
|
451
|
-
fieldMessage: '',
|
|
452
|
-
alertMessage: '',
|
|
453
|
-
})
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
resolve({
|
|
457
|
-
newValue: value,
|
|
458
|
-
stepHasError,
|
|
459
|
-
})
|
|
460
|
-
}
|
|
461
|
-
})
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// import { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
465
|
-
// import { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
|
|
466
|
-
// import { API_UI_I_Error, UI_I_TablePayload } from '~/models/store/interfaces'
|
|
467
|
-
// import { UI_I_FolderOrFileTreePayload } from '~/models/store/storage/interfaces'
|
|
468
|
-
// import { UI_I_FileTreeNode } from '~/components/models/interfaces'
|
|
469
|
-
// import { UI_I_Localization, UI_I_ArbitraryObject } from '~/models/interfaces'
|
|
470
|
-
// import {
|
|
471
|
-
// UI_I_VmForm,
|
|
472
|
-
// UI_I_VmFormCash,
|
|
473
|
-
// } from '~/components/common/vm/actions/common/models/interfaces'
|
|
474
|
-
// import { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/models/interfaces'
|
|
475
|
-
// import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
|
|
476
|
-
// import { UI_I_OsChange } from '~/components/common/vm/actions/common/select/models/interfaces'
|
|
477
|
-
// import {
|
|
478
|
-
// UI_I_SendDataCpu,
|
|
479
|
-
// UI_I_SendDataMemory,
|
|
480
|
-
// UI_I_SendDataNewCdDvdDrive,
|
|
481
|
-
// UI_I_SendDataNewHardDisk,
|
|
482
|
-
// UI_I_SendDataNewNetwork,
|
|
483
|
-
// } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/models/interfaces'
|
|
484
|
-
// import {
|
|
485
|
-
// UI_T_AddVmFinishFunc,
|
|
486
|
-
// UI_T_SelectedNavItem,
|
|
487
|
-
// } from '~/components/common/vm/actions/common/models/types'
|
|
488
|
-
// import {
|
|
489
|
-
// UI_I_OptionItem,
|
|
490
|
-
// UI_I_VerticalStepItem,
|
|
491
|
-
// } from '~/components/atoms/models/interfaces'
|
|
492
|
-
// import { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
493
|
-
// import { UI_I_ConfigurePciDevicesTable } from '~/models/store/host/interfaces'
|
|
494
|
-
// import { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/models/types'
|
|
495
|
-
// import { UI_T_Project } from '~/models/types'
|
|
496
|
-
// import { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
497
|
-
// import { capabilities } from '~/components/common/vm/actions/common/config/capabilities'
|
|
498
|
-
// import {
|
|
499
|
-
// stepItemsFunc,
|
|
500
|
-
// subTitleFunc,
|
|
501
|
-
// } from '~/components/common/vm/actions/add/utils'
|
|
502
|
-
//
|
|
503
246
|
const props = defineProps<{
|
|
504
247
|
project: UI_T_Project
|
|
505
248
|
nodes: UI_I_FileTreeNode[]
|
|
@@ -521,7 +264,7 @@ const props = defineProps<{
|
|
|
521
264
|
computeResource?: UI_I_TreeNode // для сферы
|
|
522
265
|
computeResourceTree?: UI_I_TreeNode[] // для сферы
|
|
523
266
|
}>()
|
|
524
|
-
|
|
267
|
+
|
|
525
268
|
const emits = defineEmits<{
|
|
526
269
|
(event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
|
|
527
270
|
(event: 'get-storage', value: UI_I_TablePayload): void
|
|
@@ -540,304 +283,301 @@ const emits = defineEmits<{
|
|
|
540
283
|
(event: 'select-compute-resource-tree', value: UI_I_TreeNode): void // для сферы
|
|
541
284
|
(event: 'clear-compute-resource-tree'): void // для сферы
|
|
542
285
|
}>()
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
//
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
//
|
|
616
|
-
//
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
// data[1] !== null && (stepPosition.value = data[1])
|
|
710
|
-
// })
|
|
711
|
-
// }
|
|
286
|
+
|
|
287
|
+
const { $recursion } = useNuxtApp()
|
|
288
|
+
|
|
289
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
290
|
+
|
|
291
|
+
const stepPosition = ref<number>(0)
|
|
292
|
+
watch(stepPosition, (newValue) => {
|
|
293
|
+
if (props.project === 'sphere' ? newValue === 7 : newValue === 6)
|
|
294
|
+
validateSendData()
|
|
295
|
+
})
|
|
296
|
+
const stepItems = ref<UI_I_VerticalStepItem[]>([])
|
|
297
|
+
stepItems.value = stepItemsFunc(localization.value, props.project)
|
|
298
|
+
|
|
299
|
+
const subTitle: string[] = subTitleFunc(localization.value, props.project)
|
|
300
|
+
const stepSubTitle = computed<string>(() => subTitle[stepPosition.value])
|
|
301
|
+
|
|
302
|
+
const storageIdCash = ref<string | null>(null)
|
|
303
|
+
const vmForm = ref<UI_I_VmForm>({
|
|
304
|
+
name: '',
|
|
305
|
+
compatibility: '',
|
|
306
|
+
guestMachineType: null,
|
|
307
|
+
guestOsFamily: null,
|
|
308
|
+
guestOsVersion: null,
|
|
309
|
+
computeResource: null,
|
|
310
|
+
storage: null,
|
|
311
|
+
locationPath: '',
|
|
312
|
+
dataCenter: null,
|
|
313
|
+
})
|
|
314
|
+
const vmFormCash = ref<UI_I_VmFormCash>({
|
|
315
|
+
dataCenterId: null,
|
|
316
|
+
computeResourceTypeAndId: null,
|
|
317
|
+
})
|
|
318
|
+
|
|
319
|
+
const isPowerOnByDefault = ref<boolean>(true)
|
|
320
|
+
|
|
321
|
+
const onChangeNameAndNext = (name: string, node: UI_I_TreeNode): void => {
|
|
322
|
+
const hasChanges = vmFormCash.value.dataCenterId !== node?.id
|
|
323
|
+
if (hasChanges) checkLocalChangeAndChangeStepStatus()
|
|
324
|
+
|
|
325
|
+
vmForm.value.name = name
|
|
326
|
+
if (props.project === 'sphere') {
|
|
327
|
+
vmForm.value.locationPath = $recursion.createAbsolutePathRecursion(
|
|
328
|
+
node,
|
|
329
|
+
'id',
|
|
330
|
+
'parent'
|
|
331
|
+
)
|
|
332
|
+
vmForm.value.dataCenter = $recursion.findParentByValue(
|
|
333
|
+
node,
|
|
334
|
+
'datacenter',
|
|
335
|
+
'type',
|
|
336
|
+
'parent'
|
|
337
|
+
)
|
|
338
|
+
vmFormCash.value.dataCenterId = vmForm.value.dataCenter?.id || null
|
|
339
|
+
}
|
|
340
|
+
onNext(true)
|
|
341
|
+
}
|
|
342
|
+
// Для сферы
|
|
343
|
+
const computeResourcePath = ref<string>('')
|
|
344
|
+
const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
|
|
345
|
+
emits('select-compute-resource-tree', node)
|
|
346
|
+
computeResourcePath.value = $recursion.createAbsolutePathRecursion(
|
|
347
|
+
node,
|
|
348
|
+
'id',
|
|
349
|
+
'parent'
|
|
350
|
+
)
|
|
351
|
+
}
|
|
352
|
+
const changeComputeResourceAndNext = (node: UI_I_TreeNode): void => {
|
|
353
|
+
const hasChanges =
|
|
354
|
+
`${node.type}${node.id}` !== vmFormCash.value.computeResourceTypeAndId
|
|
355
|
+
if (hasChanges) checkLocalChangeAndChangeStepStatus()
|
|
356
|
+
|
|
357
|
+
vmForm.value.computeResource = node
|
|
358
|
+
// const type = node.type.toUpperCase()
|
|
359
|
+
// schedRequirementsTemplate.value = `sched_requirements="(${type}_ID=${node.id})"\\`
|
|
360
|
+
vmFormCash.value.computeResourceTypeAndId = `${node.type}${node.id}` || null
|
|
361
|
+
|
|
362
|
+
onNext(true)
|
|
363
|
+
}
|
|
364
|
+
const onChangeStorageAndNext = (
|
|
365
|
+
storage: UI_I_DatastoreTableItem | null
|
|
366
|
+
): void => {
|
|
367
|
+
if (!storage) return
|
|
368
|
+
|
|
369
|
+
const hasChanges = storage.id !== storageIdCash.value
|
|
370
|
+
if (hasChanges) checkLocalChangeAndChangeStepStatus()
|
|
371
|
+
|
|
372
|
+
vmForm.value.storage = storage
|
|
373
|
+
storageIdCash.value = storage.id
|
|
374
|
+
|
|
375
|
+
onNext(true)
|
|
376
|
+
}
|
|
377
|
+
const compatibilityInfo = ref<string>('')
|
|
378
|
+
const onChangeCompatibility = (compatibility: UI_I_OptionItem): void => {
|
|
379
|
+
vmForm.value.compatibility = compatibility.value
|
|
380
|
+
|
|
381
|
+
const version = compatibility.value.split('-')[1]
|
|
382
|
+
compatibilityInfo.value = `${localization.value.compatibility}: ${compatibility.text} (${localization.value.vmVersion} ${version})`
|
|
383
|
+
}
|
|
384
|
+
const onChangeOs = (data: UI_I_OsChange): void => {
|
|
385
|
+
vmForm.value.guestMachineType = data.selectedMachineType
|
|
386
|
+
vmForm.value.guestOsFamily = data.selectedOS
|
|
387
|
+
vmForm.value.guestOsVersion = data.selectedVersion
|
|
388
|
+
}
|
|
389
|
+
const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
|
|
390
|
+
const onChangeCustomizeHardware = (
|
|
391
|
+
data: UI_I_SendDataCustomizeHardware
|
|
392
|
+
): void => {
|
|
393
|
+
customizeHardware.value = data
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
const virtualHardwareHardDisksLocal = computed<
|
|
397
|
+
UI_I_SendDataNewHardDisk[] | null
|
|
398
|
+
>(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
|
|
399
|
+
const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
|
|
400
|
+
() => customizeHardware.value?.virtualHardware?.networks || null
|
|
401
|
+
)
|
|
402
|
+
const virtualHardwareCdDvdDrivesLocal = computed<
|
|
403
|
+
UI_I_SendDataNewCdDvdDrive[] | null
|
|
404
|
+
>(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
|
|
405
|
+
|
|
406
|
+
const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
|
|
407
|
+
() => customizeHardware.value?.virtualHardware?.cpu || null
|
|
408
|
+
)
|
|
409
|
+
const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
|
|
410
|
+
() => customizeHardware.value?.virtualHardware?.memory || null
|
|
411
|
+
)
|
|
412
|
+
const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
|
|
413
|
+
const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
|
|
414
|
+
null
|
|
415
|
+
)
|
|
416
|
+
const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
|
|
417
|
+
const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
|
|
418
|
+
virtualHardwareHardDisks.value = data[0]
|
|
419
|
+
virtualHardwareCdDvdDrives.value = data[1]
|
|
420
|
+
virtualHardwareNetworks.value = data[2]
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
watch(() => props.vmNameInWizard, (newValue) => {
|
|
424
|
+
vmForm.value.name = newValue
|
|
425
|
+
})
|
|
426
|
+
|
|
427
|
+
const loading = ref<boolean>(false)
|
|
428
|
+
const validateSendData = (): void => {
|
|
429
|
+
loading.value = true
|
|
430
|
+
props
|
|
431
|
+
.validateSendDataFunc(
|
|
432
|
+
vmForm.value,
|
|
433
|
+
virtualHardwareCpu.value,
|
|
434
|
+
virtualHardwareMemory.value,
|
|
435
|
+
customizeHardware.value,
|
|
436
|
+
virtualHardwareNetworks.value,
|
|
437
|
+
virtualHardwareHardDisks.value,
|
|
438
|
+
virtualHardwareCdDvdDrives.value,
|
|
439
|
+
isPowerOnByDefault.value,
|
|
440
|
+
localization.value,
|
|
441
|
+
vmForm.value.locationPath, // для сферы
|
|
442
|
+
computeResourcePath.value // для сферы
|
|
443
|
+
)
|
|
444
|
+
.then((data) => {
|
|
445
|
+
loading.value = false
|
|
446
|
+
if (!data) return
|
|
447
|
+
|
|
448
|
+
selectedNavItem.value = data[0]
|
|
449
|
+
data[1] !== null && (stepPosition.value = data[1])
|
|
450
|
+
})
|
|
451
|
+
}
|
|
712
452
|
const onFinish = (): void => {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
453
|
+
loading.value = true
|
|
454
|
+
props
|
|
455
|
+
.finishFunc(
|
|
456
|
+
vmForm.value,
|
|
457
|
+
virtualHardwareCpu.value,
|
|
458
|
+
virtualHardwareMemory.value,
|
|
459
|
+
customizeHardware.value,
|
|
460
|
+
virtualHardwareNetworks.value,
|
|
461
|
+
virtualHardwareHardDisks.value,
|
|
462
|
+
virtualHardwareCdDvdDrives.value,
|
|
463
|
+
isPowerOnByDefault.value,
|
|
464
|
+
localization.value,
|
|
465
|
+
vmForm.value.locationPath, // для сферы
|
|
466
|
+
computeResourcePath.value, // для сферы
|
|
467
|
+
false
|
|
468
|
+
)
|
|
469
|
+
.then(() => {
|
|
470
|
+
onHideModal()
|
|
471
|
+
loading.value = false
|
|
472
|
+
})
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
|
|
476
|
+
|
|
477
|
+
const nameFormSubmit = ref<number>(0)
|
|
478
|
+
const computeResourceSubmit = ref<number>(0)
|
|
479
|
+
const storageSubmit = ref<number>(0)
|
|
480
|
+
const customizeHardwareSubmit = ref<number>(0)
|
|
481
|
+
const onNext = (force = false): void => {
|
|
482
|
+
const isValid = checkSubmit(force)
|
|
483
|
+
if (!isValid) {
|
|
484
|
+
return
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
const isDisabled = stepItems.value[cashStep]?.disabled
|
|
488
|
+
if (cashStep !== -1 && !isDisabled) {
|
|
489
|
+
stepPosition.value = cashStep
|
|
490
|
+
cashStep = -1
|
|
491
|
+
return
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
stepItems.value[stepPosition.value].complete = true
|
|
495
|
+
stepItems.value[stepPosition.value + 1].disabled = false
|
|
496
|
+
stepPosition.value++
|
|
733
497
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
// const onBack = (): void => {
|
|
818
|
-
// stepPosition.value--
|
|
819
|
-
// }
|
|
820
|
-
// let cashStep = -1
|
|
821
|
-
// const onChangeStep = (key: number): void => {
|
|
822
|
-
// const isValid = checkSubmitByManual(key)
|
|
823
|
-
// if (!isValid) {
|
|
824
|
-
// cashStep = key
|
|
825
|
-
// return
|
|
826
|
-
// }
|
|
827
|
-
//
|
|
828
|
-
// stepPosition.value = key
|
|
829
|
-
// }
|
|
830
|
-
//
|
|
831
|
-
// const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
|
|
832
|
-
// const guestOsFamilies = ref<UI_I_OptionItem[]>(capabilities.guestOsFamilies)
|
|
833
|
-
// const guestOsVersions = ref<UI_I_ArbitraryObject<UI_I_OptionItem[]>>(
|
|
834
|
-
// capabilities.guestOsVersions
|
|
835
|
-
// )
|
|
836
|
-
// const machineTypes = ref<UI_I_OptionItem[]>(capabilities.machineTypes)
|
|
837
|
-
// const cpuModels = ref<UI_I_OptionItem[]>(capabilities.cpuModels)
|
|
838
|
-
// const maxCpus = ref<number>(capabilities.maxCpus)
|
|
839
|
-
// const maxMemory = ref<number>(capabilities.maxMemory)
|
|
840
|
-
//
|
|
498
|
+
const checkLocalChangeAndChangeStepStatus = (): void => {
|
|
499
|
+
stepItems.value = stepItems.value.map((step, index) => {
|
|
500
|
+
if (index > stepPosition.value) {
|
|
501
|
+
step.complete = false
|
|
502
|
+
step.disabled = index > stepPosition.value + 1
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
return step
|
|
506
|
+
})
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const checkSubmit = (force = false): boolean => {
|
|
510
|
+
if (stepPosition.value === 1 && !force) {
|
|
511
|
+
nameFormSubmit.value++
|
|
512
|
+
return false
|
|
513
|
+
}
|
|
514
|
+
if (props.project === 'sphere' && stepPosition.value === 2 && !force) {
|
|
515
|
+
computeResourceSubmit.value++
|
|
516
|
+
return false
|
|
517
|
+
}
|
|
518
|
+
if (
|
|
519
|
+
(props.project === 'sphere'
|
|
520
|
+
? stepPosition.value === 3
|
|
521
|
+
: stepPosition.value === 2) &&
|
|
522
|
+
!force
|
|
523
|
+
) {
|
|
524
|
+
storageSubmit.value++
|
|
525
|
+
return false
|
|
526
|
+
}
|
|
527
|
+
if (
|
|
528
|
+
(props.project === 'sphere'
|
|
529
|
+
? stepPosition.value === 6
|
|
530
|
+
: stepPosition.value === 5) &&
|
|
531
|
+
!force
|
|
532
|
+
) {
|
|
533
|
+
customizeHardwareSubmit.value++
|
|
534
|
+
return false
|
|
535
|
+
}
|
|
536
|
+
return true
|
|
537
|
+
}
|
|
538
|
+
const checkSubmitByManual = (step: number): boolean => {
|
|
539
|
+
if (stepPosition.value === 1) {
|
|
540
|
+
nameFormSubmit.value++
|
|
541
|
+
return false
|
|
542
|
+
}
|
|
543
|
+
if (
|
|
544
|
+
props.project === 'sphere'
|
|
545
|
+
? stepPosition.value === 3
|
|
546
|
+
: stepPosition.value === 2
|
|
547
|
+
) {
|
|
548
|
+
storageSubmit.value++
|
|
549
|
+
return false
|
|
550
|
+
}
|
|
551
|
+
if (props.project === 'sphere' ? step === 8 : step === 7) {
|
|
552
|
+
customizeHardwareSubmit.value++
|
|
553
|
+
return false
|
|
554
|
+
}
|
|
555
|
+
return true
|
|
556
|
+
}
|
|
557
|
+
const onBack = (): void => {
|
|
558
|
+
stepPosition.value--
|
|
559
|
+
}
|
|
560
|
+
let cashStep = -1
|
|
561
|
+
const onChangeStep = (key: number): void => {
|
|
562
|
+
const isValid = checkSubmitByManual(key)
|
|
563
|
+
if (!isValid) {
|
|
564
|
+
cashStep = key
|
|
565
|
+
return
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
stepPosition.value = key
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
|
|
572
|
+
const guestOsFamilies = ref<UI_I_OptionItem[]>(capabilities.guestOsFamilies)
|
|
573
|
+
const guestOsVersions = ref<UI_I_ArbitraryObject<UI_I_OptionItem[]>>(
|
|
574
|
+
capabilities.guestOsVersions
|
|
575
|
+
)
|
|
576
|
+
const machineTypes = ref<UI_I_OptionItem[]>(capabilities.machineTypes)
|
|
577
|
+
const cpuModels = ref<UI_I_OptionItem[]>(capabilities.cpuModels)
|
|
578
|
+
const maxCpus = ref<number>(capabilities.maxCpus)
|
|
579
|
+
const maxMemory = ref<number>(capabilities.maxMemory)
|
|
580
|
+
|
|
841
581
|
const onHideModal = (): void => {
|
|
842
582
|
emits('hide')
|
|
843
583
|
}
|