bfg-common 1.4.734 → 1.4.799
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-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/assets/localization/local_be.json +2 -16
- package/assets/localization/local_en.json +2 -16
- package/assets/localization/local_hy.json +2 -16
- package/assets/localization/local_kk.json +2 -16
- package/assets/localization/local_ru.json +2 -16
- package/assets/localization/local_zh.json +2 -16
- package/components/atoms/select/TheSelect.vue +1 -10
- package/components/common/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- package/components/common/{monitor/advanced/tools/chartOptionsModal → chartOptionsModal}/counters/timespan/form/Form.vue +544 -539
- package/components/common/{pages/hardwareHealth/historyTestimony/tools/chartOptionsModal → chartOptionsModal}/counters/timespan/form/lib/config/dateForm.ts +116 -115
- package/components/common/diagramMain/Header.vue +211 -211
- package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
- package/components/common/diagramMain/lib/config/initial.ts +50 -50
- package/components/common/diagramMain/lib/models/types.ts +21 -21
- package/components/common/diagramMain/lib/utils/utils.ts +331 -331
- package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
- package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
- package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
- package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
- package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
- package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
- package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
- package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
- package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +398 -398
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
- package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
- package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
- package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
- package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
- package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
- package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
- package/components/common/diagramMain/port/Ports.vue +47 -47
- package/components/common/monitor/advanced/Advanced.vue +5 -0
- package/components/common/monitor/advanced/tools/Tools.vue +9 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +9 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +2 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +95 -93
- package/components/common/monitor/overview/filters/Filters.vue +3 -0
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +15 -5
- package/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker.ts +24 -14
- package/components/common/pages/hardwareHealth/HardwareHealth.vue +12 -5
- package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +456 -451
- package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +387 -380
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +13 -6
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/Counters.vue +94 -94
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/Timespan.vue +66 -66
- package/components/common/pages/tasks/Tasks.vue +0 -9
- package/components/common/pages/tasks/table/Table.vue +1 -0
- package/components/common/pages/tasks/table/errorInfo/ErrorInfo.vue +6 -10
- package/components/common/pages/tasks/table/expandDetails/ExpandDetails.vue +8 -8
- package/components/common/vm/actions/add/Add.vue +0 -2
- package/components/common/vm/actions/clone/Clone.vue +0 -2
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +0 -3
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +0 -2
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +0 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +1 -9
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +2 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +1 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +4 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +10 -52
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +5 -31
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +5 -31
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +2 -9
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +4 -11
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionOld.vue +1 -1
- package/components/common/vm/actions/editSettings/EditSettings.vue +0 -3
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +0 -2
- package/components/common/vm/actions/editSettings/new/New.vue +0 -2
- package/package.json +3 -3
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +0 -114
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/form/Form.vue +0 -539
|
@@ -1,398 +1,398 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="wizard-content__container">
|
|
3
|
-
<div class="wizard-content">
|
|
4
|
-
<atoms-alert
|
|
5
|
-
v-if="isShowErrorMessage"
|
|
6
|
-
status="alert-danger"
|
|
7
|
-
:items="validationMessagesArray"
|
|
8
|
-
test-id="traffic-shaping-alert"
|
|
9
|
-
@remove="onHideErrorMessageAlert"
|
|
10
|
-
/>
|
|
11
|
-
<form id="traffic-shaping-form" action="">
|
|
12
|
-
<div class="horizontal-flex-container">
|
|
13
|
-
<span class="flex-property-label-group large">
|
|
14
|
-
{{ localization.common.status }}
|
|
15
|
-
</span>
|
|
16
|
-
|
|
17
|
-
<div class="flex-property-value-group overridable-dropdown">
|
|
18
|
-
<div class="horizontal-flex-container no-margin">
|
|
19
|
-
<div class="flex-property-value-group">
|
|
20
|
-
<div class="horizontal-flex-container">
|
|
21
|
-
<div
|
|
22
|
-
v-if="!props.isSwitch"
|
|
23
|
-
class="flex-property-label-group small checkbox-inline"
|
|
24
|
-
>
|
|
25
|
-
<input
|
|
26
|
-
id="status"
|
|
27
|
-
v-model="fieldsValues.status.checked"
|
|
28
|
-
data-id="status-input"
|
|
29
|
-
type="checkbox"
|
|
30
|
-
/>
|
|
31
|
-
<label for="status" class="normal-weight">
|
|
32
|
-
{{ localization.common.override }}
|
|
33
|
-
</label>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="flex-property-value-group">
|
|
36
|
-
<div class="select">
|
|
37
|
-
<select
|
|
38
|
-
id="traffic-shaping-select"
|
|
39
|
-
v-model.number="fieldsValues.status.selected"
|
|
40
|
-
:disabled="!fieldsValues.status.checked"
|
|
41
|
-
data-id="traffic-shaping-select"
|
|
42
|
-
name="selectName"
|
|
43
|
-
>
|
|
44
|
-
<option :label="localization.common.enabled" value="1">
|
|
45
|
-
{{ localization.common.enabled }}
|
|
46
|
-
</option>
|
|
47
|
-
<option :label="localization.common.disabled" value="0">
|
|
48
|
-
{{ localization.common.disabled }}
|
|
49
|
-
</option>
|
|
50
|
-
</select>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="horizontal-flex-container">
|
|
59
|
-
<span class="flex-property-label-group large">
|
|
60
|
-
{{ localization.common.averageBandwidthKbit }}
|
|
61
|
-
</span>
|
|
62
|
-
|
|
63
|
-
<div class="flex-property-value-group">
|
|
64
|
-
<div class="horizontal-flex-container no-margin">
|
|
65
|
-
<div class="flex-property-value-group">
|
|
66
|
-
<div class="horizontal-flex-container">
|
|
67
|
-
<div
|
|
68
|
-
v-if="!props.isSwitch"
|
|
69
|
-
class="flex-property-label-group small checkbox-inline dummy"
|
|
70
|
-
>
|
|
71
|
-
<input
|
|
72
|
-
id="traffic-shaping-override-average-input"
|
|
73
|
-
data-id="traffic-shaping-override-average-input"
|
|
74
|
-
type="checkbox"
|
|
75
|
-
/>
|
|
76
|
-
<label
|
|
77
|
-
for="traffic-shaping-override-input"
|
|
78
|
-
class="normal-weight"
|
|
79
|
-
>
|
|
80
|
-
{{ localization.common.override }}
|
|
81
|
-
</label>
|
|
82
|
-
</div>
|
|
83
|
-
<div class="property-value-group tooltip-field-container">
|
|
84
|
-
<atoms-tooltip-error
|
|
85
|
-
:has-error="!!props.errorMessages.average"
|
|
86
|
-
>
|
|
87
|
-
<template #elem>
|
|
88
|
-
<input
|
|
89
|
-
id="average"
|
|
90
|
-
v-model="fieldsValues.average"
|
|
91
|
-
type="number"
|
|
92
|
-
:disabled="
|
|
93
|
-
!fieldsValues.status.checked ||
|
|
94
|
-
fieldsValues.status.selected === '0'
|
|
95
|
-
"
|
|
96
|
-
data-id="average-input"
|
|
97
|
-
name="average"
|
|
98
|
-
:class="[
|
|
99
|
-
'tooltip-field',
|
|
100
|
-
{
|
|
101
|
-
'danger-not-valid':
|
|
102
|
-
fieldsValues.status.checked &&
|
|
103
|
-
fieldsValues.status.selected !== '0' &&
|
|
104
|
-
props.errorMessages.average,
|
|
105
|
-
},
|
|
106
|
-
]"
|
|
107
|
-
@click.stop
|
|
108
|
-
/>
|
|
109
|
-
</template>
|
|
110
|
-
<template #content>
|
|
111
|
-
{{ props.errorMessages.average }}
|
|
112
|
-
</template>
|
|
113
|
-
</atoms-tooltip-error>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
<div class="horizontal-flex-container">
|
|
121
|
-
<span class="flex-property-label-group large">
|
|
122
|
-
{{ localization.common.peakBandwidthKbit }}
|
|
123
|
-
</span>
|
|
124
|
-
|
|
125
|
-
<div class="flex-property-value-group">
|
|
126
|
-
<div class="horizontal-flex-container no-margin">
|
|
127
|
-
<div class="flex-property-value-group">
|
|
128
|
-
<div class="horizontal-flex-container">
|
|
129
|
-
<div
|
|
130
|
-
v-if="!props.isSwitch"
|
|
131
|
-
class="flex-property-label-group small checkbox-inline dummy"
|
|
132
|
-
>
|
|
133
|
-
<input
|
|
134
|
-
id="traffic-shaping-override-peak-input"
|
|
135
|
-
data-id="traffic-shaping-override-peak-input"
|
|
136
|
-
type="checkbox"
|
|
137
|
-
/>
|
|
138
|
-
<label
|
|
139
|
-
for="traffic-shaping-override-peak-input"
|
|
140
|
-
class="normal-weight"
|
|
141
|
-
>
|
|
142
|
-
{{ localization.common.override }}
|
|
143
|
-
</label>
|
|
144
|
-
</div>
|
|
145
|
-
<div class="property-value-group tooltip-field-container">
|
|
146
|
-
<atoms-tooltip-error
|
|
147
|
-
:has-error="!!props.errorMessages.peak"
|
|
148
|
-
>
|
|
149
|
-
<template #elem>
|
|
150
|
-
<input
|
|
151
|
-
id="peak"
|
|
152
|
-
v-model="fieldsValues.peak"
|
|
153
|
-
type="number"
|
|
154
|
-
:disabled="
|
|
155
|
-
!fieldsValues.status.checked ||
|
|
156
|
-
fieldsValues.status.selected === '0'
|
|
157
|
-
"
|
|
158
|
-
data-id="peak-input"
|
|
159
|
-
name="peak"
|
|
160
|
-
:class="[
|
|
161
|
-
'tooltip-field',
|
|
162
|
-
{
|
|
163
|
-
'danger-not-valid':
|
|
164
|
-
fieldsValues.status.checked &&
|
|
165
|
-
fieldsValues.status.selected !== '0' &&
|
|
166
|
-
props.errorMessages.peak,
|
|
167
|
-
},
|
|
168
|
-
]"
|
|
169
|
-
@click.stop
|
|
170
|
-
/>
|
|
171
|
-
</template>
|
|
172
|
-
<template #content>
|
|
173
|
-
{{ props.errorMessages.peak }}
|
|
174
|
-
</template>
|
|
175
|
-
</atoms-tooltip-error>
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
<div class="horizontal-flex-container">
|
|
183
|
-
<span class="flex-property-label-group large">
|
|
184
|
-
{{ localization.common.burstSizeKb }}
|
|
185
|
-
</span>
|
|
186
|
-
|
|
187
|
-
<div class="flex-property-value-group">
|
|
188
|
-
<div class="horizontal-flex-container no-margin">
|
|
189
|
-
<div class="flex-property-value-group">
|
|
190
|
-
<div class="horizontal-flex-container">
|
|
191
|
-
<div
|
|
192
|
-
v-if="!props.isSwitch"
|
|
193
|
-
class="flex-property-label-group small checkbox-inline dummy"
|
|
194
|
-
>
|
|
195
|
-
<input
|
|
196
|
-
id="traffic-shaping-override-burst-size-input"
|
|
197
|
-
data-id="traffic-shaping-override-burst-size-input"
|
|
198
|
-
type="checkbox"
|
|
199
|
-
/>
|
|
200
|
-
<label
|
|
201
|
-
for="traffic-shaping-override-burst-size-input"
|
|
202
|
-
class="normal-weight"
|
|
203
|
-
>
|
|
204
|
-
{{ localization.common.override }}
|
|
205
|
-
</label>
|
|
206
|
-
</div>
|
|
207
|
-
<div class="property-value-group tooltip-field-container">
|
|
208
|
-
<atoms-tooltip-error
|
|
209
|
-
:has-error="!!props.errorMessages.burstSize"
|
|
210
|
-
>
|
|
211
|
-
<template #elem>
|
|
212
|
-
<input
|
|
213
|
-
id="burst-size"
|
|
214
|
-
v-model="fieldsValues.burstSize"
|
|
215
|
-
type="number"
|
|
216
|
-
:disabled="
|
|
217
|
-
!fieldsValues.status.checked ||
|
|
218
|
-
fieldsValues.status.selected === '0'
|
|
219
|
-
"
|
|
220
|
-
data-id="burst-size-input"
|
|
221
|
-
name="burst-size"
|
|
222
|
-
:class="[
|
|
223
|
-
'tooltip-field',
|
|
224
|
-
{
|
|
225
|
-
'danger-not-valid':
|
|
226
|
-
fieldsValues.status.checked &&
|
|
227
|
-
fieldsValues.status.selected !== '0' &&
|
|
228
|
-
props.errorMessages.burstSize,
|
|
229
|
-
},
|
|
230
|
-
]"
|
|
231
|
-
@click.stop
|
|
232
|
-
/>
|
|
233
|
-
</template>
|
|
234
|
-
<template #content>
|
|
235
|
-
{{ props.errorMessages.burstSize }}
|
|
236
|
-
</template>
|
|
237
|
-
</atoms-tooltip-error>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
</div>
|
|
243
|
-
</div>
|
|
244
|
-
</form>
|
|
245
|
-
</div>
|
|
246
|
-
</div>
|
|
247
|
-
</template>
|
|
248
|
-
|
|
249
|
-
<script setup lang="ts">
|
|
250
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
251
|
-
import type {
|
|
252
|
-
UI_I_ModalsInitialData,
|
|
253
|
-
UI_I_TrafficShapingFields,
|
|
254
|
-
UI_I_EditSettingsErrorMessage,
|
|
255
|
-
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
256
|
-
import type { UI_T_TrafficShapingFieldName } from '~/components/common/diagramMain/lib/models/types'
|
|
257
|
-
import { validationMessagesArrayFunc } from '~/components/common/diagramMain/modals/lib/utils'
|
|
258
|
-
import { trafficShapingFieldsInitialFunc } from '~/components/common/diagramMain/modals/lib/config'
|
|
259
|
-
|
|
260
|
-
// Props from up
|
|
261
|
-
const props = withDefaults(
|
|
262
|
-
defineProps<{
|
|
263
|
-
isShowErrorMessageAlert: boolean
|
|
264
|
-
initialData?: UI_I_ModalsInitialData
|
|
265
|
-
errorMessages: UI_I_EditSettingsErrorMessage
|
|
266
|
-
hasErrorMessages?: boolean
|
|
267
|
-
isSwitch: boolean
|
|
268
|
-
}>(),
|
|
269
|
-
{
|
|
270
|
-
initialData: () => ({}),
|
|
271
|
-
isSwitch: false,
|
|
272
|
-
}
|
|
273
|
-
)
|
|
274
|
-
|
|
275
|
-
const validationMessagesArray = computed(() =>
|
|
276
|
-
validationMessagesArrayFunc(
|
|
277
|
-
['average', 'peak', 'burstSize'],
|
|
278
|
-
props.errorMessages
|
|
279
|
-
)
|
|
280
|
-
)
|
|
281
|
-
|
|
282
|
-
// UI_I_Localization
|
|
283
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
284
|
-
|
|
285
|
-
// For showing component validation errors on the top of modal
|
|
286
|
-
const isShowErrorMessage = computed<boolean>(
|
|
287
|
-
() => props.isShowErrorMessageAlert && props.hasErrorMessages
|
|
288
|
-
)
|
|
289
|
-
|
|
290
|
-
const fieldsValues = ref<UI_I_TrafficShapingFields>(
|
|
291
|
-
trafficShapingFieldsInitialFunc(props.isSwitch, props.initialData)
|
|
292
|
-
)
|
|
293
|
-
|
|
294
|
-
// Validation
|
|
295
|
-
const emits = defineEmits<{
|
|
296
|
-
(
|
|
297
|
-
event: 'change-error-messages',
|
|
298
|
-
errorMessage: string,
|
|
299
|
-
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
300
|
-
): void
|
|
301
|
-
(event: 'hide-error-message-alert'): void
|
|
302
|
-
(
|
|
303
|
-
event: 'change-edit-traffic-shaping-data',
|
|
304
|
-
trafficShapingData: UI_I_TrafficShapingFields
|
|
305
|
-
): void
|
|
306
|
-
}>()
|
|
307
|
-
|
|
308
|
-
const onHideErrorMessageAlert = (): void => emits('hide-error-message-alert')
|
|
309
|
-
|
|
310
|
-
const onChangeData = (data: UI_I_TrafficShapingFields) =>
|
|
311
|
-
emits('change-edit-traffic-shaping-data', data)
|
|
312
|
-
|
|
313
|
-
const messageTexts = (local: UI_I_Localization) => ({
|
|
314
|
-
average: local.common.averageInvalidError,
|
|
315
|
-
peak: local.common.peakInvalidError,
|
|
316
|
-
burstSize: local.common.burstSizeInvalidError,
|
|
317
|
-
averageBig: local.common.averageBigInvalidError,
|
|
318
|
-
peakBig: local.common.peakBigInvalidError,
|
|
319
|
-
burstSizeBig: local.common.burstSizeBigInvalidError,
|
|
320
|
-
})
|
|
321
|
-
|
|
322
|
-
const changeErrorMessage = (
|
|
323
|
-
errorMessage: string,
|
|
324
|
-
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
325
|
-
) => emits('change-error-messages', errorMessage, fieldName)
|
|
326
|
-
|
|
327
|
-
const MAX_BANDWIDTH = 9_007_199_254_740_991
|
|
328
|
-
const setMessageOnChangedField = (
|
|
329
|
-
values: number[],
|
|
330
|
-
index: number,
|
|
331
|
-
name: UI_T_TrafficShapingFieldName,
|
|
332
|
-
text1: string,
|
|
333
|
-
text2: string
|
|
334
|
-
): void => {
|
|
335
|
-
if (
|
|
336
|
-
!fieldsValues.value.status.checked ||
|
|
337
|
-
fieldsValues.value.status.selected === '0'
|
|
338
|
-
) {
|
|
339
|
-
changeErrorMessage('', 'average')
|
|
340
|
-
changeErrorMessage('', 'peak')
|
|
341
|
-
changeErrorMessage('', 'burstSize')
|
|
342
|
-
return
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
if (values[index] >= 1 && values[index] <= MAX_BANDWIDTH) {
|
|
346
|
-
changeErrorMessage('', name)
|
|
347
|
-
} else if (values[index] < 1) {
|
|
348
|
-
changeErrorMessage(text1, name)
|
|
349
|
-
} else if (values[index] > MAX_BANDWIDTH) {
|
|
350
|
-
changeErrorMessage(text2, name)
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
watch(
|
|
355
|
-
fieldsValues,
|
|
356
|
-
(newFieldsValues: UI_I_TrafficShapingFields): void => {
|
|
357
|
-
const { average, peak, burstSize } = newFieldsValues
|
|
358
|
-
const arrayValues = [average, peak, burstSize]
|
|
359
|
-
|
|
360
|
-
setMessageOnChangedField(
|
|
361
|
-
arrayValues,
|
|
362
|
-
0,
|
|
363
|
-
'average',
|
|
364
|
-
messageTexts(localization.value).average,
|
|
365
|
-
messageTexts(localization.value).averageBig
|
|
366
|
-
)
|
|
367
|
-
setMessageOnChangedField(
|
|
368
|
-
arrayValues,
|
|
369
|
-
1,
|
|
370
|
-
'peak',
|
|
371
|
-
messageTexts(localization.value).peak,
|
|
372
|
-
messageTexts(localization.value).peakBig
|
|
373
|
-
)
|
|
374
|
-
setMessageOnChangedField(
|
|
375
|
-
arrayValues,
|
|
376
|
-
2,
|
|
377
|
-
'burstSize',
|
|
378
|
-
messageTexts(localization.value).burstSize,
|
|
379
|
-
messageTexts(localization.value).burstSizeBig
|
|
380
|
-
)
|
|
381
|
-
|
|
382
|
-
onChangeData(newFieldsValues)
|
|
383
|
-
!props.hasErrorMessages && onHideErrorMessageAlert()
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
deep: true,
|
|
387
|
-
}
|
|
388
|
-
)
|
|
389
|
-
|
|
390
|
-
onMounted(() => {
|
|
391
|
-
onChangeData(fieldsValues.value)
|
|
392
|
-
})
|
|
393
|
-
onUnmounted((): void => {
|
|
394
|
-
onHideErrorMessageAlert()
|
|
395
|
-
})
|
|
396
|
-
</script>
|
|
397
|
-
|
|
398
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wizard-content__container">
|
|
3
|
+
<div class="wizard-content">
|
|
4
|
+
<atoms-alert
|
|
5
|
+
v-if="isShowErrorMessage"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="validationMessagesArray"
|
|
8
|
+
test-id="traffic-shaping-alert"
|
|
9
|
+
@remove="onHideErrorMessageAlert"
|
|
10
|
+
/>
|
|
11
|
+
<form id="traffic-shaping-form" action="">
|
|
12
|
+
<div class="horizontal-flex-container">
|
|
13
|
+
<span class="flex-property-label-group large">
|
|
14
|
+
{{ localization.common.status }}
|
|
15
|
+
</span>
|
|
16
|
+
|
|
17
|
+
<div class="flex-property-value-group overridable-dropdown">
|
|
18
|
+
<div class="horizontal-flex-container no-margin">
|
|
19
|
+
<div class="flex-property-value-group">
|
|
20
|
+
<div class="horizontal-flex-container">
|
|
21
|
+
<div
|
|
22
|
+
v-if="!props.isSwitch"
|
|
23
|
+
class="flex-property-label-group small checkbox-inline"
|
|
24
|
+
>
|
|
25
|
+
<input
|
|
26
|
+
id="status"
|
|
27
|
+
v-model="fieldsValues.status.checked"
|
|
28
|
+
data-id="status-input"
|
|
29
|
+
type="checkbox"
|
|
30
|
+
/>
|
|
31
|
+
<label for="status" class="normal-weight">
|
|
32
|
+
{{ localization.common.override }}
|
|
33
|
+
</label>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="flex-property-value-group">
|
|
36
|
+
<div class="select">
|
|
37
|
+
<select
|
|
38
|
+
id="traffic-shaping-select"
|
|
39
|
+
v-model.number="fieldsValues.status.selected"
|
|
40
|
+
:disabled="!fieldsValues.status.checked"
|
|
41
|
+
data-id="traffic-shaping-select"
|
|
42
|
+
name="selectName"
|
|
43
|
+
>
|
|
44
|
+
<option :label="localization.common.enabled" value="1">
|
|
45
|
+
{{ localization.common.enabled }}
|
|
46
|
+
</option>
|
|
47
|
+
<option :label="localization.common.disabled" value="0">
|
|
48
|
+
{{ localization.common.disabled }}
|
|
49
|
+
</option>
|
|
50
|
+
</select>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="horizontal-flex-container">
|
|
59
|
+
<span class="flex-property-label-group large">
|
|
60
|
+
{{ localization.common.averageBandwidthKbit }}
|
|
61
|
+
</span>
|
|
62
|
+
|
|
63
|
+
<div class="flex-property-value-group">
|
|
64
|
+
<div class="horizontal-flex-container no-margin">
|
|
65
|
+
<div class="flex-property-value-group">
|
|
66
|
+
<div class="horizontal-flex-container">
|
|
67
|
+
<div
|
|
68
|
+
v-if="!props.isSwitch"
|
|
69
|
+
class="flex-property-label-group small checkbox-inline dummy"
|
|
70
|
+
>
|
|
71
|
+
<input
|
|
72
|
+
id="traffic-shaping-override-average-input"
|
|
73
|
+
data-id="traffic-shaping-override-average-input"
|
|
74
|
+
type="checkbox"
|
|
75
|
+
/>
|
|
76
|
+
<label
|
|
77
|
+
for="traffic-shaping-override-input"
|
|
78
|
+
class="normal-weight"
|
|
79
|
+
>
|
|
80
|
+
{{ localization.common.override }}
|
|
81
|
+
</label>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="property-value-group tooltip-field-container">
|
|
84
|
+
<atoms-tooltip-error
|
|
85
|
+
:has-error="!!props.errorMessages.average"
|
|
86
|
+
>
|
|
87
|
+
<template #elem>
|
|
88
|
+
<input
|
|
89
|
+
id="average"
|
|
90
|
+
v-model="fieldsValues.average"
|
|
91
|
+
type="number"
|
|
92
|
+
:disabled="
|
|
93
|
+
!fieldsValues.status.checked ||
|
|
94
|
+
fieldsValues.status.selected === '0'
|
|
95
|
+
"
|
|
96
|
+
data-id="average-input"
|
|
97
|
+
name="average"
|
|
98
|
+
:class="[
|
|
99
|
+
'tooltip-field',
|
|
100
|
+
{
|
|
101
|
+
'danger-not-valid':
|
|
102
|
+
fieldsValues.status.checked &&
|
|
103
|
+
fieldsValues.status.selected !== '0' &&
|
|
104
|
+
props.errorMessages.average,
|
|
105
|
+
},
|
|
106
|
+
]"
|
|
107
|
+
@click.stop
|
|
108
|
+
/>
|
|
109
|
+
</template>
|
|
110
|
+
<template #content>
|
|
111
|
+
{{ props.errorMessages.average }}
|
|
112
|
+
</template>
|
|
113
|
+
</atoms-tooltip-error>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="horizontal-flex-container">
|
|
121
|
+
<span class="flex-property-label-group large">
|
|
122
|
+
{{ localization.common.peakBandwidthKbit }}
|
|
123
|
+
</span>
|
|
124
|
+
|
|
125
|
+
<div class="flex-property-value-group">
|
|
126
|
+
<div class="horizontal-flex-container no-margin">
|
|
127
|
+
<div class="flex-property-value-group">
|
|
128
|
+
<div class="horizontal-flex-container">
|
|
129
|
+
<div
|
|
130
|
+
v-if="!props.isSwitch"
|
|
131
|
+
class="flex-property-label-group small checkbox-inline dummy"
|
|
132
|
+
>
|
|
133
|
+
<input
|
|
134
|
+
id="traffic-shaping-override-peak-input"
|
|
135
|
+
data-id="traffic-shaping-override-peak-input"
|
|
136
|
+
type="checkbox"
|
|
137
|
+
/>
|
|
138
|
+
<label
|
|
139
|
+
for="traffic-shaping-override-peak-input"
|
|
140
|
+
class="normal-weight"
|
|
141
|
+
>
|
|
142
|
+
{{ localization.common.override }}
|
|
143
|
+
</label>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="property-value-group tooltip-field-container">
|
|
146
|
+
<atoms-tooltip-error
|
|
147
|
+
:has-error="!!props.errorMessages.peak"
|
|
148
|
+
>
|
|
149
|
+
<template #elem>
|
|
150
|
+
<input
|
|
151
|
+
id="peak"
|
|
152
|
+
v-model="fieldsValues.peak"
|
|
153
|
+
type="number"
|
|
154
|
+
:disabled="
|
|
155
|
+
!fieldsValues.status.checked ||
|
|
156
|
+
fieldsValues.status.selected === '0'
|
|
157
|
+
"
|
|
158
|
+
data-id="peak-input"
|
|
159
|
+
name="peak"
|
|
160
|
+
:class="[
|
|
161
|
+
'tooltip-field',
|
|
162
|
+
{
|
|
163
|
+
'danger-not-valid':
|
|
164
|
+
fieldsValues.status.checked &&
|
|
165
|
+
fieldsValues.status.selected !== '0' &&
|
|
166
|
+
props.errorMessages.peak,
|
|
167
|
+
},
|
|
168
|
+
]"
|
|
169
|
+
@click.stop
|
|
170
|
+
/>
|
|
171
|
+
</template>
|
|
172
|
+
<template #content>
|
|
173
|
+
{{ props.errorMessages.peak }}
|
|
174
|
+
</template>
|
|
175
|
+
</atoms-tooltip-error>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="horizontal-flex-container">
|
|
183
|
+
<span class="flex-property-label-group large">
|
|
184
|
+
{{ localization.common.burstSizeKb }}
|
|
185
|
+
</span>
|
|
186
|
+
|
|
187
|
+
<div class="flex-property-value-group">
|
|
188
|
+
<div class="horizontal-flex-container no-margin">
|
|
189
|
+
<div class="flex-property-value-group">
|
|
190
|
+
<div class="horizontal-flex-container">
|
|
191
|
+
<div
|
|
192
|
+
v-if="!props.isSwitch"
|
|
193
|
+
class="flex-property-label-group small checkbox-inline dummy"
|
|
194
|
+
>
|
|
195
|
+
<input
|
|
196
|
+
id="traffic-shaping-override-burst-size-input"
|
|
197
|
+
data-id="traffic-shaping-override-burst-size-input"
|
|
198
|
+
type="checkbox"
|
|
199
|
+
/>
|
|
200
|
+
<label
|
|
201
|
+
for="traffic-shaping-override-burst-size-input"
|
|
202
|
+
class="normal-weight"
|
|
203
|
+
>
|
|
204
|
+
{{ localization.common.override }}
|
|
205
|
+
</label>
|
|
206
|
+
</div>
|
|
207
|
+
<div class="property-value-group tooltip-field-container">
|
|
208
|
+
<atoms-tooltip-error
|
|
209
|
+
:has-error="!!props.errorMessages.burstSize"
|
|
210
|
+
>
|
|
211
|
+
<template #elem>
|
|
212
|
+
<input
|
|
213
|
+
id="burst-size"
|
|
214
|
+
v-model="fieldsValues.burstSize"
|
|
215
|
+
type="number"
|
|
216
|
+
:disabled="
|
|
217
|
+
!fieldsValues.status.checked ||
|
|
218
|
+
fieldsValues.status.selected === '0'
|
|
219
|
+
"
|
|
220
|
+
data-id="burst-size-input"
|
|
221
|
+
name="burst-size"
|
|
222
|
+
:class="[
|
|
223
|
+
'tooltip-field',
|
|
224
|
+
{
|
|
225
|
+
'danger-not-valid':
|
|
226
|
+
fieldsValues.status.checked &&
|
|
227
|
+
fieldsValues.status.selected !== '0' &&
|
|
228
|
+
props.errorMessages.burstSize,
|
|
229
|
+
},
|
|
230
|
+
]"
|
|
231
|
+
@click.stop
|
|
232
|
+
/>
|
|
233
|
+
</template>
|
|
234
|
+
<template #content>
|
|
235
|
+
{{ props.errorMessages.burstSize }}
|
|
236
|
+
</template>
|
|
237
|
+
</atoms-tooltip-error>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
</form>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
</template>
|
|
248
|
+
|
|
249
|
+
<script setup lang="ts">
|
|
250
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
251
|
+
import type {
|
|
252
|
+
UI_I_ModalsInitialData,
|
|
253
|
+
UI_I_TrafficShapingFields,
|
|
254
|
+
UI_I_EditSettingsErrorMessage,
|
|
255
|
+
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
256
|
+
import type { UI_T_TrafficShapingFieldName } from '~/components/common/diagramMain/lib/models/types'
|
|
257
|
+
import { validationMessagesArrayFunc } from '~/components/common/diagramMain/modals/lib/utils'
|
|
258
|
+
import { trafficShapingFieldsInitialFunc } from '~/components/common/diagramMain/modals/lib/config'
|
|
259
|
+
|
|
260
|
+
// Props from up
|
|
261
|
+
const props = withDefaults(
|
|
262
|
+
defineProps<{
|
|
263
|
+
isShowErrorMessageAlert: boolean
|
|
264
|
+
initialData?: UI_I_ModalsInitialData
|
|
265
|
+
errorMessages: UI_I_EditSettingsErrorMessage
|
|
266
|
+
hasErrorMessages?: boolean
|
|
267
|
+
isSwitch: boolean
|
|
268
|
+
}>(),
|
|
269
|
+
{
|
|
270
|
+
initialData: () => ({}),
|
|
271
|
+
isSwitch: false,
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
const validationMessagesArray = computed(() =>
|
|
276
|
+
validationMessagesArrayFunc(
|
|
277
|
+
['average', 'peak', 'burstSize'],
|
|
278
|
+
props.errorMessages
|
|
279
|
+
)
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
// UI_I_Localization
|
|
283
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
284
|
+
|
|
285
|
+
// For showing component validation errors on the top of modal
|
|
286
|
+
const isShowErrorMessage = computed<boolean>(
|
|
287
|
+
() => props.isShowErrorMessageAlert && props.hasErrorMessages
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
const fieldsValues = ref<UI_I_TrafficShapingFields>(
|
|
291
|
+
trafficShapingFieldsInitialFunc(props.isSwitch, props.initialData)
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
// Validation
|
|
295
|
+
const emits = defineEmits<{
|
|
296
|
+
(
|
|
297
|
+
event: 'change-error-messages',
|
|
298
|
+
errorMessage: string,
|
|
299
|
+
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
300
|
+
): void
|
|
301
|
+
(event: 'hide-error-message-alert'): void
|
|
302
|
+
(
|
|
303
|
+
event: 'change-edit-traffic-shaping-data',
|
|
304
|
+
trafficShapingData: UI_I_TrafficShapingFields
|
|
305
|
+
): void
|
|
306
|
+
}>()
|
|
307
|
+
|
|
308
|
+
const onHideErrorMessageAlert = (): void => emits('hide-error-message-alert')
|
|
309
|
+
|
|
310
|
+
const onChangeData = (data: UI_I_TrafficShapingFields) =>
|
|
311
|
+
emits('change-edit-traffic-shaping-data', data)
|
|
312
|
+
|
|
313
|
+
const messageTexts = (local: UI_I_Localization) => ({
|
|
314
|
+
average: local.common.averageInvalidError,
|
|
315
|
+
peak: local.common.peakInvalidError,
|
|
316
|
+
burstSize: local.common.burstSizeInvalidError,
|
|
317
|
+
averageBig: local.common.averageBigInvalidError,
|
|
318
|
+
peakBig: local.common.peakBigInvalidError,
|
|
319
|
+
burstSizeBig: local.common.burstSizeBigInvalidError,
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
const changeErrorMessage = (
|
|
323
|
+
errorMessage: string,
|
|
324
|
+
fieldName: keyof UI_I_EditSettingsErrorMessage
|
|
325
|
+
) => emits('change-error-messages', errorMessage, fieldName)
|
|
326
|
+
|
|
327
|
+
const MAX_BANDWIDTH = 9_007_199_254_740_991
|
|
328
|
+
const setMessageOnChangedField = (
|
|
329
|
+
values: number[],
|
|
330
|
+
index: number,
|
|
331
|
+
name: UI_T_TrafficShapingFieldName,
|
|
332
|
+
text1: string,
|
|
333
|
+
text2: string
|
|
334
|
+
): void => {
|
|
335
|
+
if (
|
|
336
|
+
!fieldsValues.value.status.checked ||
|
|
337
|
+
fieldsValues.value.status.selected === '0'
|
|
338
|
+
) {
|
|
339
|
+
changeErrorMessage('', 'average')
|
|
340
|
+
changeErrorMessage('', 'peak')
|
|
341
|
+
changeErrorMessage('', 'burstSize')
|
|
342
|
+
return
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (values[index] >= 1 && values[index] <= MAX_BANDWIDTH) {
|
|
346
|
+
changeErrorMessage('', name)
|
|
347
|
+
} else if (values[index] < 1) {
|
|
348
|
+
changeErrorMessage(text1, name)
|
|
349
|
+
} else if (values[index] > MAX_BANDWIDTH) {
|
|
350
|
+
changeErrorMessage(text2, name)
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
watch(
|
|
355
|
+
fieldsValues,
|
|
356
|
+
(newFieldsValues: UI_I_TrafficShapingFields): void => {
|
|
357
|
+
const { average, peak, burstSize } = newFieldsValues
|
|
358
|
+
const arrayValues = [average, peak, burstSize]
|
|
359
|
+
|
|
360
|
+
setMessageOnChangedField(
|
|
361
|
+
arrayValues,
|
|
362
|
+
0,
|
|
363
|
+
'average',
|
|
364
|
+
messageTexts(localization.value).average,
|
|
365
|
+
messageTexts(localization.value).averageBig
|
|
366
|
+
)
|
|
367
|
+
setMessageOnChangedField(
|
|
368
|
+
arrayValues,
|
|
369
|
+
1,
|
|
370
|
+
'peak',
|
|
371
|
+
messageTexts(localization.value).peak,
|
|
372
|
+
messageTexts(localization.value).peakBig
|
|
373
|
+
)
|
|
374
|
+
setMessageOnChangedField(
|
|
375
|
+
arrayValues,
|
|
376
|
+
2,
|
|
377
|
+
'burstSize',
|
|
378
|
+
messageTexts(localization.value).burstSize,
|
|
379
|
+
messageTexts(localization.value).burstSizeBig
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
onChangeData(newFieldsValues)
|
|
383
|
+
!props.hasErrorMessages && onHideErrorMessageAlert()
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
deep: true,
|
|
387
|
+
}
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
onMounted(() => {
|
|
391
|
+
onChangeData(fieldsValues.value)
|
|
392
|
+
})
|
|
393
|
+
onUnmounted((): void => {
|
|
394
|
+
onHideErrorMessageAlert()
|
|
395
|
+
})
|
|
396
|
+
</script>
|
|
397
|
+
|
|
398
|
+
<style scoped lang="scss"></style>
|