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