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
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="props.show" class="modal clr-wizard wizard-xl">
|
|
3
|
-
<div class="modal-dialog modal-xl relative">
|
|
4
|
-
<div class="modal-content-wrapper">
|
|
5
|
-
<nav class="modal-nav clr-wizard-stepnav-wrapper">
|
|
6
|
-
<h1 class="clr-wizard-title">
|
|
7
|
-
{{ props.title }}
|
|
8
|
-
</h1>
|
|
9
|
-
<div :class="['clr-wizard-stepnav']">
|
|
10
|
-
<div class="clr-wizard-stepnav-list">
|
|
11
|
-
<div
|
|
12
|
-
v-for="currentStep in props.stepsWithStatus"
|
|
13
|
-
:key="currentStep.id"
|
|
14
|
-
:class="[
|
|
15
|
-
'clr-wizard clr-wizard-stepnav-item clr-nav-link nav-item',
|
|
16
|
-
{ disabled: currentStep.status === UI_E_StepStatus.Disabled },
|
|
17
|
-
{
|
|
18
|
-
active:
|
|
19
|
-
currentStep.status === UI_E_StepStatus.Selected ||
|
|
20
|
-
currentStep.status === UI_E_StepStatus.CompleteSelected,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
complete:
|
|
24
|
-
currentStep.status === UI_E_StepStatus.Complete ||
|
|
25
|
-
currentStep.status === UI_E_StepStatus.CompleteSelected,
|
|
26
|
-
},
|
|
27
|
-
]"
|
|
28
|
-
>
|
|
29
|
-
<atoms-the-icon
|
|
30
|
-
v-if="false"
|
|
31
|
-
:style="{
|
|
32
|
-
opacity:
|
|
33
|
-
currentStep.status === UI_E_StepStatus.Complete ||
|
|
34
|
-
currentStep.status === UI_E_StepStatus.CompleteSelected
|
|
35
|
-
? 1
|
|
36
|
-
: 0,
|
|
37
|
-
}"
|
|
38
|
-
width="14px"
|
|
39
|
-
fill="#3aab24"
|
|
40
|
-
name="check"
|
|
41
|
-
/>
|
|
42
|
-
<button
|
|
43
|
-
class="btn btn-link clr-wizard-stepnav-link wizard-ml-8"
|
|
44
|
-
:disabled="currentStep.status === UI_E_StepStatus.Disabled"
|
|
45
|
-
@click="onSelectStep(currentStep.id)"
|
|
46
|
-
>
|
|
47
|
-
<span class="clr-wizard-stepnav-link-title">
|
|
48
|
-
{{ currentStep.name }}
|
|
49
|
-
</span>
|
|
50
|
-
</button>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</nav>
|
|
55
|
-
<div class="modal-content">
|
|
56
|
-
<div class="modal-header--accessible">
|
|
57
|
-
<div class="modal-title-wrapper">
|
|
58
|
-
<h2 class="modal-title">
|
|
59
|
-
<span class="modal-title-text">{{ props.secondTitle }}</span>
|
|
60
|
-
</h2>
|
|
61
|
-
</div>
|
|
62
|
-
<button class="close" @click="onHideModal">
|
|
63
|
-
<atoms-the-icon class="close-icon" name="close" />
|
|
64
|
-
</button>
|
|
65
|
-
</div>
|
|
66
|
-
<div class="modal-body">
|
|
67
|
-
<slot name="modalBody" />
|
|
68
|
-
</div>
|
|
69
|
-
<div class="modal-footer">
|
|
70
|
-
<slot name="modalFooter">
|
|
71
|
-
<button class="btn btn-link" @click="onHideModal">
|
|
72
|
-
{{ localization.cancel }}
|
|
73
|
-
</button>
|
|
74
|
-
<button
|
|
75
|
-
v-show="!props.wizard.isSelectedStep(0)"
|
|
76
|
-
class="btn btn-outline"
|
|
77
|
-
@click="onBackStep"
|
|
78
|
-
>
|
|
79
|
-
{{ localization.back }}
|
|
80
|
-
</button>
|
|
81
|
-
<button
|
|
82
|
-
v-if="props.wizard.isSelectedStep(7)"
|
|
83
|
-
class="btn btn-success"
|
|
84
|
-
@click="onFinish"
|
|
85
|
-
>
|
|
86
|
-
{{ localization.finish }}
|
|
87
|
-
</button>
|
|
88
|
-
<button v-else class="btn btn-primary" @click="onNextStep">
|
|
89
|
-
{{ localization.next }}
|
|
90
|
-
</button>
|
|
91
|
-
</slot>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
<div v-show="props.isShowLoader" class="loader">
|
|
97
|
-
<i class="fa clr-tree-node-caret-icon spinner spinner" />
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
<div class="modal-backdrop" />
|
|
101
|
-
</div>
|
|
102
|
-
</template>
|
|
103
|
-
|
|
104
|
-
<script setup lang="ts">
|
|
105
|
-
import { UI_I_Step } from '~/components/common/addNetworking/models/interfaces'
|
|
106
|
-
import { Wizard } from '~/components/common/addNetworking/utils'
|
|
107
|
-
import { UI_I_Localization } from '~/models/interfaces'
|
|
108
|
-
import { UI_E_StepStatus } from '~/components/common/addNetworking/models/enums'
|
|
109
|
-
|
|
110
|
-
const props = defineProps<{
|
|
111
|
-
wizard: Wizard
|
|
112
|
-
stepsWithStatus: UI_I_Step[]
|
|
113
|
-
width: string
|
|
114
|
-
height: string
|
|
115
|
-
show: boolean
|
|
116
|
-
title: string
|
|
117
|
-
isShowLoader: boolean
|
|
118
|
-
secondTitle: string
|
|
119
|
-
}>()
|
|
120
|
-
|
|
121
|
-
const emits = defineEmits<{
|
|
122
|
-
(event: 'select-step', id: number): void
|
|
123
|
-
(event: 'hide'): void
|
|
124
|
-
(event: 'next-step'): void
|
|
125
|
-
(event: 'finish'): void
|
|
126
|
-
}>()
|
|
127
|
-
|
|
128
|
-
// UI_I_Localization
|
|
129
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
130
|
-
|
|
131
|
-
const onHideModal = (): void => emits('hide')
|
|
132
|
-
const onSelectStep = (id: number): void => emits('select-step', id)
|
|
133
|
-
const onNextStep = (): void => emits('next-step')
|
|
134
|
-
const onBackStep = (): void => props.wizard.goToBackStep()
|
|
135
|
-
const onFinish = (): void => emits('finish')
|
|
136
|
-
</script>
|
|
137
|
-
|
|
138
|
-
<style scoped lang="scss">
|
|
139
|
-
.modal {
|
|
140
|
-
position: fixed;
|
|
141
|
-
top: 0;
|
|
142
|
-
bottom: 0;
|
|
143
|
-
right: 0;
|
|
144
|
-
left: 0;
|
|
145
|
-
z-index: 1050;
|
|
146
|
-
display: flex;
|
|
147
|
-
flex-direction: column;
|
|
148
|
-
justify-content: center;
|
|
149
|
-
align-items: center;
|
|
150
|
-
padding: 48px;
|
|
151
|
-
overflow-y: auto;
|
|
152
|
-
|
|
153
|
-
.modal-nav {
|
|
154
|
-
background-color: var(--block-view-bg-color4);
|
|
155
|
-
.clr-wizard-title {
|
|
156
|
-
color: var(--main-color-mode);
|
|
157
|
-
font-size: 22px;
|
|
158
|
-
padding: 24px 12px 24px 24px;
|
|
159
|
-
//line-height: 1.2rem;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.modal-content-wrapper {
|
|
164
|
-
position: relative;
|
|
165
|
-
-webkit-animation-name: animateTop;
|
|
166
|
-
-webkit-animation-duration: 0.4s;
|
|
167
|
-
animation-name: animateTop;
|
|
168
|
-
animation-duration: 0.4s;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.modal-content {
|
|
172
|
-
background-color: var(--modal-bg-color);
|
|
173
|
-
|
|
174
|
-
.modal-header--accessible {
|
|
175
|
-
display: flex;
|
|
176
|
-
justify-content: space-between;
|
|
177
|
-
align-items: flex-start;
|
|
178
|
-
width: 100%;
|
|
179
|
-
padding: 24px 19px 6px 24px;
|
|
180
|
-
|
|
181
|
-
.modal-title-text {
|
|
182
|
-
color: var(--main-color-mode);
|
|
183
|
-
font-size: 22px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.close-icon {
|
|
187
|
-
fill: var(--close-icon);
|
|
188
|
-
width: 24px;
|
|
189
|
-
height: 24px;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.modal-body {
|
|
194
|
-
padding: 0 3px;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.modal-footer {
|
|
198
|
-
display: flex;
|
|
199
|
-
justify-content: flex-end;
|
|
200
|
-
padding: 24px;
|
|
201
|
-
flex: unset;
|
|
202
|
-
min-height: 0;
|
|
203
|
-
height: auto;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.loader {
|
|
208
|
-
position: absolute;
|
|
209
|
-
z-index: 1000;
|
|
210
|
-
left: 0;
|
|
211
|
-
right: 0;
|
|
212
|
-
bottom: 0;
|
|
213
|
-
top: 0;
|
|
214
|
-
display: flex;
|
|
215
|
-
align-items: center;
|
|
216
|
-
justify-content: center;
|
|
217
|
-
background-color: rgba(0, 0, 0, 0.3);
|
|
218
|
-
|
|
219
|
-
.spinner {
|
|
220
|
-
left: unset;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.modal-backdrop {
|
|
225
|
-
opacity: 1;
|
|
226
|
-
background-color: rgba(0, 0, 0, 0.6);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
h1,
|
|
230
|
-
h2 {
|
|
231
|
-
// просмотреть если нигде не ломается переместит глобально
|
|
232
|
-
line-height: inherit;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.clr-wizard-stepnav {
|
|
236
|
-
&.check {
|
|
237
|
-
.clr-wizard-stepnav-item {
|
|
238
|
-
box-shadow: none;
|
|
239
|
-
display: flex;
|
|
240
|
-
align-items: center;
|
|
241
|
-
|
|
242
|
-
button {
|
|
243
|
-
height: auto;
|
|
244
|
-
font-size: 13px;
|
|
245
|
-
border-radius: 3px;
|
|
246
|
-
//margin-left: 4px;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
.clr-wizard-stepnav-item {
|
|
251
|
-
padding: 0.3rem 0 0.4rem;
|
|
252
|
-
|
|
253
|
-
.wizard-ml-8 {
|
|
254
|
-
margin-left: 8px;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
&.active {
|
|
258
|
-
button:hover,
|
|
259
|
-
button {
|
|
260
|
-
color: var(--vertical-steps-active-color);
|
|
261
|
-
background-color: var(--vertical-steps-active-bg-color);
|
|
262
|
-
cursor: default;
|
|
263
|
-
span {
|
|
264
|
-
color: var(--checkbox-mark-color);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
&.complete:not(&.active) {
|
|
269
|
-
button {
|
|
270
|
-
background: var(--block-view-bg-color3);
|
|
271
|
-
}
|
|
272
|
-
button:hover {
|
|
273
|
-
color: var(--vertical-steps-complete-color);
|
|
274
|
-
background-color: var(--vertical-steps-complete-bg-color);
|
|
275
|
-
border-bottom: 1px solid var(--vertical-steps-hover-border-color);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
button {
|
|
279
|
-
color: var(--add-vm-context-title);
|
|
280
|
-
.clr-wizard-stepnav-link-title {
|
|
281
|
-
font-size: 14px;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
</style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const connectionSettingsFieldsErrorMessages = {
|
|
2
|
-
networkLabel: '',
|
|
3
|
-
vlanId: '',
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const ipFourSettingsFieldsErrorMessages = {
|
|
7
|
-
ipFourAddress: '',
|
|
8
|
-
subnetMask: '',
|
|
9
|
-
defaultGateway: '',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const portPropertiesFieldsErrorMessages = {
|
|
13
|
-
networkLabel: '',
|
|
14
|
-
vlanId: '',
|
|
15
|
-
mtu: '',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const targetDeviceFieldsErrorMessages = {
|
|
19
|
-
network: '',
|
|
20
|
-
switch: '',
|
|
21
|
-
standardSwitch: '',
|
|
22
|
-
mtu: '',
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type UI_T_ConnectionSettingsFieldName = 'networkLabel' | 'vlanId'
|
|
2
|
-
export type UI_T_IpFourSettingsFieldName =
|
|
3
|
-
| 'ipFourAddress'
|
|
4
|
-
| 'subnetMask'
|
|
5
|
-
| 'defaultGateway'
|
|
6
|
-
export type UI_T_PortPropertiesFieldName = 'networkLabel' | 'vlanId' | 'mtu'
|
|
7
|
-
export type UI_T_TargetDeviceFieldName =
|
|
8
|
-
| 'network'
|
|
9
|
-
| 'switch'
|
|
10
|
-
| 'standardSwitch'
|
|
11
|
-
| 'mtu'
|
|
12
|
-
export type UI_T_TCP = 'default' | '1' | '2'
|
|
13
|
-
export type UI_T_Project = 'procurator' | 'sphere'
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
<template>
|
|
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
|
-
<div class="wizard-content wizard-content-port">
|
|
8
|
-
<atoms-alert
|
|
9
|
-
v-if="hasValidationError"
|
|
10
|
-
status="alert-danger"
|
|
11
|
-
:items="props.errorMessages"
|
|
12
|
-
@remove="onHideErrorMessageAlert"
|
|
13
|
-
/>
|
|
14
|
-
<form>
|
|
15
|
-
<div class="horizontal-flex-container">
|
|
16
|
-
<label class="property-label-group" for="network-label">
|
|
17
|
-
{{ localization.networkLabel }}
|
|
18
|
-
</label>
|
|
19
|
-
<div class="margin-left-property-value-group">
|
|
20
|
-
<div class="property-value-group">
|
|
21
|
-
<fieldset>
|
|
22
|
-
<atoms-tooltip-error
|
|
23
|
-
:has-error="!!fieldsErrorMessages.networkLabel"
|
|
24
|
-
>
|
|
25
|
-
<template #elem>
|
|
26
|
-
<input
|
|
27
|
-
id="network-label"
|
|
28
|
-
v-model="fields.networkLabel"
|
|
29
|
-
name="network-label"
|
|
30
|
-
type="text"
|
|
31
|
-
:class="[
|
|
32
|
-
'tooltip-field port-properties-network-label',
|
|
33
|
-
{
|
|
34
|
-
'danger-not-valid': fieldsErrorMessages.networkLabel,
|
|
35
|
-
},
|
|
36
|
-
]"
|
|
37
|
-
@click.stop
|
|
38
|
-
/>
|
|
39
|
-
</template>
|
|
40
|
-
<template #content>
|
|
41
|
-
{{ fieldsErrorMessages.networkLabel }}
|
|
42
|
-
</template>
|
|
43
|
-
</atoms-tooltip-error>
|
|
44
|
-
</fieldset>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div class="horizontal-flex-container port-properties-padding">
|
|
50
|
-
<label class="property-label-group">
|
|
51
|
-
{{ localization.vlanId }}
|
|
52
|
-
</label>
|
|
53
|
-
<div class="margin-left-property-value-group">
|
|
54
|
-
<div class="property-value-group">
|
|
55
|
-
<fieldset>
|
|
56
|
-
<div class="flex-align-center">
|
|
57
|
-
<atoms-combobox
|
|
58
|
-
v-model.trim="fields.vlanId"
|
|
59
|
-
:items="vlanIdSelectData"
|
|
60
|
-
:class="{
|
|
61
|
-
'danger-not-valid': fieldsErrorMessages.vlanId,
|
|
62
|
-
}"
|
|
63
|
-
@click.stop
|
|
64
|
-
/>
|
|
65
|
-
<div
|
|
66
|
-
v-show="fieldsErrorMessages.vlanId"
|
|
67
|
-
class="flex-align-center"
|
|
68
|
-
>
|
|
69
|
-
<div class="tooltip flex align-middle">
|
|
70
|
-
<atoms-the-icon
|
|
71
|
-
width="24px"
|
|
72
|
-
height="24px"
|
|
73
|
-
class="is-error tooltip-trigger"
|
|
74
|
-
name="info"
|
|
75
|
-
/>
|
|
76
|
-
<div class="tooltip-top-left tooltip-content error">
|
|
77
|
-
{{ fieldsErrorMessages.vlanId }}
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</fieldset>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</form>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</template>
|
|
90
|
-
|
|
91
|
-
<script setup lang="ts">
|
|
92
|
-
import { UI_I_ArbitraryObject, UI_I_Localization } from '~/models/interfaces'
|
|
93
|
-
import {
|
|
94
|
-
UI_I_ConnectionSettings,
|
|
95
|
-
UI_I_ConnectionSettingsFieldsErrorMessages,
|
|
96
|
-
} from '~/components/common/addNetworking/models/interfaces'
|
|
97
|
-
import { UI_T_ConnectionSettingsFieldName } from '~/components/common/addNetworking/models/types'
|
|
98
|
-
import {
|
|
99
|
-
connectionSettingsFieldsErrorMessages,
|
|
100
|
-
vlanIdSelectData,
|
|
101
|
-
} from '~/components/common/addNetworking/config'
|
|
102
|
-
|
|
103
|
-
// Props from up
|
|
104
|
-
|
|
105
|
-
const props = defineProps<{
|
|
106
|
-
title: string
|
|
107
|
-
text: string
|
|
108
|
-
stepId: number
|
|
109
|
-
connectionSettings: UI_I_ConnectionSettings
|
|
110
|
-
isShowErrorMessageAlert: boolean
|
|
111
|
-
errorMessages: string[]
|
|
112
|
-
networkLabelExistingErrorMessage: string
|
|
113
|
-
error: UI_I_ArbitraryObject<string>
|
|
114
|
-
}>()
|
|
115
|
-
|
|
116
|
-
// UI_I_Localization
|
|
117
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
118
|
-
|
|
119
|
-
// Define emits for changing data and validation messages
|
|
120
|
-
const emits = defineEmits<{
|
|
121
|
-
(
|
|
122
|
-
event: 'change-connection-settings',
|
|
123
|
-
connectionSettings: UI_I_ConnectionSettings
|
|
124
|
-
): void
|
|
125
|
-
(
|
|
126
|
-
event: 'change-error-messages',
|
|
127
|
-
errorMessages: string[],
|
|
128
|
-
stepIndex: number
|
|
129
|
-
): void
|
|
130
|
-
(event: 'hide-error-message-alert'): void
|
|
131
|
-
(event: 'set-error-empty', fieldName: string): void
|
|
132
|
-
}>()
|
|
133
|
-
|
|
134
|
-
// Checking network label existing
|
|
135
|
-
watch(
|
|
136
|
-
() => props.networkLabelExistingErrorMessage,
|
|
137
|
-
(newValue: string) => {
|
|
138
|
-
if (fieldsErrorMessages.value.networkLabel) return
|
|
139
|
-
|
|
140
|
-
fieldsErrorMessages.value.networkLabel = newValue
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
// Validation error check for this step
|
|
145
|
-
const hasValidationError = computed<boolean>(
|
|
146
|
-
() => props.isShowErrorMessageAlert && !!props.errorMessages.length
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
const fields = ref<UI_I_ConnectionSettings>(
|
|
150
|
-
useDeepCopy(props.connectionSettings)
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
const fieldsErrorMessages = ref<UI_I_ConnectionSettingsFieldsErrorMessages>(
|
|
154
|
-
connectionSettingsFieldsErrorMessages
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
const messageTexts = (
|
|
158
|
-
local: UI_I_Localization
|
|
159
|
-
): UI_I_ArbitraryObject<string> => ({
|
|
160
|
-
networkLabel: local.networkLabelInvalidMessage,
|
|
161
|
-
vlanId: local.vlanIdInvalidMessage,
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
const isNumberInRange = (
|
|
165
|
-
value: number | string,
|
|
166
|
-
down: number,
|
|
167
|
-
up: number
|
|
168
|
-
): boolean => isNaN(Number(value)) || Number(value) < down || Number(value) > up
|
|
169
|
-
|
|
170
|
-
const setMessageOnChangedField = (
|
|
171
|
-
values: string | number,
|
|
172
|
-
name: UI_T_ConnectionSettingsFieldName,
|
|
173
|
-
text: string
|
|
174
|
-
): void => {
|
|
175
|
-
if (name === 'networkLabel' && !values) {
|
|
176
|
-
fieldsErrorMessages.value[name] = text
|
|
177
|
-
return
|
|
178
|
-
}
|
|
179
|
-
if (
|
|
180
|
-
name === 'vlanId' &&
|
|
181
|
-
values !== 'None (0)' &&
|
|
182
|
-
values !== 'All (4095)' &&
|
|
183
|
-
(isNumberInRange(values, 0, 4095) || values === '')
|
|
184
|
-
) {
|
|
185
|
-
fieldsErrorMessages.value[name] = text
|
|
186
|
-
return
|
|
187
|
-
}
|
|
188
|
-
fieldsErrorMessages.value[name] = ''
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
watch(
|
|
192
|
-
() => props.error,
|
|
193
|
-
(newError) => {
|
|
194
|
-
fieldsErrorMessages.value = {
|
|
195
|
-
networkLabel: newError.name,
|
|
196
|
-
vlanId: newError.vlan,
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const fieldsErrorMessagesFiltered = Object.values(
|
|
200
|
-
fieldsErrorMessages.value
|
|
201
|
-
).filter(
|
|
202
|
-
(errorMessage: string | undefined) =>
|
|
203
|
-
errorMessage !== '' && errorMessage !== undefined
|
|
204
|
-
)
|
|
205
|
-
|
|
206
|
-
emits('change-error-messages', fieldsErrorMessagesFiltered, props.stepId)
|
|
207
|
-
},
|
|
208
|
-
{ deep: true, immediate: true }
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
const oldFields = ref<any>(useDeepCopy(fields.value))
|
|
212
|
-
|
|
213
|
-
const cacheOldFields = (newFields: UI_I_ConnectionSettings): void => {
|
|
214
|
-
oldFields.value = useDeepCopy(newFields)
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const setErrorEmpty = (
|
|
218
|
-
newValue: UI_I_ConnectionSettings,
|
|
219
|
-
oldValue: UI_I_ConnectionSettings,
|
|
220
|
-
fieldName: keyof UI_I_ConnectionSettings,
|
|
221
|
-
errFieldName: string
|
|
222
|
-
): void => {
|
|
223
|
-
newValue[fieldName] !== oldValue[fieldName] &&
|
|
224
|
-
emits('set-error-empty', errFieldName)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Changing data and validate they
|
|
228
|
-
watch(
|
|
229
|
-
fields,
|
|
230
|
-
(newFields: UI_I_ConnectionSettings) => {
|
|
231
|
-
setErrorEmpty(newFields, oldFields.value, 'networkLabel', 'name')
|
|
232
|
-
setErrorEmpty(newFields, oldFields.value, 'vlanId', 'vlan')
|
|
233
|
-
|
|
234
|
-
cacheOldFields(newFields)
|
|
235
|
-
|
|
236
|
-
setMessageOnChangedField(
|
|
237
|
-
newFields.vlanId,
|
|
238
|
-
'vlanId',
|
|
239
|
-
messageTexts(localization.value).vlanId
|
|
240
|
-
)
|
|
241
|
-
|
|
242
|
-
setMessageOnChangedField(
|
|
243
|
-
newFields.networkLabel,
|
|
244
|
-
'networkLabel',
|
|
245
|
-
messageTexts(localization.value).networkLabel
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
const fieldsErrorMessagesFiltered = Object.values(
|
|
249
|
-
fieldsErrorMessages.value
|
|
250
|
-
).filter((errorMessage: string) => errorMessage !== '')
|
|
251
|
-
|
|
252
|
-
fieldsErrorMessagesFiltered.length === 0 &&
|
|
253
|
-
emits('hide-error-message-alert')
|
|
254
|
-
|
|
255
|
-
emits('change-error-messages', fieldsErrorMessagesFiltered, props.stepId)
|
|
256
|
-
|
|
257
|
-
emits('change-connection-settings', newFields)
|
|
258
|
-
},
|
|
259
|
-
{ deep: true, immediate: true }
|
|
260
|
-
)
|
|
261
|
-
|
|
262
|
-
// Validation message show and hide
|
|
263
|
-
const onHideErrorMessageAlert = (): void => {
|
|
264
|
-
emits('hide-error-message-alert')
|
|
265
|
-
}
|
|
266
|
-
onUnmounted(() => {
|
|
267
|
-
emits('hide-error-message-alert')
|
|
268
|
-
})
|
|
269
|
-
</script>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="wizard-content-header-area">
|
|
3
|
-
<div>
|
|
4
|
-
<div
|
|
5
|
-
class="description"
|
|
6
|
-
>
|
|
7
|
-
{{ props.text }}
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
// Props from up
|
|
15
|
-
|
|
16
|
-
const props = defineProps<{
|
|
17
|
-
title: string
|
|
18
|
-
text: string
|
|
19
|
-
}>()
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<style scoped lang="scss">
|
|
23
|
-
|
|
24
|
-
.wizard-content-header-area {
|
|
25
|
-
flex-shrink: 0;
|
|
26
|
-
width: inherit;
|
|
27
|
-
height: auto;
|
|
28
|
-
background-color: transparent;
|
|
29
|
-
padding-bottom: 3px;
|
|
30
|
-
border-bottom: 1px solid #a6a6a6;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.wizard-content-header-area {
|
|
34
|
-
display: flex;
|
|
35
|
-
//padding-top: 12px;
|
|
36
|
-
|
|
37
|
-
.description {
|
|
38
|
-
color: #333333;
|
|
39
|
-
font-size: 13px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.description,
|
|
43
|
-
.select {
|
|
44
|
-
flex: 1 1 100%;
|
|
45
|
-
margin-right: 5px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
:deep(select) {
|
|
49
|
-
background-color: transparent;
|
|
50
|
-
border-color: var(--type-list-border-color);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
</style>
|