bfg-common 1.5.869 → 1.5.871
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/img/icons/icons-sprite-dark-5.svg +15 -2
- package/assets/img/icons/icons-sprite-light-5.svg +18 -5
- package/assets/localization/local_be.json +4 -1
- package/assets/localization/local_en.json +7 -4
- package/assets/localization/local_hy.json +4 -1
- package/assets/localization/local_kk.json +4 -1
- package/assets/localization/local_ru.json +10 -7
- package/assets/localization/local_zh.json +4 -1
- package/components/common/adapterManager/AdapterManagerNew.vue +39 -5
- package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +3 -2
- package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +3 -3
- package/components/common/adapterManager/ui/actions/moveDownAdapterButton/MoveDownAdapterButtonNew.vue +1 -0
- package/components/common/adapterManager/ui/actions/moveUpAdapterButton/MoveUpAdapterButtonNew.vue +1 -0
- package/components/common/adapterManager/ui/noSelectedAdapter/NoSelectedAdapterNew.vue +10 -4
- package/components/common/adapterManager/ui/secondTitle/SecondTitleNew.vue +15 -0
- package/components/common/adapterManager/ui/table/TableNew.vue +3 -2
- package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +69 -36
- package/components/common/adapterManager/ui/table/header/HeaderNew.vue +5 -1
- package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +218 -218
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +19 -19
- package/components/common/diagramMain/modals/viewSettings/info/InfoNew.vue +17 -0
- package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsNew.vue +13 -8
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/lib/config/optionsMetrics.ts +6 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +20 -4
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/New.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Old.vue +3 -2
- package/components/common/wizards/network/add/Add.vue +872 -872
- package/components/common/wizards/network/add/AddNew.vue +483 -476
- package/components/common/wizards/network/add/lib/config/initialData.ts +86 -86
- package/components/common/wizards/network/add/lib/config/selectSwitch.ts +237 -237
- package/components/common/wizards/network/add/lib/utils/utils.ts +9 -9
- package/components/common/wizards/network/add/mappers/mappers.ts +199 -199
- package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettings.vue +89 -84
- package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsNew.vue +3 -0
- package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsOld.vue +126 -126
- package/components/common/wizards/network/add/steps/createStandardSwitch/CreateStandardSwitch.vue +81 -81
- package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettings.vue +144 -144
- package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsNew.vue +48 -9
- package/components/common/wizards/network/add/steps/portProperties/PortProperties.vue +196 -193
- package/components/common/wizards/network/add/steps/portProperties/PortPropertiesNew.vue +312 -294
- package/components/common/wizards/network/add/steps/readyComplete/ReadyComplete.vue +24 -24
- package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionType.vue +34 -34
- package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDevice.vue +187 -187
- package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +455 -455
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectNetwork.vue +63 -63
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectStandardSwitch.vue +63 -63
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectSwitch.vue +63 -63
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectSwitch.vue +180 -180
- package/components/common/wizards/network/add/validations/common.ts +30 -30
- package/components/common/wizards/network/add/validations/networkValidation.ts +2 -2
- package/components/common/wizards/network/add/validations/portProperties.ts +115 -115
- package/package.json +2 -2
|
@@ -1,38 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<template v-for="(adapter, index) in adapters" :key="adapter.id">
|
|
3
|
-
<
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
]"
|
|
13
|
-
:data-id="`adapter-${adapter.id}`"
|
|
14
|
-
@click="onSelectAdapter(adapter.id)"
|
|
3
|
+
<ui-tooltip
|
|
4
|
+
:id="`adapter-${adapter.id}`"
|
|
5
|
+
:test-id="`adapter-tooltip-${adapter.id}`"
|
|
6
|
+
size="md"
|
|
7
|
+
position="bottom"
|
|
8
|
+
position-by-tooltip="center"
|
|
9
|
+
show-type="variant-1"
|
|
10
|
+
timing="660"
|
|
11
|
+
width="214"
|
|
15
12
|
>
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
13
|
+
<template #target>
|
|
14
|
+
<div
|
|
15
|
+
:id="`adapter-${adapter.id}`"
|
|
16
|
+
:class="[
|
|
17
|
+
'adapter',
|
|
18
|
+
{
|
|
19
|
+
selected: props.selectedAdapterId === adapter.id,
|
|
20
|
+
'first-item': index === 0,
|
|
21
|
+
'last-item': props.adapters.length === index + 1,
|
|
22
|
+
'is-add-modal': props.isAddModal,
|
|
23
|
+
},
|
|
24
|
+
]"
|
|
25
|
+
:data-id="`adapter-${adapter.id}`"
|
|
26
|
+
@click="onSelectAdapter(adapter.id)"
|
|
27
|
+
>
|
|
28
|
+
<div class="adapter-info">
|
|
29
|
+
<span class="adapter-info-icon">
|
|
30
|
+
<ui-icon name="diagram-physical-adapter" width="20" height="20" />
|
|
31
|
+
</span>
|
|
32
|
+
<span class="adapter-info-title">{{ adapter.id }}</span>
|
|
33
|
+
</div>
|
|
34
|
+
<span
|
|
35
|
+
v-if="!props.isAddModal && props.fullMode"
|
|
36
|
+
:class="[
|
|
37
|
+
'adapter-remove',
|
|
38
|
+
{
|
|
39
|
+
show: props.selectedAdapterId === adapter.id,
|
|
40
|
+
disabled: adapter.isCore,
|
|
41
|
+
},
|
|
42
|
+
]"
|
|
43
|
+
@click.prevent.stop="onRemove(adapter.id)"
|
|
44
|
+
>
|
|
45
|
+
<ui-icon name="close" width="16" height="16" />
|
|
46
|
+
</span>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
<template #content>
|
|
50
|
+
<div class="tooltip-text">
|
|
51
|
+
{{ adapter.id }}
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
</ui-tooltip>
|
|
36
55
|
</template>
|
|
37
56
|
</template>
|
|
38
57
|
|
|
@@ -69,6 +88,7 @@ const adapters = computed(() =>
|
|
|
69
88
|
display: flex;
|
|
70
89
|
align-items: center;
|
|
71
90
|
justify-content: space-between;
|
|
91
|
+
column-gap: 8px;
|
|
72
92
|
padding: 6px 8px;
|
|
73
93
|
border-radius: 6px;
|
|
74
94
|
color: var(--table-text-first);
|
|
@@ -83,7 +103,8 @@ const adapters = computed(() =>
|
|
|
83
103
|
|
|
84
104
|
&.is-add-modal {
|
|
85
105
|
margin-top: 0;
|
|
86
|
-
width:
|
|
106
|
+
width: 100%;
|
|
107
|
+
cursor: pointer;
|
|
87
108
|
}
|
|
88
109
|
|
|
89
110
|
&:hover {
|
|
@@ -107,6 +128,9 @@ const adapters = computed(() =>
|
|
|
107
128
|
display: flex;
|
|
108
129
|
align-items: center;
|
|
109
130
|
column-gap: 8px;
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
text-overflow: ellipsis;
|
|
133
|
+
overflow: hidden;
|
|
110
134
|
|
|
111
135
|
&-icon {
|
|
112
136
|
color: var(--text-green);
|
|
@@ -121,6 +145,9 @@ const adapters = computed(() =>
|
|
|
121
145
|
letter-spacing: 0;
|
|
122
146
|
vertical-align: middle;
|
|
123
147
|
user-select: none;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
text-overflow: ellipsis;
|
|
150
|
+
overflow: hidden;
|
|
124
151
|
}
|
|
125
152
|
}
|
|
126
153
|
|
|
@@ -132,9 +159,11 @@ const adapters = computed(() =>
|
|
|
132
159
|
display: none;
|
|
133
160
|
|
|
134
161
|
&.disabled {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
//opacity: 64%;
|
|
163
|
+
display: none !important;
|
|
164
|
+
//color: var(--btn-text-disabled-color);
|
|
165
|
+
//user-select: none;
|
|
166
|
+
//pointer-events: none;
|
|
138
167
|
}
|
|
139
168
|
|
|
140
169
|
&.show {
|
|
@@ -150,4 +179,8 @@ const adapters = computed(() =>
|
|
|
150
179
|
}
|
|
151
180
|
}
|
|
152
181
|
}
|
|
182
|
+
|
|
183
|
+
.tooltip-text {
|
|
184
|
+
word-wrap: break-word;
|
|
185
|
+
}
|
|
153
186
|
</style>
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
>
|
|
19
19
|
<ui-icon name="plus" width="18" height="18" />
|
|
20
20
|
</span>
|
|
21
|
+
<span v-else class="empty-block"></span>
|
|
21
22
|
</div>
|
|
22
23
|
</template>
|
|
23
24
|
|
|
@@ -56,7 +57,6 @@ const onShowAddAdapterModal = (): void => {
|
|
|
56
57
|
vertical-align: middle;
|
|
57
58
|
margin-top: 2px;
|
|
58
59
|
color: var(--table-text-first);
|
|
59
|
-
max-width: 172px;
|
|
60
60
|
word-wrap: break-word;
|
|
61
61
|
user-select: none;
|
|
62
62
|
}
|
|
@@ -73,5 +73,9 @@ const onShowAddAdapterModal = (): void => {
|
|
|
73
73
|
color: var(--table-text-hover);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
+
.empty-block {
|
|
77
|
+
width: 18px;
|
|
78
|
+
height: 18px;
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
81
|
</style>
|
|
@@ -1,218 +1,218 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="wizard-content__container">
|
|
3
|
-
<div class="wizard-content">
|
|
4
|
-
<atoms-alert
|
|
5
|
-
v-if="isShowErrorMessage"
|
|
6
|
-
:items="validationMessagesArray"
|
|
7
|
-
status="alert-danger"
|
|
8
|
-
test-id="network-properties-alert"
|
|
9
|
-
@remove="onHideErrorMessageAlert"
|
|
10
|
-
/>
|
|
11
|
-
<form id="network-properties-form">
|
|
12
|
-
<div class="horizontal-flex-container">
|
|
13
|
-
<label class="property-label-group" for="network-label">
|
|
14
|
-
{{ localization.common.networkLabel }}
|
|
15
|
-
</label>
|
|
16
|
-
<div class="margin-left-property-value-group">
|
|
17
|
-
<div class="property-value-group">
|
|
18
|
-
<fieldset>
|
|
19
|
-
<atoms-tooltip-error
|
|
20
|
-
:has-error="!!props.errorMessages.networkLabel"
|
|
21
|
-
>
|
|
22
|
-
<template #elem>
|
|
23
|
-
<input
|
|
24
|
-
id="network-label"
|
|
25
|
-
v-model="fieldsValues.networkLabel"
|
|
26
|
-
:class="[
|
|
27
|
-
'tooltip-field',
|
|
28
|
-
{
|
|
29
|
-
'danger-not-valid': props.errorMessages.networkLabel,
|
|
30
|
-
},
|
|
31
|
-
]"
|
|
32
|
-
data-id="network-label-input"
|
|
33
|
-
name="network-label"
|
|
34
|
-
type="text"
|
|
35
|
-
@click.stop
|
|
36
|
-
/>
|
|
37
|
-
</template>
|
|
38
|
-
<template #content>
|
|
39
|
-
{{ props.errorMessages.networkLabel }}
|
|
40
|
-
</template>
|
|
41
|
-
</atoms-tooltip-error>
|
|
42
|
-
</fieldset>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="horizontal-flex-container port-properties-vlanid-row">
|
|
47
|
-
<label class="property-label-group">
|
|
48
|
-
{{ localization.common.vlanId }}
|
|
49
|
-
</label>
|
|
50
|
-
<div class="margin-left-property-value-group">
|
|
51
|
-
<div class="property-value-group">
|
|
52
|
-
<fieldset>
|
|
53
|
-
<div class="flex-align-center">
|
|
54
|
-
<atoms-combobox
|
|
55
|
-
v-model="fieldsValues.vlanId"
|
|
56
|
-
:items="vlanIdSelectDataLocal"
|
|
57
|
-
test-id="vlan-id-select-combobox"
|
|
58
|
-
@click.stop
|
|
59
|
-
@select="selectVlanId"
|
|
60
|
-
/>
|
|
61
|
-
<div
|
|
62
|
-
v-show="props.errorMessages.vlanId"
|
|
63
|
-
class="flex-align-center"
|
|
64
|
-
>
|
|
65
|
-
<div class="tooltip">
|
|
66
|
-
<atoms-the-icon
|
|
67
|
-
width="24px"
|
|
68
|
-
height="24px"
|
|
69
|
-
class="is-error tooltip-trigger"
|
|
70
|
-
name="info"
|
|
71
|
-
/>
|
|
72
|
-
<div class="tooltip-top-left tooltip-content error">
|
|
73
|
-
{{ props.errorMessages.vlanId }}
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</fieldset>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</form>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</template>
|
|
86
|
-
|
|
87
|
-
<script setup lang="ts">
|
|
88
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
89
|
-
import type {
|
|
90
|
-
UI_I_ModalsInitialData,
|
|
91
|
-
UI_I_EditSettingsErrorMessage,
|
|
92
|
-
UI_I_PropertiesFields,
|
|
93
|
-
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
94
|
-
import type { UI_T_PropertiesFieldName } from '~/components/common/diagramMain/lib/models/types'
|
|
95
|
-
import { validationMessagesArrayFunc } from '~/components/common/diagramMain/modals/lib/utils'
|
|
96
|
-
import { vlanIdSelectDataFunc } from '~/components/common/wizards/network/add/lib/config/config'
|
|
97
|
-
|
|
98
|
-
// Props from up
|
|
99
|
-
const props = withDefaults(
|
|
100
|
-
defineProps<{
|
|
101
|
-
isShowErrorMessageAlert: boolean
|
|
102
|
-
errorMessages: UI_I_EditSettingsErrorMessage
|
|
103
|
-
networkAlreadyExists: boolean
|
|
104
|
-
initialData?: UI_I_ModalsInitialData
|
|
105
|
-
hasErrorMessages?: boolean
|
|
106
|
-
}>(),
|
|
107
|
-
{
|
|
108
|
-
initialData: () => ({}),
|
|
109
|
-
hasErrorMessages: undefined,
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
// Validation
|
|
114
|
-
const emits = defineEmits<{
|
|
115
|
-
(
|
|
116
|
-
event: 'change-error-messages',
|
|
117
|
-
errorMessage: string,
|
|
118
|
-
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
119
|
-
): void
|
|
120
|
-
(event: 'hide-error-message-alert'): void
|
|
121
|
-
(
|
|
122
|
-
event: 'change-edit-properties-data',
|
|
123
|
-
propertiesData: UI_I_PropertiesFields
|
|
124
|
-
): void
|
|
125
|
-
}>()
|
|
126
|
-
|
|
127
|
-
const validationMessagesArray = computed(() =>
|
|
128
|
-
validationMessagesArrayFunc(['networkLabel', 'vlanId'], props.errorMessages)
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
// UI_I_Localization
|
|
132
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
133
|
-
const vlanIdSelectDataLocal = computed<UI_I_Localization>(() =>
|
|
134
|
-
vlanIdSelectDataFunc(localization.value)
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
// For showing component validation errors on the top of modal
|
|
138
|
-
const isShowErrorMessage = computed<boolean>(
|
|
139
|
-
() => props.isShowErrorMessageAlert && props.hasErrorMessages
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
const fieldsValues = ref<UI_I_PropertiesFields>(
|
|
143
|
-
useDeepCopy({
|
|
144
|
-
vlanId: props.initialData.vlanId || `${localization.value.common.none} (0)`,
|
|
145
|
-
networkLabel: props.initialData.networkLabel || 'Network',
|
|
146
|
-
})
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
const selectVlanId = (id: string): void => {
|
|
150
|
-
fieldsValues.value.vlanId = id
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const onHideErrorMessageAlert = () => emits('hide-error-message-alert')
|
|
154
|
-
|
|
155
|
-
const onChangeData = (data: UI_I_PropertiesFields) =>
|
|
156
|
-
emits('change-edit-properties-data', data)
|
|
157
|
-
|
|
158
|
-
const changeErrorMessage = (
|
|
159
|
-
errorMessage: string,
|
|
160
|
-
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
161
|
-
) => emits('change-error-messages', errorMessage, fieldName)
|
|
162
|
-
|
|
163
|
-
const messageTexts = (local: UI_I_Localization) => ({
|
|
164
|
-
vlanId: local.common.vlanIdInvalidMessage,
|
|
165
|
-
networkLabel: local.common.networkLabelInvalidMessage,
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
const isNumberInRange = (value: number | string, down: number, up: number) =>
|
|
169
|
-
isNaN(Number(value)) || Number(value) < down || Number(value) > up
|
|
170
|
-
|
|
171
|
-
const setMessageOnChangedField = (
|
|
172
|
-
values: string | number,
|
|
173
|
-
name: UI_T_PropertiesFieldName,
|
|
174
|
-
text: string
|
|
175
|
-
) => {
|
|
176
|
-
if (name === 'networkLabel' && !values) {
|
|
177
|
-
changeErrorMessage(text, name)
|
|
178
|
-
return
|
|
179
|
-
} else if (name === 'networkLabel' && props.networkAlreadyExists) return
|
|
180
|
-
|
|
181
|
-
if (
|
|
182
|
-
name === 'vlanId' &&
|
|
183
|
-
values !== `${localization.value.common.none} (0)` &&
|
|
184
|
-
values !== `${localization.value.common.all} (4095)` &&
|
|
185
|
-
(isNumberInRange(values, 0, 4095) || values === '')
|
|
186
|
-
) {
|
|
187
|
-
changeErrorMessage(text, name)
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
changeErrorMessage('', name)
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
watch(
|
|
194
|
-
fieldsValues,
|
|
195
|
-
(newValues: UI_I_PropertiesFields) => {
|
|
196
|
-
setMessageOnChangedField(
|
|
197
|
-
newValues.vlanId,
|
|
198
|
-
'vlanId',
|
|
199
|
-
messageTexts(localization.value).vlanId
|
|
200
|
-
)
|
|
201
|
-
setMessageOnChangedField(
|
|
202
|
-
newValues.networkLabel,
|
|
203
|
-
'networkLabel',
|
|
204
|
-
messageTexts(localization.value).networkLabel
|
|
205
|
-
)
|
|
206
|
-
onChangeData(newValues)
|
|
207
|
-
!props.hasErrorMessages && onHideErrorMessageAlert()
|
|
208
|
-
},
|
|
209
|
-
{ deep: true }
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
onMounted(() => {
|
|
213
|
-
onChangeData(fieldsValues.value)
|
|
214
|
-
})
|
|
215
|
-
onUnmounted(() => {
|
|
216
|
-
onHideErrorMessageAlert()
|
|
217
|
-
})
|
|
218
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wizard-content__container">
|
|
3
|
+
<div class="wizard-content">
|
|
4
|
+
<atoms-alert
|
|
5
|
+
v-if="isShowErrorMessage"
|
|
6
|
+
:items="validationMessagesArray"
|
|
7
|
+
status="alert-danger"
|
|
8
|
+
test-id="network-properties-alert"
|
|
9
|
+
@remove="onHideErrorMessageAlert"
|
|
10
|
+
/>
|
|
11
|
+
<form id="network-properties-form">
|
|
12
|
+
<div class="horizontal-flex-container">
|
|
13
|
+
<label class="property-label-group" for="network-label">
|
|
14
|
+
{{ localization.common.networkLabel }}
|
|
15
|
+
</label>
|
|
16
|
+
<div class="margin-left-property-value-group">
|
|
17
|
+
<div class="property-value-group">
|
|
18
|
+
<fieldset>
|
|
19
|
+
<atoms-tooltip-error
|
|
20
|
+
:has-error="!!props.errorMessages.networkLabel"
|
|
21
|
+
>
|
|
22
|
+
<template #elem>
|
|
23
|
+
<input
|
|
24
|
+
id="network-label"
|
|
25
|
+
v-model="fieldsValues.networkLabel"
|
|
26
|
+
:class="[
|
|
27
|
+
'tooltip-field',
|
|
28
|
+
{
|
|
29
|
+
'danger-not-valid': props.errorMessages.networkLabel,
|
|
30
|
+
},
|
|
31
|
+
]"
|
|
32
|
+
data-id="network-label-input"
|
|
33
|
+
name="network-label"
|
|
34
|
+
type="text"
|
|
35
|
+
@click.stop
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
<template #content>
|
|
39
|
+
{{ props.errorMessages.networkLabel }}
|
|
40
|
+
</template>
|
|
41
|
+
</atoms-tooltip-error>
|
|
42
|
+
</fieldset>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="horizontal-flex-container port-properties-vlanid-row">
|
|
47
|
+
<label class="property-label-group">
|
|
48
|
+
{{ localization.common.vlanId }}
|
|
49
|
+
</label>
|
|
50
|
+
<div class="margin-left-property-value-group">
|
|
51
|
+
<div class="property-value-group">
|
|
52
|
+
<fieldset>
|
|
53
|
+
<div class="flex-align-center">
|
|
54
|
+
<atoms-combobox
|
|
55
|
+
v-model="fieldsValues.vlanId"
|
|
56
|
+
:items="vlanIdSelectDataLocal"
|
|
57
|
+
test-id="vlan-id-select-combobox"
|
|
58
|
+
@click.stop
|
|
59
|
+
@select="selectVlanId"
|
|
60
|
+
/>
|
|
61
|
+
<div
|
|
62
|
+
v-show="props.errorMessages.vlanId"
|
|
63
|
+
class="flex-align-center"
|
|
64
|
+
>
|
|
65
|
+
<div class="tooltip">
|
|
66
|
+
<atoms-the-icon
|
|
67
|
+
width="24px"
|
|
68
|
+
height="24px"
|
|
69
|
+
class="is-error tooltip-trigger"
|
|
70
|
+
name="info"
|
|
71
|
+
/>
|
|
72
|
+
<div class="tooltip-top-left tooltip-content error">
|
|
73
|
+
{{ props.errorMessages.vlanId }}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</fieldset>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</form>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<script setup lang="ts">
|
|
88
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
89
|
+
import type {
|
|
90
|
+
UI_I_ModalsInitialData,
|
|
91
|
+
UI_I_EditSettingsErrorMessage,
|
|
92
|
+
UI_I_PropertiesFields,
|
|
93
|
+
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
94
|
+
import type { UI_T_PropertiesFieldName } from '~/components/common/diagramMain/lib/models/types'
|
|
95
|
+
import { validationMessagesArrayFunc } from '~/components/common/diagramMain/modals/lib/utils'
|
|
96
|
+
import { vlanIdSelectDataFunc } from '~/components/common/wizards/network/add/lib/config/config'
|
|
97
|
+
|
|
98
|
+
// Props from up
|
|
99
|
+
const props = withDefaults(
|
|
100
|
+
defineProps<{
|
|
101
|
+
isShowErrorMessageAlert: boolean
|
|
102
|
+
errorMessages: UI_I_EditSettingsErrorMessage
|
|
103
|
+
networkAlreadyExists: boolean
|
|
104
|
+
initialData?: UI_I_ModalsInitialData
|
|
105
|
+
hasErrorMessages?: boolean
|
|
106
|
+
}>(),
|
|
107
|
+
{
|
|
108
|
+
initialData: () => ({}),
|
|
109
|
+
hasErrorMessages: undefined,
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
// Validation
|
|
114
|
+
const emits = defineEmits<{
|
|
115
|
+
(
|
|
116
|
+
event: 'change-error-messages',
|
|
117
|
+
errorMessage: string,
|
|
118
|
+
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
119
|
+
): void
|
|
120
|
+
(event: 'hide-error-message-alert'): void
|
|
121
|
+
(
|
|
122
|
+
event: 'change-edit-properties-data',
|
|
123
|
+
propertiesData: UI_I_PropertiesFields
|
|
124
|
+
): void
|
|
125
|
+
}>()
|
|
126
|
+
|
|
127
|
+
const validationMessagesArray = computed(() =>
|
|
128
|
+
validationMessagesArrayFunc(['networkLabel', 'vlanId'], props.errorMessages)
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
// UI_I_Localization
|
|
132
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
133
|
+
const vlanIdSelectDataLocal = computed<UI_I_Localization>(() =>
|
|
134
|
+
vlanIdSelectDataFunc(localization.value)
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
// For showing component validation errors on the top of modal
|
|
138
|
+
const isShowErrorMessage = computed<boolean>(
|
|
139
|
+
() => props.isShowErrorMessageAlert && props.hasErrorMessages
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
const fieldsValues = ref<UI_I_PropertiesFields>(
|
|
143
|
+
useDeepCopy({
|
|
144
|
+
vlanId: props.initialData.vlanId || `${localization.value.common.none} (0)`,
|
|
145
|
+
networkLabel: props.initialData.networkLabel || 'Network',
|
|
146
|
+
})
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
const selectVlanId = (id: string): void => {
|
|
150
|
+
fieldsValues.value.vlanId = id
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const onHideErrorMessageAlert = () => emits('hide-error-message-alert')
|
|
154
|
+
|
|
155
|
+
const onChangeData = (data: UI_I_PropertiesFields) =>
|
|
156
|
+
emits('change-edit-properties-data', data)
|
|
157
|
+
|
|
158
|
+
const changeErrorMessage = (
|
|
159
|
+
errorMessage: string,
|
|
160
|
+
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
161
|
+
) => emits('change-error-messages', errorMessage, fieldName)
|
|
162
|
+
|
|
163
|
+
const messageTexts = (local: UI_I_Localization) => ({
|
|
164
|
+
vlanId: local.common.vlanIdInvalidMessage,
|
|
165
|
+
networkLabel: local.common.networkLabelInvalidMessage,
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
const isNumberInRange = (value: number | string, down: number, up: number) =>
|
|
169
|
+
isNaN(Number(value)) || Number(value) < down || Number(value) > up
|
|
170
|
+
|
|
171
|
+
const setMessageOnChangedField = (
|
|
172
|
+
values: string | number,
|
|
173
|
+
name: UI_T_PropertiesFieldName,
|
|
174
|
+
text: string
|
|
175
|
+
) => {
|
|
176
|
+
if (name === 'networkLabel' && !values) {
|
|
177
|
+
changeErrorMessage(text, name)
|
|
178
|
+
return
|
|
179
|
+
} else if (name === 'networkLabel' && props.networkAlreadyExists) return
|
|
180
|
+
|
|
181
|
+
if (
|
|
182
|
+
name === 'vlanId' &&
|
|
183
|
+
values !== `${localization.value.common.none} (0)` &&
|
|
184
|
+
values !== `${localization.value.common.all} (4095)` &&
|
|
185
|
+
(isNumberInRange(values, 0, 4095) || values === '')
|
|
186
|
+
) {
|
|
187
|
+
changeErrorMessage(text, name)
|
|
188
|
+
return
|
|
189
|
+
}
|
|
190
|
+
changeErrorMessage('', name)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
watch(
|
|
194
|
+
fieldsValues,
|
|
195
|
+
(newValues: UI_I_PropertiesFields) => {
|
|
196
|
+
setMessageOnChangedField(
|
|
197
|
+
newValues.vlanId,
|
|
198
|
+
'vlanId',
|
|
199
|
+
messageTexts(localization.value).vlanId
|
|
200
|
+
)
|
|
201
|
+
setMessageOnChangedField(
|
|
202
|
+
newValues.networkLabel,
|
|
203
|
+
'networkLabel',
|
|
204
|
+
messageTexts(localization.value).networkLabel
|
|
205
|
+
)
|
|
206
|
+
onChangeData(newValues)
|
|
207
|
+
!props.hasErrorMessages && onHideErrorMessageAlert()
|
|
208
|
+
},
|
|
209
|
+
{ deep: true }
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
onMounted(() => {
|
|
213
|
+
onChangeData(fieldsValues.value)
|
|
214
|
+
})
|
|
215
|
+
onUnmounted(() => {
|
|
216
|
+
onHideErrorMessageAlert()
|
|
217
|
+
})
|
|
218
|
+
</script>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
-
|
|
3
|
-
export const isIntegerNumberInRange = (
|
|
4
|
-
value: number | string | undefined,
|
|
5
|
-
down: number,
|
|
6
|
-
up: number
|
|
7
|
-
): boolean =>
|
|
8
|
-
isNaN(Number(value)) ||
|
|
9
|
-
Number(value) < down ||
|
|
10
|
-
Number(value) > up ||
|
|
11
|
-
Number(value) !== Math.round(Number(value))
|
|
12
|
-
|
|
13
|
-
export const checkVlanId = (
|
|
14
|
-
vlanId: string,
|
|
15
|
-
localization: UI_I_Localization
|
|
16
|
-
): boolean =>
|
|
17
|
-
vlanId !== `${localization.common.none} (0)` &&
|
|
18
|
-
vlanId !== `${localization.common.all} (4095)` &&
|
|
19
|
-
(isIntegerNumberInRange(vlanId, 0, 4095) || vlanId === '')
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
|
|
3
|
+
export const isIntegerNumberInRange = (
|
|
4
|
+
value: number | string | undefined,
|
|
5
|
+
down: number,
|
|
6
|
+
up: number
|
|
7
|
+
): boolean =>
|
|
8
|
+
isNaN(Number(value)) ||
|
|
9
|
+
Number(value) < down ||
|
|
10
|
+
Number(value) > up ||
|
|
11
|
+
Number(value) !== Math.round(Number(value))
|
|
12
|
+
|
|
13
|
+
export const checkVlanId = (
|
|
14
|
+
vlanId: string,
|
|
15
|
+
localization: UI_I_Localization
|
|
16
|
+
): boolean =>
|
|
17
|
+
vlanId !== `${localization.common.none} (0)` &&
|
|
18
|
+
vlanId !== `${localization.common.all} (4095)` &&
|
|
19
|
+
(isIntegerNumberInRange(vlanId, 0, 4095) || vlanId === '')
|
|
@@ -154,4 +154,21 @@ const viewSettingsTabContent = (tab: number): UI_I_ViewSettingsFields[] =>
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
|
|
158
|
+
.tabs-container {
|
|
159
|
+
:deep(.tabs-wrapper) {
|
|
160
|
+
// padding-left: 16px;
|
|
161
|
+
// padding-right: 16px;
|
|
162
|
+
overflow-x: auto;
|
|
163
|
+
//
|
|
164
|
+
&::-webkit-scrollbar {
|
|
165
|
+
height: 0;
|
|
166
|
+
}
|
|
167
|
+
//
|
|
168
|
+
.tab-item {
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
display: inline-block;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
157
174
|
</style>
|