bfg-common 1.2.189 → 1.2.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/localization/local_be.json +2 -3
- package/assets/localization/local_en.json +2 -3
- package/assets/localization/local_hy.json +2 -3
- package/assets/localization/local_kk.json +2 -3
- package/assets/localization/local_ru.json +2 -3
- package/assets/localization/local_zh.json +2 -3
- package/components/atoms/table/simpleTable/SimpleTable.vue +2 -5
- package/components/atoms/wizard/Wizard.vue +4 -4
- package/components/atoms/wizard/models/interfaces.ts +3 -4
- package/components/atoms/wizard/utils/utils.ts +27 -106
- package/components/common/addNetworking/AddNetworking.vue +1123 -0
- package/components/common/addNetworking/Wizard.vue +286 -0
- package/components/common/{wizards/network/add/config/steps.ts → addNetworking/config/addNetworkingSteps.ts} +60 -107
- package/components/common/{wizards/network/add → addNetworking}/config/index.ts +16 -2
- package/components/common/{wizards/network/add → addNetworking}/config/initialData.ts +19 -4
- package/components/common/{wizards/network/add → addNetworking}/config/portPropertiesStep.ts +1 -1
- package/components/common/{wizards/network/add → addNetworking}/config/selectSwitch.ts +1 -1
- package/components/common/{wizards/network/add → addNetworking}/config/sendData.ts +1 -1
- package/components/common/addNetworking/config/temporaryData.ts +8 -0
- package/components/common/addNetworking/config/validation.ts +23 -0
- package/components/common/{wizards/network/add → addNetworking}/modals/SelectNetwork.vue +2 -2
- package/components/common/{wizards/network/add → addNetworking}/modals/SelectStandardSwitch.vue +2 -2
- package/components/common/{wizards/network/add → addNetworking}/modals/SelectSwitch.vue +2 -2
- package/components/common/addNetworking/models/enums.ts +7 -0
- package/components/common/{wizards/network/add → addNetworking}/models/interfaces.ts +37 -30
- package/components/common/addNetworking/models/types.ts +13 -0
- package/components/common/addNetworking/steps/ConnectionSettings.vue +269 -0
- package/components/common/{wizards/network/add → addNetworking}/steps/CreateStandardSwitch.vue +7 -0
- package/components/common/addNetworking/steps/Header.vue +53 -0
- package/components/common/addNetworking/steps/IpFourSettings.vue +361 -0
- package/components/common/{wizards/network/add → addNetworking}/steps/PhysicalAdapter.vue +12 -1
- package/components/common/{wizards/network/add → addNetworking}/steps/PortProperties.vue +180 -57
- package/components/common/{wizards/network/add → addNetworking}/steps/ReadyComplete.vue +10 -1
- package/components/common/{wizards/network/add → addNetworking}/steps/SelectConnectionType.vue +15 -3
- package/components/common/{wizards/network/add → addNetworking}/steps/SelectedTargetDevice.vue +212 -106
- package/components/common/addNetworking/utils/index.ts +212 -0
- package/components/common/diagramMain/DiagramMain.vue +47 -11
- package/components/common/diagramMain/modals/MigrateVmkernelAdapter.vue +603 -0
- package/components/common/diagramMain/modals/config/index.ts +6 -0
- package/components/common/diagramMain/modals/config/migrateVmkernelAdapterSteps.ts +81 -0
- package/components/common/diagramMain/modals/config/validation.ts +3 -0
- 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 +1 -1
- package/components/common/diagramMain/modals/steps/ConnectionSettings.vue +221 -0
- package/components/common/diagramMain/modals/steps/Header.vue +60 -0
- package/components/common/diagramMain/modals/{migrateVmkernelAdapter/steps → steps}/SelectVmkernelAdapter.vue +86 -24
- package/components/common/diagramMain/modals/{migrateVmkernelAdapter/steps → steps}/VmkernelAdapterReadyComplete.vue +11 -7
- package/components/common/diagramMain/models/enums.ts +7 -6
- package/components/common/diagramMain/models/interfaces.ts +29 -28
- package/components/common/diagramMain/models/types.ts +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +447 -447
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +77 -77
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +177 -177
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +181 -181
- package/package.json +1 -1
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +0 -531
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/config/steps.ts +0 -114
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +0 -161
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +0 -47
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +0 -146
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +0 -54
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +0 -19
- package/components/common/wizards/network/add/Add.vue +0 -874
- package/components/common/wizards/network/add/models/enums.ts +0 -17
- package/components/common/wizards/network/add/models/types.ts +0 -2
- package/components/common/wizards/network/add/steps/ConnectionSettings.vue +0 -148
- package/components/common/wizards/network/add/steps/IpFourSettings.vue +0 -245
- package/components/common/wizards/network/add/utils/index.ts +0 -4
- package/components/common/wizards/network/add/validations/common.ts +0 -58
- package/components/common/wizards/network/add/validations/connectionSettings.ts +0 -75
- package/components/common/wizards/network/add/validations/createStandardSwitch.ts +0 -58
- package/components/common/wizards/network/add/validations/ipFourSettings.ts +0 -188
- package/components/common/wizards/network/add/validations/networkValidation.ts +0 -73
- package/components/common/wizards/network/add/validations/portProperties.ts +0 -87
- package/components/common/wizards/network/add/validations/targetDevice.ts +0 -113
- package/components/common/wizards/network/add/validations/validations.ts +0 -43
- /package/components/common/{wizards/network/add → addNetworking}/mappers/mappers.ts +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export enum UI_E_ValidationFields {
|
|
2
|
-
TARGET_DEVICE_STANDARD_SWITCH = 'switch',
|
|
3
|
-
TARGET_DEVICE_NETWORK = 'network',
|
|
4
|
-
TARGET_DEVICE_SWITCH = 'switch2',
|
|
5
|
-
TARGET_DEVICE_MTU = 'new_switch.mtu',
|
|
6
|
-
|
|
7
|
-
PORT_PROPERTIES_NETWORK = 'network_name',
|
|
8
|
-
PORT_PROPERTIES_VLAN = 'new_network.vlan',
|
|
9
|
-
PORT_PROPERTIES_MTU = 'mtu',
|
|
10
|
-
|
|
11
|
-
IPV_SETTINGS_IPV = 'tcp_config.ipv4',
|
|
12
|
-
IPV_SETTINGS_MASK = 'tcp_config.net_mask',
|
|
13
|
-
IPV_SETTINGS_GATEWAY = 'tcp_config.gateway',
|
|
14
|
-
|
|
15
|
-
CONNECTION_SETTINGS_NETWORK = 'name',
|
|
16
|
-
CONNECTION_SETTINGS_VLAN = 'vlan',
|
|
17
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
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="horizontal-flex-container">
|
|
12
|
-
<label class="property-label-group" for="network-label">
|
|
13
|
-
{{ localization.networkLabel }}
|
|
14
|
-
</label>
|
|
15
|
-
<div class="margin-left-property-value-group">
|
|
16
|
-
<div class="property-value-group">
|
|
17
|
-
<fieldset>
|
|
18
|
-
<atoms-tooltip-error
|
|
19
|
-
:has-error="!!props.messagesFields.name.field"
|
|
20
|
-
>
|
|
21
|
-
<template #elem>
|
|
22
|
-
<input
|
|
23
|
-
id="network-label"
|
|
24
|
-
v-model="fields.networkLabel"
|
|
25
|
-
name="network-label"
|
|
26
|
-
type="text"
|
|
27
|
-
:class="[
|
|
28
|
-
'tooltip-field port-properties-network-label',
|
|
29
|
-
{
|
|
30
|
-
'danger-not-valid': props.messagesFields.name.field,
|
|
31
|
-
},
|
|
32
|
-
]"
|
|
33
|
-
@click.stop
|
|
34
|
-
/>
|
|
35
|
-
</template>
|
|
36
|
-
<template #content>
|
|
37
|
-
{{ props.messagesFields.name.field }}
|
|
38
|
-
</template>
|
|
39
|
-
</atoms-tooltip-error>
|
|
40
|
-
</fieldset>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<div class="horizontal-flex-container port-properties-padding">
|
|
46
|
-
<label class="property-label-group">
|
|
47
|
-
{{ localization.vlanId }}
|
|
48
|
-
</label>
|
|
49
|
-
<div class="margin-left-property-value-group">
|
|
50
|
-
<div class="property-value-group">
|
|
51
|
-
<fieldset>
|
|
52
|
-
<div class="flex-align-center">
|
|
53
|
-
<atoms-combobox
|
|
54
|
-
v-model.trim="fields.vlanId"
|
|
55
|
-
:items="vlanIdSelectData"
|
|
56
|
-
:class="{
|
|
57
|
-
'danger-not-valid': props.messagesFields.vlan.field,
|
|
58
|
-
}"
|
|
59
|
-
@click.stop
|
|
60
|
-
/>
|
|
61
|
-
<div
|
|
62
|
-
v-show="props.messagesFields.vlan.field"
|
|
63
|
-
class="flex-align-center"
|
|
64
|
-
>
|
|
65
|
-
<div class="tooltip flex align-middle">
|
|
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.messagesFields.vlan.field }}
|
|
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 { UI_I_ArbitraryObject, UI_I_Localization } from '~/models/interfaces'
|
|
89
|
-
import { UI_I_ConnectionSettings } from '~/components/common/wizards/network/add/models/interfaces'
|
|
90
|
-
import { vlanIdSelectData } from '~/components/common/wizards/network/add/config'
|
|
91
|
-
import { UI_I_ErrorFields } from '~/components/atoms/wizard/models/interfaces'
|
|
92
|
-
import type Wizard from '~/components/atoms/wizard/utils/utils'
|
|
93
|
-
import {
|
|
94
|
-
validateNetworkConnectionSettingsLocal,
|
|
95
|
-
validateVlanIdConnectionSettingsLocal,
|
|
96
|
-
} from '~/components/common/wizards/network/add/validations/validations'
|
|
97
|
-
|
|
98
|
-
const props = defineProps<{
|
|
99
|
-
connectionSettings: UI_I_ConnectionSettings
|
|
100
|
-
alertMessages: string[]
|
|
101
|
-
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
102
|
-
wizard: Wizard
|
|
103
|
-
}>()
|
|
104
|
-
|
|
105
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
106
|
-
|
|
107
|
-
const emits = defineEmits<{
|
|
108
|
-
(
|
|
109
|
-
event: 'change-connection-settings',
|
|
110
|
-
connectionSettings: UI_I_ConnectionSettings
|
|
111
|
-
): void
|
|
112
|
-
(event: 'hide-alert', stepId: 5): void
|
|
113
|
-
}>()
|
|
114
|
-
|
|
115
|
-
const fields = ref<UI_I_ConnectionSettings>(
|
|
116
|
-
useDeepCopy(props.connectionSettings)
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
let oldFields = useDeepCopy(fields.value)
|
|
120
|
-
|
|
121
|
-
watch(
|
|
122
|
-
fields,
|
|
123
|
-
(newFields: UI_I_ConnectionSettings) => {
|
|
124
|
-
oldFields.vlanId !== newFields.vlanId &&
|
|
125
|
-
validateVlanIdConnectionSettingsLocal(
|
|
126
|
-
localization.value,
|
|
127
|
-
newFields,
|
|
128
|
-
props.wizard
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
oldFields.networkLabel !== newFields.networkLabel &&
|
|
132
|
-
validateNetworkConnectionSettingsLocal(
|
|
133
|
-
localization.value,
|
|
134
|
-
newFields,
|
|
135
|
-
props.wizard
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
oldFields = useDeepCopy(fields.value)
|
|
139
|
-
|
|
140
|
-
emits('change-connection-settings', newFields)
|
|
141
|
-
},
|
|
142
|
-
{ deep: true, immediate: true }
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
const onHideAlert = (): void => {
|
|
146
|
-
emits('hide-alert', 5)
|
|
147
|
-
}
|
|
148
|
-
</script>
|
|
@@ -1,245 +0,0 @@
|
|
|
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,58 +0,0 @@
|
|
|
1
|
-
import type Wizard from '~/components/atoms/wizard/utils/utils'
|
|
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 checkIfValidIP = (str: string): boolean => {
|
|
14
|
-
const regexExp =
|
|
15
|
-
/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/gi
|
|
16
|
-
|
|
17
|
-
return regexExp.test(str)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const checkVlanId = (vlanId: string): boolean =>
|
|
21
|
-
vlanId !== 'None (0)' &&
|
|
22
|
-
vlanId !== 'All (4095)' &&
|
|
23
|
-
(isIntegerNumberInRange(vlanId, 0, 4095) || vlanId === '')
|
|
24
|
-
|
|
25
|
-
export const checkMtu = (mtu: number): boolean => {
|
|
26
|
-
return !!(mtu === 0 ? '0' : mtu) && isIntegerNumberInRange(mtu, 1280, 65535)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const validateFieldLocal = (
|
|
30
|
-
wizard: Wizard,
|
|
31
|
-
stepId: number,
|
|
32
|
-
field: string,
|
|
33
|
-
rule: boolean | boolean[],
|
|
34
|
-
fieldMessage: string | string[],
|
|
35
|
-
alertMessage: string | string[]
|
|
36
|
-
): void => {
|
|
37
|
-
if (typeof rule === 'boolean') {
|
|
38
|
-
if (rule) {
|
|
39
|
-
wizard.setValidation(stepId, field, {
|
|
40
|
-
fieldMessage: fieldMessage as string,
|
|
41
|
-
alertMessage: alertMessage as string,
|
|
42
|
-
})
|
|
43
|
-
} else if (wizard.hasMessage(stepId, field)) {
|
|
44
|
-
wizard.removeValidationLocal(stepId, field)
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
const ruleIndex = rule.indexOf(true)
|
|
48
|
-
|
|
49
|
-
if (ruleIndex !== -1) {
|
|
50
|
-
wizard.setValidation(stepId, field, {
|
|
51
|
-
fieldMessage: fieldMessage[ruleIndex],
|
|
52
|
-
alertMessage: alertMessage[ruleIndex],
|
|
53
|
-
})
|
|
54
|
-
} else if (wizard.hasMessage(stepId, field)) {
|
|
55
|
-
wizard.removeValidationLocal(stepId, field)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { UI_I_ConnectionSettings } from '~/components/common/wizards/network/add/models/interfaces'
|
|
2
|
-
import { UI_E_ValidationFields } from '~/components/common/wizards/network/add/models/enums'
|
|
3
|
-
import { UI_I_Localization } from '~/models/interfaces'
|
|
4
|
-
import type Wizard from '~/components/atoms/wizard/utils/utils'
|
|
5
|
-
import {
|
|
6
|
-
UI_I_ValidationReturn,
|
|
7
|
-
UI_I_WizardStep,
|
|
8
|
-
} from '~/components/atoms/wizard/models/interfaces'
|
|
9
|
-
import {
|
|
10
|
-
validateFieldLocal,
|
|
11
|
-
checkVlanId,
|
|
12
|
-
} from '~/components/common/wizards/network/add/validations/common'
|
|
13
|
-
|
|
14
|
-
export const validateVlanIdConnectionSettingsLocal = (
|
|
15
|
-
localization: UI_I_Localization,
|
|
16
|
-
data: UI_I_ConnectionSettings,
|
|
17
|
-
wizard: Wizard
|
|
18
|
-
): void => {
|
|
19
|
-
validateFieldLocal(
|
|
20
|
-
wizard,
|
|
21
|
-
5,
|
|
22
|
-
UI_E_ValidationFields.CONNECTION_SETTINGS_VLAN,
|
|
23
|
-
checkVlanId(data.vlanId),
|
|
24
|
-
localization.vlanIdInvalidMessage,
|
|
25
|
-
localization.vlanIdInvalidMessage
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const validateNetworkConnectionSettingsLocal = (
|
|
30
|
-
localization: UI_I_Localization,
|
|
31
|
-
data: UI_I_ConnectionSettings,
|
|
32
|
-
wizard: Wizard
|
|
33
|
-
): void => {
|
|
34
|
-
validateFieldLocal(
|
|
35
|
-
wizard,
|
|
36
|
-
5,
|
|
37
|
-
UI_E_ValidationFields.CONNECTION_SETTINGS_NETWORK,
|
|
38
|
-
data.networkLabel === '',
|
|
39
|
-
localization.networkLabelInvalidMessage,
|
|
40
|
-
localization.networkLabelInvalidMessage
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const checkConnectionSettingsSync = (
|
|
45
|
-
localization: UI_I_Localization,
|
|
46
|
-
data: UI_I_ConnectionSettings,
|
|
47
|
-
wizard: Wizard,
|
|
48
|
-
value: UI_I_WizardStep[]
|
|
49
|
-
): UI_I_ValidationReturn => {
|
|
50
|
-
let stepHasError = false
|
|
51
|
-
|
|
52
|
-
if (checkVlanId(data.vlanId)) {
|
|
53
|
-
stepHasError = wizard.setValidation(
|
|
54
|
-
5,
|
|
55
|
-
UI_E_ValidationFields.CONNECTION_SETTINGS_VLAN,
|
|
56
|
-
{
|
|
57
|
-
fieldMessage: localization.vlanIdInvalidMessage,
|
|
58
|
-
alertMessage: localization.vlanIdInvalidMessage,
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
} else if (
|
|
62
|
-
wizard.hasMessage(5, UI_E_ValidationFields.CONNECTION_SETTINGS_VLAN)
|
|
63
|
-
) {
|
|
64
|
-
value = wizard.removeValidation(
|
|
65
|
-
5,
|
|
66
|
-
UI_E_ValidationFields.CONNECTION_SETTINGS_VLAN,
|
|
67
|
-
value
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
newValue: value,
|
|
73
|
-
stepHasError,
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
UI_I_AdapterStatus,
|
|
3
|
-
UI_I_Adapter,
|
|
4
|
-
} from '~/components/common/diagramMain/models/interfaces'
|
|
5
|
-
import { UI_I_Localization } from '~/models/interfaces'
|
|
6
|
-
import {
|
|
7
|
-
UI_I_ValidationReturn,
|
|
8
|
-
UI_I_WizardStep,
|
|
9
|
-
} from '~/components/atoms/wizard/models/interfaces'
|
|
10
|
-
|
|
11
|
-
export const checkAdaptersSync = (
|
|
12
|
-
localization: UI_I_Localization,
|
|
13
|
-
data: UI_I_AdapterStatus,
|
|
14
|
-
value: UI_I_WizardStep[],
|
|
15
|
-
currentStepId: number,
|
|
16
|
-
nextStepId: number,
|
|
17
|
-
freeAdapters: UI_I_Adapter[],
|
|
18
|
-
showNoActiveAdaptersModal: () => void,
|
|
19
|
-
showNoConnectedActiveAdaptersModal: () => void
|
|
20
|
-
): UI_I_ValidationReturn => {
|
|
21
|
-
const stepShouldStop = {
|
|
22
|
-
ifOnCurrentStep: false,
|
|
23
|
-
ifFromAnyStep: false,
|
|
24
|
-
stoppageStepId: 2,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const isOnStoppageStep = currentStepId === stepShouldStop.stoppageStepId
|
|
28
|
-
|
|
29
|
-
if (isOnStoppageStep && data.active.length === 0) {
|
|
30
|
-
stepShouldStop.ifOnCurrentStep = true
|
|
31
|
-
showNoActiveAdaptersModal()
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (stepShouldStop.ifOnCurrentStep)
|
|
35
|
-
return {
|
|
36
|
-
newValue: value,
|
|
37
|
-
stepHasError: false,
|
|
38
|
-
stepShouldStop,
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const activeAndConnectedAdapters = data.active.filter(
|
|
42
|
-
(adapterName: string) =>
|
|
43
|
-
freeAdapters.find(
|
|
44
|
-
(freeAdapter: UI_I_Adapter) => freeAdapter.name === adapterName
|
|
45
|
-
)?.carrier
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
if (isOnStoppageStep && activeAndConnectedAdapters.length === 0) {
|
|
49
|
-
stepShouldStop.ifOnCurrentStep = true
|
|
50
|
-
showNoConnectedActiveAdaptersModal()
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
newValue: value,
|
|
55
|
-
stepHasError: false,
|
|
56
|
-
stepShouldStop,
|
|
57
|
-
}
|
|
58
|
-
}
|