bfg-common 1.3.205 → 1.3.206
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/adapterManager/AdapterManager.vue +7 -5
- package/components/common/adapterManager/AddAdapterModal.vue +5 -6
- package/components/common/diagramMain/DiagramMain.vue +5 -4
- package/components/common/diagramMain/lib/models/interfaces.ts +84 -33
- package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +5 -3
- package/components/common/diagramMain/modals/editSettings/EditSettings.vue +3 -2
- package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +8 -5
- package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +6 -3
- package/components/common/wizards/network/add/Add.vue +567 -566
- package/components/common/wizards/network/add/steps/CreateStandardSwitch.vue +6 -3
- package/lib/models/enums.ts +10 -4
- package/package.json +1 -1
|
@@ -1,190 +1,191 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
<atoms-wizard
|
|
3
|
+
v-model:show="props.show"
|
|
4
|
+
:steps="wizard.steps"
|
|
5
|
+
:selected-scheme="selectedScheme"
|
|
6
|
+
:is-loading="wizard.wizardLoader.status"
|
|
7
|
+
:loader-messages="wizard.wizardLoader.messages"
|
|
8
|
+
:title="title"
|
|
9
|
+
max-height="551px"
|
|
10
|
+
:was-completed="wasCompleted"
|
|
11
|
+
:localization="localization"
|
|
12
|
+
:class="[
|
|
13
13
|
'add-networking-wizard',
|
|
14
14
|
{
|
|
15
15
|
'is-dark': props.isDarkMode,
|
|
16
16
|
},
|
|
17
17
|
]"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
18
|
+
@change-steps="onChangeSteps"
|
|
19
|
+
@hide="onHideAddNetworkingModal"
|
|
20
|
+
@submit="onSubmit"
|
|
21
|
+
>
|
|
22
|
+
<template #modalBody="{ selectedStep }">
|
|
23
|
+
<common-wizards-network-add-steps-select-connection-type
|
|
24
|
+
v-if="selectedStep.id === 0"
|
|
25
|
+
v-model="connectionTypeLocal"
|
|
26
|
+
/>
|
|
27
|
+
<common-wizards-network-add-steps-selected-target-device
|
|
28
|
+
v-if="selectedStep.id === 1"
|
|
29
|
+
:wizard="wizard"
|
|
30
|
+
:target-device="targetDevice"
|
|
31
|
+
:connection-type="connectionTypeLocal"
|
|
32
|
+
:standard-switches-initial="props.standardSwitchesInitial"
|
|
33
|
+
:messages-fields="selectedStep.fields"
|
|
34
|
+
:alert-messages="alertMessages[1]"
|
|
35
|
+
:selected-standard-switch-id="props.selectedStandardSwitchId"
|
|
36
|
+
:selected-switch-id="props.selectedSwitchId"
|
|
37
|
+
@hide-alert="onHideAlert"
|
|
38
|
+
@change-target-device="onChangeTargetDevice"
|
|
39
|
+
/>
|
|
40
|
+
<common-wizards-network-add-steps-create-standard-switch
|
|
41
|
+
v-if="selectedStep.id === 2 || selectedStep.id === 6"
|
|
42
|
+
:free-adapters="props.freeAdapters"
|
|
43
|
+
:added-adapters="addedAdapters"
|
|
44
|
+
:core-adapters="coreAdapters"
|
|
45
|
+
:adapter-status="adapterStatus"
|
|
46
|
+
:adapters="props.adapters"
|
|
47
|
+
:is-show-no-connected-active-adapters-modal="
|
|
48
48
|
isShowNoConnectedActiveAdaptersModal
|
|
49
49
|
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
:is-show-no-active-adapters-modal="isShowNoActiveAdaptersModal"
|
|
51
|
+
:is-dark-mode="props.isDarkMode"
|
|
52
|
+
@get-free-adapters="onGetFreeAdapters"
|
|
53
|
+
@change-added-adapters="onChangeAddedAdapters"
|
|
54
|
+
@change-adapter-status="onChangeAdapterStatus"
|
|
55
|
+
@confirm-no-active-adapters-modal="onConfirmNoActiveAdaptersModal"
|
|
56
|
+
@hide-no-connected-active-adapters-modal="
|
|
57
57
|
onHideNoConnectedActiveAdaptersModal
|
|
58
58
|
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
59
|
+
@hide-no-active-adapters-modal="onHideNoActiveAdaptersModal"
|
|
60
|
+
/>
|
|
61
|
+
<common-wizards-network-add-steps-port-properties
|
|
62
|
+
v-if="selectedStep.id === 3"
|
|
63
|
+
:wizard="wizard"
|
|
64
|
+
:port-properties="portProperties"
|
|
65
|
+
:mtu-from-switch="mtuFromSwitch"
|
|
66
|
+
:project="props.project"
|
|
67
|
+
:messages-fields="selectedStep.fields"
|
|
68
|
+
:alert-messages="alertMessages[3]"
|
|
69
|
+
:tcp-stacks="props.tcpStacks"
|
|
70
|
+
@change-gateway-flag="onChangeGatewayFlag"
|
|
71
|
+
@change-port-properties="onChangePortProperties"
|
|
72
|
+
@hide-alert="onHideAlert"
|
|
73
|
+
/>
|
|
74
|
+
<common-wizards-network-add-steps-ip-four-settings
|
|
75
|
+
v-if="selectedStep.id === 4"
|
|
76
|
+
:wizard="wizard"
|
|
77
|
+
:ip-four-settings="ipFourSettings"
|
|
78
|
+
:messages-fields="selectedStep.fields"
|
|
79
|
+
:alert-messages="alertMessages[4]"
|
|
80
|
+
:tcp-stacks="props.tcpStacks"
|
|
81
|
+
:tcp="portProperties.tcp"
|
|
82
|
+
:gateway-flag="gatewayFlag"
|
|
83
|
+
@change-gateway-flag="onChangeGatewayFlag"
|
|
84
|
+
@change-ip-four-settings="onChangeIpFourSettings"
|
|
85
|
+
@hide-alert="onHideAlert"
|
|
86
|
+
/>
|
|
87
|
+
<common-wizards-network-add-steps-connection-settings
|
|
88
|
+
v-if="selectedStep.id === 5"
|
|
89
|
+
:wizard="wizard"
|
|
90
|
+
:connection-settings="connectionSettings"
|
|
91
|
+
:messages-fields="selectedStep.fields"
|
|
92
|
+
:alert-messages="alertMessages[5]"
|
|
93
|
+
@change-connection-settings="onChangeConnectionSettings"
|
|
94
|
+
@hide-alert="onHideAlert"
|
|
95
|
+
/>
|
|
96
|
+
<!-- <common-wizards-network-add-steps-physical-adapter-->
|
|
97
|
+
<!-- v-if="selectedStep.id === 6"-->
|
|
98
|
+
<!-- />-->
|
|
99
|
+
<common-wizards-network-add-steps-ready-complete
|
|
100
|
+
v-if="selectedStep.id === 7"
|
|
101
|
+
:ready-complete-fields="readyCompleteFields"
|
|
102
|
+
/>
|
|
103
|
+
</template>
|
|
104
|
+
</atoms-wizard>
|
|
105
105
|
</template>
|
|
106
106
|
|
|
107
107
|
<script setup lang="ts">
|
|
108
108
|
import {
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
UI_I_ArbitraryObject,
|
|
110
|
+
UI_I_Localization,
|
|
111
|
+
UI_I_ItemsWithTotalCounts,
|
|
111
112
|
} from '~/lib/models/interfaces'
|
|
112
113
|
import { UI_T_Project } from '~/lib/models/types'
|
|
113
114
|
import {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
UI_I_PortProperties,
|
|
116
|
+
UI_I_IpFourSettings,
|
|
117
|
+
UI_I_ConnectionSettings,
|
|
118
|
+
UI_I_TargetDevice,
|
|
119
|
+
UI_I_Switch,
|
|
120
|
+
UI_I_ReadyCompleteFields,
|
|
121
|
+
UI_I_AddNetworkingSecondOrThirdSchemeDataSend,
|
|
122
|
+
UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
|
|
123
|
+
UI_I_AddNetworkingFourthOrFifthSchemeDataSend,
|
|
124
|
+
UI_I_AddNetworkingEmits,
|
|
125
|
+
UI_I_TCPStack,
|
|
125
126
|
} from '~/components/common/wizards/network/add/lib/models/interfaces'
|
|
126
127
|
import {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
UI_I_Adapter,
|
|
129
|
+
UI_I_AdapterStatus,
|
|
130
|
+
UI_I_SwitchAdapterItem,
|
|
131
|
+
UI_I_DiagramData,
|
|
130
132
|
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
131
133
|
import {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
UI_I_ValidationReturn,
|
|
135
|
+
UI_I_WizardStep,
|
|
134
136
|
} from '~/components/atoms/wizard/lib/models/interfaces'
|
|
135
137
|
import { UI_E_ValidationFields } from '~/components/common/wizards/network/add/lib/models/enums'
|
|
136
138
|
import { getVlanId } from '~/components/common/wizards/network/add/lib/utils'
|
|
137
139
|
import Wizard from '~/components/atoms/wizard/lib/utils/utils'
|
|
138
140
|
import {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
141
|
+
createZeroSchemeReadyCompleteFunc,
|
|
142
|
+
createFirstSchemeReadyCompleteFunc,
|
|
143
|
+
createSecondSchemeReadyCompleteFunc,
|
|
144
|
+
createThirdSchemeReadyCompleteFunc,
|
|
145
|
+
stepsSchemeInitial,
|
|
146
|
+
stepsFunc,
|
|
147
|
+
connectionSettingsInitial,
|
|
148
|
+
portPropertiesInitial,
|
|
149
|
+
ipFourSettingsInitial,
|
|
150
|
+
targetDeviceInitial,
|
|
151
|
+
addNetworkingZeroOrFirstSchemeDataFunc,
|
|
152
|
+
addNetworkingSecondOrThirdSchemeDataFunc,
|
|
153
|
+
addNetworkingFourthOrFifthSchemeDataFunc,
|
|
152
154
|
} from '~/components/common/wizards/network/add/lib/config'
|
|
153
|
-
|
|
154
155
|
import {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
checkTargetDeviceSync,
|
|
157
|
+
checkAdaptersSync,
|
|
158
|
+
checkPortPropertiesSync,
|
|
159
|
+
checkIpFourSettingsSync,
|
|
160
|
+
checkConnectionSettingsSync,
|
|
161
|
+
checkNetworkAsync,
|
|
161
162
|
} from '~/components/common/wizards/network/add/validations/validations'
|
|
162
163
|
|
|
163
164
|
const props = withDefaults(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
165
|
+
defineProps<{
|
|
166
|
+
show: boolean
|
|
167
|
+
adapters: UI_I_ItemsWithTotalCounts<UI_I_SwitchAdapterItem>
|
|
168
|
+
standardSwitchesInitial: UI_I_Switch[]
|
|
169
|
+
freeAdapters: UI_I_Adapter[]
|
|
170
|
+
project?: UI_T_Project
|
|
171
|
+
isDarkMode?: boolean
|
|
172
|
+
selectedStandardSwitchId?: string
|
|
173
|
+
selectedSwitchId?: string
|
|
174
|
+
tcpStacks?: UI_I_TCPStack[]
|
|
175
|
+
tcpStackLoading?: boolean
|
|
176
|
+
diagramsData?: UI_I_DiagramData[]
|
|
177
|
+
}>(),
|
|
178
|
+
{
|
|
179
|
+
standardSwitchesInitial: () => [],
|
|
180
|
+
freeAdapters: () => [],
|
|
181
|
+
project: 'procurator',
|
|
182
|
+
isDarkMode: false,
|
|
183
|
+
selectedStandardSwitchId: '',
|
|
184
|
+
selectedSwitchId: '',
|
|
185
|
+
tcpStacks: () => [],
|
|
186
|
+
tcpStackLoading: false,
|
|
187
|
+
diagramsData: [],
|
|
188
|
+
}
|
|
188
189
|
)
|
|
189
190
|
|
|
190
191
|
const emits = defineEmits<UI_I_AddNetworkingEmits>()
|
|
@@ -193,12 +194,12 @@ const localization = computed<UI_I_Localization>(() => useLocal())
|
|
|
193
194
|
|
|
194
195
|
const hostname = ref<string>('')
|
|
195
196
|
const title = computed<string>(
|
|
196
|
-
|
|
197
|
+
() => `${hostname.value} - ${localization.value.addNetworking}`
|
|
197
198
|
)
|
|
198
199
|
|
|
199
200
|
const wizard: Wizard = new Wizard(
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
stepsFunc(localization.value),
|
|
202
|
+
stepsSchemeInitial
|
|
202
203
|
)
|
|
203
204
|
const wasCompleted = computed<boolean>(() => wizard.wasCompleted())
|
|
204
205
|
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
@@ -210,15 +211,15 @@ const readyCompleteFields = ref<UI_I_ReadyCompleteFields[]>([])
|
|
|
210
211
|
const connectionType = ref<string>('0')
|
|
211
212
|
|
|
212
213
|
const connectionTypeLocal = computed<string>({
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
get() {
|
|
215
|
+
return connectionType.value
|
|
216
|
+
},
|
|
217
|
+
set(newValue: string) {
|
|
218
|
+
wizard.resetAfterSelected()
|
|
219
|
+
connectionType.value = newValue
|
|
220
|
+
targetDevice.value.standardSwitch = props.selectedStandardSwitchId
|
|
221
|
+
targetDevice.value.switch = props.selectedSwitchId
|
|
222
|
+
},
|
|
222
223
|
})
|
|
223
224
|
|
|
224
225
|
// Step's content data (createStandardSwitch)
|
|
@@ -226,16 +227,16 @@ const addedAdapters = ref<string[]>([])
|
|
|
226
227
|
const coreAdapters = ref<string[]>([])
|
|
227
228
|
|
|
228
229
|
const onChangeAddedAdapters = (addedAdaptersNew: string[]): void => {
|
|
229
|
-
|
|
230
|
+
addedAdapters.value = addedAdaptersNew
|
|
230
231
|
}
|
|
231
232
|
|
|
232
233
|
const adapterStatus = ref<UI_I_AdapterStatus>({
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
active: [],
|
|
235
|
+
standby: [],
|
|
236
|
+
unused: [],
|
|
236
237
|
})
|
|
237
238
|
const onChangeAdapterStatus = (adapterStatusNew: UI_I_AdapterStatus): void => {
|
|
238
|
-
|
|
239
|
+
adapterStatus.value = adapterStatusNew
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
// Step's content data and changers (targetDevice)
|
|
@@ -243,525 +244,525 @@ const targetDevice = ref<UI_I_TargetDevice>(useDeepCopy(targetDeviceInitial))
|
|
|
243
244
|
const mtuFromSwitch = ref<number>(1500)
|
|
244
245
|
|
|
245
246
|
const onChangeTargetDevice = (newTargetDevice: UI_I_TargetDevice): void => {
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
const oldTargetDeviceSelected = useDeepCopy(targetDevice.value).selected
|
|
248
|
+
const newTargetDeviceSelected = newTargetDevice.selected
|
|
248
249
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
if (oldTargetDeviceSelected !== newTargetDeviceSelected) {
|
|
251
|
+
wizard.resetAfterSelected()
|
|
252
|
+
}
|
|
252
253
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
const selectedSwitch = props.standardSwitchesInitial.find(
|
|
255
|
+
(sw) => newTargetDevice.standardSwitch === sw.name
|
|
256
|
+
)
|
|
256
257
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
if (newTargetDeviceSelected === '1' && selectedSwitch) {
|
|
259
|
+
mtuFromSwitch.value = selectedSwitch?.mtu || 1500
|
|
260
|
+
}
|
|
261
|
+
if (newTargetDeviceSelected === '3') {
|
|
262
|
+
mtuFromSwitch.value = newTargetDevice.mtu || 1500
|
|
263
|
+
}
|
|
263
264
|
|
|
264
|
-
|
|
265
|
+
targetDevice.value = useDeepCopy(newTargetDevice)
|
|
265
266
|
}
|
|
266
267
|
|
|
267
268
|
// Step's content data and changers (portProperties)
|
|
268
269
|
const portProperties = ref<UI_I_PortProperties>(
|
|
269
|
-
|
|
270
|
+
useDeepCopy(portPropertiesInitial)
|
|
270
271
|
)
|
|
271
272
|
const onChangePortProperties = (newFields: UI_I_PortProperties): void => {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
273
|
+
if (portProperties.value.tcp !== newFields.tcp) {
|
|
274
|
+
ipFourSettings.value.static.defaultGateway.value =
|
|
275
|
+
props.tcpStacks?.find((tcp: UI_I_TCPStack) => tcp.id === newFields.tcp)
|
|
276
|
+
.gateway || ''
|
|
277
|
+
}
|
|
278
|
+
portProperties.value = newFields
|
|
278
279
|
}
|
|
279
280
|
|
|
280
281
|
// Step's content data and changers (ipFourSettings)
|
|
281
282
|
const ipFourSettings = ref<UI_I_IpFourSettings>(ipFourSettingsInitial)
|
|
282
283
|
const onChangeIpFourSettings = (newFields: UI_I_IpFourSettings): void => {
|
|
283
|
-
|
|
284
|
+
ipFourSettings.value = newFields
|
|
284
285
|
}
|
|
285
286
|
|
|
286
287
|
const gatewayFlag = ref<boolean>(false)
|
|
287
288
|
const onChangeGatewayFlag = (newValue: boolean) => {
|
|
288
|
-
|
|
289
|
+
gatewayFlag.value = newValue
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
// Step's content data and changers (connectionSettings)
|
|
292
293
|
const connectionSettings = ref<UI_I_ConnectionSettings>(
|
|
293
|
-
|
|
294
|
+
connectionSettingsInitial
|
|
294
295
|
)
|
|
295
296
|
const onChangeConnectionSettings = (
|
|
296
|
-
|
|
297
|
+
newFields: UI_I_ConnectionSettings
|
|
297
298
|
): void => {
|
|
298
|
-
|
|
299
|
+
connectionSettings.value = newFields
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
const onHideAlert = (stepId: number): void => {
|
|
302
|
-
|
|
303
|
+
wizard.hideAlertMessagesByStepId(stepId)
|
|
303
304
|
}
|
|
304
305
|
|
|
305
306
|
let flagSwitch = ''
|
|
306
307
|
|
|
307
308
|
// Choosing Scheme
|
|
308
309
|
watch(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
310
|
+
[connectionTypeLocal, targetDevice],
|
|
311
|
+
(newValues, oldValues) => {
|
|
312
|
+
const newCT = newValues[0] // -> newConnectionType
|
|
313
|
+
const oldCT = oldValues[0] // -> oldConnectionType
|
|
314
|
+
const newTD = newValues[1] // -> newTargetDevice
|
|
315
|
+
const oldTD = oldValues[1] // -> oldTargetDevice
|
|
316
|
+
if (!oldTD || oldTD.selected !== newTD.selected) {
|
|
317
|
+
flagSwitch = ''
|
|
318
|
+
addedAdapters.value = []
|
|
319
|
+
adapterStatus.value = {
|
|
320
|
+
active: [],
|
|
321
|
+
standby: [],
|
|
322
|
+
unused: [],
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (newCT !== oldCT) {
|
|
326
|
+
newCT === '0' && props.selectedStandardSwitchId
|
|
327
|
+
? (targetDevice.value.selected = '1')
|
|
328
|
+
: (targetDevice.value.selected = '0')
|
|
329
|
+
newCT === '1' && (targetDevice.value.selected = '1')
|
|
330
|
+
newCT === '2' && (targetDevice.value.selected = '2')
|
|
331
|
+
}
|
|
332
|
+
if (newCT === '0') {
|
|
333
|
+
;(newTD.selected === '0' || newTD.selected === '1') &&
|
|
334
|
+
wizard.changeScheme(0)
|
|
335
|
+
newTD.selected === '3' && wizard.changeScheme(1)
|
|
336
|
+
}
|
|
337
|
+
if (newCT === '1') {
|
|
338
|
+
newTD.selected === '1' && wizard.changeScheme(2)
|
|
339
|
+
newTD.selected === '3' && wizard.changeScheme(3)
|
|
340
|
+
}
|
|
341
|
+
if (newCT === '2') {
|
|
342
|
+
newTD.selected === '2' && wizard.changeScheme(4)
|
|
343
|
+
newTD.selected === '3' && wizard.changeScheme(5)
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
{ deep: true, immediate: true }
|
|
346
347
|
)
|
|
347
348
|
|
|
348
349
|
const onGetExistingStandardSwitches = (): void => {
|
|
349
|
-
|
|
350
|
-
|
|
350
|
+
wizard.setLoader(true)
|
|
351
|
+
emits('get-existing-standard-switches', () => wizard.setLoader(false))
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
const onGetTcpStacks = (): void => {
|
|
354
|
-
|
|
355
|
+
emits('get-tcp-stacks')
|
|
355
356
|
}
|
|
356
357
|
|
|
357
358
|
watch(
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
() => props.tcpStackLoading,
|
|
360
|
+
(newValue: boolean) => {
|
|
361
|
+
wizard.setLoader(newValue)
|
|
362
|
+
}
|
|
362
363
|
)
|
|
363
364
|
|
|
364
365
|
watch(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}
|
|
366
|
+
() => wizard.selectedStepId,
|
|
367
|
+
(newSelectedStep: number) => {
|
|
368
|
+
if (newSelectedStep === 1) {
|
|
369
|
+
onGetExistingStandardSwitches()
|
|
370
|
+
}
|
|
371
|
+
if (newSelectedStep === 3) {
|
|
372
|
+
onGetTcpStacks()
|
|
373
|
+
}
|
|
374
|
+
if (newSelectedStep === 6 && flagSwitch !== targetDevice.value.switch) {
|
|
375
|
+
const nics = props.standardSwitchesInitial.find(
|
|
376
|
+
(sw) => sw.id === targetDevice.value.switch
|
|
377
|
+
).nics
|
|
378
|
+
adapterStatus.value = {
|
|
379
|
+
active: nics.active || [],
|
|
380
|
+
standby: nics.standby || [],
|
|
381
|
+
unused: nics.unused || [],
|
|
382
|
+
}
|
|
383
|
+
coreAdapters.value = [
|
|
384
|
+
...adapterStatus.value.active,
|
|
385
|
+
...adapterStatus.value.standby,
|
|
386
|
+
...adapterStatus.value.unused,
|
|
387
|
+
]
|
|
388
|
+
flagSwitch = targetDevice.value.switch
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (newSelectedStep !== 7) return // If last step
|
|
392
|
+
if (wizard.isSelectedScheme(0)) {
|
|
393
|
+
readyCompleteFields.value = createZeroSchemeReadyCompleteFunc(
|
|
394
|
+
targetDevice.value,
|
|
395
|
+
portProperties.value,
|
|
396
|
+
ipFourSettings.value,
|
|
397
|
+
localization.value
|
|
398
|
+
)
|
|
399
|
+
return
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (wizard.isSelectedScheme(1)) {
|
|
403
|
+
readyCompleteFields.value = createFirstSchemeReadyCompleteFunc(
|
|
404
|
+
targetDevice.value,
|
|
405
|
+
portProperties.value,
|
|
406
|
+
ipFourSettings.value,
|
|
407
|
+
addedAdapters.value,
|
|
408
|
+
localization.value
|
|
409
|
+
)
|
|
410
|
+
return
|
|
411
|
+
}
|
|
412
|
+
if (wizard.isSelectedScheme(2)) {
|
|
413
|
+
readyCompleteFields.value = createSecondSchemeReadyCompleteFunc(
|
|
414
|
+
connectionSettings.value,
|
|
415
|
+
targetDevice.value,
|
|
416
|
+
localization.value
|
|
417
|
+
)
|
|
418
|
+
return
|
|
419
|
+
}
|
|
420
|
+
if (wizard.isSelectedScheme(3)) {
|
|
421
|
+
readyCompleteFields.value = createThirdSchemeReadyCompleteFunc(
|
|
422
|
+
connectionSettings.value,
|
|
423
|
+
targetDevice.value,
|
|
424
|
+
addedAdapters.value,
|
|
425
|
+
localization.value
|
|
426
|
+
)
|
|
427
427
|
}
|
|
428
|
+
}
|
|
428
429
|
)
|
|
429
430
|
|
|
430
431
|
// Reset data
|
|
431
432
|
const reset = (): void => {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
433
|
+
wizard.reset()
|
|
434
|
+
connectionTypeLocal.value = '0'
|
|
435
|
+
targetDevice.value = useDeepCopy(targetDeviceInitial)
|
|
436
|
+
connectionSettings.value = useDeepCopy(connectionSettingsInitial)
|
|
437
|
+
portProperties.value = useDeepCopy(portPropertiesInitial)
|
|
438
|
+
ipFourSettings.value = useDeepCopy(ipFourSettingsInitial)
|
|
439
|
+
coreAdapters.value = []
|
|
440
|
+
addedAdapters.value = []
|
|
441
|
+
adapterStatus.value = {
|
|
442
|
+
active: [],
|
|
443
|
+
standby: [],
|
|
444
|
+
unused: [],
|
|
445
|
+
}
|
|
445
446
|
}
|
|
446
447
|
|
|
447
448
|
const isShowNoConnectedActiveAdaptersModal = ref(false)
|
|
448
449
|
const isShowNoActiveAdaptersModal = ref(false)
|
|
449
450
|
|
|
450
451
|
const showNoConnectedActiveAdaptersModal = (): void => {
|
|
451
|
-
|
|
452
|
+
isShowNoConnectedActiveAdaptersModal.value = true
|
|
452
453
|
}
|
|
453
454
|
const onHideNoConnectedActiveAdaptersModal = (): void => {
|
|
454
|
-
|
|
455
|
+
isShowNoConnectedActiveAdaptersModal.value = false
|
|
455
456
|
}
|
|
456
457
|
const showNoActiveAdaptersModal = (): void => {
|
|
457
|
-
|
|
458
|
+
isShowNoActiveAdaptersModal.value = true
|
|
458
459
|
}
|
|
459
460
|
const onHideNoActiveAdaptersModal = (): void => {
|
|
460
|
-
|
|
461
|
+
isShowNoActiveAdaptersModal.value = false
|
|
461
462
|
}
|
|
462
463
|
|
|
463
464
|
const onConfirmNoActiveAdaptersModal = (): void => {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
465
|
+
onHideNoConnectedActiveAdaptersModal()
|
|
466
|
+
onHideNoActiveAdaptersModal()
|
|
467
|
+
wizard.selectStepHard(wizard.waitingStepId)
|
|
467
468
|
}
|
|
468
469
|
|
|
469
470
|
const onGetFreeAdapters = (showAddAdapterModal: () => void): void => {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
471
|
+
wizard.setLoader(true)
|
|
472
|
+
emits('get-free-adapters', () => {
|
|
473
|
+
wizard.setLoader(false)
|
|
474
|
+
showAddAdapterModal()
|
|
475
|
+
})
|
|
475
476
|
}
|
|
476
477
|
|
|
477
478
|
const checkFinal = async (): Promise<UI_I_ArbitraryObject<string>> => {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
)
|
|
496
|
-
|
|
497
|
-
type = 'vmkernel'
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
501
|
-
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
502
|
-
|
|
503
|
-
sendData = addNetworkingSecondOrThirdSchemeDataFunc(
|
|
504
|
-
connectionSettings.value,
|
|
505
|
-
targetDevice.value,
|
|
506
|
-
Number(vlan),
|
|
507
|
-
wizard.isSelectedScheme(2),
|
|
508
|
-
adapterStatus.value
|
|
509
|
-
)
|
|
510
|
-
|
|
511
|
-
type = 'network'
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
515
|
-
sendData = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
516
|
-
targetDevice.value.switch,
|
|
517
|
-
wizard.isSelectedScheme(4),
|
|
518
|
-
adapterStatus.value,
|
|
519
|
-
props.diagramsData,
|
|
520
|
-
targetDevice.value.mtu
|
|
521
|
-
)
|
|
522
|
-
|
|
523
|
-
type = 'network'
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
return new Promise((resolve, _reject) =>
|
|
527
|
-
emits(
|
|
528
|
-
'add-networking-data-validate',
|
|
529
|
-
sendData,
|
|
530
|
-
type,
|
|
531
|
-
(err_arg: UI_I_ArbitraryObject<string>): void => {
|
|
532
|
-
resolve(err_arg)
|
|
533
|
-
}
|
|
534
|
-
)
|
|
479
|
+
let sendData:
|
|
480
|
+
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend
|
|
481
|
+
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
482
|
+
| UI_I_AddNetworkingFourthOrFifthSchemeDataSend
|
|
483
|
+
|
|
484
|
+
let type: 'network' | 'vmkernel'
|
|
485
|
+
|
|
486
|
+
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
487
|
+
const vlan = getVlanId(portProperties.value.vlanId)
|
|
488
|
+
|
|
489
|
+
sendData = addNetworkingZeroOrFirstSchemeDataFunc(
|
|
490
|
+
targetDevice.value,
|
|
491
|
+
Number(vlan),
|
|
492
|
+
portProperties.value,
|
|
493
|
+
ipFourSettings.value,
|
|
494
|
+
wizard.isSelectedScheme(1),
|
|
495
|
+
adapterStatus.value
|
|
535
496
|
)
|
|
497
|
+
|
|
498
|
+
type = 'vmkernel'
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
502
|
+
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
503
|
+
|
|
504
|
+
sendData = addNetworkingSecondOrThirdSchemeDataFunc(
|
|
505
|
+
connectionSettings.value,
|
|
506
|
+
targetDevice.value,
|
|
507
|
+
Number(vlan),
|
|
508
|
+
wizard.isSelectedScheme(2),
|
|
509
|
+
adapterStatus.value
|
|
510
|
+
)
|
|
511
|
+
|
|
512
|
+
type = 'network'
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
516
|
+
sendData = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
517
|
+
targetDevice.value.switch,
|
|
518
|
+
wizard.isSelectedScheme(4),
|
|
519
|
+
adapterStatus.value,
|
|
520
|
+
props.diagramsData,
|
|
521
|
+
targetDevice.value.mtu
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
type = 'network'
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
return new Promise((resolve, _reject) =>
|
|
528
|
+
emits(
|
|
529
|
+
'add-networking-data-validate',
|
|
530
|
+
sendData,
|
|
531
|
+
type,
|
|
532
|
+
(err_arg: UI_I_ArbitraryObject<string>): void => {
|
|
533
|
+
resolve(err_arg)
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
)
|
|
536
537
|
}
|
|
537
538
|
|
|
538
539
|
const finalValidationFunc = async (
|
|
539
|
-
|
|
540
|
+
value: UI_I_WizardStep[]
|
|
540
541
|
): Promise<UI_I_ValidationReturn> => {
|
|
541
|
-
|
|
542
|
+
let stepHasError = false
|
|
542
543
|
|
|
543
|
-
|
|
544
|
+
wizard.setLoader(true)
|
|
544
545
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
546
|
+
const validationFields: {
|
|
547
|
+
[key: string]: string
|
|
548
|
+
} = await checkFinal()
|
|
548
549
|
|
|
549
|
-
|
|
550
|
+
wizard.setLoader(false)
|
|
550
551
|
|
|
551
|
-
|
|
552
|
-
|
|
552
|
+
for (const fieldName in validationFields) {
|
|
553
|
+
const stepId = wizard.getStepIdByFieldName(fieldName)
|
|
553
554
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
}
|
|
555
|
+
if (stepId !== -1) {
|
|
556
|
+
stepHasError = wizard.setValidation(stepId, fieldName, {
|
|
557
|
+
fieldMessage: validationFields[fieldName],
|
|
558
|
+
alertMessage: validationFields[fieldName],
|
|
559
|
+
})
|
|
560
560
|
}
|
|
561
|
+
}
|
|
561
562
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
563
|
+
return {
|
|
564
|
+
stepHasError,
|
|
565
|
+
newValue: value,
|
|
566
|
+
}
|
|
566
567
|
}
|
|
567
568
|
|
|
568
569
|
const validationFunc = async (
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
value: UI_I_WizardStep[],
|
|
571
|
+
currentStep: UI_I_WizardStep,
|
|
572
|
+
nextStep: UI_I_WizardStep
|
|
572
573
|
): Promise<UI_I_ValidationReturn> => {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
|
|
581
|
-
const targetDeviceValidation = checkTargetDeviceSync(
|
|
582
|
-
localization.value,
|
|
583
|
-
targetDevice.value,
|
|
584
|
-
wizard,
|
|
585
|
-
value
|
|
586
|
-
)
|
|
574
|
+
let stepHasError = false
|
|
575
|
+
let stepShouldStop = {
|
|
576
|
+
ifOnCurrentStep: false,
|
|
577
|
+
ifFromAnyStep: false,
|
|
578
|
+
stoppageStepId: -1,
|
|
579
|
+
}
|
|
587
580
|
|
|
588
|
-
|
|
581
|
+
if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
|
|
582
|
+
const targetDeviceValidation = checkTargetDeviceSync(
|
|
583
|
+
localization.value,
|
|
584
|
+
targetDevice.value,
|
|
585
|
+
wizard,
|
|
586
|
+
value
|
|
587
|
+
)
|
|
589
588
|
|
|
590
|
-
|
|
591
|
-
}
|
|
589
|
+
value = targetDeviceValidation.newValue
|
|
592
590
|
|
|
593
|
-
|
|
594
|
-
|
|
591
|
+
stepHasError = stepHasError || targetDeviceValidation.stepHasError
|
|
592
|
+
}
|
|
595
593
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
594
|
+
if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
|
|
595
|
+
wizard.waitingStepId = nextStep.id
|
|
596
|
+
|
|
597
|
+
const adapterValidation = checkAdaptersSync(
|
|
598
|
+
localization.value,
|
|
599
|
+
adapterStatus.value,
|
|
600
|
+
value,
|
|
601
|
+
currentStep.id,
|
|
602
|
+
nextStep.id,
|
|
603
|
+
props.freeAdapters,
|
|
604
|
+
showNoActiveAdaptersModal,
|
|
605
|
+
showNoConnectedActiveAdaptersModal
|
|
606
|
+
)
|
|
606
607
|
|
|
607
|
-
|
|
608
|
+
value = adapterValidation.newValue
|
|
608
609
|
|
|
609
|
-
|
|
610
|
+
stepShouldStop = adapterValidation.stepShouldStop || stepShouldStop
|
|
610
611
|
|
|
611
|
-
|
|
612
|
-
|
|
612
|
+
stepHasError = stepHasError || adapterValidation.stepHasError
|
|
613
|
+
}
|
|
613
614
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
615
|
+
if (wizard.isValidateForStep(3, currentStep.id, nextStep.id)) {
|
|
616
|
+
const labelValidation = await checkNetworkAsync(
|
|
617
|
+
value,
|
|
618
|
+
portProperties.value.networkLabel,
|
|
619
|
+
3,
|
|
620
|
+
UI_E_ValidationFields.PORT_PROPERTIES_NETWORK,
|
|
621
|
+
emits,
|
|
622
|
+
localization.value,
|
|
623
|
+
wizard
|
|
624
|
+
)
|
|
624
625
|
|
|
625
|
-
|
|
626
|
+
value = labelValidation.newValue
|
|
626
627
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
628
|
+
const portPropertiesValidation = checkPortPropertiesSync(
|
|
629
|
+
localization.value,
|
|
630
|
+
portProperties.value,
|
|
631
|
+
wizard,
|
|
632
|
+
value
|
|
633
|
+
)
|
|
633
634
|
|
|
634
|
-
|
|
635
|
+
value = portPropertiesValidation.newValue
|
|
635
636
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
637
|
+
stepHasError =
|
|
638
|
+
stepHasError ||
|
|
639
|
+
labelValidation.stepHasError ||
|
|
640
|
+
portPropertiesValidation.stepHasError
|
|
641
|
+
}
|
|
641
642
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
643
|
+
if (wizard.isValidateForStep(4, currentStep.id, nextStep.id)) {
|
|
644
|
+
const ipValidation = checkIpFourSettingsSync(
|
|
645
|
+
localization.value,
|
|
646
|
+
ipFourSettings.value,
|
|
647
|
+
wizard,
|
|
648
|
+
value
|
|
649
|
+
)
|
|
649
650
|
|
|
650
|
-
|
|
651
|
+
value = ipValidation.newValue
|
|
651
652
|
|
|
652
|
-
|
|
653
|
-
|
|
653
|
+
stepHasError = stepHasError || ipValidation.stepHasError
|
|
654
|
+
}
|
|
654
655
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
656
|
+
if (wizard.isValidateForStep(5, currentStep.id, nextStep.id)) {
|
|
657
|
+
const labelValidation = await checkNetworkAsync(
|
|
658
|
+
value,
|
|
659
|
+
connectionSettings.value.networkLabel,
|
|
660
|
+
5,
|
|
661
|
+
UI_E_ValidationFields.CONNECTION_SETTINGS_NETWORK,
|
|
662
|
+
emits,
|
|
663
|
+
localization.value,
|
|
664
|
+
wizard
|
|
665
|
+
)
|
|
665
666
|
|
|
666
|
-
|
|
667
|
+
value = labelValidation.newValue
|
|
667
668
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
669
|
+
const connectionSettingsValidation = checkConnectionSettingsSync(
|
|
670
|
+
localization.value,
|
|
671
|
+
connectionSettings.value,
|
|
672
|
+
wizard,
|
|
673
|
+
value
|
|
674
|
+
)
|
|
674
675
|
|
|
675
|
-
|
|
676
|
+
value = connectionSettingsValidation.newValue
|
|
676
677
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
678
|
+
stepHasError =
|
|
679
|
+
stepHasError ||
|
|
680
|
+
labelValidation.stepHasError ||
|
|
681
|
+
connectionSettingsValidation.stepHasError
|
|
682
|
+
}
|
|
682
683
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
684
|
+
return {
|
|
685
|
+
newValue: value,
|
|
686
|
+
stepHasError,
|
|
687
|
+
stepShouldStop,
|
|
688
|
+
}
|
|
688
689
|
}
|
|
689
690
|
|
|
690
691
|
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
|
|
691
|
-
|
|
692
|
+
wizard.changeSteps(value, validationFunc, finalValidationFunc)
|
|
692
693
|
|
|
693
694
|
const onHideAddNetworkingModal = (): void => {
|
|
694
|
-
|
|
695
|
-
|
|
695
|
+
emits('hide')
|
|
696
|
+
reset()
|
|
696
697
|
}
|
|
697
698
|
|
|
698
699
|
const onSubmit = async (): Promise<void> => {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
700
|
+
wizard.setLoader(true)
|
|
701
|
+
let sendData:
|
|
702
|
+
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend
|
|
703
|
+
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
704
|
+
| null = null
|
|
705
|
+
let type: 'network' | 'vmkernel' = 'network'
|
|
706
|
+
|
|
707
|
+
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
708
|
+
const vlan = getVlanId(portProperties.value.vlanId)
|
|
709
|
+
type = 'vmkernel'
|
|
710
|
+
sendData = addNetworkingZeroOrFirstSchemeDataFunc(
|
|
711
|
+
targetDevice.value,
|
|
712
|
+
Number(vlan),
|
|
713
|
+
portProperties.value,
|
|
714
|
+
ipFourSettings.value,
|
|
715
|
+
wizard.isSelectedScheme(1),
|
|
716
|
+
adapterStatus.value
|
|
717
|
+
)
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
721
|
+
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
722
|
+
type = 'network'
|
|
723
|
+
sendData = addNetworkingSecondOrThirdSchemeDataFunc(
|
|
724
|
+
connectionSettings.value,
|
|
725
|
+
targetDevice.value,
|
|
726
|
+
Number(vlan),
|
|
727
|
+
wizard.isSelectedScheme(2),
|
|
728
|
+
adapterStatus.value
|
|
729
|
+
)
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
733
|
+
sendData = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
734
|
+
targetDevice.value.switch,
|
|
735
|
+
wizard.isSelectedScheme(4),
|
|
736
|
+
adapterStatus.value,
|
|
737
|
+
props.diagramsData,
|
|
738
|
+
targetDevice.value.mtu
|
|
739
|
+
)
|
|
740
|
+
|
|
741
|
+
type = 'adapter'
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
sendData &&
|
|
744
745
|
emits(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
746
|
+
'send-add-networking-data',
|
|
747
|
+
sendData,
|
|
748
|
+
type,
|
|
749
|
+
() => wizard.setLoader(false),
|
|
750
|
+
onHideAddNetworkingModal
|
|
750
751
|
)
|
|
751
752
|
}
|
|
752
753
|
|
|
753
754
|
onMounted(() => {
|
|
754
|
-
|
|
755
|
+
hostname.value = location.hostname
|
|
755
756
|
})
|
|
756
757
|
|
|
757
758
|
watch(
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
759
|
+
props.tcpStacks,
|
|
760
|
+
(newValue: UI_I_TCPStack[]) => {
|
|
761
|
+
portProperties.value.tcp = newValue?.[0]?.id || ''
|
|
762
|
+
ipFourSettings.value.static.defaultGateway.value =
|
|
763
|
+
newValue?.[0]?.gateway || ''
|
|
764
|
+
},
|
|
765
|
+
{ deep: true }
|
|
765
766
|
)
|
|
766
767
|
</script>
|
|
767
768
|
|