bfg-common 1.0.14 → 1.0.16
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 +1 -1
- package/components/common/vm/actions/add/FolderTreeView.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/CustomizeHardware.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/Cpu.vue +371 -368
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/CpuModel.vue +2 -2
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/MaxCpu.vue +105 -99
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/shares/Shares.vue +155 -151
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/Limit.vue +214 -210
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/Memory.vue +282 -278
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/Location.vue +10 -10
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +10 -6
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +7 -3
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +2 -2
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/Location.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +256 -252
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +6 -6
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +3 -3
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/reservation/Reservation.vue +231 -228
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/VideoCard.vue +173 -169
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/Vmoptions.vue +145 -141
- package/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/BootOptions.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +230 -226
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +1 -1
- package/components/common/vm/actions/add/select/compatibility/Compatibility.vue +6 -6
- package/components/common/vm/actions/add/select/os/os.vue +7 -7
- package/package.json +1 -1
|
@@ -46,11 +46,11 @@ const localization = computed<UI_I_Localization>(() => useLocal())
|
|
|
46
46
|
const props = defineProps<{
|
|
47
47
|
diskProvisioning: string
|
|
48
48
|
index: number
|
|
49
|
-
errorValidationFields: UI_I_ErrorValidationField
|
|
49
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
50
50
|
disabled: boolean
|
|
51
51
|
}>()
|
|
52
52
|
const emits = defineEmits<{
|
|
53
|
-
(event: 'update:disk-provisioning',
|
|
53
|
+
(event: 'update:disk-provisioning', value: string): void
|
|
54
54
|
(event: 'remove-error-by-title', value: string): void
|
|
55
55
|
}>()
|
|
56
56
|
|
package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/Location.vue
CHANGED
|
@@ -79,7 +79,7 @@ const onHideLocationModal = (): void => {
|
|
|
79
79
|
emits('hide')
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const locationFilter = ref('')
|
|
82
|
+
const locationFilter = ref<string>('')
|
|
83
83
|
const tagsHeadItems = ref<UI_I_TableHeadItem[]>([
|
|
84
84
|
{ text: localization.value.name },
|
|
85
85
|
{ text: localization.value.nsxPortGroupId },
|
package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue
CHANGED
|
@@ -1,252 +1,256 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="hardware-network">
|
|
3
|
-
<atoms-stack-block :has-children="true" removable @remove="removeNetwork">
|
|
4
|
-
<template #stackBlockKey>
|
|
5
|
-
<div class="vm-wizard-toggle-block-network flex-align-center">
|
|
6
|
-
<span>{{ label }}</span>
|
|
7
|
-
<atoms-the-icon
|
|
8
|
-
v-show="newNetworkInvalid"
|
|
9
|
-
width="24px"
|
|
10
|
-
height="24px"
|
|
11
|
-
class="is-error tooltip-trigger"
|
|
12
|
-
name="info"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
<template #stackBlockContent>
|
|
17
|
-
<div class="flex-align-center flex-space-between">
|
|
18
|
-
<atoms-tooltip-error
|
|
19
|
-
:has-error="!!apiError"
|
|
20
|
-
:selector="`.vm-wizard-network-field-${props.index}`"
|
|
21
|
-
@remove="onRemoveValidationError"
|
|
22
|
-
>
|
|
23
|
-
<template #elem>
|
|
24
|
-
<div class="select">
|
|
25
|
-
<select
|
|
26
|
-
:id="`vm-wizard-network-field-${props.index}`"
|
|
27
|
-
v-model="selectedLocation"
|
|
28
|
-
:class="`vm-wizard-network-field-${props.index}`"
|
|
29
|
-
@click.stop
|
|
30
|
-
@change="changeLocation"
|
|
31
|
-
>
|
|
32
|
-
<option
|
|
33
|
-
v-for="(item, key) in locationOptions"
|
|
34
|
-
:key="key"
|
|
35
|
-
:value="item.value"
|
|
36
|
-
>
|
|
37
|
-
{{ item.text }}
|
|
38
|
-
</option>
|
|
39
|
-
</select>
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
<template #content>{{ apiError }}</template>
|
|
43
|
-
</atoms-tooltip-error>
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
<template #stackChildren>
|
|
47
|
-
<common-vm-actions-add-customize-hardware-virtual-hardware-new-network-adapter-type
|
|
48
|
-
v-model:adapter-type="adapterType"
|
|
49
|
-
:index="props.index"
|
|
50
|
-
:disabled="props.type === 'edit'"
|
|
51
|
-
:error-validation-fields="props.errorValidationFields"
|
|
52
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
53
|
-
/>
|
|
54
|
-
<common-vm-actions-add-customize-hardware-virtual-hardware-new-network-mac-address
|
|
55
|
-
v-model:mac-address="macAddress"
|
|
56
|
-
v-model:mac-address-type="macAddressType"
|
|
57
|
-
:index="props.index"
|
|
58
|
-
:disabled="props.type === 'edit'"
|
|
59
|
-
:error-validation-fields="props.errorValidationFields"
|
|
60
|
-
@invalid="newNetworkInvalid = $event"
|
|
61
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
62
|
-
/>
|
|
63
|
-
</template>
|
|
64
|
-
</atoms-stack-block>
|
|
65
|
-
|
|
66
|
-
<common-vm-actions-add-customize-hardware-virtual-hardware-new-network-location
|
|
67
|
-
:location-modal-is-show="locationModalIsShow"
|
|
68
|
-
:networks-table="networksTable"
|
|
69
|
-
@hide="onHideLocationModal"
|
|
70
|
-
@select="onSelectLocation"
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
</template>
|
|
74
|
-
|
|
75
|
-
<script setup lang="ts">
|
|
76
|
-
import { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
77
|
-
import { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
|
|
78
|
-
import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
|
|
79
|
-
import { UI_I_SendDataNewNetwork } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
|
|
80
|
-
import { UI_T_NetworkType } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/types'
|
|
81
|
-
import { UI_I_Localization, UI_I_HTMLSelectElement } from '~/models/interfaces'
|
|
82
|
-
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
83
|
-
|
|
84
|
-
const props = defineProps<{
|
|
85
|
-
index: number
|
|
86
|
-
type: UI_T_NetworkType
|
|
87
|
-
network: UI_I_SendDataNewNetwork
|
|
88
|
-
networksTable: UI_I_NetworkTableItem[]
|
|
89
|
-
errorValidationFields: UI_I_ErrorValidationField
|
|
90
|
-
}>()
|
|
91
|
-
|
|
92
|
-
const emits = defineEmits<{
|
|
93
|
-
(event: 'send-data', value: UI_I_SendDataNewNetwork): void
|
|
94
|
-
(event: 'invalid', value: boolean): void
|
|
95
|
-
(event: 'remove'): void
|
|
96
|
-
(event: 'remove-error-by-title', value: string): void
|
|
97
|
-
(event: 'get-networks-table', value: UI_I_TablePayload): void
|
|
98
|
-
}>()
|
|
99
|
-
|
|
100
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
101
|
-
|
|
102
|
-
const label = computed<string>(() => {
|
|
103
|
-
if (props.type === 'edit')
|
|
104
|
-
return `${localization.value.networkAdapter} ${props.index + 1}`
|
|
105
|
-
|
|
106
|
-
return `${localization.value.newNetwork} *`
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
const removeNetwork = (): void => {
|
|
110
|
-
emits('remove')
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const selectedLocationOld = ref<string>('')
|
|
114
|
-
const selectedLocation = ref<string>('')
|
|
115
|
-
const locationOptions = ref<UI_I_OptionItem[]>([])
|
|
116
|
-
|
|
117
|
-
const getNetworks = (): void => {
|
|
118
|
-
// if (props.networksTable.length) return // Из-за этого кода был баг. Открыть визард вм -> создать сеть -> открыть визард вм и в списке сетей нету новой сети
|
|
119
|
-
|
|
120
|
-
const payload: UI_I_TablePayload = {
|
|
121
|
-
pagination: {
|
|
122
|
-
page: 1,
|
|
123
|
-
pageSize: 100,
|
|
124
|
-
},
|
|
125
|
-
schema: 'full',
|
|
126
|
-
type: 'network',
|
|
127
|
-
sortBy: null,
|
|
128
|
-
}
|
|
129
|
-
emits('get-networks-table', payload)
|
|
130
|
-
}
|
|
131
|
-
getNetworks()
|
|
132
|
-
watch(
|
|
133
|
-
() => props.networksTable,
|
|
134
|
-
(networks) => {
|
|
135
|
-
if (!networks.length || props.type === 'edit') return
|
|
136
|
-
|
|
137
|
-
selectedLocationOld.value = networks[0].net_bridge
|
|
138
|
-
selectedLocation.value = networks[0].net_bridge
|
|
139
|
-
|
|
140
|
-
locationOptions.value = [
|
|
141
|
-
{ text: networks[0].name, value: networks[0].net_bridge },
|
|
142
|
-
{ text: `${localization.value.browse}...`, value: '' },
|
|
143
|
-
]
|
|
144
|
-
},
|
|
145
|
-
{ immediate: true }
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
const locationModalIsShow = ref<boolean>(false)
|
|
149
|
-
const onHideLocationModal = (): void => {
|
|
150
|
-
locationModalIsShow.value = false
|
|
151
|
-
selectedLocation.value = selectedLocationOld.value
|
|
152
|
-
}
|
|
153
|
-
const changeLocation = (event: UI_I_HTMLSelectElement): void => {
|
|
154
|
-
const value = event.target.value
|
|
155
|
-
if (value === '') {
|
|
156
|
-
locationModalIsShow.value = true
|
|
157
|
-
return
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
selectedLocationOld.value = value
|
|
161
|
-
selectedLocation.value = value
|
|
162
|
-
// netBridge.value = value
|
|
163
|
-
}
|
|
164
|
-
const onSelectLocation = (network: UI_I_NetworkTableItem): void => {
|
|
165
|
-
locationModalIsShow.value = false
|
|
166
|
-
|
|
167
|
-
selectedLocationOld.value = network.net_bridge
|
|
168
|
-
selectedLocation.value = network.net_bridge
|
|
169
|
-
|
|
170
|
-
const hasNetwork = locationOptions.value.some(
|
|
171
|
-
(option) => option.value === network.net_bridge
|
|
172
|
-
)
|
|
173
|
-
if (hasNetwork) {
|
|
174
|
-
return
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
locationOptions.value = [
|
|
178
|
-
...locationOptions.value.slice(0, -1),
|
|
179
|
-
{ text: network.name, value: network.net_bridge },
|
|
180
|
-
locationOptions.value[locationOptions.value.length - 1],
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
const adapterType = ref<string>('rtl8139')
|
|
185
|
-
|
|
186
|
-
const macAddress = ref<string>('')
|
|
187
|
-
const macAddressType = ref<string>('automatic')
|
|
188
|
-
const newNetworkInvalid = ref<boolean>(false)
|
|
189
|
-
watch(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
)
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hardware-network">
|
|
3
|
+
<atoms-stack-block :has-children="true" removable @remove="removeNetwork">
|
|
4
|
+
<template #stackBlockKey>
|
|
5
|
+
<div class="vm-wizard-toggle-block-network flex-align-center">
|
|
6
|
+
<span>{{ label }}</span>
|
|
7
|
+
<atoms-the-icon
|
|
8
|
+
v-show="newNetworkInvalid"
|
|
9
|
+
width="24px"
|
|
10
|
+
height="24px"
|
|
11
|
+
class="is-error tooltip-trigger"
|
|
12
|
+
name="info"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<template #stackBlockContent>
|
|
17
|
+
<div class="flex-align-center flex-space-between">
|
|
18
|
+
<atoms-tooltip-error
|
|
19
|
+
:has-error="!!apiError"
|
|
20
|
+
:selector="`.vm-wizard-network-field-${props.index}`"
|
|
21
|
+
@remove="onRemoveValidationError"
|
|
22
|
+
>
|
|
23
|
+
<template #elem>
|
|
24
|
+
<div class="select">
|
|
25
|
+
<select
|
|
26
|
+
:id="`vm-wizard-network-field-${props.index}`"
|
|
27
|
+
v-model="selectedLocation"
|
|
28
|
+
:class="`vm-wizard-network-field-${props.index}`"
|
|
29
|
+
@click.stop
|
|
30
|
+
@change="changeLocation"
|
|
31
|
+
>
|
|
32
|
+
<option
|
|
33
|
+
v-for="(item, key) in locationOptions"
|
|
34
|
+
:key="key"
|
|
35
|
+
:value="item.value"
|
|
36
|
+
>
|
|
37
|
+
{{ item.text }}
|
|
38
|
+
</option>
|
|
39
|
+
</select>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<template #content>{{ apiError }}</template>
|
|
43
|
+
</atoms-tooltip-error>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<template #stackChildren>
|
|
47
|
+
<common-vm-actions-add-customize-hardware-virtual-hardware-new-network-adapter-type
|
|
48
|
+
v-model:adapter-type="adapterType"
|
|
49
|
+
:index="props.index"
|
|
50
|
+
:disabled="props.type === 'edit'"
|
|
51
|
+
:error-validation-fields="props.errorValidationFields"
|
|
52
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
53
|
+
/>
|
|
54
|
+
<common-vm-actions-add-customize-hardware-virtual-hardware-new-network-mac-address
|
|
55
|
+
v-model:mac-address="macAddress"
|
|
56
|
+
v-model:mac-address-type="macAddressType"
|
|
57
|
+
:index="props.index"
|
|
58
|
+
:disabled="props.type === 'edit'"
|
|
59
|
+
:error-validation-fields="props.errorValidationFields"
|
|
60
|
+
@invalid="newNetworkInvalid = $event"
|
|
61
|
+
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
62
|
+
/>
|
|
63
|
+
</template>
|
|
64
|
+
</atoms-stack-block>
|
|
65
|
+
|
|
66
|
+
<common-vm-actions-add-customize-hardware-virtual-hardware-new-network-location
|
|
67
|
+
:location-modal-is-show="locationModalIsShow"
|
|
68
|
+
:networks-table="networksTable"
|
|
69
|
+
@hide="onHideLocationModal"
|
|
70
|
+
@select="onSelectLocation"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
77
|
+
import { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
|
|
78
|
+
import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
|
|
79
|
+
import { UI_I_SendDataNewNetwork } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
|
|
80
|
+
import { UI_T_NetworkType } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/types'
|
|
81
|
+
import { UI_I_Localization, UI_I_HTMLSelectElement } from '~/models/interfaces'
|
|
82
|
+
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
83
|
+
|
|
84
|
+
const props = defineProps<{
|
|
85
|
+
index: number
|
|
86
|
+
type: UI_T_NetworkType
|
|
87
|
+
network: UI_I_SendDataNewNetwork
|
|
88
|
+
networksTable: UI_I_NetworkTableItem[]
|
|
89
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
90
|
+
}>()
|
|
91
|
+
|
|
92
|
+
const emits = defineEmits<{
|
|
93
|
+
(event: 'send-data', value: UI_I_SendDataNewNetwork): void
|
|
94
|
+
(event: 'invalid', value: boolean): void
|
|
95
|
+
(event: 'remove'): void
|
|
96
|
+
(event: 'remove-error-by-title', value: string): void
|
|
97
|
+
(event: 'get-networks-table', value: UI_I_TablePayload): void
|
|
98
|
+
}>()
|
|
99
|
+
|
|
100
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
101
|
+
|
|
102
|
+
const label = computed<string>(() => {
|
|
103
|
+
if (props.type === 'edit')
|
|
104
|
+
return `${localization.value.networkAdapter} ${props.index + 1}`
|
|
105
|
+
|
|
106
|
+
return `${localization.value.newNetwork} *`
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
const removeNetwork = (): void => {
|
|
110
|
+
emits('remove')
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const selectedLocationOld = ref<string>('')
|
|
114
|
+
const selectedLocation = ref<string>('')
|
|
115
|
+
const locationOptions = ref<UI_I_OptionItem[]>([])
|
|
116
|
+
|
|
117
|
+
const getNetworks = (): void => {
|
|
118
|
+
// if (props.networksTable.length) return // Из-за этого кода был баг. Открыть визард вм -> создать сеть -> открыть визард вм и в списке сетей нету новой сети
|
|
119
|
+
|
|
120
|
+
const payload: UI_I_TablePayload = {
|
|
121
|
+
pagination: {
|
|
122
|
+
page: 1,
|
|
123
|
+
pageSize: 100,
|
|
124
|
+
},
|
|
125
|
+
schema: 'full',
|
|
126
|
+
type: 'network',
|
|
127
|
+
sortBy: null,
|
|
128
|
+
}
|
|
129
|
+
emits('get-networks-table', payload)
|
|
130
|
+
}
|
|
131
|
+
getNetworks()
|
|
132
|
+
watch(
|
|
133
|
+
() => props.networksTable,
|
|
134
|
+
(networks) => {
|
|
135
|
+
if (!networks.length || props.type === 'edit') return
|
|
136
|
+
|
|
137
|
+
selectedLocationOld.value = networks[0].net_bridge
|
|
138
|
+
selectedLocation.value = networks[0].net_bridge
|
|
139
|
+
|
|
140
|
+
locationOptions.value = [
|
|
141
|
+
{ text: networks[0].name, value: networks[0].net_bridge },
|
|
142
|
+
{ text: `${localization.value.browse}...`, value: '' },
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{ immediate: true }
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
const locationModalIsShow = ref<boolean>(false)
|
|
149
|
+
const onHideLocationModal = (): void => {
|
|
150
|
+
locationModalIsShow.value = false
|
|
151
|
+
selectedLocation.value = selectedLocationOld.value
|
|
152
|
+
}
|
|
153
|
+
const changeLocation = (event: UI_I_HTMLSelectElement): void => {
|
|
154
|
+
const value = event.target.value
|
|
155
|
+
if (value === '') {
|
|
156
|
+
locationModalIsShow.value = true
|
|
157
|
+
return
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
selectedLocationOld.value = value
|
|
161
|
+
selectedLocation.value = value
|
|
162
|
+
// netBridge.value = value
|
|
163
|
+
}
|
|
164
|
+
const onSelectLocation = (network: UI_I_NetworkTableItem): void => {
|
|
165
|
+
locationModalIsShow.value = false
|
|
166
|
+
|
|
167
|
+
selectedLocationOld.value = network.net_bridge
|
|
168
|
+
selectedLocation.value = network.net_bridge
|
|
169
|
+
|
|
170
|
+
const hasNetwork = locationOptions.value.some(
|
|
171
|
+
(option) => option.value === network.net_bridge
|
|
172
|
+
)
|
|
173
|
+
if (hasNetwork) {
|
|
174
|
+
return
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
locationOptions.value = [
|
|
178
|
+
...locationOptions.value.slice(0, -1),
|
|
179
|
+
{ text: network.name, value: network.net_bridge },
|
|
180
|
+
locationOptions.value[locationOptions.value.length - 1],
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const adapterType = ref<string>('rtl8139')
|
|
185
|
+
|
|
186
|
+
const macAddress = ref<string>('')
|
|
187
|
+
const macAddressType = ref<string>('automatic')
|
|
188
|
+
const newNetworkInvalid = ref<boolean>(false)
|
|
189
|
+
watch(
|
|
190
|
+
newNetworkInvalid,
|
|
191
|
+
(newValue) => {
|
|
192
|
+
emits('invalid', newValue)
|
|
193
|
+
},
|
|
194
|
+
{ immediate: true }
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
watch(
|
|
198
|
+
[selectedLocation, adapterType, macAddress, macAddressType, locationOptions],
|
|
199
|
+
() => {
|
|
200
|
+
const option = locationOptions.value.find(
|
|
201
|
+
(option) => option.value === selectedLocation.value
|
|
202
|
+
)
|
|
203
|
+
if (!option) return
|
|
204
|
+
|
|
205
|
+
emits('send-data', {
|
|
206
|
+
network: option.text,
|
|
207
|
+
net_bridge: option.value,
|
|
208
|
+
target: '',
|
|
209
|
+
model: adapterType.value,
|
|
210
|
+
mac: macAddress.value,
|
|
211
|
+
boot_order: -1,
|
|
212
|
+
})
|
|
213
|
+
},
|
|
214
|
+
{ immediate: true }
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
// Добавляем данные для редактирования
|
|
218
|
+
watch(
|
|
219
|
+
() => props.network,
|
|
220
|
+
(newValue) => {
|
|
221
|
+
if (props.type !== 'edit') return
|
|
222
|
+
|
|
223
|
+
locationOptions.value = [
|
|
224
|
+
{ text: newValue.network, value: newValue.net_bridge },
|
|
225
|
+
{ text: `${localization.value.browse}...`, value: '' },
|
|
226
|
+
]
|
|
227
|
+
selectedLocation.value = newValue.net_bridge
|
|
228
|
+
|
|
229
|
+
adapterType.value = newValue.model
|
|
230
|
+
macAddress.value = newValue.mac
|
|
231
|
+
},
|
|
232
|
+
{ immediate: true }
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
const typeError = computed<string>(
|
|
236
|
+
() => `network_devices[${props.index}].network`
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
const apiError = computed<string>(() => {
|
|
240
|
+
return (
|
|
241
|
+
props.errorValidationFields?.find(
|
|
242
|
+
(message) => message.field === typeError.value
|
|
243
|
+
)?.error_message || ''
|
|
244
|
+
)
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
const onRemoveValidationError = (): void => {
|
|
248
|
+
emits('remove-error-by-title', typeError.value)
|
|
249
|
+
}
|
|
250
|
+
</script>
|
|
251
|
+
|
|
252
|
+
<style scoped lang="scss">
|
|
253
|
+
#network-connect {
|
|
254
|
+
margin-right: 4px;
|
|
255
|
+
}
|
|
256
|
+
</style>
|
|
@@ -48,7 +48,7 @@ const props = defineProps<{
|
|
|
48
48
|
adapterType: string
|
|
49
49
|
index: number
|
|
50
50
|
disabled: boolean
|
|
51
|
-
errorValidationFields: UI_I_ErrorValidationField
|
|
51
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
52
52
|
}>()
|
|
53
53
|
const emits = defineEmits<{
|
|
54
54
|
(event: 'update:adapter-type', value: string): void
|
|
@@ -66,7 +66,7 @@ const props = defineProps<{
|
|
|
66
66
|
macAddress: string
|
|
67
67
|
index: number
|
|
68
68
|
disabled: boolean
|
|
69
|
-
errorValidationFields: UI_I_ErrorValidationField
|
|
69
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
70
70
|
}>()
|
|
71
71
|
const emits = defineEmits<{
|
|
72
72
|
(event: 'update:mac-address', value: string): void
|
|
@@ -79,12 +79,12 @@ const macAddressOptions = ref<UI_I_OptionItem[]>(
|
|
|
79
79
|
macAddressOptionsFunc(localization.value)
|
|
80
80
|
)
|
|
81
81
|
|
|
82
|
-
const onChangeMacAddressType = (
|
|
83
|
-
emits('update:mac-address-type',
|
|
84
|
-
emits('update:mac-address',
|
|
82
|
+
const onChangeMacAddressType = (event: UI_I_HTMLSelectElement): void => {
|
|
83
|
+
emits('update:mac-address-type', event.target.value)
|
|
84
|
+
emits('update:mac-address', event.target.value === 'manual' ? '00:50:56:' : '')
|
|
85
85
|
}
|
|
86
|
-
const onChangeMacAddress = (
|
|
87
|
-
const target =
|
|
86
|
+
const onChangeMacAddress = (event: Event): void => {
|
|
87
|
+
const target = event.target as HTMLInputElement
|
|
88
88
|
emits('update:mac-address', target.value)
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -41,7 +41,7 @@ const props = withDefaults(
|
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
const emits = defineEmits<{
|
|
44
|
-
(event: 'send-data',
|
|
44
|
+
(event: 'send-data', value: string): void
|
|
45
45
|
}>()
|
|
46
46
|
|
|
47
47
|
const localization = computed(() => useLocal())
|
|
@@ -51,8 +51,8 @@ const usbControllerOptions = ref<UI_I_OptionItem[]>(usbControllerOptionsConfig)
|
|
|
51
51
|
|
|
52
52
|
watch(
|
|
53
53
|
selectedUsbController,
|
|
54
|
-
(
|
|
55
|
-
emits('send-data',
|
|
54
|
+
(newValue) => {
|
|
55
|
+
emits('send-data', newValue)
|
|
56
56
|
},
|
|
57
57
|
{ immediate: true }
|
|
58
58
|
)
|