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
package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
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">
|
|
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/diagramMain/modals/migrateVmkernelAdapter/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: 1): void
|
|
113
|
+
}>()
|
|
114
|
+
|
|
115
|
+
const fields = ref<UI_I_ConnectionSettings>(useDeepCopy(props.connectionSettings))
|
|
116
|
+
|
|
117
|
+
let oldFields = useDeepCopy(fields.value)
|
|
118
|
+
|
|
119
|
+
watch(
|
|
120
|
+
fields,
|
|
121
|
+
(newFields: UI_I_ConnectionSettings) => {
|
|
122
|
+
oldFields.vlanId !== newFields.vlanId &&
|
|
123
|
+
validateVlanIdConnectionSettingsLocal(
|
|
124
|
+
localization.value,
|
|
125
|
+
newFields,
|
|
126
|
+
props.wizard
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
oldFields.networkLabel !== newFields.networkLabel &&
|
|
130
|
+
validateNetworkConnectionSettingsLocal(
|
|
131
|
+
localization.value,
|
|
132
|
+
newFields,
|
|
133
|
+
props.wizard
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
oldFields = useDeepCopy(fields.value)
|
|
137
|
+
|
|
138
|
+
emits('change-connection-settings', newFields)
|
|
139
|
+
},
|
|
140
|
+
{ deep: true, immediate: true }
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
const onHideAlert = (): void => {
|
|
144
|
+
emits('hide-alert', 1)
|
|
145
|
+
}
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style scoped lang="scss">
|
|
149
|
+
.wizard-content-container {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
align-items: stretch;
|
|
153
|
+
flex: 1 1 100%;
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
padding: 16px 15px 10px 10px;
|
|
156
|
+
overflow-y: auto;
|
|
157
|
+
color: #333;
|
|
158
|
+
order: 2;
|
|
159
|
+
width: 100%;
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wizard-content-container">
|
|
3
|
-
<common-diagram-main-modals-steps-header
|
|
4
|
-
:title="props.title"
|
|
5
|
-
:text="props.text"
|
|
6
|
-
/>
|
|
7
3
|
<div class="wizard-content wizard-content-port">
|
|
8
4
|
<atoms-alert
|
|
9
|
-
v-if="
|
|
5
|
+
v-if="props.alertMessages.length"
|
|
10
6
|
status="alert-danger"
|
|
11
|
-
:items="props.
|
|
12
|
-
@remove="
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
13
9
|
/>
|
|
14
10
|
<div class="table-top-margin-container">
|
|
15
11
|
<atoms-table-simple-table
|
|
16
12
|
:head-items="tableHeadItems"
|
|
17
13
|
:body-items="tableBodyItems"
|
|
14
|
+
:selected-row-key="selectedRowKey"
|
|
18
15
|
editable
|
|
19
16
|
@select="onSelectRow"
|
|
20
17
|
/>
|
|
21
18
|
</div>
|
|
22
19
|
<common-diagram-main-modals-view-settings-info
|
|
23
|
-
:show="selectedRowData.length"
|
|
20
|
+
:show="!!selectedRowData.length"
|
|
24
21
|
:modal-tabs="modalTabs"
|
|
25
22
|
:view-settings-fields="viewSettingsFields"
|
|
26
23
|
:with-collapse="false"
|
|
@@ -42,11 +39,10 @@ import {
|
|
|
42
39
|
UI_I_ReadyCompleteFields,
|
|
43
40
|
UI_I_SelectVmkernelAdapter,
|
|
44
41
|
UI_I_TableHead,
|
|
45
|
-
} from '~/components/common/
|
|
42
|
+
} from '~/components/common/wizards/network/add/models/interfaces'
|
|
46
43
|
import {
|
|
47
44
|
UI_I_ModalTabs,
|
|
48
45
|
UI_I_SelectedVmkernelAdapterTableRaw,
|
|
49
|
-
UI_I_SelectVmKernelAdapterFieldsErrorMessages,
|
|
50
46
|
UI_I_VmkernelAdapterTableData,
|
|
51
47
|
} from '~/components/common/diagramMain/models/interfaces'
|
|
52
48
|
import {
|
|
@@ -54,136 +50,78 @@ import {
|
|
|
54
50
|
vmKernelAdapterViewSettingsTableHeadFunc,
|
|
55
51
|
vmKernelAdapterTableBodyMapperFunc,
|
|
56
52
|
vmKernelAdapterViewSettingsFunc,
|
|
57
|
-
selectVmKernelAdapterFieldsErrorMessages,
|
|
58
53
|
} from '~/components/common/diagramMain/modals/config'
|
|
59
|
-
import { UI_T_VmKernelAdapterFieldName } from '~/components/common/diagramMain/models/types'
|
|
60
54
|
|
|
61
|
-
// Props from up
|
|
62
55
|
const props = defineProps<{
|
|
63
|
-
title: string
|
|
64
|
-
text: string
|
|
65
|
-
stepId: number
|
|
66
56
|
tableData: UI_I_VmkernelAdapterTableData[]
|
|
67
57
|
vmkernelAdapter: UI_I_SelectVmkernelAdapter
|
|
68
|
-
|
|
69
|
-
errorMessages: string[]
|
|
58
|
+
alertMessages: string[]
|
|
70
59
|
}>()
|
|
71
60
|
|
|
72
|
-
// UI_I_Localization
|
|
73
61
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
74
62
|
|
|
75
|
-
// View settings modal tabs data
|
|
76
63
|
const modalTabs = computed<UI_I_ModalTabs[]>(() =>
|
|
77
64
|
vmKernelAdapterViewSettingsModalTabsFunc(localization.value)
|
|
78
65
|
)
|
|
79
66
|
|
|
80
|
-
// View settings modal data
|
|
81
67
|
const viewSettingsFields = computed<UI_I_ReadyCompleteFields[]>(() =>
|
|
82
68
|
vmKernelAdapterViewSettingsFunc(localization.value)
|
|
83
69
|
)
|
|
84
70
|
|
|
85
|
-
// Table head data
|
|
86
71
|
const tableHeadItems = computed<UI_I_TableHead[]>(() =>
|
|
87
72
|
vmKernelAdapterViewSettingsTableHeadFunc(localization.value)
|
|
88
73
|
)
|
|
89
74
|
|
|
90
|
-
// Table body data
|
|
91
75
|
const tableBodyItems = computed<UI_I_BodyItems[][]>(() =>
|
|
92
76
|
props.tableData.map(vmKernelAdapterTableBodyMapperFunc)
|
|
93
77
|
)
|
|
94
78
|
|
|
95
|
-
// Select the row
|
|
96
79
|
const selectedRowData = ref<UI_I_SelectedVmkernelAdapterTableRaw[]>(
|
|
97
80
|
tableBodyItems.value.find(
|
|
98
|
-
(item) => item[0].
|
|
81
|
+
(item) => item[0].text === props.vmkernelAdapter.vm
|
|
99
82
|
) || []
|
|
100
83
|
)
|
|
101
84
|
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
const selectedRowKey = ref<number>(
|
|
86
|
+
tableBodyItems.value.findIndex(
|
|
87
|
+
(item) => item[0].text === props.vmkernelAdapter.vm
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
const fields = ref<UI_I_SelectVmkernelAdapter>(
|
|
92
|
+
useDeepCopy(props.vmkernelAdapter)
|
|
93
|
+
)
|
|
104
94
|
|
|
105
|
-
// Select row handler
|
|
106
95
|
const onSelectRow = (index: number): void => {
|
|
107
96
|
selectedRowData.value = tableBodyItems.value[index]
|
|
108
97
|
|
|
109
98
|
const selectedVmkernelAdapter =
|
|
110
99
|
selectedRowData.value &&
|
|
111
100
|
selectedRowData.value[0] &&
|
|
112
|
-
selectedRowData.value[0].
|
|
101
|
+
selectedRowData.value[0].text
|
|
113
102
|
|
|
114
103
|
selectedVmkernelAdapter && (fields.value.vm = selectedVmkernelAdapter)
|
|
115
104
|
}
|
|
116
105
|
|
|
117
|
-
// Validation error check for this step
|
|
118
|
-
const isShowErrorMessage = computed<boolean>(
|
|
119
|
-
() => props.isShowErrorMessageAlert && !!props.errorMessages.length
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
// Validation
|
|
123
106
|
const emits = defineEmits<{
|
|
124
107
|
(
|
|
125
108
|
event: 'change-vmkernel-adapter',
|
|
126
109
|
vmkernelAdapter: UI_I_SelectVmkernelAdapter
|
|
127
110
|
): void
|
|
128
|
-
(
|
|
129
|
-
event: 'change-error-messages',
|
|
130
|
-
errorMessages: string[],
|
|
131
|
-
stepIndex: number
|
|
132
|
-
): void
|
|
133
|
-
(event: 'hide-error-message-alert'): void
|
|
111
|
+
(event: 'hide-alert', stepId: 0): void
|
|
134
112
|
}>()
|
|
135
113
|
|
|
136
|
-
const fieldsErrorMessages = ref<UI_I_SelectVmKernelAdapterFieldsErrorMessages>(
|
|
137
|
-
selectVmKernelAdapterFieldsErrorMessages
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
const messageTexts = (
|
|
141
|
-
local: UI_I_Localization
|
|
142
|
-
): UI_I_ArbitraryObject<string> => ({
|
|
143
|
-
vm: local.noVmKernelNetworkAdapterSelectedForMigration,
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
const setMessageOnChangedField = (
|
|
147
|
-
values: string,
|
|
148
|
-
name: UI_T_VmKernelAdapterFieldName,
|
|
149
|
-
text: string
|
|
150
|
-
): void => {
|
|
151
|
-
if (name === 'vm') {
|
|
152
|
-
if (values) {
|
|
153
|
-
fieldsErrorMessages.value[name] = ''
|
|
154
|
-
} else {
|
|
155
|
-
fieldsErrorMessages.value[name] = text
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
114
|
watch(
|
|
161
115
|
fields,
|
|
162
116
|
(newFields: UI_I_SelectVmkernelAdapter) => {
|
|
163
|
-
setMessageOnChangedField(
|
|
164
|
-
newFields.vm,
|
|
165
|
-
'vm',
|
|
166
|
-
messageTexts(localization.value).vm
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
const fieldsErrorMessagesFiltered = Object.values(
|
|
170
|
-
fieldsErrorMessages.value
|
|
171
|
-
).filter((errorMessage: string) => errorMessage !== '')
|
|
172
|
-
fieldsErrorMessagesFiltered.length === 0 &&
|
|
173
|
-
emits('hide-error-message-alert')
|
|
174
|
-
emits('change-error-messages', fieldsErrorMessagesFiltered, props.stepId)
|
|
175
117
|
emits('change-vmkernel-adapter', newFields)
|
|
176
118
|
},
|
|
177
119
|
{ deep: true, immediate: true }
|
|
178
120
|
)
|
|
179
121
|
|
|
180
|
-
const
|
|
181
|
-
emits('hide-
|
|
122
|
+
const onHideAlert = (): void => {
|
|
123
|
+
emits('hide-alert', 0)
|
|
182
124
|
}
|
|
183
|
-
onUnmounted(() => {
|
|
184
|
-
selectedRowData.value = []
|
|
185
|
-
emits('hide-error-message-alert')
|
|
186
|
-
})
|
|
187
125
|
</script>
|
|
188
126
|
|
|
189
127
|
<style scoped lang="scss">
|
|
@@ -193,7 +131,7 @@ onUnmounted(() => {
|
|
|
193
131
|
align-items: stretch;
|
|
194
132
|
flex: 1 1 100%;
|
|
195
133
|
box-sizing: border-box;
|
|
196
|
-
padding:
|
|
134
|
+
padding: 0px 15px 0px 10px;
|
|
197
135
|
overflow-y: auto;
|
|
198
136
|
color: #333;
|
|
199
137
|
order: 2;
|
|
@@ -204,8 +142,8 @@ onUnmounted(() => {
|
|
|
204
142
|
}
|
|
205
143
|
|
|
206
144
|
:deep(.table-fixed-height) {
|
|
207
|
-
max-height:
|
|
208
|
-
min-height:
|
|
145
|
+
max-height: 143px;
|
|
146
|
+
min-height: 143px;
|
|
209
147
|
}
|
|
210
148
|
.no-item-info {
|
|
211
149
|
span {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wizard-content-container">
|
|
3
|
-
<common-diagram-main-modals-steps-header
|
|
4
|
-
:title="props.title"
|
|
5
|
-
:text="props.text"
|
|
6
|
-
/>
|
|
7
3
|
<div class="ready-complete-container">
|
|
8
4
|
<template
|
|
9
5
|
v-for="viewSettingsField in viewSettingsFields"
|
|
@@ -19,21 +15,21 @@
|
|
|
19
15
|
|
|
20
16
|
<script setup lang="ts">
|
|
21
17
|
import { UI_I_Localization } from '~/models/interfaces'
|
|
22
|
-
import {
|
|
18
|
+
import { UI_I_MigrationVmkernelAdapterReadyComplete } from '~/components/common/diagramMain/models/interfaces'
|
|
19
|
+
import { createMigrateVmkernelAdapterSchemeReadyCompleteFunc } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/config/steps'
|
|
23
20
|
|
|
24
21
|
// Props from up
|
|
25
22
|
const props = defineProps<{
|
|
26
|
-
|
|
27
|
-
text: string
|
|
28
|
-
stepId: number
|
|
23
|
+
data: UI_I_MigrationVmkernelAdapterReadyComplete
|
|
29
24
|
}>()
|
|
30
25
|
|
|
31
|
-
// UI_I_Localization
|
|
32
26
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
33
27
|
|
|
34
|
-
// View settings fields data
|
|
35
28
|
const viewSettingsFields = computed(() =>
|
|
36
|
-
createMigrateVmkernelAdapterSchemeReadyCompleteFunc(
|
|
29
|
+
createMigrateVmkernelAdapterSchemeReadyCompleteFunc(
|
|
30
|
+
localization.value,
|
|
31
|
+
props.data
|
|
32
|
+
)
|
|
37
33
|
)
|
|
38
34
|
</script>
|
|
39
35
|
|
|
@@ -0,0 +1,47 @@
|
|
|
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 checkVlanId = (vlanId: string): boolean =>
|
|
14
|
+
vlanId !== 'None (0)' &&
|
|
15
|
+
vlanId !== 'All (4095)' &&
|
|
16
|
+
(isIntegerNumberInRange(vlanId, 0, 4095) || vlanId === '')
|
|
17
|
+
|
|
18
|
+
export const validateFieldLocal = (
|
|
19
|
+
wizard: Wizard,
|
|
20
|
+
stepId: number,
|
|
21
|
+
field: string,
|
|
22
|
+
rule: boolean | boolean[],
|
|
23
|
+
fieldMessage: string | string[],
|
|
24
|
+
alertMessage: string | string[]
|
|
25
|
+
): void => {
|
|
26
|
+
if (typeof rule === 'boolean') {
|
|
27
|
+
if (rule) {
|
|
28
|
+
wizard.setValidation(stepId, field, {
|
|
29
|
+
fieldMessage: fieldMessage as string,
|
|
30
|
+
alertMessage: alertMessage as string,
|
|
31
|
+
})
|
|
32
|
+
} else if (wizard.hasMessage(stepId, field)) {
|
|
33
|
+
wizard.removeValidationLocal(stepId, field)
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
const ruleIndex = rule.indexOf(true)
|
|
37
|
+
|
|
38
|
+
if (ruleIndex !== -1) {
|
|
39
|
+
wizard.setValidation(stepId, field, {
|
|
40
|
+
fieldMessage: fieldMessage[ruleIndex],
|
|
41
|
+
alertMessage: alertMessage[ruleIndex],
|
|
42
|
+
})
|
|
43
|
+
} else if (wizard.hasMessage(stepId, field)) {
|
|
44
|
+
wizard.removeValidationLocal(stepId, field)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { UI_I_ConnectionSettings } from '~/components/common/wizards/network/add/models/interfaces'
|
|
2
|
+
import { UI_I_MigrateVmkernelAdapterEmits } from '~/components/common/diagramMain/models/interfaces'
|
|
3
|
+
import { UI_E_MigrationValidationFields } from '~/components/common/diagramMain/models/enums'
|
|
4
|
+
import { UI_I_Localization } from '~/models/interfaces'
|
|
5
|
+
import type Wizard from '~/components/atoms/wizard/utils/utils'
|
|
6
|
+
import {
|
|
7
|
+
UI_I_AsyncCheckReturn,
|
|
8
|
+
UI_I_ValidationReturn,
|
|
9
|
+
UI_I_WizardStep,
|
|
10
|
+
} from '~/components/atoms/wizard/models/interfaces'
|
|
11
|
+
import {
|
|
12
|
+
validateFieldLocal,
|
|
13
|
+
checkVlanId,
|
|
14
|
+
} from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common'
|
|
15
|
+
|
|
16
|
+
export const validateVlanIdConnectionSettingsLocal = (
|
|
17
|
+
localization: UI_I_Localization,
|
|
18
|
+
data: UI_I_ConnectionSettings,
|
|
19
|
+
wizard: Wizard
|
|
20
|
+
): void => {
|
|
21
|
+
validateFieldLocal(
|
|
22
|
+
wizard,
|
|
23
|
+
1,
|
|
24
|
+
UI_E_MigrationValidationFields.CONNECTION_SETTINGS_VLAN,
|
|
25
|
+
checkVlanId(data.vlanId),
|
|
26
|
+
localization.vlanIdInvalidMessage,
|
|
27
|
+
localization.vlanIdInvalidMessage
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const validateNetworkConnectionSettingsLocal = (
|
|
32
|
+
localization: UI_I_Localization,
|
|
33
|
+
data: UI_I_ConnectionSettings,
|
|
34
|
+
wizard: Wizard
|
|
35
|
+
): void => {
|
|
36
|
+
validateFieldLocal(
|
|
37
|
+
wizard,
|
|
38
|
+
1,
|
|
39
|
+
UI_E_MigrationValidationFields.CONNECTION_SETTINGS_NETWORK,
|
|
40
|
+
data.networkLabel === '',
|
|
41
|
+
localization.networkLabelInvalidMessage,
|
|
42
|
+
localization.networkLabelInvalidMessage
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const checkConnectionSettingsSync = (
|
|
47
|
+
localization: UI_I_Localization,
|
|
48
|
+
data: UI_I_ConnectionSettings,
|
|
49
|
+
wizard: Wizard,
|
|
50
|
+
value: UI_I_WizardStep[]
|
|
51
|
+
): UI_I_ValidationReturn => {
|
|
52
|
+
let stepHasError = false
|
|
53
|
+
|
|
54
|
+
if (checkVlanId(data.vlanId)) {
|
|
55
|
+
stepHasError = wizard.setValidation(
|
|
56
|
+
1,
|
|
57
|
+
UI_E_MigrationValidationFields.CONNECTION_SETTINGS_VLAN,
|
|
58
|
+
{
|
|
59
|
+
fieldMessage: localization.vlanIdInvalidMessage,
|
|
60
|
+
alertMessage: localization.vlanIdInvalidMessage,
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
} else if (
|
|
64
|
+
wizard.hasMessage(
|
|
65
|
+
1,
|
|
66
|
+
UI_E_MigrationValidationFields.CONNECTION_SETTINGS_VLAN
|
|
67
|
+
)
|
|
68
|
+
) {
|
|
69
|
+
value = wizard.removeValidation(
|
|
70
|
+
1,
|
|
71
|
+
UI_E_MigrationValidationFields.CONNECTION_SETTINGS_VLAN,
|
|
72
|
+
value
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
newValue: value,
|
|
78
|
+
stepHasError,
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const checkNetwork = async (
|
|
83
|
+
networkLabel: string,
|
|
84
|
+
localization: UI_I_Localization,
|
|
85
|
+
emits: UI_I_MigrateVmkernelAdapterEmits
|
|
86
|
+
): Promise<UI_I_AsyncCheckReturn> => {
|
|
87
|
+
if (networkLabel) {
|
|
88
|
+
return new Promise((resolve, _reject) =>
|
|
89
|
+
emits('check-network-label', networkLabel, (error_message: string) => {
|
|
90
|
+
if (error_message === '') {
|
|
91
|
+
resolve({
|
|
92
|
+
isValid: true,
|
|
93
|
+
message: '',
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (error_message !== '') {
|
|
98
|
+
resolve({
|
|
99
|
+
isValid: false,
|
|
100
|
+
message: error_message,
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
)
|
|
105
|
+
} else {
|
|
106
|
+
return {
|
|
107
|
+
isValid: false,
|
|
108
|
+
message: localization.networkLabelInvalidMessage,
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const checkNetworkAsync = async (
|
|
114
|
+
value: UI_I_WizardStep[],
|
|
115
|
+
networkLabel: string,
|
|
116
|
+
stepId: number,
|
|
117
|
+
fieldName: string,
|
|
118
|
+
emits: UI_I_MigrateVmkernelAdapterEmits,
|
|
119
|
+
localization: UI_I_Localization,
|
|
120
|
+
wizard: Wizard
|
|
121
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
122
|
+
let stepHasError = false
|
|
123
|
+
|
|
124
|
+
wizard.setLoader(true)
|
|
125
|
+
|
|
126
|
+
const labelValidation: {
|
|
127
|
+
isValid: boolean
|
|
128
|
+
message: string
|
|
129
|
+
} = await checkNetwork(networkLabel, localization, emits)
|
|
130
|
+
|
|
131
|
+
wizard.setLoader(false)
|
|
132
|
+
|
|
133
|
+
if (!labelValidation.isValid) {
|
|
134
|
+
stepHasError = wizard.setValidation(stepId, fieldName, {
|
|
135
|
+
fieldMessage: labelValidation.message,
|
|
136
|
+
alertMessage: labelValidation.message,
|
|
137
|
+
})
|
|
138
|
+
} else if (wizard.hasMessage(stepId, fieldName)) {
|
|
139
|
+
value = wizard.removeValidation(stepId, fieldName, value)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
newValue: value,
|
|
144
|
+
stepHasError,
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { UI_I_SelectVmkernelAdapter } from '~/components/common/wizards/network/add/models/interfaces'
|
|
2
|
+
import { UI_E_MigrationValidationFields } from '~/components/common/diagramMain/models/enums'
|
|
3
|
+
import { UI_I_Localization } from '~/models/interfaces'
|
|
4
|
+
import type Wizard from '~/components/atoms/wizard/utils/utils'
|
|
5
|
+
import { UI_I_WizardStep, UI_I_ValidationReturn } from '~/components/atoms/wizard/models/interfaces'
|
|
6
|
+
import { validateFieldLocal } from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common'
|
|
7
|
+
|
|
8
|
+
export const validateSelectedVmLocal = (
|
|
9
|
+
localization: UI_I_Localization,
|
|
10
|
+
data: UI_I_SelectVmkernelAdapter,
|
|
11
|
+
wizard: Wizard
|
|
12
|
+
): void => {
|
|
13
|
+
validateFieldLocal(
|
|
14
|
+
wizard,
|
|
15
|
+
0,
|
|
16
|
+
'vm',
|
|
17
|
+
data.vm === '',
|
|
18
|
+
'',
|
|
19
|
+
localization.noVmKernelNetworkAdapterSelectedForMigration
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const checkSelectedVmSync = (
|
|
24
|
+
localization: UI_I_Localization,
|
|
25
|
+
data: UI_I_SelectVmkernelAdapter,
|
|
26
|
+
wizard: Wizard,
|
|
27
|
+
value: UI_I_WizardStep[]
|
|
28
|
+
): UI_I_ValidationReturn => {
|
|
29
|
+
let stepHasError = false
|
|
30
|
+
|
|
31
|
+
if (data.vm === '') {
|
|
32
|
+
stepHasError = wizard.setValidation(
|
|
33
|
+
0,
|
|
34
|
+
UI_E_MigrationValidationFields.SELECT_ADAPTER_VM,
|
|
35
|
+
{
|
|
36
|
+
fieldMessage: '',
|
|
37
|
+
alertMessage: localization.noVmKernelNetworkAdapterSelectedForMigration,
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
} else if (
|
|
41
|
+
wizard.hasMessage(0, UI_E_MigrationValidationFields.SELECT_ADAPTER_VM)
|
|
42
|
+
) {
|
|
43
|
+
value = wizard.removeValidation(
|
|
44
|
+
0,
|
|
45
|
+
UI_E_MigrationValidationFields.SELECT_ADAPTER_VM,
|
|
46
|
+
value
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
newValue: value,
|
|
52
|
+
stepHasError,
|
|
53
|
+
}
|
|
54
|
+
}
|
package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validateVlanIdConnectionSettingsLocal,
|
|
3
|
+
validateNetworkConnectionSettingsLocal,
|
|
4
|
+
checkConnectionSettingsSync,
|
|
5
|
+
checkNetworkAsync,
|
|
6
|
+
} from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings'
|
|
7
|
+
import {
|
|
8
|
+
checkSelectedVmSync,
|
|
9
|
+
validateSelectedVmLocal,
|
|
10
|
+
} from '~/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter'
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
validateVlanIdConnectionSettingsLocal,
|
|
14
|
+
validateNetworkConnectionSettingsLocal,
|
|
15
|
+
checkConnectionSettingsSync,
|
|
16
|
+
checkNetworkAsync,
|
|
17
|
+
checkSelectedVmSync,
|
|
18
|
+
validateSelectedVmLocal,
|
|
19
|
+
}
|