bfg-common 1.5.577 → 1.5.578
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/common/vm/actions/add/Add.vue +886 -960
- package/components/common/vm/actions/add/New.vue +16 -54
- package/components/common/vm/actions/add/Old.vue +16 -55
- package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
- package/components/common/vm/actions/clone/Clone.vue +744 -816
- package/components/common/vm/actions/clone/new/New.vue +14 -50
- package/components/common/vm/actions/clone/old/Old.vue +16 -52
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +14 -81
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +7 -56
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +8 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +211 -206
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +225 -120
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +220 -118
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +66 -53
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +139 -159
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +8 -15
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +8 -13
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +62 -75
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +241 -149
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +3 -4
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +2 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +62 -100
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +6 -17
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +6 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +6 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +17 -39
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +6 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +6 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
- package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +6 -93
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +8 -60
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +8 -58
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +5 -69
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +12 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +12 -33
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +114 -132
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +41 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +44 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +8 -23
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +21 -31
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +26 -34
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +28 -34
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +24 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +8 -112
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapNew.vue → New.vue} +6 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapOld.vue → Old.vue} +5 -5
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +6 -7
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +9 -27
- package/components/common/vm/actions/common/lib/models/interfaces.ts +58 -25
- package/components/common/vm/actions/common/select/options/New.vue +258 -258
- package/components/common/vm/actions/common/select/options/Old.vue +103 -103
- package/components/common/vm/actions/common/select/options/Options.vue +54 -54
- package/components/common/vm/actions/editSettings/EditSettings.vue +32 -90
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +14 -41
- package/components/common/vm/actions/editSettings/new/New.vue +14 -41
- package/components/common/vm/actions/lib/models/interfaces.ts +4 -29
- package/components/common/vm/actions/lib/utils.ts +64 -36
- package/package.json +1 -1
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordNew.vue → New.vue} +0 -0
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordOld.vue → Old.vue} +0 -0
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-new
|
|
3
3
|
v-if="isNewView"
|
|
4
4
|
v-model:delete-files-from-datastore="deleteFilesFromDatastore"
|
|
5
|
-
v-model:size="
|
|
5
|
+
v-model:size="sizeLocal"
|
|
6
6
|
v-model:hard-disk-type="hardDiskType"
|
|
7
|
-
v-model:disk-provisioning="
|
|
8
|
-
v-model:sharing="
|
|
7
|
+
v-model:disk-provisioning="provisionType"
|
|
8
|
+
v-model:sharing="sharingLocal"
|
|
9
9
|
v-model:limit-iops="limitIops"
|
|
10
10
|
v-model:limit-iops-type="limitIopsType"
|
|
11
11
|
v-model:limit-iops-invalid="limitIopsInvalid"
|
|
12
12
|
v-model:disk-mode="diskMode"
|
|
13
13
|
v-model:cache="cache"
|
|
14
14
|
v-model:bus="bus"
|
|
15
|
+
v-model:source="source"
|
|
15
16
|
:is-removable="isRemovable"
|
|
16
17
|
:label="label"
|
|
17
18
|
:hard-disk-invalid="hardDiskInvalid"
|
|
@@ -36,7 +37,6 @@
|
|
|
36
37
|
:error-validation-fields="props.errorValidationFields"
|
|
37
38
|
:index="props.index"
|
|
38
39
|
:type="props.type"
|
|
39
|
-
:hard-disk="props.hardDisk"
|
|
40
40
|
:guest-machine-type="props.guestMachineType"
|
|
41
41
|
:compute-resource="props.computeResource"
|
|
42
42
|
@remove="emits('remove')"
|
|
@@ -48,16 +48,17 @@
|
|
|
48
48
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-old
|
|
49
49
|
v-else
|
|
50
50
|
v-model:delete-files-from-datastore="deleteFilesFromDatastore"
|
|
51
|
-
v-model:size="
|
|
51
|
+
v-model:size="sizeLocal"
|
|
52
52
|
v-model:hard-disk-type="hardDiskType"
|
|
53
|
-
v-model:disk-provisioning="
|
|
54
|
-
v-model:sharing="
|
|
53
|
+
v-model:disk-provisioning="provisionType"
|
|
54
|
+
v-model:sharing="sharingLocal"
|
|
55
55
|
v-model:limit-iops="limitIops"
|
|
56
56
|
v-model:limit-iops-type="limitIopsType"
|
|
57
57
|
v-model:limit-iops-invalid="limitIopsInvalid"
|
|
58
58
|
v-model:disk-mode="diskMode"
|
|
59
59
|
v-model:cache="cache"
|
|
60
60
|
v-model:bus="bus"
|
|
61
|
+
v-model:source="source"
|
|
61
62
|
:is-removable="isRemovable"
|
|
62
63
|
:label="label"
|
|
63
64
|
:hard-disk-invalid="hardDiskInvalid"
|
|
@@ -82,7 +83,6 @@
|
|
|
82
83
|
:error-validation-fields="props.errorValidationFields"
|
|
83
84
|
:index="props.index"
|
|
84
85
|
:type="props.type"
|
|
85
|
-
:hard-disk="props.hardDisk"
|
|
86
86
|
:guest-machine-type="props.guestMachineType"
|
|
87
87
|
:compute-resource="props.computeResource"
|
|
88
88
|
:disabled="false"
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
|
|
97
97
|
<script setup lang="ts">
|
|
98
98
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
99
|
-
import type {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
99
|
+
// import type {
|
|
100
|
+
// UI_I_SendDataNewHardDisk,
|
|
101
|
+
// UI_I_SendDataNewHardDiskStorage,
|
|
102
|
+
// } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
103
103
|
import type { UI_T_HardDiskType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
|
|
104
104
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
105
105
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
@@ -108,10 +108,61 @@ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
|
108
108
|
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
|
109
109
|
import { binaryOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/binaryOptions'
|
|
110
110
|
|
|
111
|
+
const size = defineModel<number>('size', { required: true })
|
|
112
|
+
const initialSize = size.value
|
|
113
|
+
// const provisionType = ref<string>('thick')
|
|
114
|
+
const provisionType = defineModel<string>('provisionType', { required: true })
|
|
115
|
+
// const sharing = ref<string>('')
|
|
116
|
+
const sharing = defineModel<boolean>('sharing', { required: true })
|
|
117
|
+
// const sharingLocal = ref<string>(sharing.value ? 'yes' : '')
|
|
118
|
+
const sharingLocal = computed<string>({
|
|
119
|
+
set(newValue) {
|
|
120
|
+
sharing.value = newValue === 'yes'
|
|
121
|
+
},
|
|
122
|
+
get() {
|
|
123
|
+
return sharing.value ? 'yes' : ''
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
// const shares = ref<number>(0)
|
|
127
|
+
const shares = defineModel<number>('shares', { required: true })
|
|
128
|
+
|
|
129
|
+
// const limitIops = ref<number>(16)
|
|
130
|
+
const limitIops = defineModel<number>('limitIops', { required: true })
|
|
131
|
+
const limitIopsType = ref<string>('unlimited') // ??
|
|
132
|
+
const limitIopsInvalid = ref<boolean>(false) // ??
|
|
133
|
+
|
|
134
|
+
// const diskMode = ref<string>('dependent')
|
|
135
|
+
const diskMode = defineModel<string>('diskMode', { required: true })
|
|
136
|
+
|
|
137
|
+
// const cache = ref<string>('none')
|
|
138
|
+
const cache = defineModel<string>('cache', { required: true })
|
|
139
|
+
|
|
140
|
+
// const bus = ref<string>('ide')
|
|
141
|
+
const bus = defineModel<string>('bus', { required: true })
|
|
142
|
+
|
|
143
|
+
// const readOnly = ref<boolean>(false)
|
|
144
|
+
const readOnly = defineModel<boolean>('readOnly', { required: true })
|
|
145
|
+
|
|
146
|
+
// const discard = ref<string>('')
|
|
147
|
+
const discard = defineModel<string>('discard', { required: true })
|
|
148
|
+
|
|
149
|
+
// const io = ref<string>('')
|
|
150
|
+
const io = defineModel<string>('io', { required: true })
|
|
151
|
+
|
|
152
|
+
// const target = ref<string>('')
|
|
153
|
+
const target = defineModel<string>('target', { required: true })
|
|
154
|
+
|
|
155
|
+
const source = defineModel<string>('source', { required: true })
|
|
156
|
+
|
|
157
|
+
const storage = defineModel<any>('storage', { required: true })
|
|
158
|
+
|
|
159
|
+
const remove = defineModel<boolean>('remove', { required: true })
|
|
160
|
+
const detach = defineModel<boolean>('detach', { required: true })
|
|
161
|
+
|
|
111
162
|
const props = withDefaults(
|
|
112
163
|
defineProps<{
|
|
113
|
-
|
|
114
|
-
hardDisk: UI_I_SendDataNewHardDisk
|
|
164
|
+
mainStorage: UI_I_DatastoreTableItem | null
|
|
165
|
+
// hardDisk: UI_I_SendDataNewHardDisk
|
|
115
166
|
type: UI_T_HardDiskType
|
|
116
167
|
index: number
|
|
117
168
|
errorValidationFields: UI_I_ErrorValidationField[]
|
|
@@ -130,13 +181,18 @@ const props = withDefaults(
|
|
|
130
181
|
}
|
|
131
182
|
)
|
|
132
183
|
const emits = defineEmits<{
|
|
133
|
-
(event: 'send-data', value: UI_I_SendDataNewHardDisk): void
|
|
184
|
+
// (event: 'send-data', value: UI_I_SendDataNewHardDisk): void
|
|
134
185
|
(event: 'invalid', value: boolean): void
|
|
135
186
|
(event: 'remove'): void
|
|
136
187
|
(event: 'roll-back'): void
|
|
137
188
|
(event: 'remove-error-by-title', value: string): void
|
|
138
189
|
}>()
|
|
139
190
|
|
|
191
|
+
watch(() => props.type, (newValue) => {
|
|
192
|
+
detach.value = newValue === 'removed'
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
|
|
140
196
|
const { $store, $binary }: any = useNuxtApp()
|
|
141
197
|
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
142
198
|
|
|
@@ -180,23 +236,24 @@ const label = computed<string>(() => {
|
|
|
180
236
|
})
|
|
181
237
|
|
|
182
238
|
const maxHardDisk = computed<number>(() => {
|
|
183
|
-
const hardDiskSizeMb = $binary.gbToMb(props.hardDisk.size)
|
|
239
|
+
// const hardDiskSizeMb = $binary.gbToMb(props.hardDisk.size)
|
|
184
240
|
|
|
185
|
-
if (props.type === 'exist') return
|
|
241
|
+
if (props.type === 'exist') return initialSize
|
|
186
242
|
|
|
187
|
-
if (!
|
|
188
|
-
const free =
|
|
243
|
+
if (!storageLocal.value) return 0
|
|
244
|
+
const free = (storageLocal.value.capacity.free_mb ||
|
|
245
|
+
storageLocal.value.capacity) as number // TODO fix
|
|
189
246
|
|
|
190
|
-
if (props.isEdit) return free +
|
|
247
|
+
if (props.isEdit) return free + initialSize
|
|
191
248
|
|
|
192
249
|
return free
|
|
193
250
|
})
|
|
194
251
|
const hardDiskTypeErrorLocalText = computed<string>(() => {
|
|
195
|
-
if (
|
|
252
|
+
if (size.value > maxHardDisk.value) {
|
|
196
253
|
return localization.value.common.diskCapacitySpecifiedGreater
|
|
197
254
|
}
|
|
198
255
|
|
|
199
|
-
if (
|
|
256
|
+
if (size.value <= 0) {
|
|
200
257
|
return localization.value.common.diskCapacityCannotZero
|
|
201
258
|
}
|
|
202
259
|
|
|
@@ -217,25 +274,38 @@ const hardDiskLocalAndApiErrorsTexts = computed<string>(() => {
|
|
|
217
274
|
})
|
|
218
275
|
|
|
219
276
|
const deleteFilesFromDatastore = ref<boolean>(false)
|
|
277
|
+
watch(deleteFilesFromDatastore, (newValue) => {
|
|
278
|
+
remove.value = props.type === 'removed' && newValue
|
|
279
|
+
})
|
|
220
280
|
|
|
221
|
-
const hardDiskType = ref<string>('gb')
|
|
281
|
+
const hardDiskType = ref<string>(size.value < 1024 ? 'mb' : 'gb')
|
|
282
|
+
watch(hardDiskType, (newValue) => {
|
|
283
|
+
size.value = $binary.universalFromTo(sizeLocal.value, newValue, 'mb')
|
|
284
|
+
})
|
|
222
285
|
const hardDiskTypeOptions = ref<UI_I_OptionItem[]>(
|
|
223
286
|
binaryOptionsFunc(localization.value)
|
|
224
287
|
)
|
|
225
288
|
|
|
226
|
-
const
|
|
227
|
-
|
|
289
|
+
const sizeLocal = ref<number>(size.value < 1024 ? size.value : $binary.mbToGb(size.value))
|
|
290
|
+
watch(sizeLocal, (newValue) => {
|
|
228
291
|
if (hardDiskType.value === 'mb') {
|
|
229
|
-
|
|
292
|
+
size.value = newValue
|
|
230
293
|
}
|
|
231
294
|
|
|
232
|
-
|
|
295
|
+
size.value = $binary.universalFromTo(newValue, hardDiskType.value, 'mb')
|
|
233
296
|
})
|
|
297
|
+
// const sizeInMb = computed<number>(() => {
|
|
298
|
+
// if (hardDiskType.value === 'mb') {
|
|
299
|
+
// return size.value
|
|
300
|
+
// }
|
|
301
|
+
//
|
|
302
|
+
// return $binary.universalFromTo(size.value, hardDiskType.value, 'mb')
|
|
303
|
+
// })
|
|
234
304
|
const onValidateSize = (): void => {
|
|
235
305
|
if (props.type !== 'edit') return
|
|
236
|
-
if (
|
|
237
|
-
|
|
238
|
-
|
|
306
|
+
if (size.value < initialSize) {
|
|
307
|
+
sizeLocal.value = $binary.universalFromTo(
|
|
308
|
+
initialSize,
|
|
239
309
|
'mb',
|
|
240
310
|
hardDiskType.value
|
|
241
311
|
)
|
|
@@ -247,7 +317,7 @@ const isDisabledSize = computed<boolean>(() => {
|
|
|
247
317
|
return (
|
|
248
318
|
props.type === 'exist' ||
|
|
249
319
|
(props.type === 'edit' && readOnly.value) ||
|
|
250
|
-
(isRunning.value &&
|
|
320
|
+
(isRunning.value && provisionType.value === 'thick')
|
|
251
321
|
)
|
|
252
322
|
})
|
|
253
323
|
const isDisabledProvisioning = computed<boolean>(() => {
|
|
@@ -271,13 +341,25 @@ const isDisabledBus = computed<boolean>(() => {
|
|
|
271
341
|
return !isNewHardDisk.value && isRunning.value
|
|
272
342
|
})
|
|
273
343
|
|
|
274
|
-
const location = ref<UI_I_DatastoreTableItem | null>(props.
|
|
275
|
-
const
|
|
344
|
+
const location = ref<UI_I_DatastoreTableItem | null>(props.mainStorage || null)
|
|
345
|
+
const storageLocal = ref<UI_I_DatastoreTableItem | null>(props.mainStorage)
|
|
276
346
|
watch(
|
|
277
|
-
() => props.
|
|
347
|
+
() => props.mainStorage,
|
|
278
348
|
(newValue) => {
|
|
279
349
|
location.value = newValue
|
|
280
|
-
|
|
350
|
+
storageLocal.value = newValue
|
|
351
|
+
|
|
352
|
+
storage.value = {
|
|
353
|
+
id: newValue?.id || '',
|
|
354
|
+
name: newValue?.name || '',
|
|
355
|
+
type: newValue?.type_text || '',
|
|
356
|
+
pool: newValue?.pool_name || '',
|
|
357
|
+
user: '',
|
|
358
|
+
endpoint: '',
|
|
359
|
+
password: '',
|
|
360
|
+
protocol: '',
|
|
361
|
+
options: '',
|
|
362
|
+
}
|
|
281
363
|
},
|
|
282
364
|
{
|
|
283
365
|
immediate: true,
|
|
@@ -285,125 +367,135 @@ watch(
|
|
|
285
367
|
}
|
|
286
368
|
)
|
|
287
369
|
const onChangeStorage = (item: UI_I_DatastoreTableItem): void => {
|
|
288
|
-
|
|
370
|
+
storageLocal.value = item
|
|
371
|
+
|
|
372
|
+
storage.value = {
|
|
373
|
+
id: item?.id || '',
|
|
374
|
+
name: item?.name || '',
|
|
375
|
+
type: item?.type_text || '',
|
|
376
|
+
pool: item?.pool_name || '',
|
|
377
|
+
user: '',
|
|
378
|
+
endpoint: '',
|
|
379
|
+
password: '',
|
|
380
|
+
protocol: '',
|
|
381
|
+
options: '',
|
|
382
|
+
}
|
|
289
383
|
}
|
|
290
384
|
|
|
291
|
-
const diskProvisioning = ref<string>('thick')
|
|
292
|
-
const sharing = ref<string>('')
|
|
293
|
-
const shares = ref<number>(0)
|
|
294
|
-
|
|
295
|
-
const limitIops = ref<number>(16)
|
|
296
|
-
const limitIopsType = ref<string>('unlimited')
|
|
297
|
-
const limitIopsInvalid = ref<boolean>(false)
|
|
298
|
-
|
|
299
|
-
const diskMode = ref<string>('dependent')
|
|
300
|
-
|
|
301
|
-
const cache = ref<string>('none')
|
|
302
|
-
|
|
385
|
+
// const diskProvisioning = ref<string>('thick')
|
|
386
|
+
// const sharing = ref<string>('')
|
|
387
|
+
// const shares = ref<number>(0)
|
|
388
|
+
//
|
|
389
|
+
// const limitIops = ref<number>(16)
|
|
390
|
+
// const limitIopsType = ref<string>('unlimited')
|
|
391
|
+
// const limitIopsInvalid = ref<boolean>(false)
|
|
392
|
+
//
|
|
393
|
+
// const diskMode = ref<string>('dependent')
|
|
394
|
+
//
|
|
395
|
+
// const cache = ref<string>('none')
|
|
396
|
+
//
|
|
303
397
|
// const bus = ref<string>('ide')
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
)
|
|
398
|
+
//
|
|
399
|
+
// const readOnly = ref<boolean>(false)
|
|
400
|
+
//
|
|
401
|
+
// const discard = ref<string>('')
|
|
402
|
+
//
|
|
403
|
+
// const io = ref<string>('')
|
|
404
|
+
//
|
|
405
|
+
// const target = ref<string>('')
|
|
406
|
+
|
|
407
|
+
// watch(
|
|
408
|
+
// [
|
|
409
|
+
// sizeInMb,
|
|
410
|
+
// storage,
|
|
411
|
+
// diskProvisioning,
|
|
412
|
+
// sharing,
|
|
413
|
+
// limitIops,
|
|
414
|
+
// limitIopsType,
|
|
415
|
+
// diskMode,
|
|
416
|
+
// cache,
|
|
417
|
+
// bus,
|
|
418
|
+
// deleteFilesFromDatastore,
|
|
419
|
+
// (): void => props.type,
|
|
420
|
+
// ],
|
|
421
|
+
// () => {
|
|
422
|
+
// const limitIopsLocal =
|
|
423
|
+
// limitIopsType.value === 'unlimited' ? 0 : limitIops.value
|
|
424
|
+
// const storageLocal: UI_I_SendDataNewHardDiskStorage = {
|
|
425
|
+
// id: storage.value?.id || '',
|
|
426
|
+
// name: storage.value?.name || '',
|
|
427
|
+
// type: storage.value?.type_text || '',
|
|
428
|
+
// pool: storage.value?.pool_name || '',
|
|
429
|
+
// user: '',
|
|
430
|
+
// endpoint: '',
|
|
431
|
+
// password: '',
|
|
432
|
+
// protocol: '',
|
|
433
|
+
// options: '',
|
|
434
|
+
// }
|
|
435
|
+
//
|
|
436
|
+
// emits('send-data', {
|
|
437
|
+
// create: props.hardDisk.create,
|
|
438
|
+
// attach: props.hardDisk.attach,
|
|
439
|
+
// source: props.hardDisk.source,
|
|
440
|
+
// size: Math.ceil(sizeInMb.value),
|
|
441
|
+
// bus: bus.value,
|
|
442
|
+
// target: target.value,
|
|
443
|
+
// storage: storageLocal,
|
|
444
|
+
// device_type: 'disk',
|
|
445
|
+
// provision_type: diskProvisioning.value,
|
|
446
|
+
// disk_mode: diskMode.value,
|
|
447
|
+
// sharing: sharing.value === 'yes',
|
|
448
|
+
// read_only: readOnly.value,
|
|
449
|
+
// shares: shares.value,
|
|
450
|
+
// cache: cache.value,
|
|
451
|
+
// io: io.value,
|
|
452
|
+
// limit_iops: limitIopsLocal,
|
|
453
|
+
// discard: discard.value,
|
|
454
|
+
// capacity: Math.ceil(sizeInMb.value),
|
|
455
|
+
// boot_order: props.hardDisk.boot_order,
|
|
456
|
+
// detach: props.type === 'removed',
|
|
457
|
+
// remove: props.type === 'removed' && deleteFilesFromDatastore.value, // Проверяем если удалили диск и указали Delete files from datastore
|
|
458
|
+
// })
|
|
459
|
+
// },
|
|
460
|
+
// { immediate: true }
|
|
461
|
+
// )
|
|
369
462
|
|
|
370
463
|
// Добавляем данные для редактирования
|
|
371
|
-
watch(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
)
|
|
464
|
+
// watch(
|
|
465
|
+
// () => props.hardDisk,
|
|
466
|
+
// (newValue) => {
|
|
467
|
+
// // TODO refactoring
|
|
468
|
+
// if (props.type === 'exist') {
|
|
469
|
+
// diskProvisioning.value = newValue.provision_type || 'thick'
|
|
470
|
+
// return
|
|
471
|
+
// }
|
|
472
|
+
// // if (props.type !== 'edit') return
|
|
473
|
+
// if (props.type !== 'edit' && props.type !== 'clone') return
|
|
474
|
+
//
|
|
475
|
+
// const sizeInGb = $binary.mbToGb(newValue.size)
|
|
476
|
+
// if (sizeInGb < 1) {
|
|
477
|
+
// size.value = newValue.size
|
|
478
|
+
// hardDiskType.value = 'mb'
|
|
479
|
+
// } else {
|
|
480
|
+
// size.value = sizeInGb
|
|
481
|
+
// hardDiskType.value = 'gb'
|
|
482
|
+
// }
|
|
483
|
+
// diskProvisioning.value = newValue.provision_type || 'thick'
|
|
484
|
+
// sharing.value = newValue.sharing ? 'yes' : ''
|
|
485
|
+
// shares.value = newValue.shares || 0
|
|
486
|
+
// // limitIopsType.value = newValue.io === 'native' ? 'unlimited' : 'custom'
|
|
487
|
+
// limitIopsType.value = newValue.limit_iops === 0 ? 'unlimited' : 'custom'
|
|
488
|
+
// limitIops.value = newValue.limit_iops || 16
|
|
489
|
+
// diskMode.value = newValue.disk_mode || 'dependent'
|
|
490
|
+
// cache.value = newValue.cache || 'none'
|
|
491
|
+
// bus.value = newValue.bus || 'ide'
|
|
492
|
+
// readOnly.value = newValue.read_only || false
|
|
493
|
+
// discard.value = newValue.discard || ''
|
|
494
|
+
// io.value = newValue.io || ''
|
|
495
|
+
// target.value = newValue.target || ''
|
|
496
|
+
// },
|
|
497
|
+
// { immediate: true }
|
|
498
|
+
// )
|
|
407
499
|
watch(
|
|
408
500
|
isRunning,
|
|
409
501
|
(newValue) => {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
/>
|
|
108
108
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-file
|
|
109
109
|
v-else
|
|
110
|
-
:path="
|
|
110
|
+
:path="source"
|
|
111
111
|
:index="props.index"
|
|
112
112
|
/>
|
|
113
113
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-provisioning
|
|
@@ -165,7 +165,6 @@
|
|
|
165
165
|
|
|
166
166
|
<script setup lang="ts">
|
|
167
167
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
168
|
-
import type { UI_I_SendDataNewHardDisk } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
169
168
|
import type { UI_T_HardDiskType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
|
|
170
169
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
171
170
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
@@ -191,6 +190,7 @@ const limitIopsInvalid = defineModel<boolean>('limitIopsInvalid', {
|
|
|
191
190
|
const diskMode = defineModel<string>('diskMode', { required: true })
|
|
192
191
|
const cache = defineModel<string>('cache', { required: true })
|
|
193
192
|
const bus = defineModel<string>('bus', { required: true })
|
|
193
|
+
const source = defineModel<string>('source', { required: true })
|
|
194
194
|
|
|
195
195
|
const props = withDefaults(
|
|
196
196
|
defineProps<{
|
|
@@ -216,10 +216,9 @@ const props = withDefaults(
|
|
|
216
216
|
datastore: UI_I_DatastoreTableItem[]
|
|
217
217
|
isDatastoreLoading: boolean
|
|
218
218
|
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
219
|
-
errorValidationFields: UI_I_ErrorValidationField
|
|
219
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
220
220
|
index: number
|
|
221
221
|
type: UI_T_HardDiskType
|
|
222
|
-
hardDisk: UI_I_SendDataNewHardDisk
|
|
223
222
|
guestMachineType?: UI_I_OptionItem | null
|
|
224
223
|
computeResource?: UI_I_TreeNode | null
|
|
225
224
|
}>(),
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
/>
|
|
122
122
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-file
|
|
123
123
|
v-else
|
|
124
|
-
:path="
|
|
124
|
+
:path="source"
|
|
125
125
|
:index="props.index"
|
|
126
126
|
/>
|
|
127
127
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-provisioning
|
|
@@ -180,7 +180,6 @@
|
|
|
180
180
|
|
|
181
181
|
<script setup lang="ts">
|
|
182
182
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
183
|
-
import type { UI_I_SendDataNewHardDisk } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
184
183
|
import type { UI_T_HardDiskType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
|
|
185
184
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
186
185
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
@@ -206,6 +205,7 @@ const limitIopsInvalid = defineModel<boolean>('limitIopsInvalid', {
|
|
|
206
205
|
const diskMode = defineModel<string>('diskMode', { required: true })
|
|
207
206
|
const cache = defineModel<string>('cache', { required: true })
|
|
208
207
|
const bus = defineModel<string>('bus', { required: true })
|
|
208
|
+
const source = defineModel<string>('source', { required: true })
|
|
209
209
|
|
|
210
210
|
const props = withDefaults(
|
|
211
211
|
defineProps<{
|
|
@@ -234,7 +234,6 @@ const props = withDefaults(
|
|
|
234
234
|
errorValidationFields: UI_I_ErrorValidationField<string>[]
|
|
235
235
|
index: number
|
|
236
236
|
type: UI_T_HardDiskType
|
|
237
|
-
hardDisk: UI_I_SendDataNewHardDisk
|
|
238
237
|
guestMachineType?: UI_I_OptionItem | null
|
|
239
238
|
computeResource?: UI_I_TreeNode | null
|
|
240
239
|
}>(),
|