bfg-common 1.2.186 → 1.2.187
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 +9 -2
- package/assets/localization/local_en.json +9 -2
- package/assets/localization/local_hy.json +9 -2
- package/assets/localization/local_kk.json +9 -2
- package/assets/localization/local_ru.json +9 -2
- package/assets/localization/local_zh.json +9 -2
- package/assets/scss/common/theme.scss +27 -25
- package/components/atoms/table/simpleTable/SimpleTable.vue +5 -2
- package/components/atoms/wizard/Wizard.vue +4 -4
- package/components/atoms/wizard/models/interfaces.ts +4 -3
- package/components/atoms/wizard/utils/utils.ts +106 -27
- package/components/common/diagramMain/DiagramMain.vue +10 -46
- package/components/common/diagramMain/modals/config/index.ts +0 -6
- package/components/common/diagramMain/modals/config/vmKernelAdapter.ts +2 -2
- package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +1 -1
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +339 -339
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +531 -0
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/config/steps.ts +114 -0
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +161 -0
- package/components/common/diagramMain/modals/{steps → migrateVmkernelAdapter/steps}/SelectVmkernelAdapter.vue +24 -86
- package/components/common/diagramMain/modals/{steps → migrateVmkernelAdapter/steps}/VmkernelAdapterReadyComplete.vue +7 -11
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +47 -0
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +146 -0
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +54 -0
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -0
- package/components/common/diagramMain/models/enums.ts +6 -7
- package/components/common/diagramMain/models/interfaces.ts +28 -29
- package/components/common/diagramMain/models/types.ts +0 -1
- package/components/common/monitor/advanced/Advanced.vue +5 -4
- package/components/common/wizards/network/add/Add.vue +874 -0
- package/components/common/{addNetworking → wizards/network/add}/config/index.ts +2 -16
- package/components/common/{addNetworking → wizards/network/add}/config/initialData.ts +4 -19
- package/components/common/{addNetworking → wizards/network/add}/config/portPropertiesStep.ts +1 -1
- package/components/common/{addNetworking → wizards/network/add}/config/selectSwitch.ts +1 -1
- package/components/common/{addNetworking → wizards/network/add}/config/sendData.ts +1 -1
- package/components/common/{addNetworking/config/addNetworkingSteps.ts → wizards/network/add/config/steps.ts} +107 -60
- package/components/common/{addNetworking → wizards/network/add}/modals/SelectNetwork.vue +2 -2
- package/components/common/{addNetworking → wizards/network/add}/modals/SelectStandardSwitch.vue +2 -2
- package/components/common/{addNetworking → wizards/network/add}/modals/SelectSwitch.vue +2 -2
- package/components/common/wizards/network/add/models/enums.ts +17 -0
- package/components/common/{addNetworking → wizards/network/add}/models/interfaces.ts +30 -37
- package/components/common/wizards/network/add/models/types.ts +2 -0
- package/components/common/wizards/network/add/steps/ConnectionSettings.vue +148 -0
- package/components/common/{addNetworking → wizards/network/add}/steps/CreateStandardSwitch.vue +0 -7
- package/components/common/wizards/network/add/steps/IpFourSettings.vue +245 -0
- package/components/common/{addNetworking → wizards/network/add}/steps/PhysicalAdapter.vue +1 -12
- package/components/common/{addNetworking → wizards/network/add}/steps/PortProperties.vue +57 -180
- package/components/common/{addNetworking → wizards/network/add}/steps/ReadyComplete.vue +1 -10
- package/components/common/{addNetworking → wizards/network/add}/steps/SelectConnectionType.vue +3 -15
- package/components/common/{addNetworking → wizards/network/add}/steps/SelectedTargetDevice.vue +103 -209
- package/components/common/wizards/network/add/utils/index.ts +4 -0
- package/components/common/wizards/network/add/validations/common.ts +58 -0
- package/components/common/wizards/network/add/validations/connectionSettings.ts +75 -0
- package/components/common/wizards/network/add/validations/createStandardSwitch.ts +58 -0
- package/components/common/wizards/network/add/validations/ipFourSettings.ts +188 -0
- package/components/common/wizards/network/add/validations/networkValidation.ts +73 -0
- package/components/common/wizards/network/add/validations/portProperties.ts +87 -0
- package/components/common/wizards/network/add/validations/targetDevice.ts +113 -0
- package/components/common/wizards/network/add/validations/validations.ts +43 -0
- package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +2 -0
- package/package.json +1 -1
- package/components/common/addNetworking/AddNetworking.vue +0 -1123
- package/components/common/addNetworking/Wizard.vue +0 -286
- package/components/common/addNetworking/config/temporaryData.ts +0 -8
- package/components/common/addNetworking/config/validation.ts +0 -23
- package/components/common/addNetworking/models/enums.ts +0 -7
- package/components/common/addNetworking/models/types.ts +0 -13
- package/components/common/addNetworking/steps/ConnectionSettings.vue +0 -269
- package/components/common/addNetworking/steps/Header.vue +0 -53
- package/components/common/addNetworking/steps/IpFourSettings.vue +0 -361
- package/components/common/addNetworking/utils/index.ts +0 -212
- package/components/common/diagramMain/modals/MigrateVmkernelAdapter.vue +0 -603
- package/components/common/diagramMain/modals/config/migrateVmkernelAdapterSteps.ts +0 -81
- package/components/common/diagramMain/modals/config/validation.ts +0 -3
- package/components/common/diagramMain/modals/steps/ConnectionSettings.vue +0 -221
- package/components/common/diagramMain/modals/steps/Header.vue +0 -60
- /package/components/common/{addNetworking → wizards/network/add}/mappers/mappers.ts +0 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wizard-content-container add-networking-step">
|
|
3
|
+
<div class="wizard-content wizard-content-port">
|
|
4
|
+
<atoms-alert
|
|
5
|
+
v-if="props.alertMessages.length"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
9
|
+
/>
|
|
10
|
+
<form>
|
|
11
|
+
<div class="radio">
|
|
12
|
+
<input
|
|
13
|
+
id="Obtain"
|
|
14
|
+
v-model="fields.ipSettings"
|
|
15
|
+
type="radio"
|
|
16
|
+
value="0"
|
|
17
|
+
name="IPv4-settings"
|
|
18
|
+
/>
|
|
19
|
+
<label for="Obtain">
|
|
20
|
+
{{ localization.obtainIPv4SettingsAutomatically }}
|
|
21
|
+
</label>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="radio">
|
|
24
|
+
<input
|
|
25
|
+
id="static"
|
|
26
|
+
v-model="fields.ipSettings"
|
|
27
|
+
type="radio"
|
|
28
|
+
value="1"
|
|
29
|
+
name="IPv4-settings"
|
|
30
|
+
/>
|
|
31
|
+
<label for="static"> {{ localization.useStaticIPv4Settings }} </label>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div
|
|
35
|
+
:class="[
|
|
36
|
+
'form-block form-block-ipv',
|
|
37
|
+
{ disabled: fields.ipSettings === '0' },
|
|
38
|
+
]"
|
|
39
|
+
>
|
|
40
|
+
<div class="horizontal-flex-container p-b-14">
|
|
41
|
+
<label class="property-label-group">
|
|
42
|
+
{{ localization.ipv4address }}
|
|
43
|
+
</label>
|
|
44
|
+
<div class="margin-left-property-value-group">
|
|
45
|
+
<div class="property-value-group">
|
|
46
|
+
<fieldset>
|
|
47
|
+
<atoms-tooltip-error
|
|
48
|
+
:has-error="!!props.messagesFields['tcp_config.ipv4'].field"
|
|
49
|
+
>
|
|
50
|
+
<template #elem>
|
|
51
|
+
<input
|
|
52
|
+
v-model="fields.static.ipFourAddress"
|
|
53
|
+
type="text"
|
|
54
|
+
placeholder="e.g. 192.168.1.1"
|
|
55
|
+
:class="[
|
|
56
|
+
'tooltip-field port-properties-network-label',
|
|
57
|
+
{
|
|
58
|
+
'danger-not-valid':
|
|
59
|
+
props.messagesFields['tcp_config.ipv4'].field,
|
|
60
|
+
},
|
|
61
|
+
]"
|
|
62
|
+
/>
|
|
63
|
+
</template>
|
|
64
|
+
<template #content>
|
|
65
|
+
{{ props.messagesFields['tcp_config.ipv4'].field }}
|
|
66
|
+
</template>
|
|
67
|
+
</atoms-tooltip-error>
|
|
68
|
+
</fieldset>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="horizontal-flex-container p-b-14">
|
|
73
|
+
<label class="property-label-group">
|
|
74
|
+
{{ localization.subnetMask }}
|
|
75
|
+
</label>
|
|
76
|
+
<div class="margin-left-property-value-group">
|
|
77
|
+
<div class="property-value-group">
|
|
78
|
+
<fieldset>
|
|
79
|
+
<atoms-tooltip-error
|
|
80
|
+
:has-error="
|
|
81
|
+
!!props.messagesFields['tcp_config.net_mask'].field
|
|
82
|
+
"
|
|
83
|
+
>
|
|
84
|
+
<template #elem>
|
|
85
|
+
<input
|
|
86
|
+
v-model="fields.static.subnetMask"
|
|
87
|
+
type="text"
|
|
88
|
+
placeholder="e.g. 255.255.255.0"
|
|
89
|
+
:class="[
|
|
90
|
+
'tooltip-field',
|
|
91
|
+
{
|
|
92
|
+
'danger-not-valid':
|
|
93
|
+
props.messagesFields['tcp_config.net_mask'].field,
|
|
94
|
+
},
|
|
95
|
+
]"
|
|
96
|
+
/>
|
|
97
|
+
</template>
|
|
98
|
+
<template #content>
|
|
99
|
+
{{ props.messagesFields['tcp_config.net_mask'].field }}
|
|
100
|
+
</template>
|
|
101
|
+
</atoms-tooltip-error>
|
|
102
|
+
</fieldset>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="horizontal-flex-container p-b-14">
|
|
107
|
+
<label class="property-label-group">
|
|
108
|
+
{{ localization.defaultGateway }}
|
|
109
|
+
</label>
|
|
110
|
+
<div class="margin-left-property-value-group">
|
|
111
|
+
<div class="property-value-group">
|
|
112
|
+
<div
|
|
113
|
+
class="flex-property-label-group small checkbox-inline with-margin p-b-14"
|
|
114
|
+
>
|
|
115
|
+
<input
|
|
116
|
+
id="default-gateway"
|
|
117
|
+
v-model="fields.static.defaultGateway.override"
|
|
118
|
+
type="checkbox"
|
|
119
|
+
/>
|
|
120
|
+
<label
|
|
121
|
+
for="default-gateway"
|
|
122
|
+
class="normal-weight normal-font-size"
|
|
123
|
+
>
|
|
124
|
+
{{ localization.overrideDefaultGatewayForThisAdapter }}
|
|
125
|
+
</label>
|
|
126
|
+
</div>
|
|
127
|
+
<div>
|
|
128
|
+
<fieldset>
|
|
129
|
+
<atoms-tooltip-error
|
|
130
|
+
:has-error="
|
|
131
|
+
!!props.messagesFields['tcp_config.gateway'].field
|
|
132
|
+
"
|
|
133
|
+
>
|
|
134
|
+
<template #elem>
|
|
135
|
+
<input
|
|
136
|
+
v-model="fields.static.defaultGateway.value"
|
|
137
|
+
type="text"
|
|
138
|
+
:disabled="!fields.static.defaultGateway.override"
|
|
139
|
+
placeholder="10.10.101.1"
|
|
140
|
+
:class="[
|
|
141
|
+
'tooltip-field',
|
|
142
|
+
{
|
|
143
|
+
'danger-not-valid':
|
|
144
|
+
props.messagesFields['tcp_config.gateway']
|
|
145
|
+
.field,
|
|
146
|
+
},
|
|
147
|
+
]"
|
|
148
|
+
/>
|
|
149
|
+
</template>
|
|
150
|
+
<template #content>
|
|
151
|
+
{{ props.messagesFields['tcp_config.gateway'].field }}
|
|
152
|
+
</template>
|
|
153
|
+
</atoms-tooltip-error>
|
|
154
|
+
</fieldset>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</form>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</template>
|
|
164
|
+
|
|
165
|
+
<script setup lang="ts">
|
|
166
|
+
import { UI_I_ArbitraryObject, UI_I_Localization } from '~/models/interfaces'
|
|
167
|
+
import { UI_I_IpFourSettings } from '~/components/common/wizards/network/add/models/interfaces'
|
|
168
|
+
import { UI_I_ErrorFields } from '~/components/atoms/wizard/models/interfaces'
|
|
169
|
+
import type Wizard from '~/components/atoms/wizard/utils/utils'
|
|
170
|
+
import {
|
|
171
|
+
removeIpFourSettingsValidationLocal,
|
|
172
|
+
validateAddressIpFourSettingsLocal,
|
|
173
|
+
validateGatewayIpFourSettingsLocal,
|
|
174
|
+
validateMaskIpFourSettingsLocal,
|
|
175
|
+
} from '~/components/common/wizards/network/add/validations/validations'
|
|
176
|
+
|
|
177
|
+
const props = defineProps<{
|
|
178
|
+
ipFourSettings: UI_I_IpFourSettings
|
|
179
|
+
alertMessages: string[]
|
|
180
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
181
|
+
wizard: Wizard
|
|
182
|
+
}>()
|
|
183
|
+
|
|
184
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
185
|
+
|
|
186
|
+
const emits = defineEmits<{
|
|
187
|
+
(event: 'change-ip-four-settings', ipFourSettings: UI_I_IpFourSettings): void
|
|
188
|
+
(event: 'hide-alert', stepId: 4): void
|
|
189
|
+
}>()
|
|
190
|
+
|
|
191
|
+
const fields = ref<UI_I_IpFourSettings>(useDeepCopy(props.ipFourSettings))
|
|
192
|
+
|
|
193
|
+
let oldFields = useDeepCopy(fields.value)
|
|
194
|
+
|
|
195
|
+
watch(
|
|
196
|
+
fields,
|
|
197
|
+
(newFields: UI_I_IpFourSettings) => {
|
|
198
|
+
console.log(oldFields, newFields)
|
|
199
|
+
|
|
200
|
+
if (newFields.ipSettings === '1') {
|
|
201
|
+
oldFields.static.ipFourAddress !== newFields.static.ipFourAddress &&
|
|
202
|
+
validateAddressIpFourSettingsLocal(
|
|
203
|
+
localization.value,
|
|
204
|
+
newFields,
|
|
205
|
+
props.wizard
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
oldFields.static.subnetMask !== newFields.static.subnetMask &&
|
|
209
|
+
validateMaskIpFourSettingsLocal(
|
|
210
|
+
localization.value,
|
|
211
|
+
newFields,
|
|
212
|
+
props.wizard
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
newFields.static.defaultGateway &&
|
|
216
|
+
oldFields.static.defaultGateway.value !==
|
|
217
|
+
newFields.static.defaultGateway.value &&
|
|
218
|
+
validateGatewayIpFourSettingsLocal(
|
|
219
|
+
localization.value,
|
|
220
|
+
newFields,
|
|
221
|
+
props.wizard
|
|
222
|
+
)
|
|
223
|
+
} else {
|
|
224
|
+
removeIpFourSettingsValidationLocal(props.wizard)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
oldFields = useDeepCopy(fields.value)
|
|
228
|
+
|
|
229
|
+
emits('change-ip-four-settings', newFields)
|
|
230
|
+
},
|
|
231
|
+
{ deep: true }
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
const onHideAlert = (): void => {
|
|
235
|
+
emits('hide-alert', 4)
|
|
236
|
+
}
|
|
237
|
+
</script>
|
|
238
|
+
<style lang="scss" scoped>
|
|
239
|
+
.p-b-14 {
|
|
240
|
+
padding-bottom: 14px;
|
|
241
|
+
}
|
|
242
|
+
fieldset :deep(.flex) {
|
|
243
|
+
width: 144px;
|
|
244
|
+
}
|
|
245
|
+
</style>
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wizard-content-container add-networking-step">
|
|
3
|
-
<common-add-networking-steps-header
|
|
4
|
-
:title="props.title"
|
|
5
|
-
:text="props.text"
|
|
6
|
-
/>
|
|
7
3
|
<div class="wizard-content">
|
|
8
4
|
<common-adapter-manager
|
|
9
5
|
test-id="adapter-manager"
|
|
@@ -14,11 +10,4 @@
|
|
|
14
10
|
</div>
|
|
15
11
|
</template>
|
|
16
12
|
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
// Props from up
|
|
19
|
-
const props = defineProps<{
|
|
20
|
-
title: string
|
|
21
|
-
text: string
|
|
22
|
-
stepId: number
|
|
23
|
-
}>()
|
|
24
|
-
</script>
|
|
13
|
+
<script setup lang="ts"></script>
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wizard-content-container add-networking-step">
|
|
3
|
-
<common-add-networking-steps-header
|
|
4
|
-
:title="props.title"
|
|
5
|
-
:text="props.text"
|
|
6
|
-
/>
|
|
7
3
|
<div class="wizard-content wizard-content-port">
|
|
8
4
|
<atoms-alert
|
|
9
|
-
v-if="
|
|
5
|
+
v-if="props.alertMessages.length"
|
|
10
6
|
status="alert-danger"
|
|
11
|
-
:items="props.
|
|
12
|
-
@remove="
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
13
9
|
/>
|
|
14
10
|
<form>
|
|
15
11
|
<b class="property-label-group">
|
|
@@ -24,7 +20,7 @@
|
|
|
24
20
|
<div class="property-value-group">
|
|
25
21
|
<fieldset>
|
|
26
22
|
<atoms-tooltip-error
|
|
27
|
-
:has-error="!!
|
|
23
|
+
:has-error="!!props.messagesFields.network_name.field"
|
|
28
24
|
>
|
|
29
25
|
<template #elem>
|
|
30
26
|
<input
|
|
@@ -35,14 +31,15 @@
|
|
|
35
31
|
:class="[
|
|
36
32
|
'tooltip-field port-properties-network-label',
|
|
37
33
|
{
|
|
38
|
-
'danger-not-valid':
|
|
34
|
+
'danger-not-valid':
|
|
35
|
+
props.messagesFields.network_name.field,
|
|
39
36
|
},
|
|
40
37
|
]"
|
|
41
38
|
@click.stop
|
|
42
39
|
/>
|
|
43
40
|
</template>
|
|
44
41
|
<template #content>
|
|
45
|
-
{{
|
|
42
|
+
{{ props.messagesFields.network_name.field }}
|
|
46
43
|
</template>
|
|
47
44
|
</atoms-tooltip-error>
|
|
48
45
|
</fieldset>
|
|
@@ -61,12 +58,13 @@
|
|
|
61
58
|
v-model="fields.vlanId"
|
|
62
59
|
:items="vlanIdSelectData"
|
|
63
60
|
:class="{
|
|
64
|
-
'danger-not-valid':
|
|
61
|
+
'danger-not-valid':
|
|
62
|
+
props.messagesFields['new_network.vlan'].field,
|
|
65
63
|
}"
|
|
66
64
|
@click.stop
|
|
67
65
|
/>
|
|
68
66
|
<div
|
|
69
|
-
v-show="
|
|
67
|
+
v-show="props.messagesFields['new_network.vlan'].field"
|
|
70
68
|
class="flex-align-center"
|
|
71
69
|
>
|
|
72
70
|
<div class="tooltip flex align-middle">
|
|
@@ -77,7 +75,7 @@
|
|
|
77
75
|
name="info"
|
|
78
76
|
/>
|
|
79
77
|
<div class="tooltip-top-left tooltip-content error">
|
|
80
|
-
{{
|
|
78
|
+
{{ props.messagesFields['new_network.vlan'].field }}
|
|
81
79
|
</div>
|
|
82
80
|
</div>
|
|
83
81
|
</div>
|
|
@@ -101,7 +99,9 @@
|
|
|
101
99
|
<option value="1">{{ localization.custom }}</option>
|
|
102
100
|
</select>
|
|
103
101
|
</div>
|
|
104
|
-
<atoms-tooltip-error
|
|
102
|
+
<atoms-tooltip-error
|
|
103
|
+
:has-error="!!props.messagesFields.mtu.field"
|
|
104
|
+
>
|
|
105
105
|
<template #elem>
|
|
106
106
|
<input
|
|
107
107
|
id="mtu"
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
'tooltip-field show-arrow',
|
|
113
113
|
{
|
|
114
114
|
disabled: fields.mtu.option === '0',
|
|
115
|
-
'danger-not-valid':
|
|
115
|
+
'danger-not-valid': props.messagesFields.mtu.field,
|
|
116
116
|
},
|
|
117
117
|
]"
|
|
118
118
|
@click.stop
|
|
119
119
|
/>
|
|
120
120
|
</template>
|
|
121
121
|
<template #content>
|
|
122
|
-
{{
|
|
122
|
+
{{ props.messagesFields.mtu.field }}
|
|
123
123
|
</template>
|
|
124
124
|
</atoms-tooltip-error>
|
|
125
125
|
</div>
|
|
@@ -205,74 +205,45 @@ import { UI_T_Project } from '~/models/types'
|
|
|
205
205
|
import {
|
|
206
206
|
servicesInitial,
|
|
207
207
|
vlanIdSelectData,
|
|
208
|
-
portPropertiesFieldsErrorMessages,
|
|
209
208
|
portPropertiesEnabledServicesFunc,
|
|
210
|
-
} from '~/components/common/
|
|
211
|
-
import {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
} from '~/components/common/wizards/network/add/config'
|
|
210
|
+
import { UI_I_PortProperties } from '~/components/common/wizards/network/add/models/interfaces'
|
|
211
|
+
import { UI_T_TCP } from '~/components/common/wizards/network/add/models/types'
|
|
212
|
+
import { UI_I_ErrorFields } from '~/components/atoms/wizard/models/interfaces'
|
|
213
|
+
import type Wizard from '~/components/atoms/wizard/utils/utils'
|
|
215
214
|
import {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
validateMtuPortPropertiesLocal,
|
|
216
|
+
validateNetworkPortPropertiesLocal,
|
|
217
|
+
validateVlanIdPortPropertiesLocal,
|
|
218
|
+
} from '~/components/common/wizards/network/add/validations/validations'
|
|
219
219
|
|
|
220
|
-
// Props from up
|
|
221
220
|
const props = withDefaults(
|
|
222
221
|
defineProps<{
|
|
223
|
-
title: string
|
|
224
|
-
text: string
|
|
225
|
-
stepId: number
|
|
226
222
|
portProperties: UI_I_PortProperties
|
|
227
|
-
|
|
228
|
-
errorMessages: string[]
|
|
229
|
-
networkLabelExistingErrorMessage: string
|
|
230
|
-
mtuFromSwitch: number
|
|
231
|
-
error: UI_I_ArbitraryObject<string>
|
|
223
|
+
mtuFromSwitch?: number
|
|
232
224
|
project: UI_T_Project
|
|
225
|
+
alertMessages: string[]
|
|
226
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
227
|
+
wizard: Wizard
|
|
233
228
|
}>(),
|
|
234
229
|
{
|
|
235
230
|
mtuFromSwitch: 1500,
|
|
236
231
|
}
|
|
237
232
|
)
|
|
238
233
|
|
|
239
|
-
// UI_I_Localization
|
|
240
234
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
241
235
|
|
|
242
236
|
const isSphereProject = computed<boolean>(() => props.project === 'sphere')
|
|
243
237
|
|
|
244
|
-
// Making port properties enabled services template
|
|
245
238
|
const portPropertiesEnabledServices = computed(() =>
|
|
246
239
|
portPropertiesEnabledServicesFunc(localization.value, isSphereProject.value)
|
|
247
240
|
)
|
|
248
241
|
|
|
249
|
-
// Define emits for changing data and validation messages
|
|
250
242
|
const emits = defineEmits<{
|
|
251
243
|
(event: 'change-port-properties', portProperties: UI_I_PortProperties): void
|
|
252
|
-
(
|
|
253
|
-
event: 'change-error-messages',
|
|
254
|
-
errorMessages: string[],
|
|
255
|
-
stepIndex: number
|
|
256
|
-
): void
|
|
257
|
-
(event: 'hide-error-message-alert'): void
|
|
258
|
-
(event: 'set-error-empty', fieldName: string): void
|
|
244
|
+
(event: 'hide-alert', stepId: 3): void
|
|
259
245
|
}>()
|
|
260
246
|
|
|
261
|
-
// Checking network label existing
|
|
262
|
-
watch(
|
|
263
|
-
() => props.networkLabelExistingErrorMessage,
|
|
264
|
-
(newValue: string) => {
|
|
265
|
-
if (fieldsErrorMessages.value.networkLabel) return
|
|
266
|
-
|
|
267
|
-
fieldsErrorMessages.value.networkLabel = newValue
|
|
268
|
-
}
|
|
269
|
-
)
|
|
270
|
-
|
|
271
|
-
// Validation error check for this step
|
|
272
|
-
const hasValidationError = computed<boolean>(
|
|
273
|
-
() => props.isShowErrorMessageAlert && !!props.errorMessages.length
|
|
274
|
-
)
|
|
275
|
-
|
|
276
247
|
const mtuCustom = ref<number>()
|
|
277
248
|
|
|
278
249
|
const fields = ref<UI_I_PortProperties>({
|
|
@@ -286,56 +257,6 @@ const fields = ref<UI_I_PortProperties>({
|
|
|
286
257
|
},
|
|
287
258
|
})
|
|
288
259
|
|
|
289
|
-
const fieldsErrorMessages = ref<UI_I_PortPropertiesFieldsErrorMessages>(
|
|
290
|
-
portPropertiesFieldsErrorMessages
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
const messageTexts = (
|
|
294
|
-
local: UI_I_Localization
|
|
295
|
-
): UI_I_ArbitraryObject<string> => ({
|
|
296
|
-
networkLabel: local.networkLabelInvalidMessage,
|
|
297
|
-
vlanId: local.vlanIdInvalidMessage,
|
|
298
|
-
mtu: local.mtuInvalidMessage,
|
|
299
|
-
})
|
|
300
|
-
const isNumberInRange = (value: number | string, down: number, up: number) =>
|
|
301
|
-
isNaN(Number(value)) || Number(value) < down || Number(value) > up
|
|
302
|
-
|
|
303
|
-
const setMessageOnChangedField = (
|
|
304
|
-
values: UI_I_PortProperties,
|
|
305
|
-
name: UI_T_PortPropertiesFieldName,
|
|
306
|
-
text: string
|
|
307
|
-
): void => {
|
|
308
|
-
if (
|
|
309
|
-
name === 'mtu' &&
|
|
310
|
-
values.mtu.option === '1' &&
|
|
311
|
-
isNumberInRange(values.mtu.size, 1280, 65535)
|
|
312
|
-
) {
|
|
313
|
-
fieldsErrorMessages.value[name] = text
|
|
314
|
-
return
|
|
315
|
-
} else if (name === 'mtu' && !props.error.mtu) {
|
|
316
|
-
fieldsErrorMessages.value[name] = ''
|
|
317
|
-
return
|
|
318
|
-
}
|
|
319
|
-
if (name === 'networkLabel' && !values.networkLabel) {
|
|
320
|
-
fieldsErrorMessages.value[name] = text
|
|
321
|
-
return
|
|
322
|
-
} else if (name === 'networkLabel' && !props.error.network_name) {
|
|
323
|
-
fieldsErrorMessages.value[name] = ''
|
|
324
|
-
return
|
|
325
|
-
}
|
|
326
|
-
if (
|
|
327
|
-
name === 'vlanId' &&
|
|
328
|
-
values.vlanId !== 'None (0)' &&
|
|
329
|
-
values.vlanId !== 'All (4095)' &&
|
|
330
|
-
(isNumberInRange(values.vlanId, 0, 4095) || values.vlanId === '')
|
|
331
|
-
) {
|
|
332
|
-
fieldsErrorMessages.value[name] = text
|
|
333
|
-
} else if (name === 'vlanId' && !props.error['new_network.vlan']) {
|
|
334
|
-
fieldsErrorMessages.value[name] = ''
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
// Setting enabled services type depends on tcp value
|
|
339
260
|
const setEnabledServiceDefault = (
|
|
340
261
|
tcp: UI_T_TCP,
|
|
341
262
|
currentFields: UI_I_PortProperties
|
|
@@ -346,6 +267,7 @@ const setEnabledServiceDefault = (
|
|
|
346
267
|
services: servicesInitial,
|
|
347
268
|
})
|
|
348
269
|
}
|
|
270
|
+
|
|
349
271
|
const setEnabledServiceProvisioning = (
|
|
350
272
|
tcp: UI_T_TCP,
|
|
351
273
|
currentFields: UI_I_PortProperties,
|
|
@@ -360,6 +282,7 @@ const setEnabledServiceProvisioning = (
|
|
|
360
282
|
},
|
|
361
283
|
})
|
|
362
284
|
}
|
|
285
|
+
|
|
363
286
|
const setEnabledServiceVMotion = (
|
|
364
287
|
tcp: UI_T_TCP,
|
|
365
288
|
currentFields: UI_I_PortProperties,
|
|
@@ -375,82 +298,40 @@ const setEnabledServiceVMotion = (
|
|
|
375
298
|
})
|
|
376
299
|
}
|
|
377
300
|
|
|
378
|
-
|
|
379
|
-
() => props.error,
|
|
380
|
-
(newError) => {
|
|
381
|
-
fieldsErrorMessages.value = {
|
|
382
|
-
networkLabel: newError.network_name,
|
|
383
|
-
vlanId: newError['new_network.vlan'],
|
|
384
|
-
mtu: newError.mtu,
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
const fieldsErrorMessagesFiltered = Object.values(
|
|
388
|
-
fieldsErrorMessages.value
|
|
389
|
-
).filter(
|
|
390
|
-
(errorMessage: string | undefined) =>
|
|
391
|
-
errorMessage !== '' && errorMessage !== undefined
|
|
392
|
-
)
|
|
393
|
-
|
|
394
|
-
emits('change-error-messages', fieldsErrorMessagesFiltered, props.stepId)
|
|
395
|
-
},
|
|
396
|
-
{ deep: true, immediate: true }
|
|
397
|
-
)
|
|
398
|
-
|
|
399
|
-
const oldFields = ref<any>(useDeepCopy(fields.value))
|
|
400
|
-
|
|
401
|
-
const cacheOldFields = (newFields: UI_I_PortProperties): void => {
|
|
402
|
-
oldFields.value = useDeepCopy(newFields)
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
const setErrorEmpty = (
|
|
406
|
-
newValue: UI_I_PortProperties,
|
|
407
|
-
oldValue: UI_I_PortProperties,
|
|
408
|
-
fieldName: keyof UI_I_PortProperties,
|
|
409
|
-
errFieldName: string
|
|
410
|
-
): void => {
|
|
411
|
-
newValue[fieldName] !== oldValue[fieldName] &&
|
|
412
|
-
emits('set-error-empty', errFieldName)
|
|
413
|
-
}
|
|
301
|
+
let oldFields = useDeepCopy(fields.value)
|
|
414
302
|
|
|
415
303
|
// Changing data and validate they
|
|
416
304
|
watch(
|
|
417
305
|
fields,
|
|
418
306
|
(newFields: UI_I_PortProperties) => {
|
|
419
|
-
setErrorEmpty(newFields, oldFields.value, 'networkLabel', 'network_name')
|
|
420
|
-
setErrorEmpty(newFields, oldFields.value, 'vlanId', 'new_network.vlan')
|
|
421
|
-
newFields.mtu.size !== oldFields.value.mtu.size &&
|
|
422
|
-
emits('set-error-empty', 'mtu')
|
|
423
|
-
|
|
424
|
-
cacheOldFields(newFields)
|
|
425
|
-
|
|
426
|
-
setMessageOnChangedField(
|
|
427
|
-
newFields,
|
|
428
|
-
'mtu',
|
|
429
|
-
messageTexts(localization.value).mtu
|
|
430
|
-
)
|
|
431
|
-
setMessageOnChangedField(
|
|
432
|
-
newFields,
|
|
433
|
-
'vlanId',
|
|
434
|
-
messageTexts(localization.value).vlanId
|
|
435
|
-
)
|
|
436
|
-
setMessageOnChangedField(
|
|
437
|
-
newFields,
|
|
438
|
-
'networkLabel',
|
|
439
|
-
messageTexts(localization.value).networkLabel
|
|
440
|
-
)
|
|
441
307
|
if (newFields.tcp && newFields.tcp !== fields.value.tcp) {
|
|
442
308
|
setEnabledServiceProvisioning(newFields.tcp, fields.value, newFields)
|
|
443
309
|
setEnabledServiceVMotion(newFields.tcp, fields.value, newFields)
|
|
444
310
|
}
|
|
445
311
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
312
|
+
oldFields.networkLabel !== newFields.networkLabel &&
|
|
313
|
+
validateNetworkPortPropertiesLocal(
|
|
314
|
+
localization.value,
|
|
315
|
+
newFields,
|
|
316
|
+
props.wizard
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
oldFields.vlanId !== newFields.vlanId &&
|
|
320
|
+
validateVlanIdPortPropertiesLocal(
|
|
321
|
+
localization.value,
|
|
322
|
+
newFields,
|
|
323
|
+
props.wizard
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
oldFields.mtu.size !== newFields.mtu.size &&
|
|
327
|
+
validateMtuPortPropertiesLocal(
|
|
328
|
+
localization.value,
|
|
329
|
+
newFields,
|
|
330
|
+
props.wizard
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
oldFields = useDeepCopy(newFields)
|
|
449
334
|
|
|
450
|
-
fieldsErrorMessagesFiltered.length === 0 &&
|
|
451
|
-
emits('hide-error-message-alert')
|
|
452
|
-
|
|
453
|
-
emits('change-error-messages', fieldsErrorMessagesFiltered, props.stepId)
|
|
454
335
|
emits('change-port-properties', newFields)
|
|
455
336
|
},
|
|
456
337
|
{ deep: true, immediate: true }
|
|
@@ -482,11 +363,7 @@ watch(
|
|
|
482
363
|
}
|
|
483
364
|
)
|
|
484
365
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
emits('hide-error-message-alert')
|
|
366
|
+
const onHideAlert = (): void => {
|
|
367
|
+
emits('hide-alert', 3)
|
|
488
368
|
}
|
|
489
|
-
onUnmounted(() => {
|
|
490
|
-
emits('hide-error-message-alert')
|
|
491
|
-
})
|
|
492
369
|
</script>
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wizard-content-container add-networking-step">
|
|
3
|
-
<common-add-networking-steps-header
|
|
4
|
-
:title="props.title"
|
|
5
|
-
:text="props.text"
|
|
6
|
-
/>
|
|
7
3
|
<template
|
|
8
4
|
v-for="readyCompleteField in props.readyCompleteFields"
|
|
9
5
|
:key="readyCompleteField.id"
|
|
10
6
|
>
|
|
11
7
|
<common-diagram-main-modals-view-settings
|
|
12
|
-
modal-name=""
|
|
13
8
|
:view-settings-field="readyCompleteField"
|
|
14
9
|
/>
|
|
15
10
|
</template>
|
|
@@ -17,13 +12,9 @@
|
|
|
17
12
|
</template>
|
|
18
13
|
|
|
19
14
|
<script setup lang="ts">
|
|
20
|
-
import { UI_I_ReadyCompleteFields } from '~/components/common/
|
|
15
|
+
import { UI_I_ReadyCompleteFields } from '~/components/common/wizards/network/add/models/interfaces'
|
|
21
16
|
|
|
22
|
-
// Props from up
|
|
23
17
|
const props = defineProps<{
|
|
24
|
-
title: string
|
|
25
|
-
text: string
|
|
26
|
-
stepId: number
|
|
27
18
|
readyCompleteFields: UI_I_ReadyCompleteFields[]
|
|
28
19
|
}>()
|
|
29
20
|
</script>
|