bfg-common 1.2.189 → 1.2.190
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 +2 -3
- package/assets/localization/local_en.json +2 -3
- package/assets/localization/local_hy.json +2 -3
- package/assets/localization/local_kk.json +2 -3
- package/assets/localization/local_ru.json +2 -3
- package/assets/localization/local_zh.json +2 -3
- package/components/atoms/table/simpleTable/SimpleTable.vue +2 -5
- package/components/atoms/wizard/Wizard.vue +4 -4
- package/components/atoms/wizard/models/interfaces.ts +3 -4
- package/components/atoms/wizard/utils/utils.ts +27 -106
- package/components/common/addNetworking/AddNetworking.vue +1123 -0
- package/components/common/addNetworking/Wizard.vue +286 -0
- package/components/common/{wizards/network/add/config/steps.ts → addNetworking/config/addNetworkingSteps.ts} +60 -107
- package/components/common/{wizards/network/add → addNetworking}/config/index.ts +16 -2
- package/components/common/{wizards/network/add → addNetworking}/config/initialData.ts +19 -4
- package/components/common/{wizards/network/add → addNetworking}/config/portPropertiesStep.ts +1 -1
- package/components/common/{wizards/network/add → addNetworking}/config/selectSwitch.ts +1 -1
- package/components/common/{wizards/network/add → addNetworking}/config/sendData.ts +1 -1
- package/components/common/addNetworking/config/temporaryData.ts +8 -0
- package/components/common/addNetworking/config/validation.ts +23 -0
- package/components/common/{wizards/network/add → addNetworking}/modals/SelectNetwork.vue +2 -2
- package/components/common/{wizards/network/add → addNetworking}/modals/SelectStandardSwitch.vue +2 -2
- package/components/common/{wizards/network/add → addNetworking}/modals/SelectSwitch.vue +2 -2
- package/components/common/addNetworking/models/enums.ts +7 -0
- package/components/common/{wizards/network/add → addNetworking}/models/interfaces.ts +37 -30
- package/components/common/addNetworking/models/types.ts +13 -0
- package/components/common/addNetworking/steps/ConnectionSettings.vue +269 -0
- package/components/common/{wizards/network/add → addNetworking}/steps/CreateStandardSwitch.vue +7 -0
- package/components/common/addNetworking/steps/Header.vue +53 -0
- package/components/common/addNetworking/steps/IpFourSettings.vue +361 -0
- package/components/common/{wizards/network/add → addNetworking}/steps/PhysicalAdapter.vue +12 -1
- package/components/common/{wizards/network/add → addNetworking}/steps/PortProperties.vue +180 -57
- package/components/common/{wizards/network/add → addNetworking}/steps/ReadyComplete.vue +10 -1
- package/components/common/{wizards/network/add → addNetworking}/steps/SelectConnectionType.vue +15 -3
- package/components/common/{wizards/network/add → addNetworking}/steps/SelectedTargetDevice.vue +212 -106
- package/components/common/addNetworking/utils/index.ts +212 -0
- package/components/common/diagramMain/DiagramMain.vue +47 -11
- package/components/common/diagramMain/modals/MigrateVmkernelAdapter.vue +603 -0
- package/components/common/diagramMain/modals/config/index.ts +6 -0
- package/components/common/diagramMain/modals/config/migrateVmkernelAdapterSteps.ts +81 -0
- package/components/common/diagramMain/modals/config/validation.ts +3 -0
- package/components/common/diagramMain/modals/config/vmKernelAdapter.ts +2 -2
- package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +1 -1
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +1 -1
- package/components/common/diagramMain/modals/steps/ConnectionSettings.vue +221 -0
- package/components/common/diagramMain/modals/steps/Header.vue +60 -0
- package/components/common/diagramMain/modals/{migrateVmkernelAdapter/steps → steps}/SelectVmkernelAdapter.vue +86 -24
- package/components/common/diagramMain/modals/{migrateVmkernelAdapter/steps → steps}/VmkernelAdapterReadyComplete.vue +11 -7
- package/components/common/diagramMain/models/enums.ts +7 -6
- package/components/common/diagramMain/models/interfaces.ts +29 -28
- package/components/common/diagramMain/models/types.ts +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +447 -447
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +77 -77
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +177 -177
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +181 -181
- package/package.json +1 -1
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +0 -531
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/config/steps.ts +0 -114
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +0 -161
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +0 -47
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +0 -146
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +0 -54
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +0 -19
- package/components/common/wizards/network/add/Add.vue +0 -874
- package/components/common/wizards/network/add/models/enums.ts +0 -17
- package/components/common/wizards/network/add/models/types.ts +0 -2
- package/components/common/wizards/network/add/steps/ConnectionSettings.vue +0 -148
- package/components/common/wizards/network/add/steps/IpFourSettings.vue +0 -245
- package/components/common/wizards/network/add/utils/index.ts +0 -4
- package/components/common/wizards/network/add/validations/common.ts +0 -58
- package/components/common/wizards/network/add/validations/connectionSettings.ts +0 -75
- package/components/common/wizards/network/add/validations/createStandardSwitch.ts +0 -58
- package/components/common/wizards/network/add/validations/ipFourSettings.ts +0 -188
- package/components/common/wizards/network/add/validations/networkValidation.ts +0 -73
- package/components/common/wizards/network/add/validations/portProperties.ts +0 -87
- package/components/common/wizards/network/add/validations/targetDevice.ts +0 -113
- package/components/common/wizards/network/add/validations/validations.ts +0 -43
- /package/components/common/{wizards/network/add → addNetworking}/mappers/mappers.ts +0 -0
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="hardware-
|
|
3
|
-
<atoms-stack-block :has-children="false">
|
|
4
|
-
<template #stackBlockKey>
|
|
5
|
-
<div class="flex-align-center">
|
|
6
|
-
<span>{{ localization.newUsbController }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
<template #stackBlockContent>
|
|
10
|
-
<div v-if="props.isEdit">
|
|
11
|
-
{{ selectedUsbControllerText }}
|
|
12
|
-
</div>
|
|
13
|
-
<div v-else class="select">
|
|
14
|
-
<select
|
|
15
|
-
id="usb-controller-select"
|
|
16
|
-
v-model="selectedUsbController"
|
|
17
|
-
:disabled="props.isEdit"
|
|
18
|
-
@click.stop
|
|
19
|
-
>
|
|
20
|
-
<option
|
|
21
|
-
v-for="(item, key) in usbControllerOptions"
|
|
22
|
-
:key="key"
|
|
23
|
-
:value="item.value"
|
|
24
|
-
>
|
|
25
|
-
{{ item.text }}
|
|
26
|
-
</option>
|
|
27
|
-
</select>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
</atoms-stack-block>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script setup lang="ts">
|
|
35
|
-
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
36
|
-
import { UI_I_Localization } from '~/models/interfaces'
|
|
37
|
-
import { usbControllerOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/config/options'
|
|
38
|
-
|
|
39
|
-
const props = withDefaults(
|
|
40
|
-
defineProps<{
|
|
41
|
-
usbController: string
|
|
42
|
-
isEdit: boolean
|
|
43
|
-
state?: string | number
|
|
44
|
-
}>(),
|
|
45
|
-
{
|
|
46
|
-
usbController: 'usb2',
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
const emits = defineEmits<{
|
|
50
|
-
(event: 'send-data', value: string): void
|
|
51
|
-
}>()
|
|
52
|
-
|
|
53
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
54
|
-
|
|
55
|
-
const usbControllerOptions = ref<UI_I_OptionItem[]>(usbControllerOptionsConfig)
|
|
56
|
-
const selectedUsbController = ref<string>(props.usbController)
|
|
57
|
-
const selectedUsbControllerText = computed<string>(
|
|
58
|
-
() =>
|
|
59
|
-
usbControllerOptions.value.find(
|
|
60
|
-
(option) => option.value === selectedUsbController.value
|
|
61
|
-
)?.text || ''
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
watch(
|
|
65
|
-
selectedUsbController,
|
|
66
|
-
(newValue) => {
|
|
67
|
-
emits('send-data', newValue)
|
|
68
|
-
},
|
|
69
|
-
{ immediate: true }
|
|
70
|
-
)
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
<style scoped lang="scss">
|
|
74
|
-
#network-connect {
|
|
75
|
-
margin-right: 4px;
|
|
76
|
-
}
|
|
77
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hardware-cpu">
|
|
3
|
+
<atoms-stack-block :has-children="false">
|
|
4
|
+
<template #stackBlockKey>
|
|
5
|
+
<div class="flex-align-center">
|
|
6
|
+
<span>{{ localization.newUsbController }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<template #stackBlockContent>
|
|
10
|
+
<div v-if="props.isEdit">
|
|
11
|
+
{{ selectedUsbControllerText }}
|
|
12
|
+
</div>
|
|
13
|
+
<div v-else class="select">
|
|
14
|
+
<select
|
|
15
|
+
id="usb-controller-select"
|
|
16
|
+
v-model="selectedUsbController"
|
|
17
|
+
:disabled="props.isEdit"
|
|
18
|
+
@click.stop
|
|
19
|
+
>
|
|
20
|
+
<option
|
|
21
|
+
v-for="(item, key) in usbControllerOptions"
|
|
22
|
+
:key="key"
|
|
23
|
+
:value="item.value"
|
|
24
|
+
>
|
|
25
|
+
{{ item.text }}
|
|
26
|
+
</option>
|
|
27
|
+
</select>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
</atoms-stack-block>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
36
|
+
import { UI_I_Localization } from '~/models/interfaces'
|
|
37
|
+
import { usbControllerOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/config/options'
|
|
38
|
+
|
|
39
|
+
const props = withDefaults(
|
|
40
|
+
defineProps<{
|
|
41
|
+
usbController: string
|
|
42
|
+
isEdit: boolean
|
|
43
|
+
state?: string | number
|
|
44
|
+
}>(),
|
|
45
|
+
{
|
|
46
|
+
usbController: 'usb2',
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
const emits = defineEmits<{
|
|
50
|
+
(event: 'send-data', value: string): void
|
|
51
|
+
}>()
|
|
52
|
+
|
|
53
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
54
|
+
|
|
55
|
+
const usbControllerOptions = ref<UI_I_OptionItem[]>(usbControllerOptionsConfig)
|
|
56
|
+
const selectedUsbController = ref<string>(props.usbController)
|
|
57
|
+
const selectedUsbControllerText = computed<string>(
|
|
58
|
+
() =>
|
|
59
|
+
usbControllerOptions.value.find(
|
|
60
|
+
(option) => option.value === selectedUsbController.value
|
|
61
|
+
)?.text || ''
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
watch(
|
|
65
|
+
selectedUsbController,
|
|
66
|
+
(newValue) => {
|
|
67
|
+
emits('send-data', newValue)
|
|
68
|
+
},
|
|
69
|
+
{ immediate: true }
|
|
70
|
+
)
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style scoped lang="scss">
|
|
74
|
+
#network-connect {
|
|
75
|
+
margin-right: 4px;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
@@ -1,177 +1,177 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="hardware-
|
|
3
|
-
<atoms-stack-block :has-children="true">
|
|
4
|
-
<template #stackBlockKey>
|
|
5
|
-
<div id="vm-wizard-toggle-block-video-card" class="flex-align-center">
|
|
6
|
-
<span>{{ localization.videoCard }}: {{ videoCardModelName }}</span>
|
|
7
|
-
<atoms-the-icon
|
|
8
|
-
v-show="invalid"
|
|
9
|
-
width="24px"
|
|
10
|
-
height="24px"
|
|
11
|
-
class="is-error tooltip-trigger"
|
|
12
|
-
name="info"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
<template #stackBlockContent>
|
|
17
|
-
<atoms-tooltip-error
|
|
18
|
-
:has-error="!!apiError"
|
|
19
|
-
selector=".vm-wizard-video-card"
|
|
20
|
-
@remove="onRemoveValidationError"
|
|
21
|
-
>
|
|
22
|
-
<template #elem>
|
|
23
|
-
<div class="select">
|
|
24
|
-
<select
|
|
25
|
-
id="vm-wizard-video-card"
|
|
26
|
-
v-model="selectedVideoCard"
|
|
27
|
-
class="vm-wizard-video-card input-text-color"
|
|
28
|
-
:disabled="props.isEdit && props.state !== 1"
|
|
29
|
-
@click.stop
|
|
30
|
-
>
|
|
31
|
-
<option
|
|
32
|
-
v-for="(item, key) in videoCardOptions"
|
|
33
|
-
:key="key"
|
|
34
|
-
:value="item.value"
|
|
35
|
-
>
|
|
36
|
-
{{ item.text }}
|
|
37
|
-
</option>
|
|
38
|
-
</select>
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
41
|
-
<template #content>{{ apiError }}</template>
|
|
42
|
-
</atoms-tooltip-error>
|
|
43
|
-
</template>
|
|
44
|
-
<template #stackChildren>
|
|
45
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
|
|
46
|
-
v-model:number-displays="numberDisplays"
|
|
47
|
-
:disabled="isDisabled"
|
|
48
|
-
:error-validation-fields="props.errorValidationFields"
|
|
49
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
50
|
-
/>
|
|
51
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-total-video-memory
|
|
52
|
-
v-model:total-video-memory="totalVideoMemory"
|
|
53
|
-
:disabled="isDisabled"
|
|
54
|
-
:is-edit="props.isEdit"
|
|
55
|
-
:error-validation-fields="props.errorValidationFields"
|
|
56
|
-
@invalid="invalid = $event"
|
|
57
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
58
|
-
/>
|
|
59
|
-
<!-- <templates-home-vm-actions-add-customize-hardware-virtual-hardware-video-card-graphics-->
|
|
60
|
-
<!-- v-model:graphics="graphics"-->
|
|
61
|
-
<!-- />-->
|
|
62
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model
|
|
63
|
-
v-model:video-card-model="videoCardModel"
|
|
64
|
-
:disabled="isDisabled"
|
|
65
|
-
/>
|
|
66
|
-
</template>
|
|
67
|
-
</atoms-stack-block>
|
|
68
|
-
</div>
|
|
69
|
-
</template>
|
|
70
|
-
|
|
71
|
-
<script setup lang="ts">
|
|
72
|
-
import { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/models/interfaces'
|
|
73
|
-
import { UI_I_Localization } from '~/models/interfaces'
|
|
74
|
-
import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
|
|
75
|
-
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
76
|
-
import { videoCardModelOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/config/options'
|
|
77
|
-
import { videoCardOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/config/options'
|
|
78
|
-
|
|
79
|
-
const props = defineProps<{
|
|
80
|
-
isEdit: boolean
|
|
81
|
-
errorValidationFields: UI_I_ErrorValidationField[]
|
|
82
|
-
videoCard?: UI_I_SendDataVideoCard
|
|
83
|
-
state?: string | number
|
|
84
|
-
}>()
|
|
85
|
-
const emits = defineEmits<{
|
|
86
|
-
(event: 'send-data', value: UI_I_SendDataVideoCard): void
|
|
87
|
-
(event: 'invalid', value: boolean): void
|
|
88
|
-
(event: 'remove-error-by-title', value: string): void
|
|
89
|
-
}>()
|
|
90
|
-
|
|
91
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
92
|
-
|
|
93
|
-
const selectedVideoCard = ref<number>(1)
|
|
94
|
-
const videoCardOptions = ref<UI_I_OptionItem[]>(
|
|
95
|
-
videoCardOptionsFunc(localization.value)
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
const isDisabled = computed<boolean>(
|
|
99
|
-
() => selectedVideoCard.value === 0 || (props.isEdit && props.state !== 1)
|
|
100
|
-
)
|
|
101
|
-
watch(isDisabled, (val) => {
|
|
102
|
-
if (!val) {
|
|
103
|
-
return
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
numberDisplays.value = '1'
|
|
107
|
-
})
|
|
108
|
-
const numberDisplays = ref<string>('1')
|
|
109
|
-
|
|
110
|
-
const totalVideoMemory = ref<number>(8)
|
|
111
|
-
const invalid = ref<boolean>(false)
|
|
112
|
-
watch(
|
|
113
|
-
invalid,
|
|
114
|
-
(newValue) => {
|
|
115
|
-
emits('invalid', newValue)
|
|
116
|
-
},
|
|
117
|
-
{ immediate: true }
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
// const graphics = ref(false)
|
|
121
|
-
|
|
122
|
-
const videoCardModel = ref<string>('qxl')
|
|
123
|
-
const videoCardModelOptions = ref<UI_I_OptionItem[]>(
|
|
124
|
-
videoCardModelOptionsConfig
|
|
125
|
-
)
|
|
126
|
-
const videoCardModelName = computed<string>(
|
|
127
|
-
() =>
|
|
128
|
-
videoCardModelOptions.value.find(
|
|
129
|
-
(videoCard) => videoCard.value === videoCardModel.value
|
|
130
|
-
)?.text || ''
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
watch(
|
|
134
|
-
[numberDisplays, totalVideoMemory, videoCardModel],
|
|
135
|
-
() => {
|
|
136
|
-
emits('send-data', {
|
|
137
|
-
adapter: videoCardModel.value,
|
|
138
|
-
displays: +numberDisplays.value,
|
|
139
|
-
memory_mb: totalVideoMemory.value,
|
|
140
|
-
})
|
|
141
|
-
},
|
|
142
|
-
{ immediate: true }
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
// Добавляем данные для редактирования
|
|
146
|
-
watch(
|
|
147
|
-
() => props.videoCard,
|
|
148
|
-
(newValue) => {
|
|
149
|
-
if (!newValue) return
|
|
150
|
-
|
|
151
|
-
selectedVideoCard.value = 1
|
|
152
|
-
videoCardModel.value = newValue.adapter
|
|
153
|
-
numberDisplays.value = '' + newValue.displays
|
|
154
|
-
totalVideoMemory.value = newValue.memory_mb
|
|
155
|
-
},
|
|
156
|
-
{ immediate: true }
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
const typeError = 'video_card.adapter'
|
|
160
|
-
|
|
161
|
-
const apiError = computed<string>(() => {
|
|
162
|
-
return (
|
|
163
|
-
props.errorValidationFields?.find((message) => message.field === typeError)
|
|
164
|
-
?.error_message || ''
|
|
165
|
-
)
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
const onRemoveValidationError = (): void => {
|
|
169
|
-
emits('remove-error-by-title', typeError)
|
|
170
|
-
}
|
|
171
|
-
</script>
|
|
172
|
-
|
|
173
|
-
<style scoped lang="scss">
|
|
174
|
-
#network-connect {
|
|
175
|
-
margin-right: 4px;
|
|
176
|
-
}
|
|
177
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hardware-cpu">
|
|
3
|
+
<atoms-stack-block :has-children="true">
|
|
4
|
+
<template #stackBlockKey>
|
|
5
|
+
<div id="vm-wizard-toggle-block-video-card" class="flex-align-center">
|
|
6
|
+
<span>{{ localization.videoCard }}: {{ videoCardModelName }}</span>
|
|
7
|
+
<atoms-the-icon
|
|
8
|
+
v-show="invalid"
|
|
9
|
+
width="24px"
|
|
10
|
+
height="24px"
|
|
11
|
+
class="is-error tooltip-trigger"
|
|
12
|
+
name="info"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<template #stackBlockContent>
|
|
17
|
+
<atoms-tooltip-error
|
|
18
|
+
:has-error="!!apiError"
|
|
19
|
+
selector=".vm-wizard-video-card"
|
|
20
|
+
@remove="onRemoveValidationError"
|
|
21
|
+
>
|
|
22
|
+
<template #elem>
|
|
23
|
+
<div class="select">
|
|
24
|
+
<select
|
|
25
|
+
id="vm-wizard-video-card"
|
|
26
|
+
v-model="selectedVideoCard"
|
|
27
|
+
class="vm-wizard-video-card input-text-color"
|
|
28
|
+
:disabled="props.isEdit && props.state !== 1"
|
|
29
|
+
@click.stop
|
|
30
|
+
>
|
|
31
|
+
<option
|
|
32
|
+
v-for="(item, key) in videoCardOptions"
|
|
33
|
+
:key="key"
|
|
34
|
+
:value="item.value"
|
|
35
|
+
>
|
|
36
|
+
{{ item.text }}
|
|
37
|
+
</option>
|
|
38
|
+
</select>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
<template #content>{{ apiError }}</template>
|
|
42
|
+
</atoms-tooltip-error>
|
|
43
|
+
</template>
|
|
44
|
+
<template #stackChildren>
|
|
45
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
|
|
46
|
+
v-model:number-displays="numberDisplays"
|
|
47
|
+
:disabled="isDisabled"
|
|
48
|
+
:error-validation-fields="props.errorValidationFields"
|
|
49
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
50
|
+
/>
|
|
51
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-total-video-memory
|
|
52
|
+
v-model:total-video-memory="totalVideoMemory"
|
|
53
|
+
:disabled="isDisabled"
|
|
54
|
+
:is-edit="props.isEdit"
|
|
55
|
+
:error-validation-fields="props.errorValidationFields"
|
|
56
|
+
@invalid="invalid = $event"
|
|
57
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
58
|
+
/>
|
|
59
|
+
<!-- <templates-home-vm-actions-add-customize-hardware-virtual-hardware-video-card-graphics-->
|
|
60
|
+
<!-- v-model:graphics="graphics"-->
|
|
61
|
+
<!-- />-->
|
|
62
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model
|
|
63
|
+
v-model:video-card-model="videoCardModel"
|
|
64
|
+
:disabled="isDisabled"
|
|
65
|
+
/>
|
|
66
|
+
</template>
|
|
67
|
+
</atoms-stack-block>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
import { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/models/interfaces'
|
|
73
|
+
import { UI_I_Localization } from '~/models/interfaces'
|
|
74
|
+
import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
|
|
75
|
+
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
76
|
+
import { videoCardModelOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/config/options'
|
|
77
|
+
import { videoCardOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/config/options'
|
|
78
|
+
|
|
79
|
+
const props = defineProps<{
|
|
80
|
+
isEdit: boolean
|
|
81
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
82
|
+
videoCard?: UI_I_SendDataVideoCard
|
|
83
|
+
state?: string | number
|
|
84
|
+
}>()
|
|
85
|
+
const emits = defineEmits<{
|
|
86
|
+
(event: 'send-data', value: UI_I_SendDataVideoCard): void
|
|
87
|
+
(event: 'invalid', value: boolean): void
|
|
88
|
+
(event: 'remove-error-by-title', value: string): void
|
|
89
|
+
}>()
|
|
90
|
+
|
|
91
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
92
|
+
|
|
93
|
+
const selectedVideoCard = ref<number>(1)
|
|
94
|
+
const videoCardOptions = ref<UI_I_OptionItem[]>(
|
|
95
|
+
videoCardOptionsFunc(localization.value)
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
const isDisabled = computed<boolean>(
|
|
99
|
+
() => selectedVideoCard.value === 0 || (props.isEdit && props.state !== 1)
|
|
100
|
+
)
|
|
101
|
+
watch(isDisabled, (val) => {
|
|
102
|
+
if (!val) {
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
numberDisplays.value = '1'
|
|
107
|
+
})
|
|
108
|
+
const numberDisplays = ref<string>('1')
|
|
109
|
+
|
|
110
|
+
const totalVideoMemory = ref<number>(8)
|
|
111
|
+
const invalid = ref<boolean>(false)
|
|
112
|
+
watch(
|
|
113
|
+
invalid,
|
|
114
|
+
(newValue) => {
|
|
115
|
+
emits('invalid', newValue)
|
|
116
|
+
},
|
|
117
|
+
{ immediate: true }
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
// const graphics = ref(false)
|
|
121
|
+
|
|
122
|
+
const videoCardModel = ref<string>('qxl')
|
|
123
|
+
const videoCardModelOptions = ref<UI_I_OptionItem[]>(
|
|
124
|
+
videoCardModelOptionsConfig
|
|
125
|
+
)
|
|
126
|
+
const videoCardModelName = computed<string>(
|
|
127
|
+
() =>
|
|
128
|
+
videoCardModelOptions.value.find(
|
|
129
|
+
(videoCard) => videoCard.value === videoCardModel.value
|
|
130
|
+
)?.text || ''
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
watch(
|
|
134
|
+
[numberDisplays, totalVideoMemory, videoCardModel],
|
|
135
|
+
() => {
|
|
136
|
+
emits('send-data', {
|
|
137
|
+
adapter: videoCardModel.value,
|
|
138
|
+
displays: +numberDisplays.value,
|
|
139
|
+
memory_mb: totalVideoMemory.value,
|
|
140
|
+
})
|
|
141
|
+
},
|
|
142
|
+
{ immediate: true }
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
// Добавляем данные для редактирования
|
|
146
|
+
watch(
|
|
147
|
+
() => props.videoCard,
|
|
148
|
+
(newValue) => {
|
|
149
|
+
if (!newValue) return
|
|
150
|
+
|
|
151
|
+
selectedVideoCard.value = 1
|
|
152
|
+
videoCardModel.value = newValue.adapter
|
|
153
|
+
numberDisplays.value = '' + newValue.displays
|
|
154
|
+
totalVideoMemory.value = newValue.memory_mb
|
|
155
|
+
},
|
|
156
|
+
{ immediate: true }
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
const typeError = 'video_card.adapter'
|
|
160
|
+
|
|
161
|
+
const apiError = computed<string>(() => {
|
|
162
|
+
return (
|
|
163
|
+
props.errorValidationFields?.find((message) => message.field === typeError)
|
|
164
|
+
?.error_message || ''
|
|
165
|
+
)
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
const onRemoveValidationError = (): void => {
|
|
169
|
+
emits('remove-error-by-title', typeError)
|
|
170
|
+
}
|
|
171
|
+
</script>
|
|
172
|
+
|
|
173
|
+
<style scoped lang="scss">
|
|
174
|
+
#network-connect {
|
|
175
|
+
margin-right: 4px;
|
|
176
|
+
}
|
|
177
|
+
</style>
|