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