bfg-common 1.5.572 → 1.5.574
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 +46 -120
- 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/clone/Clone.vue +43 -115
- 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 +42 -60
- package/components/common/vm/actions/common/lib/models/interfaces.ts +58 -25
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-network-new
|
|
3
3
|
v-if="isNewView"
|
|
4
|
-
v-model:selected-location="
|
|
5
|
-
v-model:adapter-type="
|
|
6
|
-
v-model:mac-address="
|
|
4
|
+
v-model:selected-location="networkValue"
|
|
5
|
+
v-model:adapter-type="model"
|
|
6
|
+
v-model:mac-address="mac"
|
|
7
7
|
v-model:mac-address-type="macAddressType"
|
|
8
8
|
v-model:new-network-invalid="newNetworkInvalid"
|
|
9
9
|
:index="props.index"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
/>
|
|
27
27
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new-network-old
|
|
28
28
|
v-else
|
|
29
|
-
v-model:selected-location="
|
|
30
|
-
v-model:adapter-type="
|
|
31
|
-
v-model:mac-address="
|
|
29
|
+
v-model:selected-location="networkValue"
|
|
30
|
+
v-model:adapter-type="model"
|
|
31
|
+
v-model:mac-address="mac"
|
|
32
32
|
v-model:mac-address-type="macAddressType"
|
|
33
33
|
v-model:new-network-invalid="newNetworkInvalid"
|
|
34
34
|
:index="props.index"
|
|
@@ -56,23 +56,38 @@ import type { UI_T_Project } from '~/lib/models/types'
|
|
|
56
56
|
import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
|
|
57
57
|
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
|
58
58
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
59
|
-
import type { UI_I_SendDataNewNetwork } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
60
59
|
import type { UI_T_NetworkType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
|
|
61
60
|
import type {
|
|
62
61
|
UI_I_Localization,
|
|
63
62
|
UI_I_HTMLSelectElement,
|
|
64
63
|
} from '~/lib/models/interfaces'
|
|
65
64
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
65
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
66
|
+
|
|
67
|
+
const network = defineModel<UI_I_CreateVmData['network_devices'][0]['network']>(
|
|
68
|
+
'network',
|
|
69
|
+
{ required: true }
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
const mac = defineModel<UI_I_CreateVmData['network_devices'][0]['mac']>('mac', {
|
|
73
|
+
required: true,
|
|
74
|
+
})
|
|
75
|
+
const model = defineModel<UI_I_CreateVmData['network_devices'][0]['model']>(
|
|
76
|
+
'model',
|
|
77
|
+
{
|
|
78
|
+
required: true,
|
|
79
|
+
}
|
|
80
|
+
)
|
|
66
81
|
|
|
67
82
|
const props = withDefaults(
|
|
68
83
|
defineProps<{
|
|
69
84
|
project: UI_T_Project
|
|
70
85
|
index: number
|
|
71
86
|
type: UI_T_NetworkType
|
|
72
|
-
network: UI_I_SendDataNewNetwork
|
|
73
87
|
networksTable: UI_I_NetworkTableItem[]
|
|
74
88
|
errorValidationFields: UI_I_ErrorValidationField[]
|
|
75
89
|
isEdit: boolean
|
|
90
|
+
networkValueProp: 'network' | 'net_bridge'
|
|
76
91
|
state?: string | number
|
|
77
92
|
}>(),
|
|
78
93
|
{
|
|
@@ -80,18 +95,27 @@ const props = withDefaults(
|
|
|
80
95
|
}
|
|
81
96
|
)
|
|
82
97
|
const emits = defineEmits<{
|
|
83
|
-
(event: 'send-data', value: UI_I_SendDataNewNetwork): void
|
|
84
98
|
(event: 'invalid', value: boolean): void
|
|
85
99
|
(event: 'remove'): void
|
|
86
100
|
(event: 'remove-error-by-title', value: string): void
|
|
87
101
|
(event: 'get-networks-table', value: UI_I_TablePayload): void
|
|
88
102
|
}>()
|
|
89
103
|
|
|
104
|
+
const networkValue = defineModel<
|
|
105
|
+
UI_I_CreateVmData['network_devices'][0][props.networkValueProp]
|
|
106
|
+
>('networkValue', { required: true })
|
|
107
|
+
watch(networkValue, (newValue) => {
|
|
108
|
+
const selectedOption = locationOptions.value.find(
|
|
109
|
+
(option) => option.value === newValue
|
|
110
|
+
)
|
|
111
|
+
if (selectedOption) {
|
|
112
|
+
network.value = selectedOption.text
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
|
|
90
116
|
const { $store }: any = useNuxtApp()
|
|
91
117
|
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
92
118
|
|
|
93
|
-
const valueProp = props.project === 'sphere' ? 'network' : 'net_bridge'
|
|
94
|
-
|
|
95
119
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
96
120
|
|
|
97
121
|
const isRunning = computed<boolean>(() => {
|
|
@@ -102,7 +126,7 @@ const isRemovable = computed<boolean>(() => {
|
|
|
102
126
|
return (
|
|
103
127
|
!props.isEdit ||
|
|
104
128
|
!isRunning.value ||
|
|
105
|
-
(isRunning.value &&
|
|
129
|
+
(isRunning.value && model.value === 'virtio')
|
|
106
130
|
)
|
|
107
131
|
})
|
|
108
132
|
|
|
@@ -118,9 +142,15 @@ const label = computed<string>(() => {
|
|
|
118
142
|
// }
|
|
119
143
|
|
|
120
144
|
const selectedLocationOld = ref<string>('')
|
|
121
|
-
const selectedLocation = ref<string>('')
|
|
122
145
|
const locationOptions = ref<UI_I_OptionItem[]>([])
|
|
123
146
|
|
|
147
|
+
if (networkValue.value) {
|
|
148
|
+
locationOptions.value = [
|
|
149
|
+
{ text: network.value, value: networkValue.value },
|
|
150
|
+
{ text: `${localization.value.common.browse}...`, value: '' },
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
|
|
124
154
|
const getNetworks = (): void => {
|
|
125
155
|
// if (props.networksTable.length) return // Из-за этого кода был баг. Открыть визард вм -> создать сеть -> открыть визард вм и в списке сетей нету новой сети
|
|
126
156
|
|
|
@@ -149,9 +179,8 @@ watch(
|
|
|
149
179
|
watch(
|
|
150
180
|
() => props.networksTable,
|
|
151
181
|
(newValue) => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
)
|
|
182
|
+
if (!newValue.length && props.type !== 'new') return
|
|
183
|
+
|
|
155
184
|
if (!newValue.length) {
|
|
156
185
|
locationOptions.value = [
|
|
157
186
|
{
|
|
@@ -159,29 +188,33 @@ watch(
|
|
|
159
188
|
value: 'noAvailableNetworks',
|
|
160
189
|
},
|
|
161
190
|
]
|
|
162
|
-
|
|
191
|
+
networkValue.value = 'noAvailableNetworks'
|
|
163
192
|
newNetworkInvalid.value = true
|
|
164
193
|
return
|
|
165
194
|
}
|
|
166
195
|
newNetworkInvalid.value = false
|
|
167
196
|
|
|
197
|
+
const isExistValue = newValue.some(
|
|
198
|
+
(networkLocal) => networkLocal[props.networkValueProp] === networkValue.value
|
|
199
|
+
)
|
|
200
|
+
|
|
168
201
|
if (props.type === 'edit' || isExistValue) return
|
|
169
202
|
|
|
170
|
-
selectedLocationOld.value = newValue[0][
|
|
171
|
-
|
|
203
|
+
selectedLocationOld.value = newValue[0][props.networkValueProp] || ''
|
|
204
|
+
networkValue.value = newValue[0][props.networkValueProp] || ''
|
|
172
205
|
|
|
173
206
|
locationOptions.value = [
|
|
174
|
-
{ text: newValue[0].name, value: newValue[0][
|
|
207
|
+
{ text: newValue[0].name, value: newValue[0][props.networkValueProp] },
|
|
175
208
|
{ text: `${localization.value.common.browse}...`, value: '' },
|
|
176
209
|
]
|
|
177
210
|
},
|
|
178
|
-
{ immediate: true }
|
|
211
|
+
{ immediate: true, deep: true }
|
|
179
212
|
)
|
|
180
213
|
|
|
181
214
|
const locationModalIsShow = ref<boolean>(false)
|
|
182
215
|
const onHideLocationModal = (): void => {
|
|
183
216
|
locationModalIsShow.value = false
|
|
184
|
-
|
|
217
|
+
networkValue.value = selectedLocationOld.value
|
|
185
218
|
}
|
|
186
219
|
const changeLocation = (event: UI_I_HTMLSelectElement): void => {
|
|
187
220
|
const value = event.target.value
|
|
@@ -191,17 +224,16 @@ const changeLocation = (event: UI_I_HTMLSelectElement): void => {
|
|
|
191
224
|
}
|
|
192
225
|
|
|
193
226
|
selectedLocationOld.value = value
|
|
194
|
-
|
|
195
|
-
// netBridge.value = value
|
|
227
|
+
networkValue.value = value
|
|
196
228
|
}
|
|
197
|
-
const onSelectLocation = (
|
|
229
|
+
const onSelectLocation = (networkLocal: UI_I_NetworkTableItem): void => {
|
|
198
230
|
locationModalIsShow.value = false
|
|
199
231
|
|
|
200
|
-
selectedLocationOld.value =
|
|
201
|
-
|
|
232
|
+
selectedLocationOld.value = networkLocal[props.networkValueProp]
|
|
233
|
+
networkValue.value = networkLocal[props.networkValueProp]
|
|
202
234
|
|
|
203
235
|
const hasNetwork = locationOptions.value.some(
|
|
204
|
-
(option) => option.value ===
|
|
236
|
+
(option) => option.value === networkLocal[props.networkValueProp]
|
|
205
237
|
)
|
|
206
238
|
if (hasNetwork) {
|
|
207
239
|
return
|
|
@@ -209,87 +241,17 @@ const onSelectLocation = (network: UI_I_NetworkTableItem): void => {
|
|
|
209
241
|
|
|
210
242
|
locationOptions.value = [
|
|
211
243
|
...locationOptions.value.slice(0, -1),
|
|
212
|
-
{ text:
|
|
244
|
+
{ text: networkLocal.name, value: networkLocal[props.networkValueProp] },
|
|
213
245
|
locationOptions.value[locationOptions.value.length - 1],
|
|
214
246
|
]
|
|
215
247
|
}
|
|
216
|
-
|
|
217
|
-
// const adapterType = ref<string>('rtl8139')
|
|
218
|
-
const adapterType = ref<string>('virtio') // Семён попросил
|
|
219
|
-
|
|
220
|
-
const target = ref<string>('')
|
|
221
|
-
|
|
222
|
-
const macAddress = ref<string>('')
|
|
223
248
|
const macAddressType = ref<string>('automatic')
|
|
224
249
|
|
|
225
|
-
let cashNetwork = {
|
|
226
|
-
network: '',
|
|
227
|
-
mac: '',
|
|
228
|
-
}
|
|
229
|
-
if (props.network.mac) {
|
|
230
|
-
cashNetwork.network = props.network[valueProp]
|
|
231
|
-
cashNetwork.mac = props.network.mac
|
|
232
|
-
}
|
|
233
|
-
watch(selectedLocation, (newValue) => {
|
|
234
|
-
if (newValue !== cashNetwork.network) {
|
|
235
|
-
macAddressType.value = 'automatic'
|
|
236
|
-
macAddress.value = ''
|
|
237
|
-
} else {
|
|
238
|
-
macAddressType.value = cashNetwork.mac ? 'manual' : 'automatic'
|
|
239
|
-
setTimeout(() => {
|
|
240
|
-
macAddress.value = cashNetwork.mac
|
|
241
|
-
},0)
|
|
242
|
-
}
|
|
243
|
-
})
|
|
244
|
-
|
|
245
|
-
watch(
|
|
246
|
-
[selectedLocation, adapterType, macAddress, macAddressType, locationOptions],
|
|
247
|
-
() => {
|
|
248
|
-
const option = locationOptions.value.find(
|
|
249
|
-
(option) => option.value === selectedLocation.value
|
|
250
|
-
)
|
|
251
|
-
if (!option) return
|
|
252
|
-
|
|
253
|
-
emits('send-data', {
|
|
254
|
-
network: option.text,
|
|
255
|
-
// net_bridge: props.project === 'procurator' ? option.value : '',
|
|
256
|
-
net_bridge: option.value,
|
|
257
|
-
target: target.value,
|
|
258
|
-
model: adapterType.value,
|
|
259
|
-
mac: macAddress.value,
|
|
260
|
-
boot_order: props.network.boot_order,
|
|
261
|
-
})
|
|
262
|
-
},
|
|
263
|
-
{ immediate: true }
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
// Добавляем данные для редактирования
|
|
267
|
-
watch(
|
|
268
|
-
() => props.network,
|
|
269
|
-
(newValue) => {
|
|
270
|
-
// if (props.type !== 'edit') return
|
|
271
|
-
if (props.type !== 'edit' && props.type !== 'clone') return
|
|
272
|
-
|
|
273
|
-
locationOptions.value = [
|
|
274
|
-
{ text: newValue.network, value: newValue[valueProp] },
|
|
275
|
-
{ text: `${localization.value.common.browse}...`, value: '' },
|
|
276
|
-
]
|
|
277
|
-
selectedLocation.value = newValue[valueProp]
|
|
278
|
-
|
|
279
|
-
adapterType.value = newValue.model
|
|
280
|
-
target.value = newValue.target
|
|
281
|
-
// Сбрасываем mac address при клонировании
|
|
282
|
-
macAddress.value = props.type === 'clone' ? '' : newValue.mac
|
|
283
|
-
macAddressType.value = props.type === 'clone' ? 'automatic' : 'manual'
|
|
284
|
-
},
|
|
285
|
-
{ immediate: true }
|
|
286
|
-
)
|
|
287
|
-
|
|
288
250
|
watch(
|
|
289
251
|
isRunning,
|
|
290
252
|
(newValue) => {
|
|
291
253
|
if (newValue && props.type === 'new') {
|
|
292
|
-
|
|
254
|
+
model.value = 'virtio'
|
|
293
255
|
}
|
|
294
256
|
},
|
|
295
257
|
{ immediate: true }
|
|
@@ -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' },
|