bfg-common 1.4.399 → 1.4.400
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.
|
@@ -1,189 +1,203 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="customize-hardware">
|
|
3
|
-
<ui-tabs
|
|
4
|
-
v-model="selectedNavItem"
|
|
5
|
-
test-id="vm-wizard-tabs"
|
|
6
|
-
:tabs="
|
|
7
|
-
type="underline"
|
|
8
|
-
class="navigation"
|
|
9
|
-
/>
|
|
10
|
-
<ui-alert
|
|
11
|
-
v-show="props.errors.length"
|
|
12
|
-
status="alert-danger"
|
|
13
|
-
:items="props.errors"
|
|
14
|
-
test-id="customize-hardware-alert"
|
|
15
|
-
@remove="emits('remove-validation-errors')"
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
<div v-show="selectedNavItem === 0">
|
|
19
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware
|
|
20
|
-
:vm-name="vmName"
|
|
21
|
-
:storage="props.storage"
|
|
22
|
-
:max-cpus="props.maxCpus"
|
|
23
|
-
:max-memory="props.maxMemory"
|
|
24
|
-
:cpu-models="props.cpuModels"
|
|
25
|
-
:cpu="props.cpu"
|
|
26
|
-
:memory="props.memory"
|
|
27
|
-
:is-edit="props.isEdit"
|
|
28
|
-
:is-clone="props.isClone"
|
|
29
|
-
:state="props.state"
|
|
30
|
-
:hard-disks="props.hardDisks"
|
|
31
|
-
:cd-dvd-drives="props.cdDvdDrives"
|
|
32
|
-
:networks="props.networks"
|
|
33
|
-
:networks-table="props.networksTable"
|
|
34
|
-
:video-card="props.videoCard"
|
|
35
|
-
:usb-controller="props.usbController"
|
|
36
|
-
:pci-devices="props.pciDevices"
|
|
37
|
-
:nodes="props.nodes"
|
|
38
|
-
:files="props.files"
|
|
39
|
-
:error-validation-fields="props.errorValidationFields"
|
|
40
|
-
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
41
|
-
:datastore="props.datastore"
|
|
42
|
-
:vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
|
|
43
|
-
:passthrough-devices="props.passthroughDevices"
|
|
44
|
-
:project="props.project"
|
|
45
|
-
:guest-machine-type="guestMachineType"
|
|
46
|
-
@send-data="emits('send-data-virtual-hardware-method', $event)"
|
|
47
|
-
@get-storage="emits('get-storage', $event)"
|
|
48
|
-
@get-folders-or-files="emits('get-folders-or-files', $event)"
|
|
49
|
-
@get-active-device-child="emits('get-active-device-child', $event)"
|
|
50
|
-
@show-datastore-child="emits('show-datastore-child', $event)"
|
|
51
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
52
|
-
@invalid="virtualHardwareInvalid = $event"
|
|
53
|
-
@get-networks-table="emits('get-networks-table', $event)"
|
|
54
|
-
@get-pci-devices="emits('get-pci-devices')"
|
|
55
|
-
/>
|
|
56
|
-
</div>
|
|
57
|
-
<div v-show="selectedNavItem === 1">
|
|
58
|
-
<common-vm-actions-common-customize-hardware-vmoptions
|
|
59
|
-
v-model:vm-name="vmName"
|
|
60
|
-
v-model:guest-machine-type="guestMachineType"
|
|
61
|
-
v-model:guest-os-family="guestOsFamily"
|
|
62
|
-
v-model:guest-os-version="guestOsVersion"
|
|
63
|
-
:hard-disks="props.hardDisksForBootOptions"
|
|
64
|
-
:cd-dvd-drives="props.cdDvdDrivesForBootOptions"
|
|
65
|
-
:networks="props.networksForBootOptions"
|
|
66
|
-
:options="props.options"
|
|
67
|
-
:is-edit="props.isEdit"
|
|
68
|
-
:is-clone="props.isClone"
|
|
69
|
-
:error-validation-fields="props.errorValidationFields"
|
|
70
|
-
:state="props.state"
|
|
71
|
-
@change-boot-order="emits('change-boot-order', $event)"
|
|
72
|
-
@send-data="emits('send-data-vm-options-method', $event)"
|
|
73
|
-
@invalid="vmOptionsInvalid = $event"
|
|
74
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</template>
|
|
79
|
-
|
|
80
|
-
<script setup lang="ts">
|
|
81
|
-
import type {
|
|
82
|
-
import type {
|
|
83
|
-
import type {
|
|
84
|
-
import type {
|
|
85
|
-
import type {
|
|
86
|
-
import type {
|
|
87
|
-
import type {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
import type {
|
|
97
|
-
import type {
|
|
98
|
-
import type {
|
|
99
|
-
import type {
|
|
100
|
-
import type {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="customize-hardware">
|
|
3
|
+
<ui-tabs
|
|
4
|
+
v-model="selectedNavItem"
|
|
5
|
+
test-id="vm-wizard-tabs"
|
|
6
|
+
:tabs="navItemsLocal"
|
|
7
|
+
type="underline"
|
|
8
|
+
class="navigation"
|
|
9
|
+
/>
|
|
10
|
+
<ui-alert
|
|
11
|
+
v-show="props.errors.length"
|
|
12
|
+
status="alert-danger"
|
|
13
|
+
:items="props.errors"
|
|
14
|
+
test-id="customize-hardware-alert"
|
|
15
|
+
@remove="emits('remove-validation-errors')"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<div v-show="selectedNavItem === 0">
|
|
19
|
+
<common-vm-actions-common-customize-hardware-virtual-hardware
|
|
20
|
+
:vm-name="vmName"
|
|
21
|
+
:storage="props.storage"
|
|
22
|
+
:max-cpus="props.maxCpus"
|
|
23
|
+
:max-memory="props.maxMemory"
|
|
24
|
+
:cpu-models="props.cpuModels"
|
|
25
|
+
:cpu="props.cpu"
|
|
26
|
+
:memory="props.memory"
|
|
27
|
+
:is-edit="props.isEdit"
|
|
28
|
+
:is-clone="props.isClone"
|
|
29
|
+
:state="props.state"
|
|
30
|
+
:hard-disks="props.hardDisks"
|
|
31
|
+
:cd-dvd-drives="props.cdDvdDrives"
|
|
32
|
+
:networks="props.networks"
|
|
33
|
+
:networks-table="props.networksTable"
|
|
34
|
+
:video-card="props.videoCard"
|
|
35
|
+
:usb-controller="props.usbController"
|
|
36
|
+
:pci-devices="props.pciDevices"
|
|
37
|
+
:nodes="props.nodes"
|
|
38
|
+
:files="props.files"
|
|
39
|
+
:error-validation-fields="props.errorValidationFields"
|
|
40
|
+
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
41
|
+
:datastore="props.datastore"
|
|
42
|
+
:vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
|
|
43
|
+
:passthrough-devices="props.passthroughDevices"
|
|
44
|
+
:project="props.project"
|
|
45
|
+
:guest-machine-type="guestMachineType"
|
|
46
|
+
@send-data="emits('send-data-virtual-hardware-method', $event)"
|
|
47
|
+
@get-storage="emits('get-storage', $event)"
|
|
48
|
+
@get-folders-or-files="emits('get-folders-or-files', $event)"
|
|
49
|
+
@get-active-device-child="emits('get-active-device-child', $event)"
|
|
50
|
+
@show-datastore-child="emits('show-datastore-child', $event)"
|
|
51
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
52
|
+
@invalid="virtualHardwareInvalid = $event"
|
|
53
|
+
@get-networks-table="emits('get-networks-table', $event)"
|
|
54
|
+
@get-pci-devices="emits('get-pci-devices')"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
<div v-show="selectedNavItem === 1">
|
|
58
|
+
<common-vm-actions-common-customize-hardware-vmoptions
|
|
59
|
+
v-model:vm-name="vmName"
|
|
60
|
+
v-model:guest-machine-type="guestMachineType"
|
|
61
|
+
v-model:guest-os-family="guestOsFamily"
|
|
62
|
+
v-model:guest-os-version="guestOsVersion"
|
|
63
|
+
:hard-disks="props.hardDisksForBootOptions"
|
|
64
|
+
:cd-dvd-drives="props.cdDvdDrivesForBootOptions"
|
|
65
|
+
:networks="props.networksForBootOptions"
|
|
66
|
+
:options="props.options"
|
|
67
|
+
:is-edit="props.isEdit"
|
|
68
|
+
:is-clone="props.isClone"
|
|
69
|
+
:error-validation-fields="props.errorValidationFields"
|
|
70
|
+
:state="props.state"
|
|
71
|
+
@change-boot-order="emits('change-boot-order', $event)"
|
|
72
|
+
@send-data="emits('send-data-vm-options-method', $event)"
|
|
73
|
+
@invalid="vmOptionsInvalid = $event"
|
|
74
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script setup lang="ts">
|
|
81
|
+
import type { UI_I_TabItem } from 'bfg-uikit/components/ui/tabs/models/interfaces'
|
|
82
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
83
|
+
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
84
|
+
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
|
85
|
+
import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
|
|
86
|
+
import type { UI_I_FolderOrFileTreePayload } from '~/lib/models/store/storage/interfaces'
|
|
87
|
+
import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
|
|
88
|
+
import type {
|
|
89
|
+
UI_I_SendDataNewPciDevice,
|
|
90
|
+
UI_I_SendDataNewCdDvdDrive,
|
|
91
|
+
UI_I_SendDataNewHardDisk,
|
|
92
|
+
UI_I_SendDataNewNetwork,
|
|
93
|
+
UI_I_SendDataVideoCard,
|
|
94
|
+
UI_I_SendDataVirtualHardware,
|
|
95
|
+
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
96
|
+
import type { UI_I_SendDataVmoptions } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/lib/models/interfaces'
|
|
97
|
+
import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
|
|
98
|
+
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
99
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
100
|
+
import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
|
|
101
|
+
import type {
|
|
102
|
+
API_UI_I_VmEditCpu,
|
|
103
|
+
API_UI_I_VmEditMemory,
|
|
104
|
+
UI_I_PciDevice,
|
|
105
|
+
} from '~/lib/models/store/vm/interfaces'
|
|
106
|
+
import { navItemsNewViewFunc } from '~/components/common/vm/actions/common/customizeHardware/lib/config/navItems'
|
|
107
|
+
|
|
108
|
+
const vmName = defineModel<string>('vm-name', { required: true })
|
|
109
|
+
const guestOsFamily = defineModel<UI_I_OptionItem | null>('guest-os-family', {
|
|
110
|
+
required: true,
|
|
111
|
+
})
|
|
112
|
+
const guestOsVersion = defineModel<UI_I_OptionItem | null>('guest-os-version', {
|
|
113
|
+
required: true,
|
|
114
|
+
})
|
|
115
|
+
const selectedNavItem = defineModel<UI_T_SelectedNavItem>('selected-nav-item', {
|
|
116
|
+
required: true,
|
|
117
|
+
})
|
|
118
|
+
const guestMachineType = defineModel<UI_I_OptionItem | null>(
|
|
119
|
+
'guest-machine-type',
|
|
120
|
+
{ required: true }
|
|
121
|
+
)
|
|
122
|
+
const vmOptionsInvalid = defineModel<string[]>('vm-options-invalid', {
|
|
123
|
+
required: true,
|
|
124
|
+
})
|
|
125
|
+
const virtualHardwareInvalid = defineModel<string[]>(
|
|
126
|
+
'virtual-hardware-invalid',
|
|
127
|
+
{ required: true }
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
const props = defineProps<{
|
|
131
|
+
nodes: UI_I_FileTreeNode[]
|
|
132
|
+
files: UI_I_FileTreeNode[]
|
|
133
|
+
errors: string[]
|
|
134
|
+
storage: UI_I_DatastoreTableItem | null
|
|
135
|
+
maxCpus: number
|
|
136
|
+
navItems: UI_I_TabItem[]
|
|
137
|
+
cpuModels: UI_I_OptionItem[]
|
|
138
|
+
maxMemory: number
|
|
139
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
140
|
+
networksTable: UI_I_NetworkTableItem[]
|
|
141
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
142
|
+
networksForBootOptions: UI_I_SendDataNewNetwork[] | null
|
|
143
|
+
hardDisksForBootOptions: UI_I_SendDataNewHardDisk[] | null
|
|
144
|
+
cdDvdDrivesForBootOptions: UI_I_SendDataNewCdDvdDrive[] | null
|
|
145
|
+
cpu?: API_UI_I_VmEditCpu
|
|
146
|
+
state?: string | number
|
|
147
|
+
isEdit?: boolean
|
|
148
|
+
memory?: API_UI_I_VmEditMemory
|
|
149
|
+
project?: UI_T_Project
|
|
150
|
+
isClone?: boolean
|
|
151
|
+
options?: UI_I_SendDataVmoptions
|
|
152
|
+
networks?: UI_I_SendDataNewNetwork[] | null
|
|
153
|
+
videoCard?: UI_I_SendDataVideoCard
|
|
154
|
+
hardDisks?: UI_I_SendDataNewHardDisk[] | null
|
|
155
|
+
pciDevices?: UI_I_SendDataNewPciDevice[]
|
|
156
|
+
cdDvdDrives?: UI_I_SendDataNewCdDvdDrive[] | null
|
|
157
|
+
usbController?: string
|
|
158
|
+
passthroughDevices?: UI_I_PciDevice[]
|
|
159
|
+
vmCpuHelpTextSecond?: string
|
|
160
|
+
getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
|
|
161
|
+
}>()
|
|
162
|
+
const emits = defineEmits<{
|
|
163
|
+
(event: 'get-storage', value: UI_I_TablePayload): void
|
|
164
|
+
(event: 'get-pci-devices'): void
|
|
165
|
+
(event: 'get-networks-table', value: UI_I_TablePayload): void
|
|
166
|
+
(event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
|
|
167
|
+
(event: 'show-datastore-child', value: UI_I_FileTreeNode): void
|
|
168
|
+
(event: 'remove-error-by-title', value: string): void
|
|
169
|
+
(event: 'get-active-device-child', value: UI_I_FileTreeNode): void
|
|
170
|
+
(event: 'remove-validation-errors'): void
|
|
171
|
+
(event: 'send-data-vm-options-method', value: UI_I_SendDataVmoptions): void
|
|
172
|
+
(
|
|
173
|
+
event: 'send-data-virtual-hardware-method',
|
|
174
|
+
value: UI_I_SendDataVirtualHardware
|
|
175
|
+
): void
|
|
176
|
+
(event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
|
|
177
|
+
}>()
|
|
178
|
+
|
|
179
|
+
// const localization = computed<UI_I_Localization>(() => useLocal())
|
|
180
|
+
|
|
181
|
+
const navItemsLocal = computed<UI_I_TabItem[]>(() =>
|
|
182
|
+
navItemsNewViewFunc(localization.value)
|
|
183
|
+
)
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<style lang="scss">
|
|
187
|
+
:root {
|
|
188
|
+
--divider-color: #e9ebed;
|
|
189
|
+
}
|
|
190
|
+
:root.dark-theme {
|
|
191
|
+
--divider-color: #e9ebed1f;
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
194
|
+
|
|
195
|
+
<style scoped lang="scss">
|
|
196
|
+
.customize-hardware {
|
|
197
|
+
padding: 0 32px;
|
|
198
|
+
|
|
199
|
+
.navigation {
|
|
200
|
+
border-bottom: 1px solid var(--divider-color);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
</style>
|