bfg-common 1.5.554 → 1.5.555
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 +4 -20
- package/assets/localization/local_en.json +4 -20
- package/assets/localization/local_hy.json +4 -20
- package/assets/localization/local_kk.json +4 -20
- package/assets/localization/local_ru.json +4 -20
- package/assets/localization/local_zh.json +5 -21
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +1 -9
- package/components/common/modals/confirmByInput/ConfirmByInputNew.vue +2 -7
- package/components/common/pages/backups/modals/createBackup/New.vue +2 -8
- package/components/common/pages/backups/modals/restore/Restore.vue +5 -9
- package/components/common/pages/backups/modals/restore/RestoreNew.vue +3 -13
- package/components/common/pages/backups/modals/restore/RestoreOld.vue +18 -6
- package/components/common/vm/actions/add/Add.vue +46 -119
- 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/common/customizeHardware/CustomizeHardware.vue +13 -78
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +7 -52
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +8 -52
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +62 -96
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +13 -24
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +14 -25
- 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/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 -62
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +8 -60
- 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 +26 -60
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsNew.vue +7 -26
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsOld.vue +60 -86
- package/components/common/vm/actions/common/lib/models/interfaces.ts +57 -25
- package/components/common/vm/actions/editSettings/EditSettings.vue +10 -33
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +2 -30
- package/components/common/vm/actions/editSettings/new/New.vue +2 -30
- package/components/common/vm/actions/lib/models/interfaces.ts +4 -29
- package/components/common/vm/actions/lib/utils.ts +37 -32
- package/package.json +1 -3
- /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
package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
v-model:limit="limit"
|
|
11
11
|
v-model:limit-type="limitType"
|
|
12
12
|
v-model:limit-invalid="limitInvalid"
|
|
13
|
-
v-model:memory-hot-plug="
|
|
13
|
+
v-model:memory-hot-plug="model.memory.hotplug"
|
|
14
14
|
:error-validation-fields="props.errorValidationFields"
|
|
15
15
|
:memory-invalid="memoryInvalid"
|
|
16
16
|
:error-text="memorySizeLocalAndApiErrorsTexts"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
v-model:limit="limit"
|
|
36
36
|
v-model:limit-type="limitType"
|
|
37
37
|
v-model:limit-invalid="limitInvalid"
|
|
38
|
-
v-model:memory-hot-plug="
|
|
38
|
+
v-model:memory-hot-plug="model.memory.hotplug"
|
|
39
39
|
:error-validation-fields="props.errorValidationFields"
|
|
40
40
|
:memory-invalid="memoryInvalid"
|
|
41
41
|
:error-text="memorySizeLocalAndApiErrorsTexts"
|
|
@@ -52,31 +52,29 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup lang="ts">
|
|
55
|
-
import type { API_UI_I_VmEditMemory } from '~/lib/models/store/vm/interfaces'
|
|
56
|
-
import type { UI_I_SendDataMemory } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
57
55
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
58
56
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
59
57
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
58
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
60
59
|
import {
|
|
61
60
|
memoryOptionsFunc,
|
|
62
61
|
memoryTypeOptionsFunc,
|
|
63
62
|
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/lib/config/memoryOptions'
|
|
64
63
|
|
|
64
|
+
const model = defineModel<UI_I_CreateVmData>({ required: true })
|
|
65
|
+
|
|
65
66
|
const props = withDefaults(
|
|
66
67
|
defineProps<{
|
|
67
68
|
maxMemory: number
|
|
68
69
|
isEdit: boolean
|
|
69
70
|
errorValidationFields: UI_I_ErrorValidationField[]
|
|
70
71
|
state?: string | number
|
|
71
|
-
memory?: API_UI_I_VmEditMemory
|
|
72
72
|
}>(),
|
|
73
73
|
{
|
|
74
74
|
state: undefined,
|
|
75
|
-
memory: undefined,
|
|
76
75
|
}
|
|
77
76
|
)
|
|
78
77
|
const emits = defineEmits<{
|
|
79
|
-
(event: 'send-data', value: UI_I_SendDataMemory): void
|
|
80
78
|
(event: 'invalid', value: boolean): void
|
|
81
79
|
(event: 'remove-error-by-title', value: string): void
|
|
82
80
|
}>()
|
|
@@ -103,7 +101,7 @@ const isDisabled = computed<boolean>(() => {
|
|
|
103
101
|
})
|
|
104
102
|
|
|
105
103
|
const isMemoryDisabled = computed<boolean>(
|
|
106
|
-
() => isDisabled.value && !
|
|
104
|
+
() => isDisabled.value && !model.value.memory.hotplug
|
|
107
105
|
)
|
|
108
106
|
|
|
109
107
|
const selectedMemory = ref<number>(4)
|
|
@@ -122,6 +120,18 @@ const memoryInMb = computed<number>(() => {
|
|
|
122
120
|
|
|
123
121
|
return $binary.universalFromTo(+selectedMemory.value, memoryType.value, 'mb')
|
|
124
122
|
})
|
|
123
|
+
watch(memoryInMb, (newValue) => {
|
|
124
|
+
model.value.memory.size_mb = newValue
|
|
125
|
+
})
|
|
126
|
+
if (model.value.memory.size_mb !== 4096) {
|
|
127
|
+
const sizeInGb = $binary.mbToGb(model.value.memory.size_mb)
|
|
128
|
+
if (sizeInGb < 1) {
|
|
129
|
+
selectedMemory.value = model.value.memory.size_mb
|
|
130
|
+
memoryType.value = 'mb'
|
|
131
|
+
} else {
|
|
132
|
+
selectedMemory.value = sizeInGb
|
|
133
|
+
}
|
|
134
|
+
}
|
|
125
135
|
|
|
126
136
|
const memoryOptions = ref<UI_I_OptionItem[]>(
|
|
127
137
|
memoryOptionsFunc(localization.value, minMemoryInMb, props.maxMemory)
|
|
@@ -211,6 +221,26 @@ watch(reservation, (newValue) => {
|
|
|
211
221
|
})
|
|
212
222
|
const reservationType = ref<string>('mb')
|
|
213
223
|
const reserveGuestMemory = ref<boolean>(false)
|
|
224
|
+
if (model.value.memory.reservation_mb !== 2) {
|
|
225
|
+
const reservationInGb = $binary.mbToGb(model.value.memory.reservation_mb)
|
|
226
|
+
if (reservationInGb < 1) {
|
|
227
|
+
reservation.value = model.value.memory.reservation_mb.toString()
|
|
228
|
+
reservationType.value = 'mb'
|
|
229
|
+
} else {
|
|
230
|
+
reservation.value = reservationInGb
|
|
231
|
+
reservationType.value = 'gb'
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
watch(
|
|
235
|
+
[reservation, reservationType],
|
|
236
|
+
() => {
|
|
237
|
+
model.value.memory.reservation_mb =
|
|
238
|
+
reservationType.value === 'gb'
|
|
239
|
+
? $binary.gbToMb(+reservation.value)
|
|
240
|
+
: +reservation.value
|
|
241
|
+
},
|
|
242
|
+
{ deep: true, immediate: true }
|
|
243
|
+
)
|
|
214
244
|
|
|
215
245
|
const limit = ref<string>('Unlimited')
|
|
216
246
|
watch(limit, (newValue) => {
|
|
@@ -220,90 +250,47 @@ watch(limit, (newValue) => {
|
|
|
220
250
|
})
|
|
221
251
|
const limitType = ref<string>('mb')
|
|
222
252
|
const limitOptions = computed<UI_I_OptionItem[] | undefined>(() => {
|
|
223
|
-
if (
|
|
253
|
+
if (model.value.memory.hotplug)
|
|
224
254
|
return memoryOptionsFunc(
|
|
225
255
|
localization.value,
|
|
226
256
|
memoryInMb.value,
|
|
227
257
|
props.maxMemory
|
|
228
258
|
)
|
|
229
259
|
})
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
)
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
260
|
+
if (model.value.memory.limit_mb !== null) {
|
|
261
|
+
if (typeof model.value.memory.limit_mb === 'string')
|
|
262
|
+
limit.value = model.value.memory.limit_mb
|
|
263
|
+
else {
|
|
264
|
+
const limitInGb = $binary.mbToGb(model.value.memory.limit_mb)
|
|
265
|
+
if (limitInGb < 1) {
|
|
266
|
+
limit.value = model.value.memory.limit_mb.toString()
|
|
267
|
+
limitType.value = 'mb'
|
|
268
|
+
} else {
|
|
269
|
+
limit.value = limitInGb
|
|
270
|
+
limitType.value = 'gb'
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
239
274
|
watch(
|
|
240
|
-
[
|
|
275
|
+
[limit, limitType],
|
|
241
276
|
() => {
|
|
242
|
-
|
|
243
|
-
reservationType.value === 'mb'
|
|
244
|
-
? reservation.value
|
|
245
|
-
: '' +
|
|
246
|
-
$binary.universalFromTo(
|
|
247
|
-
reservation.value,
|
|
248
|
-
reservationType.value,
|
|
249
|
-
'mb',
|
|
250
|
-
12
|
|
251
|
-
)
|
|
252
|
-
const limitInMb =
|
|
277
|
+
model.value.memory.limit_mb =
|
|
253
278
|
limit.value === 'Unlimited'
|
|
254
279
|
? limit.value
|
|
255
280
|
: limitType.value === 'gb'
|
|
256
281
|
? $binary.gbToMb(+limit.value)
|
|
257
282
|
: +limit.value
|
|
258
|
-
emits('send-data', {
|
|
259
|
-
memory: '' + memoryInMb.value,
|
|
260
|
-
hotplug: memoryHotPlug.value,
|
|
261
|
-
reservation_mb: reservationInMb,
|
|
262
|
-
limit_mb: limitInMb,
|
|
263
|
-
})
|
|
264
283
|
},
|
|
265
|
-
{ immediate: true }
|
|
284
|
+
{ deep: true, immediate: true }
|
|
266
285
|
)
|
|
267
286
|
|
|
268
|
-
//
|
|
269
|
-
|
|
270
|
-
() => props.
|
|
271
|
-
(newValue) => {
|
|
272
|
-
if (!newValue) return
|
|
273
|
-
|
|
274
|
-
const sizeInGb = $binary.mbToGb(newValue.size_mb)
|
|
275
|
-
if (sizeInGb < 1) {
|
|
276
|
-
selectedMemory.value = newValue.size_mb
|
|
277
|
-
memoryType.value = 'mb'
|
|
278
|
-
} else {
|
|
279
|
-
selectedMemory.value = sizeInGb
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
const reservationInGb = $binary.mbToGb(newValue.reservation_mb)
|
|
283
|
-
if (reservationInGb < 1) {
|
|
284
|
-
reservation.value = newValue.reservation_mb
|
|
285
|
-
reservationType.value = 'mb'
|
|
286
|
-
} else {
|
|
287
|
-
reservation.value = reservationInGb
|
|
288
|
-
reservationType.value = 'gb'
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (typeof newValue.limit_mb === 'string') limit.value = newValue.limit_mb
|
|
292
|
-
else {
|
|
293
|
-
const limitInGb = $binary.mbToGb(newValue.limit_mb)
|
|
294
|
-
if (limitInGb < 1) {
|
|
295
|
-
limit.value = newValue.limit_mb
|
|
296
|
-
limitType.value = 'mb'
|
|
297
|
-
} else {
|
|
298
|
-
limit.value = limitInGb
|
|
299
|
-
limitType.value = 'gb'
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
memoryHotPlug.value = newValue.hotplug
|
|
304
|
-
},
|
|
305
|
-
{ immediate: true }
|
|
287
|
+
// const memoryHotPlug = ref<boolean>(false)
|
|
288
|
+
const isDisabledMemoryHotPlug = computed<boolean>(
|
|
289
|
+
() => memoryInMb.value >= props.maxMemory || isDisabled.value
|
|
306
290
|
)
|
|
291
|
+
watch(isDisabledMemoryHotPlug, (newValue) => {
|
|
292
|
+
if (newValue) model.value.memory.hotplug = false
|
|
293
|
+
})
|
|
307
294
|
|
|
308
295
|
const onRemoveValidationError = (): void => {
|
|
309
296
|
emits('remove-error-by-title', 'memory.size_mb')
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-usb-controller-new
|
|
3
3
|
v-if="isNewView"
|
|
4
|
-
v-model
|
|
4
|
+
v-model="model"
|
|
5
5
|
:is-edit="props.isEdit"
|
|
6
6
|
:selected-usb-controller-text="selectedUsbControllerText"
|
|
7
7
|
:usb-controller-options="usbControllerOptions"
|
|
8
8
|
/>
|
|
9
9
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-usb-controller-old
|
|
10
10
|
v-else
|
|
11
|
-
v-model
|
|
11
|
+
v-model="model"
|
|
12
12
|
:is-edit="props.isEdit"
|
|
13
13
|
:selected-usb-controller-text="selectedUsbControllerText"
|
|
14
14
|
:usb-controller-options="usbControllerOptions"
|
|
@@ -17,42 +17,31 @@
|
|
|
17
17
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
20
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
20
21
|
import { usbControllerOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/lib/config/options'
|
|
21
22
|
|
|
23
|
+
const model = defineModel<UI_I_CreateVmData['usb_controllers'][0]['type']>({ required: true })
|
|
24
|
+
|
|
22
25
|
const props = withDefaults(
|
|
23
26
|
defineProps<{
|
|
24
|
-
usbController: string
|
|
25
27
|
isEdit: boolean
|
|
26
28
|
state?: string | number
|
|
27
29
|
}>(),
|
|
28
30
|
{
|
|
29
|
-
usbController: 'usb2',
|
|
30
31
|
state: undefined,
|
|
31
32
|
}
|
|
32
33
|
)
|
|
33
|
-
const emits = defineEmits<{
|
|
34
|
-
(event: 'send-data', value: string): void
|
|
35
|
-
}>()
|
|
36
34
|
|
|
37
35
|
const { $store }: any = useNuxtApp()
|
|
38
36
|
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
39
37
|
|
|
40
38
|
const usbControllerOptions = ref<UI_I_OptionItem[]>(usbControllerOptionsConfig)
|
|
41
|
-
const selectedUsbController = ref<string>(props.usbController)
|
|
42
39
|
const selectedUsbControllerText = computed<string>(
|
|
43
40
|
() =>
|
|
44
41
|
usbControllerOptions.value.find(
|
|
45
|
-
(option) => option.value ===
|
|
42
|
+
(option) => option.value === model.value
|
|
46
43
|
)?.text || ''
|
|
47
44
|
)
|
|
48
|
-
|
|
49
|
-
watch(
|
|
50
|
-
selectedUsbController,
|
|
51
|
-
(newValue) => {
|
|
52
|
-
emits('send-data', newValue)
|
|
53
|
-
},
|
|
54
|
-
{ immediate: true }
|
|
55
|
-
)
|
|
56
45
|
</script>
|
|
57
46
|
|
|
58
47
|
<style scoped lang="scss"></style>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<ui-select
|
|
22
22
|
v-else
|
|
23
23
|
id="usb-controller-select"
|
|
24
|
-
v-model="
|
|
24
|
+
v-model="model"
|
|
25
25
|
:items="props.usbControllerOptions"
|
|
26
26
|
:disabled="props.isEdit"
|
|
27
27
|
width="auto"
|
|
@@ -33,10 +33,13 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script setup lang="ts">
|
|
36
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
37
36
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
37
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
38
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
38
39
|
|
|
39
|
-
const
|
|
40
|
+
const model = defineModel<UI_I_CreateVmData['usb_controllers'][0]['type']>({
|
|
41
|
+
required: true,
|
|
42
|
+
})
|
|
40
43
|
|
|
41
44
|
const props = defineProps<{
|
|
42
45
|
isEdit: boolean
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div v-else class="select">
|
|
21
21
|
<select
|
|
22
22
|
id="usb-controller-select"
|
|
23
|
-
v-model="
|
|
23
|
+
v-model="model"
|
|
24
24
|
:disabled="props.isEdit"
|
|
25
25
|
data-id="usb-controller-select"
|
|
26
26
|
@click.stop
|
|
@@ -40,10 +40,13 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<script setup lang="ts">
|
|
43
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
44
43
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
44
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
45
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
45
46
|
|
|
46
|
-
const
|
|
47
|
+
const model = defineModel<UI_I_CreateVmData['usb_controllers'][0]['type']>({
|
|
48
|
+
required: true,
|
|
49
|
+
})
|
|
47
50
|
|
|
48
51
|
const props = defineProps<{
|
|
49
52
|
isEdit: boolean
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-new
|
|
3
3
|
v-if="isNewView"
|
|
4
|
+
v-model="model"
|
|
4
5
|
v-model:invalid="invalid"
|
|
5
|
-
v-model:number-displays="numberDisplays"
|
|
6
|
-
v-model:video-card-model="videoCardModel"
|
|
7
6
|
:is-edit="props.isEdit"
|
|
8
7
|
:error-validation-fields="props.errorValidationFields"
|
|
9
8
|
:video-card-model-name="videoCardModelName"
|
|
@@ -18,9 +17,8 @@
|
|
|
18
17
|
/>
|
|
19
18
|
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-old
|
|
20
19
|
v-else
|
|
20
|
+
v-model="model"
|
|
21
21
|
v-model:invalid="invalid"
|
|
22
|
-
v-model:number-displays="numberDisplays"
|
|
23
|
-
v-model:video-card-model="videoCardModel"
|
|
24
22
|
:is-edit="props.isEdit"
|
|
25
23
|
:error-validation-fields="props.errorValidationFields"
|
|
26
24
|
:video-card-model-name="videoCardModelName"
|
|
@@ -40,9 +38,12 @@ import type { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/comm
|
|
|
40
38
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
41
39
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
42
40
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
41
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
43
42
|
import { videoCardModelOptionsConfigFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/lib/config/options'
|
|
44
43
|
import { numberDisplaysOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options'
|
|
45
44
|
|
|
45
|
+
const model = defineModel<UI_I_CreateVmData['video_card']>({ required: true })
|
|
46
|
+
|
|
46
47
|
const props = withDefaults(
|
|
47
48
|
defineProps<{
|
|
48
49
|
isEdit: boolean
|
|
@@ -56,7 +57,6 @@ const props = withDefaults(
|
|
|
56
57
|
}
|
|
57
58
|
)
|
|
58
59
|
const emits = defineEmits<{
|
|
59
|
-
(event: 'send-data', value: UI_I_SendDataVideoCard): void
|
|
60
60
|
(event: 'invalid', value: boolean): void
|
|
61
61
|
(event: 'remove-error-by-title', value: string): void
|
|
62
62
|
}>()
|
|
@@ -68,32 +68,30 @@ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
|
68
68
|
|
|
69
69
|
const isDisabled = computed<boolean>(() => props.isEdit && props.state !== 1)
|
|
70
70
|
const isDisabledNumberDisplays = computed<boolean>(
|
|
71
|
-
() =>
|
|
71
|
+
() => model.value.adapter === 'none'
|
|
72
72
|
)
|
|
73
73
|
watch(isDisabled, (newValue) => {
|
|
74
74
|
if (!newValue) {
|
|
75
75
|
return
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
model.value.displays = 1
|
|
79
79
|
})
|
|
80
80
|
|
|
81
|
-
const videoCardModel = ref<string>('qxl')
|
|
82
81
|
const videoCardModelOptions = computed<UI_I_OptionItem[]>(() =>
|
|
83
82
|
videoCardModelOptionsConfigFunc(localization.value)
|
|
84
83
|
)
|
|
85
84
|
const videoCardModelName = computed<string>(
|
|
86
85
|
() =>
|
|
87
86
|
videoCardModelOptions.value.find(
|
|
88
|
-
(videoCard) => videoCard.value ===
|
|
87
|
+
(videoCard) => videoCard.value === model.value.adapter
|
|
89
88
|
)?.text || ''
|
|
90
89
|
)
|
|
91
90
|
|
|
92
|
-
const numberDisplays = ref<string>('1')
|
|
93
91
|
const numberDisplaysOptions = computed<UI_I_OptionItem[]>(() => {
|
|
94
92
|
const result = numberDisplaysOptionsFunc()
|
|
95
|
-
if (
|
|
96
|
-
result.unshift({ text: '0', value:
|
|
93
|
+
if (model.value.adapter === 'none') {
|
|
94
|
+
result.unshift({ text: '0', value: 0 })
|
|
97
95
|
}
|
|
98
96
|
return result
|
|
99
97
|
})
|
|
@@ -110,37 +108,17 @@ watch(
|
|
|
110
108
|
|
|
111
109
|
// const graphics = ref(false)
|
|
112
110
|
|
|
113
|
-
const changeNumberDisplays = (
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
} else if (
|
|
117
|
-
|
|
111
|
+
const changeNumberDisplays = (modelLocal: string): void => {
|
|
112
|
+
if (modelLocal === 'none') {
|
|
113
|
+
model.value.displays = 0
|
|
114
|
+
} else if (model.value.displays === 0) {
|
|
115
|
+
model.value.displays = 1
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
watch(
|
|
121
|
-
|
|
122
|
-
[numberDisplays, videoCardModel],
|
|
123
|
-
([_newValue1, newValue2]) => {
|
|
124
|
-
changeNumberDisplays(newValue2)
|
|
125
|
-
|
|
126
|
-
emits('send-data', {
|
|
127
|
-
adapter: videoCardModel.value,
|
|
128
|
-
displays: +numberDisplays.value,
|
|
129
|
-
// memory_mb: totalVideoMemory.value,
|
|
130
|
-
})
|
|
131
|
-
},
|
|
132
|
-
{ immediate: true }
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
// Добавляем данные для редактирования
|
|
136
|
-
watch(
|
|
137
|
-
() => props.videoCard,
|
|
119
|
+
() => model.value.adapter,
|
|
138
120
|
(newValue) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
videoCardModel.value = newValue.adapter
|
|
142
|
-
numberDisplays.value = '' + newValue.displays
|
|
143
|
-
// totalVideoMemory.value = newValue.memory_mb
|
|
121
|
+
changeNumberDisplays(newValue)
|
|
144
122
|
},
|
|
145
123
|
{ immediate: true }
|
|
146
124
|
)
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<template #stackBlockContent>
|
|
27
27
|
<ui-select
|
|
28
28
|
id="vm-wizard-video-card"
|
|
29
|
-
v-model="
|
|
29
|
+
v-model="model.adapter"
|
|
30
30
|
:items="props.videoCardModelOptions"
|
|
31
31
|
:disabled="props.isEdit && props.state !== 1"
|
|
32
32
|
:error-text="props.errorText"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
<template #stackChildren>
|
|
40
40
|
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
|
|
41
|
-
v-model:number-displays="
|
|
41
|
+
v-model:number-displays="model.displays"
|
|
42
42
|
:number-displays-options="props.numberDisplaysOptions"
|
|
43
43
|
:disabled="props.isDisabled || props.isDisabledNumberDisplays"
|
|
44
44
|
:error-validation-fields="props.errorValidationFields"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
<!-- v-models:graphics="graphics"-->
|
|
57
57
|
<!-- />-->
|
|
58
58
|
<!-- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model-->
|
|
59
|
-
<!-- v-model:video-card-model="
|
|
59
|
+
<!-- v-model:video-card-model="model.adapter"-->
|
|
60
60
|
<!-- :disabled="props.isDisabled"-->
|
|
61
61
|
<!-- />-->
|
|
62
62
|
</template>
|
|
@@ -67,13 +67,14 @@
|
|
|
67
67
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
68
68
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
69
69
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
70
|
+
import type {UI_I_CreateVmData} from "~/components/common/vm/actions/common/lib/models/interfaces";
|
|
71
|
+
|
|
72
|
+
const model = defineModel<UI_I_CreateVmData['video_card']>({ required: true })
|
|
70
73
|
|
|
71
74
|
const invalid = defineModel<boolean>('invalid', { required: true })
|
|
72
|
-
const numberDisplays = defineModel<string>('numberDisplays', { required: true })
|
|
73
75
|
// const totalVideoMemory = defineModel<number>('totalVideoMemory', {
|
|
74
76
|
// required: true,
|
|
75
77
|
// })
|
|
76
|
-
const videoCardModel = defineModel<string>('videoCardModel', { required: true })
|
|
77
78
|
|
|
78
79
|
const props = withDefaults(
|
|
79
80
|
defineProps<{
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<div class="select">
|
|
31
31
|
<select
|
|
32
32
|
id="vm-wizard-video-card"
|
|
33
|
-
v-model="
|
|
33
|
+
v-model="model.adapter"
|
|
34
34
|
:disabled="props.isEdit && props.state !== 1"
|
|
35
35
|
data-id="vm-wizard-video-card-select"
|
|
36
36
|
class="vm-wizard-video-card input-text-color"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
<template #stackChildren>
|
|
53
53
|
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
|
|
54
|
-
v-model:number-displays="
|
|
54
|
+
v-model:number-displays="model.displays"
|
|
55
55
|
:number-displays-options="props.numberDisplaysOptions"
|
|
56
56
|
:disabled="props.isDisabled || props.isDisabledNumberDisplays"
|
|
57
57
|
:error-validation-fields="props.errorValidationFields"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<!-- v-models:graphics="graphics"-->
|
|
70
70
|
<!-- />-->
|
|
71
71
|
<!-- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model-->
|
|
72
|
-
<!-- v-model:video-card-model="
|
|
72
|
+
<!-- v-model:video-card-model="model.adapter"-->
|
|
73
73
|
<!-- :disabled="props.isDisabled"-->
|
|
74
74
|
<!-- />-->
|
|
75
75
|
</template>
|
|
@@ -81,13 +81,14 @@
|
|
|
81
81
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
82
82
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
83
83
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
84
|
+
import type {UI_I_CreateVmData} from "~/components/common/vm/actions/common/lib/models/interfaces";
|
|
85
|
+
|
|
86
|
+
const model = defineModel<UI_I_CreateVmData['video_card']>({ required: true })
|
|
84
87
|
|
|
85
88
|
const invalid = defineModel<boolean>('invalid', { required: true })
|
|
86
|
-
const numberDisplays = defineModel<string>('numberDisplays', { required: true })
|
|
87
89
|
// const totalVideoMemory = defineModel<number>('totalVideoMemory', {
|
|
88
90
|
// required: true,
|
|
89
91
|
// })
|
|
90
|
-
const videoCardModel = defineModel<string>('videoCardModel', { required: true })
|
|
91
92
|
|
|
92
93
|
const props = withDefaults(
|
|
93
94
|
defineProps<{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
2
2
|
|
|
3
3
|
export const numberDisplaysOptionsFunc = (): UI_I_OptionItem[] => [
|
|
4
|
-
{ text: '1', value:
|
|
5
|
-
{ text: '2', value:
|
|
6
|
-
{ text: '3', value:
|
|
7
|
-
{ text: '4', value:
|
|
4
|
+
{ text: '1', value: 1 },
|
|
5
|
+
{ text: '2', value: 2 },
|
|
6
|
+
{ text: '3', value: 3 },
|
|
7
|
+
{ text: '4', value: 4 },
|
|
8
8
|
// { text: '5', value: '5' },
|
|
9
9
|
// { text: '6', value: '6' },
|
|
10
10
|
// { text: '7', value: '7' },
|