bfg-common 1.1.44 → 1.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/localization/local_be.json +2 -1
- package/assets/localization/local_en.json +2 -1
- package/assets/localization/local_hy.json +2 -1
- package/assets/localization/local_kk.json +2 -1
- package/assets/localization/local_ru.json +2 -1
- package/assets/localization/local_zh.json +2 -1
- package/components/common/addNetworking/AddNetworking.vue +649 -635
- package/components/common/addNetworking/config/addNetworkingSteps.ts +34 -0
- package/components/common/addNetworking/config/index.ts +2 -1
- package/components/common/addNetworking/config/sendData.ts +25 -10
- package/components/common/addNetworking/models/interfaces.ts +10 -9
- package/components/common/addNetworking/steps/SelectedTargetDevice.vue +1 -6
- package/package.json +1 -1
|
@@ -1,189 +1,190 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
<common-add-networking-wizard
|
|
3
|
+
:wizard="wizard"
|
|
4
|
+
:steps-with-status="stepsWithStatus"
|
|
5
|
+
:width="props.width"
|
|
6
|
+
:height="props.height"
|
|
7
|
+
:show="props.show"
|
|
8
|
+
:title="title"
|
|
9
|
+
:is-show-loader="isShowLoader"
|
|
10
|
+
:second-title="secondTitle"
|
|
11
|
+
@select-step="onSelectStep"
|
|
12
|
+
@hide="onHideAddNetworkingModal"
|
|
13
|
+
@next-step="onNextStep"
|
|
14
|
+
@finish="onFinish"
|
|
15
|
+
>
|
|
16
|
+
<template #modalBody>
|
|
17
|
+
<common-add-networking-steps-select-connection-type
|
|
18
|
+
v-if="wizard.isSelectedStep(0)"
|
|
19
|
+
:step-id="0"
|
|
20
|
+
:title="localization.selectConnectionType"
|
|
21
|
+
:text="localization.selectConnectionTypeToCreate"
|
|
22
|
+
:connection-type="connectionType"
|
|
23
|
+
@change-connection-type="onChangeConnectionType"
|
|
24
|
+
/>
|
|
25
|
+
<common-add-networking-steps-selected-target-device
|
|
26
|
+
v-if="wizard.isSelectedStep(1)"
|
|
27
|
+
:step-id="1"
|
|
28
|
+
:title="localization.selectTargetDevice"
|
|
29
|
+
:text="localization.selectTargetDeviceForNewConnection"
|
|
30
|
+
:target-device="targetDevice"
|
|
31
|
+
:connection-type="connectionType"
|
|
32
|
+
:is-show-error-message-alert="isShowErrorMessageAlert"
|
|
33
|
+
:error-messages="errorMessages[1]"
|
|
34
|
+
:standard-switches-initial="props.standardSwitchesInitial"
|
|
35
|
+
:error="error"
|
|
36
|
+
@set-error-empty="onSetErrorFieldEmpty"
|
|
37
|
+
@change-error-messages="onChangeErrorMessages"
|
|
38
|
+
@hide-error-message-alert="onHideErrorMessageAlert"
|
|
39
|
+
@change-target-device="onChangeTargetDevice"
|
|
40
|
+
/>
|
|
41
|
+
<common-add-networking-steps-create-standard-switch
|
|
42
|
+
v-if="wizard.isSelectedStep(2)"
|
|
43
|
+
:step-id="2"
|
|
44
|
+
:title="localization.createStandardSwitch"
|
|
45
|
+
:text="localization.assignFreePhysicalNetworkAdaptersToTheNewSwitch"
|
|
46
|
+
:free-adapters="props.freeAdapters"
|
|
47
|
+
:added-adapters="addedAdapters"
|
|
48
|
+
:adapter-status="adapterStatus"
|
|
49
|
+
:adapters="props.adapters"
|
|
50
|
+
:is-show-no-connected-active-adapters-modal="
|
|
51
51
|
isShowNoConnectedActiveAdaptersModal
|
|
52
52
|
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
:is-show-no-active-adapters-modal="isShowNoActiveAdaptersModal"
|
|
54
|
+
@get-free-adapters="onGetFreeAdapters"
|
|
55
|
+
@change-added-adapters="onChangeAddedAdapters"
|
|
56
|
+
@change-adapter-status="onChangeAdapterStatus"
|
|
57
|
+
@confirm-no-active-adapters-modal="onConfirmNoActiveAdaptersModal"
|
|
58
|
+
@hide-no-connected-active-adapters-modal="
|
|
59
59
|
onHideNoConnectedActiveAdaptersModal
|
|
60
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
|
-
|
|
61
|
+
@hide-no-active-adapters-modal="onHideNoActiveAdaptersModal"
|
|
62
|
+
/>
|
|
63
|
+
<common-add-networking-steps-port-properties
|
|
64
|
+
v-if="wizard.isSelectedStep(3)"
|
|
65
|
+
:step-id="3"
|
|
66
|
+
:title="localization.portProperties"
|
|
67
|
+
:text="localization.specifyVMkernelPortSettings"
|
|
68
|
+
:port-properties="portProperties"
|
|
69
|
+
:is-show-error-message-alert="isShowErrorMessageAlert"
|
|
70
|
+
:error-messages="errorMessages[3]"
|
|
71
|
+
:network-label-existing-error-message="networkLabelExistingErrorMessage"
|
|
72
|
+
:mtu-from-switch="mtuFromSwitch"
|
|
73
|
+
:error="error"
|
|
74
|
+
@set-error-empty="onSetErrorFieldEmpty"
|
|
75
|
+
@change-error-messages="onChangeErrorMessages"
|
|
76
|
+
@hide-error-message-alert="onHideErrorMessageAlert"
|
|
77
|
+
@change-port-properties="onChangePortProperties"
|
|
78
|
+
/>
|
|
79
|
+
<common-add-networking-steps-ip-four-settings
|
|
80
|
+
v-if="wizard.isSelectedStep(4)"
|
|
81
|
+
:step-id="4"
|
|
82
|
+
:title="localization.ipV4Settings"
|
|
83
|
+
:text="localization.specifyVMkernelIPv4Settings"
|
|
84
|
+
:ip-four-settings="ipFourSettings"
|
|
85
|
+
:is-show-error-message-alert="isShowErrorMessageAlert"
|
|
86
|
+
:error-messages="errorMessages[4]"
|
|
87
|
+
:error="error"
|
|
88
|
+
@set-error-empty="onSetErrorFieldEmpty"
|
|
89
|
+
@change-error-messages="onChangeErrorMessages"
|
|
90
|
+
@hide-error-message-alert="onHideErrorMessageAlert"
|
|
91
|
+
@change-ip-four-settings="onChangeIpFourSettings"
|
|
92
|
+
/>
|
|
93
|
+
<common-add-networking-steps-connection-settings
|
|
94
|
+
v-if="wizard.isSelectedStep(5)"
|
|
95
|
+
:step-id="5"
|
|
96
|
+
:title="localization.connectionSettings"
|
|
97
|
+
:text="
|
|
98
98
|
localization.useNetworkLabelsToIdentifyMigrationCompatibleTwoHosts
|
|
99
99
|
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
100
|
+
:network-label-existing-error-message="networkLabelExistingErrorMessage"
|
|
101
|
+
:connection-settings="connectionSettings"
|
|
102
|
+
:is-show-error-message-alert="isShowErrorMessageAlert"
|
|
103
|
+
:error-messages="errorMessages[5]"
|
|
104
|
+
:error="error"
|
|
105
|
+
@set-error-empty="onSetErrorFieldEmpty"
|
|
106
|
+
@change-error-messages="onChangeErrorMessages"
|
|
107
|
+
@hide-error-message-alert="onHideErrorMessageAlert"
|
|
108
|
+
@change-connection-settings="onChangeConnectionSettings"
|
|
109
|
+
/>
|
|
110
|
+
<common-add-networking-steps-physical-adapter
|
|
111
|
+
v-if="wizard.isSelectedStep(6)"
|
|
112
|
+
:step-id="6"
|
|
113
|
+
:title="localization.addPhysicalNetworkAdapter"
|
|
114
|
+
:text="localization.assignPhysicalNetworkAdaptersToTheSwitch"
|
|
115
|
+
/>
|
|
116
|
+
<common-add-networking-steps-ready-complete
|
|
117
|
+
v-if="wizard.isSelectedStep(7)"
|
|
118
|
+
:step-id="7"
|
|
119
|
+
:title="localization.readyComplete"
|
|
120
|
+
:text="localization.reviewYourSettingsSelectionsWizard"
|
|
121
|
+
:ready-complete-fields="readyCompleteFields"
|
|
122
|
+
/>
|
|
123
|
+
</template>
|
|
124
|
+
</common-add-networking-wizard>
|
|
125
125
|
</template>
|
|
126
126
|
|
|
127
127
|
<script setup lang="ts">
|
|
128
128
|
import { UI_I_ArbitraryObject, UI_I_Localization } from '~/models/interfaces'
|
|
129
129
|
import {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
130
|
+
createZeroSchemeReadyCompleteFunc,
|
|
131
|
+
createFirstSchemeReadyCompleteFunc,
|
|
132
|
+
createSecondSchemeReadyCompleteFunc,
|
|
133
|
+
createThirdSchemeReadyCompleteFunc,
|
|
134
|
+
stepsSchemeFunc,
|
|
135
|
+
stepsFunc,
|
|
136
|
+
secondTitleFunc,
|
|
137
|
+
errorMessagesInitialFunc,
|
|
138
|
+
connectionSettingsInitial,
|
|
139
|
+
portPropertiesInitial,
|
|
140
|
+
ipFourSettingsInitial,
|
|
141
|
+
targetDeviceInitial,
|
|
142
|
+
isNetworkInvalidInitial,
|
|
143
|
+
addNetworkingZeroOrFirstSchemeDataFunc,
|
|
144
|
+
addNetworkingSecondOrThirdSchemeDataFunc,
|
|
143
145
|
} from '~/components/common/addNetworking/config'
|
|
144
146
|
import {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
147
|
+
UI_I_PortProperties,
|
|
148
|
+
UI_I_IpFourSettings,
|
|
149
|
+
UI_I_ConnectionSettings,
|
|
150
|
+
UI_I_TargetDevice,
|
|
151
|
+
UI_I_Switch,
|
|
152
|
+
UI_I_ReadyCompleteFields,
|
|
153
|
+
UI_I_NetworkLabelCheckExisting,
|
|
154
|
+
UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
|
|
155
|
+
UI_I_AddNetworkingSecondOrThirdSchemeDataSend,
|
|
156
|
+
UI_I_Step,
|
|
155
157
|
} from '~/components/common/addNetworking/models/interfaces'
|
|
156
158
|
import {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
UI_I_Adapter,
|
|
160
|
+
UI_I_AdapterStatus,
|
|
161
|
+
UI_I_SwitchAdapterItem,
|
|
162
|
+
UI_I_SwitchAdapters,
|
|
161
163
|
} from '~/components/common/diagramMain/models/interfaces'
|
|
162
164
|
import { Wizard, getVlanId } from '~/components/common/addNetworking/utils'
|
|
163
|
-
import { addNetworkingZeroOrFirstSchemeDataFunc } from '~/components/common/addNetworking/config/sendData'
|
|
164
165
|
|
|
165
166
|
// Props from up
|
|
166
167
|
const props = withDefaults(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
168
|
+
defineProps<{
|
|
169
|
+
modalName: string
|
|
170
|
+
viewName: string
|
|
171
|
+
show: boolean
|
|
172
|
+
width?: string
|
|
173
|
+
height?: string
|
|
174
|
+
title?: string
|
|
175
|
+
standardSwitchesInitial: UI_I_Switch[]
|
|
176
|
+
isNetworkInvalid?: UI_I_NetworkLabelCheckExisting
|
|
177
|
+
freeAdapters: UI_I_Adapter[]
|
|
178
|
+
adapters: UI_I_SwitchAdapters
|
|
179
|
+
}>(),
|
|
180
|
+
{
|
|
181
|
+
isNetworkInvalid: () => isNetworkInvalidInitial,
|
|
182
|
+
width: '576px',
|
|
183
|
+
height: '420px',
|
|
184
|
+
title: '',
|
|
185
|
+
freeAdapters: () => [],
|
|
186
|
+
standardSwitchesInitial: () => [],
|
|
187
|
+
}
|
|
187
188
|
)
|
|
188
189
|
|
|
189
190
|
// UI_I_Localization
|
|
@@ -195,11 +196,11 @@ const title = computed<string>(() => `${hostname.value} - ${props.title}`)
|
|
|
195
196
|
|
|
196
197
|
// Loader
|
|
197
198
|
const isShowLoader = computed<boolean>(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
() =>
|
|
200
|
+
isShowGetFreeAdaptersLoader.value ||
|
|
201
|
+
isShowCheckNetworkLabelLoader.value ||
|
|
202
|
+
isShowSendNetworkDataLoader.value ||
|
|
203
|
+
isShowLoaderGetStandardSwitches.value
|
|
203
204
|
)
|
|
204
205
|
|
|
205
206
|
/* **************************************
|
|
@@ -208,11 +209,11 @@ const isShowLoader = computed<boolean>(
|
|
|
208
209
|
|
|
209
210
|
// Steps
|
|
210
211
|
const wizard: Wizard = new Wizard(
|
|
211
|
-
|
|
212
|
+
stepsSchemeFunc(stepsFunc(localization.value))
|
|
212
213
|
)
|
|
213
214
|
|
|
214
215
|
const secondTitle = computed<string>(() =>
|
|
215
|
-
|
|
216
|
+
secondTitleFunc(wizard.selectedStep, localization.value)
|
|
216
217
|
)
|
|
217
218
|
|
|
218
219
|
const stepsWithStatus = computed<UI_I_Step[]>(() => wizard.stepsWithStatus())
|
|
@@ -224,26 +225,26 @@ const readyCompleteFields = ref<UI_I_ReadyCompleteFields[]>([])
|
|
|
224
225
|
const connectionType = ref<string>('0')
|
|
225
226
|
|
|
226
227
|
const onChangeConnectionType = (newConnectionType: string): void => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
wizard.resetStepsUntilX(1)
|
|
229
|
+
connectionType.value = newConnectionType
|
|
230
|
+
targetDevice.value.standardSwitch =
|
|
231
|
+
props.standardSwitchesInitial?.[0]?.name || ''
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
// Step's content data (createStandardSwitch)
|
|
234
235
|
const addedAdapters = ref<string[]>([])
|
|
235
236
|
|
|
236
237
|
const onChangeAddedAdapters = (addedAdaptersNew: string[]): void => {
|
|
237
|
-
|
|
238
|
+
addedAdapters.value = addedAdaptersNew
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
const adapterStatus = ref<UI_I_AdapterStatus>({
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
active: [],
|
|
243
|
+
standby: [],
|
|
244
|
+
unused: [],
|
|
244
245
|
})
|
|
245
246
|
const onChangeAdapterStatus = (adapterStatusNew: UI_I_AdapterStatus): void => {
|
|
246
|
-
|
|
247
|
+
adapterStatus.value = adapterStatusNew
|
|
247
248
|
}
|
|
248
249
|
|
|
249
250
|
// Step's content data and changers (targetDevice)
|
|
@@ -251,54 +252,54 @@ const targetDevice = ref<UI_I_TargetDevice>(useDeepCopy(targetDeviceInitial))
|
|
|
251
252
|
const mtuFromSwitch = ref<number>(1500)
|
|
252
253
|
|
|
253
254
|
const onChangeTargetDevice = (newTargetDevice: UI_I_TargetDevice): void => {
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
const oldTargetDeviceSelected = useDeepCopy(targetDevice.value).selected
|
|
256
|
+
const newTargetDeviceSelected = newTargetDevice.selected
|
|
256
257
|
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
if (oldTargetDeviceSelected !== newTargetDeviceSelected)
|
|
259
|
+
wizard.resetStepsUntilX(2)
|
|
259
260
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
const selectedSwitch = props.standardSwitchesInitial.find(
|
|
262
|
+
(sw) => newTargetDevice.standardSwitch === sw.name
|
|
263
|
+
)
|
|
263
264
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
if (newTargetDeviceSelected === '1' && selectedSwitch) {
|
|
266
|
+
mtuFromSwitch.value = selectedSwitch?.mtu || 1500
|
|
267
|
+
}
|
|
268
|
+
if (newTargetDeviceSelected === '3') {
|
|
269
|
+
mtuFromSwitch.value = newTargetDevice.mtu || 1500
|
|
270
|
+
}
|
|
270
271
|
|
|
271
|
-
|
|
272
|
+
targetDevice.value = useDeepCopy(newTargetDevice)
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
// Step's content data and changers (portProperties)
|
|
275
276
|
const portProperties = ref<UI_I_PortProperties>(
|
|
276
|
-
|
|
277
|
+
useDeepCopy(portPropertiesInitial)
|
|
277
278
|
)
|
|
278
279
|
const onChangePortProperties = (newFields: UI_I_PortProperties): void => {
|
|
279
|
-
|
|
280
|
+
portProperties.value = newFields
|
|
280
281
|
}
|
|
281
282
|
|
|
282
283
|
// Step's content data and changers (ipFourSettings)
|
|
283
284
|
const ipFourSettings = ref<UI_I_IpFourSettings>(ipFourSettingsInitial)
|
|
284
285
|
const onChangeIpFourSettings = (newFields: UI_I_IpFourSettings): void => {
|
|
285
|
-
|
|
286
|
+
ipFourSettings.value = newFields
|
|
286
287
|
}
|
|
287
288
|
|
|
288
289
|
// Step's content data and changers (connectionSettings)
|
|
289
290
|
const connectionSettings = ref<UI_I_ConnectionSettings>(
|
|
290
|
-
|
|
291
|
+
connectionSettingsInitial
|
|
291
292
|
)
|
|
292
293
|
const onChangeConnectionSettings = (
|
|
293
|
-
|
|
294
|
+
newFields: UI_I_ConnectionSettings
|
|
294
295
|
): void => {
|
|
295
|
-
|
|
296
|
+
connectionSettings.value = newFields
|
|
296
297
|
}
|
|
297
298
|
|
|
298
299
|
const error = ref<UI_I_ArbitraryObject<string>>({})
|
|
299
300
|
|
|
300
301
|
const onSetErrorFieldEmpty = (fieldName: string): void => {
|
|
301
|
-
|
|
302
|
+
error.value[fieldName] = ''
|
|
302
303
|
}
|
|
303
304
|
|
|
304
305
|
// Error Messages
|
|
@@ -309,562 +310,575 @@ const isShowErrorMessageAlert = ref<boolean>(false)
|
|
|
309
310
|
const networkLabelExistingErrorMessage = ref<string>('')
|
|
310
311
|
|
|
311
312
|
const onChangeErrorMessages = (
|
|
312
|
-
|
|
313
|
-
|
|
313
|
+
newErrorMessages: string[],
|
|
314
|
+
stepIndex: number
|
|
314
315
|
): void => {
|
|
315
|
-
|
|
316
|
+
errorMessages.value[stepIndex] = newErrorMessages
|
|
316
317
|
}
|
|
317
318
|
const onShowErrorMessageAlert = (): void => {
|
|
318
|
-
|
|
319
|
+
isShowErrorMessageAlert.value = true
|
|
319
320
|
}
|
|
320
321
|
const onHideErrorMessageAlert = (): void => {
|
|
321
|
-
|
|
322
|
+
isShowErrorMessageAlert.value = false
|
|
322
323
|
}
|
|
323
324
|
|
|
324
325
|
// Choosing Scheme
|
|
325
326
|
watch(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
327
|
+
[connectionType, targetDevice],
|
|
328
|
+
(newValues, oldValue) => {
|
|
329
|
+
const newCT = newValues[0] // -> newConnectionType
|
|
330
|
+
const oldCT = oldValue[0] // -> oldConnectionType
|
|
331
|
+
const newTD = newValues[1] // -> newTargetDevice
|
|
332
|
+
|
|
333
|
+
if (newCT !== oldCT) {
|
|
334
|
+
newCT === '0' && (targetDevice.value.selected = '1')
|
|
335
|
+
newCT === '1' && (targetDevice.value.selected = '1')
|
|
336
|
+
newCT === '2' && (targetDevice.value.selected = '2')
|
|
337
|
+
}
|
|
338
|
+
if (newCT === '0') {
|
|
339
|
+
;(newTD.selected === '0' || newTD.selected === '1') &&
|
|
340
|
+
(wizard.selectedScheme = 0)
|
|
341
|
+
newTD.selected === '3' && (wizard.selectedScheme = 1)
|
|
342
|
+
}
|
|
343
|
+
if (newCT === '1') {
|
|
344
|
+
newTD.selected === '1' && (wizard.selectedScheme = 2)
|
|
345
|
+
newTD.selected === '3' && (wizard.selectedScheme = 3)
|
|
346
|
+
}
|
|
347
|
+
if (newCT === '2') {
|
|
348
|
+
newTD.selected === '2' && (wizard.selectedScheme = 4)
|
|
349
|
+
newTD.selected === '3' && (wizard.selectedScheme = 5)
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
{ deep: true, immediate: true }
|
|
352
353
|
)
|
|
353
354
|
|
|
354
355
|
// Ready complete
|
|
355
356
|
watch(
|
|
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
|
-
|
|
357
|
+
() => wizard.selectedStep,
|
|
358
|
+
(newSelectedStep: number) => {
|
|
359
|
+
if (
|
|
360
|
+
newSelectedStep === 1 &&
|
|
361
|
+
targetDevice.value.selected === '1' &&
|
|
362
|
+
!targetDevice.value.standardSwitch
|
|
363
|
+
)
|
|
364
|
+
onGetExistingStandardSwitches()
|
|
365
|
+
if (newSelectedStep !== 7) return // If last step
|
|
366
|
+
if (wizard.isSelectedScheme(0)) {
|
|
367
|
+
readyCompleteFields.value = createZeroSchemeReadyCompleteFunc(
|
|
368
|
+
targetDevice.value,
|
|
369
|
+
portProperties.value,
|
|
370
|
+
ipFourSettings.value,
|
|
371
|
+
localization.value
|
|
372
|
+
)
|
|
373
|
+
return
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (wizard.isSelectedScheme(1)) {
|
|
377
|
+
readyCompleteFields.value = createFirstSchemeReadyCompleteFunc(
|
|
378
|
+
targetDevice.value,
|
|
379
|
+
portProperties.value,
|
|
380
|
+
ipFourSettings.value,
|
|
381
|
+
addedAdapters.value,
|
|
382
|
+
localization.value
|
|
383
|
+
)
|
|
384
|
+
return
|
|
385
|
+
}
|
|
386
|
+
if (wizard.isSelectedScheme(2)) {
|
|
387
|
+
readyCompleteFields.value = createSecondSchemeReadyCompleteFunc(
|
|
388
|
+
connectionSettings.value,
|
|
389
|
+
targetDevice.value,
|
|
390
|
+
localization.value
|
|
391
|
+
)
|
|
392
|
+
return
|
|
393
|
+
}
|
|
394
|
+
if (wizard.isSelectedScheme(3)) {
|
|
395
|
+
readyCompleteFields.value = createThirdSchemeReadyCompleteFunc(
|
|
396
|
+
connectionSettings.value,
|
|
397
|
+
targetDevice.value,
|
|
398
|
+
addedAdapters.value,
|
|
399
|
+
localization.value
|
|
400
|
+
)
|
|
392
401
|
}
|
|
402
|
+
}
|
|
393
403
|
)
|
|
394
404
|
|
|
395
405
|
// Reset data
|
|
396
406
|
const reset = (): void => {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
407
|
+
wizard.reset()
|
|
408
|
+
connectionType.value = '0'
|
|
409
|
+
targetDevice.value = useDeepCopy(targetDeviceInitial)
|
|
410
|
+
connectionSettings.value = useDeepCopy(connectionSettingsInitial)
|
|
411
|
+
portProperties.value = useDeepCopy(portPropertiesInitial)
|
|
412
|
+
ipFourSettings.value = useDeepCopy(ipFourSettingsInitial)
|
|
413
|
+
addedAdapters.value = []
|
|
414
|
+
adapterStatus.value = {
|
|
415
|
+
active: [],
|
|
416
|
+
standby: [],
|
|
417
|
+
unused: [],
|
|
418
|
+
}
|
|
419
|
+
errorMessages.value = errorMessagesInitial
|
|
410
420
|
}
|
|
411
421
|
|
|
412
422
|
// Checking network label existing
|
|
413
423
|
const isNetworkInvalid = ref<UI_I_NetworkLabelCheckExisting>()
|
|
414
424
|
|
|
415
425
|
watch(
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
426
|
+
() => props.isNetworkInvalid,
|
|
427
|
+
(newValue: UI_I_NetworkLabelCheckExisting) => {
|
|
428
|
+
isNetworkInvalid.value = newValue
|
|
429
|
+
},
|
|
430
|
+
{ deep: true, immediate: true }
|
|
421
431
|
)
|
|
422
432
|
|
|
423
433
|
const isShowNoConnectedActiveAdaptersModal = ref(false)
|
|
424
434
|
const isShowNoActiveAdaptersModal = ref(false)
|
|
425
435
|
|
|
426
436
|
const showNoConnectedActiveAdaptersModal = (): void => {
|
|
427
|
-
|
|
437
|
+
isShowNoConnectedActiveAdaptersModal.value = true
|
|
428
438
|
}
|
|
429
439
|
const onHideNoConnectedActiveAdaptersModal = (): void => {
|
|
430
|
-
|
|
440
|
+
isShowNoConnectedActiveAdaptersModal.value = false
|
|
431
441
|
}
|
|
432
442
|
const showNoActiveAdaptersModal = (): void => {
|
|
433
|
-
|
|
443
|
+
isShowNoActiveAdaptersModal.value = true
|
|
434
444
|
}
|
|
435
445
|
const onHideNoActiveAdaptersModal = (): void => {
|
|
436
|
-
|
|
446
|
+
isShowNoActiveAdaptersModal.value = false
|
|
437
447
|
}
|
|
438
448
|
|
|
439
449
|
const onConfirmNoActiveAdaptersModal = (): void => {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
450
|
+
wizard.selectedStep = wizard.waitingStepId
|
|
451
|
+
onHideNoConnectedActiveAdaptersModal()
|
|
452
|
+
onHideNoActiveAdaptersModal()
|
|
443
453
|
}
|
|
444
454
|
|
|
445
455
|
// Step selection
|
|
446
456
|
const isShowCheckNetworkLabelLoader = ref(false)
|
|
447
457
|
|
|
448
458
|
const checkNetwork = (networkLabel: string, nextStep?: number): void => {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
onShowErrorMessageAlert()
|
|
474
|
-
},
|
|
475
|
-
() => {
|
|
476
|
-
isShowCheckNetworkLabelLoader.value = false
|
|
477
|
-
}
|
|
478
|
-
)
|
|
479
|
-
} else {
|
|
459
|
+
if (networkLabel) {
|
|
460
|
+
isShowCheckNetworkLabelLoader.value = true
|
|
461
|
+
networkLabelExistingErrorMessage.value = ''
|
|
462
|
+
emits(
|
|
463
|
+
'check-network-label',
|
|
464
|
+
networkLabel,
|
|
465
|
+
(error_message: string) => {
|
|
466
|
+
networkLabelExistingErrorMessage.value = error_message
|
|
467
|
+
|
|
468
|
+
if (
|
|
469
|
+
error_message === '' &&
|
|
470
|
+
errorMessages.value[wizard.selectedStep].length === 0
|
|
471
|
+
) {
|
|
472
|
+
nextStep ? wizard.goToSelectedStep(nextStep) : wizard.goToNextStep()
|
|
473
|
+
return true
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (error_message !== '') {
|
|
477
|
+
const selectedStepErrorMessages: string[] =
|
|
478
|
+
errorMessages.value[wizard.selectedStep]
|
|
479
|
+
|
|
480
|
+
!selectedStepErrorMessages.includes(error_message) &&
|
|
481
|
+
selectedStepErrorMessages.push(error_message)
|
|
482
|
+
}
|
|
480
483
|
onShowErrorMessageAlert()
|
|
481
|
-
|
|
484
|
+
},
|
|
485
|
+
() => {
|
|
486
|
+
isShowCheckNetworkLabelLoader.value = false
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
} else {
|
|
490
|
+
onShowErrorMessageAlert()
|
|
491
|
+
}
|
|
482
492
|
}
|
|
483
493
|
|
|
484
494
|
const checkWizard = (nextStep?: number): void => {
|
|
485
|
-
|
|
495
|
+
isShowCheckNetworkLabelLoader.value = true
|
|
496
|
+
|
|
497
|
+
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
498
|
+
const vlan = getVlanId(portProperties.value.vlanId)
|
|
499
|
+
|
|
500
|
+
const sendData: UI_I_AddNetworkingZeroOrFirstSchemeDataSend =
|
|
501
|
+
addNetworkingZeroOrFirstSchemeDataFunc(
|
|
502
|
+
targetDevice.value,
|
|
503
|
+
Number(vlan),
|
|
504
|
+
portProperties.value,
|
|
505
|
+
ipFourSettings.value,
|
|
506
|
+
wizard.isSelectedScheme(1),
|
|
507
|
+
adapterStatus.value
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
emits(
|
|
511
|
+
'add-networking-data-validate',
|
|
512
|
+
sendData,
|
|
513
|
+
'vmkernel',
|
|
514
|
+
hideSendNetworkDataLoader,
|
|
515
|
+
setValidation,
|
|
516
|
+
(stop?: boolean) => {
|
|
517
|
+
if (
|
|
518
|
+
!Object.values(error.value).filter(
|
|
519
|
+
(errorMessage: string) => errorMessage
|
|
520
|
+
).length &&
|
|
521
|
+
!stop
|
|
522
|
+
) {
|
|
523
|
+
nextStep ? wizard.goToSelectedStep(nextStep) : wizard.goToNextStep()
|
|
524
|
+
}
|
|
486
525
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
targetDevice.value,
|
|
493
|
-
Number(vlan),
|
|
494
|
-
portProperties.value,
|
|
495
|
-
ipFourSettings.value,
|
|
496
|
-
wizard.isSelectedScheme(1),
|
|
497
|
-
adapterStatus.value
|
|
498
|
-
)
|
|
499
|
-
|
|
500
|
-
emits(
|
|
501
|
-
'add-networking-data-validate',
|
|
502
|
-
sendData,
|
|
503
|
-
'vmkernel',
|
|
504
|
-
hideSendNetworkDataLoader,
|
|
505
|
-
setValidation,
|
|
506
|
-
(stop?: boolean) => {
|
|
507
|
-
if (
|
|
508
|
-
!Object.values(error.value).filter(
|
|
509
|
-
(errorMessage: string) => errorMessage
|
|
510
|
-
).length &&
|
|
511
|
-
!stop
|
|
512
|
-
) {
|
|
513
|
-
nextStep ? wizard.goToSelectedStep(nextStep) : wizard.goToNextStep()
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
isShowCheckNetworkLabelLoader.value = false
|
|
517
|
-
}
|
|
518
|
-
)
|
|
519
|
-
return
|
|
520
|
-
}
|
|
526
|
+
isShowCheckNetworkLabelLoader.value = false
|
|
527
|
+
}
|
|
528
|
+
)
|
|
529
|
+
return
|
|
530
|
+
}
|
|
521
531
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
532
|
+
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
533
|
+
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
534
|
+
const sendData: UI_I_AddNetworkingSecondOrThirdSchemeDataSend =
|
|
535
|
+
addNetworkingSecondOrThirdSchemeDataFunc(
|
|
536
|
+
connectionSettings.value,
|
|
537
|
+
targetDevice.value,
|
|
538
|
+
Number(vlan),
|
|
539
|
+
wizard.isSelectedScheme(2),
|
|
540
|
+
adapterStatus.value
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
emits(
|
|
544
|
+
'add-networking-data-validate',
|
|
545
|
+
sendData,
|
|
546
|
+
'network',
|
|
547
|
+
hideSendNetworkDataLoader,
|
|
548
|
+
setValidation,
|
|
549
|
+
(stop?: boolean) => {
|
|
550
|
+
if (
|
|
551
|
+
!Object.values(error.value).filter(
|
|
552
|
+
(errorMessage: string) => errorMessage
|
|
553
|
+
).length &&
|
|
554
|
+
!stop
|
|
555
|
+
) {
|
|
556
|
+
nextStep ? wizard.goToSelectedStep(nextStep) : wizard.goToNextStep()
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
isShowCheckNetworkLabelLoader.value = false
|
|
560
|
+
}
|
|
561
|
+
)
|
|
562
|
+
}
|
|
551
563
|
}
|
|
552
564
|
|
|
553
565
|
const checkBeforeGoToNextStep = (
|
|
554
|
-
|
|
555
|
-
|
|
566
|
+
selectedStepIndex: number,
|
|
567
|
+
nextStep: number
|
|
556
568
|
): boolean => {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
569
|
+
if (wizard.isBeforeLastStep()) {
|
|
570
|
+
checkWizard()
|
|
571
|
+
return false
|
|
572
|
+
}
|
|
561
573
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
)
|
|
574
|
+
if (
|
|
575
|
+
wizard.checkNetworkLabelBeforeGoToNextStep(
|
|
576
|
+
5,
|
|
577
|
+
connectionSettings.value.networkLabel,
|
|
578
|
+
isNetworkInvalid.value,
|
|
579
|
+
checkNetwork
|
|
569
580
|
)
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
581
|
+
)
|
|
582
|
+
return false
|
|
583
|
+
|
|
584
|
+
if (
|
|
585
|
+
wizard.checkNetworkLabelBeforeGoToNextStep(
|
|
586
|
+
3,
|
|
587
|
+
portProperties.value.networkLabel,
|
|
588
|
+
isNetworkInvalid.value,
|
|
589
|
+
checkNetwork
|
|
590
|
+
)
|
|
591
|
+
)
|
|
592
|
+
return false
|
|
593
|
+
|
|
594
|
+
if (wizard.isSelectedStep(2)) {
|
|
595
|
+
if (adapterStatus.value.active.length === 0) {
|
|
596
|
+
showNoActiveAdaptersModal()
|
|
597
|
+
wizard.waitingStepId = nextStep
|
|
598
|
+
return false
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const activeAndConnectedAdapters = adapterStatus.value.active.filter(
|
|
602
|
+
(adapterName: string) =>
|
|
603
|
+
props.freeAdapters.find(
|
|
604
|
+
(freeAdapter: UI_I_SwitchAdapterItem) =>
|
|
605
|
+
freeAdapter.name === adapterName
|
|
606
|
+
)?.carrier
|
|
579
607
|
)
|
|
580
|
-
return false
|
|
581
|
-
|
|
582
|
-
if (wizard.isSelectedStep(2)) {
|
|
583
|
-
if (adapterStatus.value.active.length === 0) {
|
|
584
|
-
showNoActiveAdaptersModal()
|
|
585
|
-
wizard.waitingStepId = nextStep
|
|
586
|
-
return false
|
|
587
|
-
}
|
|
588
608
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
freeAdapter.name === adapterName
|
|
594
|
-
)?.carrier
|
|
595
|
-
)
|
|
596
|
-
|
|
597
|
-
if (activeAndConnectedAdapters.length === 0) {
|
|
598
|
-
showNoConnectedActiveAdaptersModal()
|
|
599
|
-
wizard.waitingStepId = nextStep
|
|
600
|
-
return false
|
|
601
|
-
}
|
|
609
|
+
if (activeAndConnectedAdapters.length === 0) {
|
|
610
|
+
showNoConnectedActiveAdaptersModal()
|
|
611
|
+
wizard.waitingStepId = nextStep
|
|
612
|
+
return false
|
|
602
613
|
}
|
|
614
|
+
}
|
|
603
615
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
616
|
+
if (
|
|
617
|
+
// If a current step has an error, show it and stop navigation on next step
|
|
618
|
+
errorMessages.value[wizard.selectedStep].length > 0 &&
|
|
619
|
+
wizard.isUpThenSelectedStep(stepsWithStatus.value[selectedStepIndex + 1].id)
|
|
620
|
+
) {
|
|
621
|
+
onShowErrorMessageAlert()
|
|
622
|
+
return false
|
|
623
|
+
}
|
|
624
|
+
return true
|
|
613
625
|
}
|
|
614
626
|
|
|
615
627
|
const checkBeforeGoToSelectedStep = (stepId: number): boolean => {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
628
|
+
if (wizard.isLastStep(stepId)) {
|
|
629
|
+
checkWizard(stepId)
|
|
630
|
+
return false
|
|
631
|
+
}
|
|
620
632
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
633
|
+
if (
|
|
634
|
+
wizard.isUpThenSelectedStep(stepId) &&
|
|
635
|
+
errorMessages.value[wizard.selectedStep].length > 0
|
|
636
|
+
) {
|
|
637
|
+
onShowErrorMessageAlert()
|
|
638
|
+
return false
|
|
639
|
+
}
|
|
628
640
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
641
|
+
if (
|
|
642
|
+
wizard.checkNetworkLabelBeforeGoToNewStep(
|
|
643
|
+
stepId,
|
|
644
|
+
2,
|
|
645
|
+
5,
|
|
646
|
+
connectionSettings.value.networkLabel,
|
|
647
|
+
isNetworkInvalid.value,
|
|
648
|
+
checkNetwork
|
|
649
|
+
)
|
|
650
|
+
) {
|
|
651
|
+
wizard.goToSelectedStep(5)
|
|
652
|
+
return false
|
|
653
|
+
}
|
|
642
654
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
655
|
+
if (
|
|
656
|
+
wizard.checkNetworkLabelBeforeGoToNewStep(
|
|
657
|
+
stepId,
|
|
658
|
+
0,
|
|
659
|
+
3,
|
|
660
|
+
portProperties.value.networkLabel,
|
|
661
|
+
isNetworkInvalid.value,
|
|
662
|
+
checkNetwork
|
|
663
|
+
)
|
|
664
|
+
) {
|
|
665
|
+
wizard.goToSelectedStep(3)
|
|
666
|
+
return false
|
|
667
|
+
}
|
|
656
668
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
+
if (
|
|
670
|
+
wizard.checkNetworkLabelBeforeGoToNewStep(
|
|
671
|
+
stepId,
|
|
672
|
+
1,
|
|
673
|
+
3,
|
|
674
|
+
portProperties.value.networkLabel,
|
|
675
|
+
isNetworkInvalid.value,
|
|
676
|
+
checkNetwork
|
|
677
|
+
)
|
|
678
|
+
) {
|
|
679
|
+
wizard.goToSelectedStep(3)
|
|
680
|
+
return false
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if (wizard.isSelectedStep(2) && stepId > 2) {
|
|
684
|
+
if (adapterStatus.value.active.length === 0) {
|
|
685
|
+
showNoActiveAdaptersModal()
|
|
686
|
+
wizard.waitingStepId = stepId
|
|
687
|
+
return false
|
|
669
688
|
}
|
|
670
689
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
690
|
+
const activeAndConnectedAdapters = adapterStatus.value.active.filter(
|
|
691
|
+
(adapterName: string) =>
|
|
692
|
+
props.freeAdapters.find(
|
|
693
|
+
(freeAdapter: UI_I_SwitchAdapterItem) =>
|
|
694
|
+
freeAdapter.name === adapterName
|
|
695
|
+
)?.carrier
|
|
696
|
+
)
|
|
677
697
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
freeAdapter.name === adapterName
|
|
683
|
-
)?.carrier
|
|
684
|
-
)
|
|
685
|
-
|
|
686
|
-
if (activeAndConnectedAdapters.length === 0) {
|
|
687
|
-
showNoConnectedActiveAdaptersModal()
|
|
688
|
-
wizard.waitingStepId = stepId
|
|
689
|
-
return false
|
|
690
|
-
}
|
|
698
|
+
if (activeAndConnectedAdapters.length === 0) {
|
|
699
|
+
showNoConnectedActiveAdaptersModal()
|
|
700
|
+
wizard.waitingStepId = stepId
|
|
701
|
+
return false
|
|
691
702
|
}
|
|
703
|
+
}
|
|
692
704
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
705
|
+
if (
|
|
706
|
+
// If a current step has an error, show it and stop navigation on next step
|
|
707
|
+
errorMessages.value[wizard.selectedStep].length > 0 &&
|
|
708
|
+
wizard.isUpThenSelectedStep(stepId)
|
|
709
|
+
) {
|
|
710
|
+
onShowErrorMessageAlert()
|
|
711
|
+
return false
|
|
712
|
+
}
|
|
713
|
+
return true
|
|
702
714
|
}
|
|
703
715
|
|
|
704
716
|
watch(
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
717
|
+
connectionSettings,
|
|
718
|
+
(newValue: UI_I_ConnectionSettings, oldValue: UI_I_ConnectionSettings) => {
|
|
719
|
+
if (newValue.networkLabel === oldValue.networkLabel) return
|
|
720
|
+
networkLabelExistingErrorMessage.value = ''
|
|
721
|
+
},
|
|
722
|
+
{ deep: true }
|
|
711
723
|
)
|
|
712
724
|
|
|
713
725
|
// Finish network adding and sending data
|
|
714
726
|
const isShowSendNetworkDataLoader = ref(false)
|
|
715
727
|
const hideSendNetworkDataLoader = (): void => {
|
|
716
|
-
|
|
728
|
+
isShowSendNetworkDataLoader.value = false
|
|
717
729
|
}
|
|
718
730
|
|
|
719
731
|
const setValidation = (err_arg: UI_I_ArbitraryObject<string>): void => {
|
|
720
|
-
|
|
732
|
+
error.value = err_arg
|
|
721
733
|
}
|
|
722
734
|
|
|
723
735
|
watch(
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
736
|
+
error,
|
|
737
|
+
(newErr) => {
|
|
738
|
+
if (!wizard.isBeforeLastStep() && !wizard.isLastStep(7)) return
|
|
727
739
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
740
|
+
if (newErr.switch || newErr.network || newErr['new_switch.mtu']) {
|
|
741
|
+
wizard.selectedStep = 1
|
|
742
|
+
return
|
|
743
|
+
}
|
|
744
|
+
if (newErr.network_name || newErr['new_network.vlan'] || newErr.mtu) {
|
|
745
|
+
wizard.selectedStep = 3
|
|
746
|
+
return
|
|
747
|
+
}
|
|
748
|
+
if (
|
|
749
|
+
newErr['tcp_config.ipv4'] ||
|
|
750
|
+
newErr['tcp_config.gateway'] ||
|
|
751
|
+
newErr['tcp_config.net_mask']
|
|
752
|
+
) {
|
|
753
|
+
wizard.selectedStep = 4
|
|
754
|
+
return
|
|
755
|
+
}
|
|
756
|
+
if (newErr.name || newErr.vlan) {
|
|
757
|
+
wizard.selectedStep = 5
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
{ deep: true }
|
|
749
761
|
)
|
|
750
762
|
|
|
751
763
|
const onFinish = async (): Promise<void> => {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
764
|
+
isShowSendNetworkDataLoader.value = true
|
|
765
|
+
|
|
766
|
+
// Finish with the zero and first scheme
|
|
767
|
+
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
768
|
+
const vlan = getVlanId(portProperties.value.vlanId)
|
|
769
|
+
const sendData: UI_I_AddNetworkingZeroOrFirstSchemeDataSend =
|
|
770
|
+
addNetworkingZeroOrFirstSchemeDataFunc(
|
|
771
|
+
targetDevice.value,
|
|
772
|
+
Number(vlan),
|
|
773
|
+
portProperties.value,
|
|
774
|
+
ipFourSettings.value,
|
|
775
|
+
wizard.isSelectedScheme(1),
|
|
776
|
+
adapterStatus.value
|
|
777
|
+
)
|
|
778
|
+
|
|
779
|
+
emits(
|
|
780
|
+
'send-add-networking-data',
|
|
781
|
+
sendData,
|
|
782
|
+
'vmkernel',
|
|
783
|
+
hideSendNetworkDataLoader,
|
|
784
|
+
onHideAddNetworkingModal
|
|
785
|
+
)
|
|
786
|
+
return
|
|
787
|
+
}
|
|
776
788
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
789
|
+
// Finish with the second scheme
|
|
790
|
+
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
791
|
+
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
792
|
+
const sendData: UI_I_AddNetworkingSecondOrThirdSchemeDataSend =
|
|
793
|
+
addNetworkingSecondOrThirdSchemeDataFunc(
|
|
794
|
+
connectionSettings.value,
|
|
795
|
+
targetDevice.value,
|
|
796
|
+
Number(vlan),
|
|
797
|
+
wizard.isSelectedScheme(2),
|
|
798
|
+
adapterStatus.value
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
emits(
|
|
802
|
+
'send-add-networking-data',
|
|
803
|
+
sendData,
|
|
804
|
+
'network',
|
|
805
|
+
hideSendNetworkDataLoader,
|
|
806
|
+
onHideAddNetworkingModal
|
|
807
|
+
)
|
|
808
|
+
}
|
|
795
809
|
}
|
|
796
810
|
|
|
797
811
|
// Trigger getting existing standard switches
|
|
798
812
|
const isShowLoaderGetStandardSwitches = ref(false)
|
|
799
813
|
const hideLoaderGetStandardSwitches = (): void => {
|
|
800
|
-
|
|
814
|
+
isShowLoaderGetStandardSwitches.value = false
|
|
801
815
|
}
|
|
802
816
|
const onGetExistingStandardSwitches = (): void => {
|
|
803
|
-
|
|
804
|
-
|
|
817
|
+
isShowLoaderGetStandardSwitches.value = true
|
|
818
|
+
emits('get-existing-standard-switches', hideLoaderGetStandardSwitches)
|
|
805
819
|
}
|
|
806
820
|
|
|
807
821
|
onMounted(() => {
|
|
808
|
-
|
|
822
|
+
hostname.value = location.hostname
|
|
809
823
|
})
|
|
810
824
|
|
|
811
825
|
const isShowGetFreeAdaptersLoader = ref(false)
|
|
812
826
|
|
|
813
827
|
const hideLoaderGetFreeAdaptersCB = (): void => {
|
|
814
|
-
|
|
828
|
+
isShowGetFreeAdaptersLoader.value = false
|
|
815
829
|
}
|
|
816
830
|
|
|
817
831
|
const onGetFreeAdapters = (showAddAdapterModal: () => void): void => {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
832
|
+
isShowGetFreeAdaptersLoader.value = true
|
|
833
|
+
emits('get-free-adapters', () => {
|
|
834
|
+
hideLoaderGetFreeAdaptersCB()
|
|
835
|
+
showAddAdapterModal()
|
|
836
|
+
})
|
|
823
837
|
}
|
|
824
838
|
|
|
825
839
|
// Modal hiding
|
|
826
840
|
const emits = defineEmits<{
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
841
|
+
(event: 'hide'): void
|
|
842
|
+
(
|
|
843
|
+
event: 'send-add-networking-data',
|
|
844
|
+
schemeData:
|
|
845
|
+
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
846
|
+
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
|
|
847
|
+
type: string,
|
|
848
|
+
hideSendNetworkDataLoader: () => void,
|
|
849
|
+
onHideAddNetworkingModal: () => void
|
|
850
|
+
): void
|
|
851
|
+
(
|
|
852
|
+
event: 'add-networking-data-validate',
|
|
853
|
+
networkData:
|
|
854
|
+
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
855
|
+
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
|
|
856
|
+
type: string,
|
|
857
|
+
hideSendNetworkDataLoader: () => void,
|
|
858
|
+
setValidation: (err_arg: UI_I_ArbitraryObject<string>) => void,
|
|
859
|
+
goToLastStep: (stop?: boolean) => void
|
|
860
|
+
): void
|
|
861
|
+
(event: 'get-existing-standard-switches', cb: () => void): void
|
|
862
|
+
(event: 'get-free-adapters', cb: () => void): void
|
|
863
|
+
(
|
|
864
|
+
event: 'check-network-label',
|
|
865
|
+
networkLabel: string,
|
|
866
|
+
cb: (error_message: string) => void,
|
|
867
|
+
hideLoader?: () => void
|
|
868
|
+
): void
|
|
855
869
|
}>()
|
|
856
870
|
|
|
857
871
|
const onSelectStep = (stepId: number): void => {
|
|
858
|
-
|
|
872
|
+
wizard.goToSelectedStep(stepId, checkBeforeGoToSelectedStep)
|
|
859
873
|
}
|
|
860
874
|
|
|
861
875
|
const onNextStep = (): void => {
|
|
862
|
-
|
|
876
|
+
wizard.goToNextStep(checkBeforeGoToNextStep)
|
|
863
877
|
}
|
|
864
878
|
|
|
865
879
|
const onHideAddNetworkingModal = (): void => {
|
|
866
|
-
|
|
867
|
-
|
|
880
|
+
emits('hide')
|
|
881
|
+
reset()
|
|
868
882
|
}
|
|
869
883
|
</script>
|
|
870
884
|
|