bfg-common 1.4.662 → 1.4.663
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/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/modal/bySteps/BySteps.vue +253 -253
- package/components/atoms/stack/StackBlock.vue +185 -185
- package/components/atoms/table/dataGrid/DataGrid.vue +1696 -1696
- package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +222 -222
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +91 -91
- package/components/common/browse/BrowseNew.vue +237 -237
- package/components/common/browse/BrowseOld.vue +217 -217
- package/components/common/browse/blocks/contents/Files.vue +37 -37
- package/components/common/browse/blocks/contents/FilesOld.vue +72 -72
- package/components/common/browse/blocks/contents/filesNew/FilesNew.vue +96 -96
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- package/components/common/context/lib/models/interfaces.ts +30 -30
- package/components/common/context/recursion/Recursion.vue +86 -86
- package/components/common/context/recursion/RecursionNew.vue +199 -199
- package/components/common/context/recursion/RecursionOld.vue +213 -213
- 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/MigrateVmkernelAdapter.vue +537 -537
- 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/layout/theHeader/helpMenu/About.vue +85 -85
- package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +105 -105
- package/components/common/mainNavigationPanel/MainNavigationPanel.vue +152 -152
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +206 -206
- package/components/common/modals/unsavedChanges/UnsavedChanges.vue +56 -56
- package/components/common/select/button/ButtonDropdown.vue +108 -108
- package/components/common/spiceConsole/Drawer.vue +370 -370
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/split/vertical/Vertical.vue +160 -160
- package/components/common/vm/actions/add/Add.vue +617 -617
- package/components/common/vm/actions/clone/lib/config/steps.ts +129 -129
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +267 -267
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +269 -269
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +219 -219
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusNew.vue +118 -118
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +161 -161
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +165 -165
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +55 -55
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +338 -338
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +147 -147
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +1 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIopsNew.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIopsOld.vue +3 -0
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/ModeOld.vue +55 -55
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +44 -44
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +281 -281
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +124 -124
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/LocationOld.vue +134 -134
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/New.vue +63 -63
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +95 -95
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressNew.vue +69 -69
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressOld.vue +83 -83
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +85 -85
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +91 -91
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +35 -35
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoNew.vue +48 -48
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +46 -46
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +56 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +107 -107
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +115 -115
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemoryNew.vue +54 -54
- package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +102 -102
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +75 -75
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +26 -26
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +57 -57
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/FirmwareNew.vue +42 -42
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/MenuNew.vue +25 -25
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +171 -171
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +50 -50
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +141 -141
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -140
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharingNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapNew.vue +39 -39
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +102 -102
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordOld.vue +94 -94
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +38 -38
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
- package/components/common/vm/actions/common/select/storage/Storage.vue +130 -130
- package/components/common/vm/actions/common/select/storage/StorageOld.vue +129 -129
- package/components/common/vm/actions/editSettings/EditSettings.vue +232 -232
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +183 -183
- package/components/common/vm/actions/editSettings/new/New.vue +177 -177
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/components/common/wizards/network/add/Add.vue +1056 -1056
- package/components/common/wizards/network/add/lib/config/steps.ts +497 -497
- package/components/common/wizards/network/add/steps/ReadyComplete.vue +20 -20
- package/components/common/wizards/network/add/steps/SelectedTargetDevice.vue +467 -467
- package/composables/productNameLocal.ts +30 -30
- package/composables/useLocalStorage.ts +1 -1
- package/package.json +1 -1
- package/plugins/date.ts +233 -233
- package/plugins/recursion.ts +311 -311
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +383 -383
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/store/tasks/mappers/recentTasks.ts +64 -64
|
@@ -1,1056 +1,1056 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<atoms-wizard
|
|
3
|
-
v-model:show="props.show"
|
|
4
|
-
:wizard="wizard"
|
|
5
|
-
:selected-scheme="selectedScheme"
|
|
6
|
-
:title="title"
|
|
7
|
-
max-height="551px"
|
|
8
|
-
:localization="localization"
|
|
9
|
-
:class="[
|
|
10
|
-
'add-networking-wizard',
|
|
11
|
-
{
|
|
12
|
-
'is-dark': props.isDarkMode,
|
|
13
|
-
},
|
|
14
|
-
]"
|
|
15
|
-
test-id="add-networking-wizard"
|
|
16
|
-
@change-steps="onChangeSteps"
|
|
17
|
-
@hide="onHideAddNetworkingModal"
|
|
18
|
-
@submit="onSubmit"
|
|
19
|
-
>
|
|
20
|
-
<template #modalBody="{ selectedStep }">
|
|
21
|
-
<common-wizards-network-add-steps-select-connection-type
|
|
22
|
-
v-if="selectedStep.id === 0"
|
|
23
|
-
v-model="connectionTypeLocal"
|
|
24
|
-
/>
|
|
25
|
-
<common-wizards-network-add-steps-selected-target-device
|
|
26
|
-
v-if="selectedStep.id === 1"
|
|
27
|
-
:wizard="wizard"
|
|
28
|
-
:target-device="targetDevice"
|
|
29
|
-
:connection-type="connectionTypeLocal"
|
|
30
|
-
:standard-switches-initial="props.standardSwitchesInitial"
|
|
31
|
-
:messages-fields="selectedStep.fields"
|
|
32
|
-
:alert-messages="alertMessages[1]"
|
|
33
|
-
:selected-standard-switch-id="props.selectedStandardSwitchId"
|
|
34
|
-
:selected-switch-id="props.selectedSwitchId"
|
|
35
|
-
@hide-alert="onHideAlert"
|
|
36
|
-
@change-target-device="onChangeTargetDevice"
|
|
37
|
-
/>
|
|
38
|
-
<common-wizards-network-add-steps-create-standard-switch
|
|
39
|
-
v-if="selectedStep.id === 2 || selectedStep.id === 6"
|
|
40
|
-
:free-adapters="props.freeAdapters"
|
|
41
|
-
:added-adapters="addedAdapters"
|
|
42
|
-
:core-adapters="coreAdapters"
|
|
43
|
-
:adapter-status="adapterStatus"
|
|
44
|
-
:adapters="props.adapters"
|
|
45
|
-
:is-show-no-connected-active-adapters-modal="
|
|
46
|
-
isShowNoConnectedActiveAdaptersModal
|
|
47
|
-
"
|
|
48
|
-
:is-show-no-active-adapters-modal="isShowNoActiveAdaptersModal"
|
|
49
|
-
:is-dark-mode="props.isDarkMode"
|
|
50
|
-
@get-free-adapters="onGetFreeAdapters"
|
|
51
|
-
@change-added-adapters="onChangeAddedAdapters"
|
|
52
|
-
@change-adapter-status="onChangeAdapterStatus"
|
|
53
|
-
@confirm-no-active-adapters-modal="onConfirmNoActiveAdaptersModal"
|
|
54
|
-
@hide-no-connected-active-adapters-modal="
|
|
55
|
-
onHideNoConnectedActiveAdaptersModal
|
|
56
|
-
"
|
|
57
|
-
@hide-no-active-adapters-modal="onHideNoActiveAdaptersModal"
|
|
58
|
-
/>
|
|
59
|
-
<common-wizards-network-add-steps-port-properties
|
|
60
|
-
v-if="selectedStep.id === 3"
|
|
61
|
-
:wizard="wizard"
|
|
62
|
-
:port-properties="portProperties"
|
|
63
|
-
:mtu-from-switch="mtuFromSwitch"
|
|
64
|
-
:project="props.project"
|
|
65
|
-
:messages-fields="selectedStep.fields"
|
|
66
|
-
:alert-messages="alertMessages[3]"
|
|
67
|
-
:tcp-stacks="props.tcpStacks"
|
|
68
|
-
@change-gateway-flag="onChangeGatewayFlag"
|
|
69
|
-
@change-port-properties="onChangePortProperties"
|
|
70
|
-
@hide-alert="onHideAlert"
|
|
71
|
-
/>
|
|
72
|
-
<common-wizards-network-add-steps-ip-four-settings
|
|
73
|
-
v-if="selectedStep.id === 4"
|
|
74
|
-
:wizard="wizard"
|
|
75
|
-
:ip-four-settings="ipFourSettings"
|
|
76
|
-
:messages-fields="selectedStep.fields"
|
|
77
|
-
:alert-messages="alertMessages[4]"
|
|
78
|
-
:tcp-stacks="props.tcpStacks"
|
|
79
|
-
:tcp="portProperties.tcp"
|
|
80
|
-
:gateway-flag="gatewayFlag"
|
|
81
|
-
@change-gateway-flag="onChangeGatewayFlag"
|
|
82
|
-
@change-ip-four-settings="onChangeIpFourSettings"
|
|
83
|
-
@hide-alert="onHideAlert"
|
|
84
|
-
/>
|
|
85
|
-
<common-wizards-network-add-steps-connection-settings
|
|
86
|
-
v-if="selectedStep.id === 5"
|
|
87
|
-
:wizard="wizard"
|
|
88
|
-
:connection-settings="connectionSettings"
|
|
89
|
-
:messages-fields="selectedStep.fields"
|
|
90
|
-
:alert-messages="alertMessages[5]"
|
|
91
|
-
@change-connection-settings="onChangeConnectionSettings"
|
|
92
|
-
@hide-alert="onHideAlert"
|
|
93
|
-
/>
|
|
94
|
-
<!-- <common-wizards-network-add-steps-physical-adapter-->
|
|
95
|
-
<!-- v-if="selectedStep.id === 6"-->
|
|
96
|
-
<!-- />-->
|
|
97
|
-
<common-wizards-network-add-steps-ready-complete
|
|
98
|
-
v-if="selectedStep.id === 7"
|
|
99
|
-
:ready-complete-fields="readyCompleteFields"
|
|
100
|
-
/>
|
|
101
|
-
</template>
|
|
102
|
-
</atoms-wizard>
|
|
103
|
-
</template>
|
|
104
|
-
|
|
105
|
-
<script setup lang="ts">
|
|
106
|
-
import {
|
|
107
|
-
UI_I_ArbitraryObject,
|
|
108
|
-
UI_I_Localization,
|
|
109
|
-
UI_I_ItemsWithTotalCounts,
|
|
110
|
-
} from '~/lib/models/interfaces'
|
|
111
|
-
import type { UI_T_Project } from '~/lib/models/types'
|
|
112
|
-
import {
|
|
113
|
-
UI_I_PortProperties,
|
|
114
|
-
UI_I_IpFourSettings,
|
|
115
|
-
UI_I_ConnectionSettings,
|
|
116
|
-
UI_I_TargetDevice,
|
|
117
|
-
UI_I_Switch,
|
|
118
|
-
UI_I_ReadyCompleteFields,
|
|
119
|
-
UI_I_AddNetworkingSecondOrThirdSchemeDataSend,
|
|
120
|
-
UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
|
|
121
|
-
UI_I_AddNetworkingFourthOrFifthSchemeDataSend,
|
|
122
|
-
UI_I_AddNetworkingEmits,
|
|
123
|
-
UI_I_TCPStack,
|
|
124
|
-
} from '~/components/common/wizards/network/add/lib/models/interfaces'
|
|
125
|
-
import {
|
|
126
|
-
UI_I_Adapter,
|
|
127
|
-
UI_I_AdapterStatus,
|
|
128
|
-
UI_I_SwitchAdapterItem,
|
|
129
|
-
UI_I_DiagramData,
|
|
130
|
-
API_UI_I_SwitchItem,
|
|
131
|
-
UI_I_AvailableAdapters,
|
|
132
|
-
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
133
|
-
import { getAvailableAdapters } from '~/components/common/diagramMain/lib/utils/utils'
|
|
134
|
-
import {
|
|
135
|
-
UI_I_ValidationReturn,
|
|
136
|
-
UI_I_WizardStep,
|
|
137
|
-
UI_I_WizardStepNavigation,
|
|
138
|
-
} from '~/components/atoms/wizard/lib/models/interfaces'
|
|
139
|
-
import { UI_E_ValidationFields } from '~/components/common/wizards/network/add/lib/models/enums'
|
|
140
|
-
import { getVlanId } from '~/components/common/wizards/network/add/lib/utils/utils'
|
|
141
|
-
import Wizard from '~/components/atoms/wizard/lib/utils/utils'
|
|
142
|
-
import {
|
|
143
|
-
createZeroSchemeReadyCompleteFunc,
|
|
144
|
-
createFirstSchemeReadyCompleteFunc,
|
|
145
|
-
createSecondSchemeReadyCompleteFunc,
|
|
146
|
-
createThirdSchemeReadyCompleteFunc,
|
|
147
|
-
createFourthSchemeReadyCompleteFunc,
|
|
148
|
-
createFifthSchemeReadyCompleteFunc,
|
|
149
|
-
stepsSchemeInitial,
|
|
150
|
-
stepsFunc,
|
|
151
|
-
connectionSettingsInitial,
|
|
152
|
-
portPropertiesInitial,
|
|
153
|
-
ipFourSettingsInitial,
|
|
154
|
-
targetDeviceInitial,
|
|
155
|
-
addNetworkingZeroOrFirstSchemeDataFunc,
|
|
156
|
-
addNetworkingSecondOrThirdSchemeDataFunc,
|
|
157
|
-
addNetworkingFourthOrFifthSchemeDataFunc,
|
|
158
|
-
} from '~/components/common/wizards/network/add/lib/config/config'
|
|
159
|
-
import {
|
|
160
|
-
checkTargetDeviceSync,
|
|
161
|
-
checkAdaptersSync,
|
|
162
|
-
checkPortPropertiesSync,
|
|
163
|
-
checkIpFourSettingsSync,
|
|
164
|
-
checkConnectionSettingsSync,
|
|
165
|
-
checkNetworkAsync,
|
|
166
|
-
} from '~/components/common/wizards/network/add/validations/validations'
|
|
167
|
-
|
|
168
|
-
const props = withDefaults(
|
|
169
|
-
defineProps<{
|
|
170
|
-
show: boolean
|
|
171
|
-
adapters: UI_I_ItemsWithTotalCounts<UI_I_SwitchAdapterItem>
|
|
172
|
-
standardSwitchesInitial?: UI_I_Switch[]
|
|
173
|
-
freeAdapters?: UI_I_Adapter[]
|
|
174
|
-
project?: UI_T_Project
|
|
175
|
-
isDarkMode?: boolean
|
|
176
|
-
selectedStandardSwitchId?: string
|
|
177
|
-
selectedSwitchId?: string
|
|
178
|
-
tcpStacks?: UI_I_TCPStack[]
|
|
179
|
-
diagramsData?: UI_I_DiagramData[]
|
|
180
|
-
isNetworkingLoading?: boolean
|
|
181
|
-
}>(),
|
|
182
|
-
{
|
|
183
|
-
standardSwitchesInitial: () => [],
|
|
184
|
-
freeAdapters: () => [],
|
|
185
|
-
project: 'procurator',
|
|
186
|
-
isDarkMode: false,
|
|
187
|
-
selectedStandardSwitchId: '',
|
|
188
|
-
selectedSwitchId: '',
|
|
189
|
-
tcpStacks: () => [],
|
|
190
|
-
diagramsData: [],
|
|
191
|
-
isNetworkingLoading: false,
|
|
192
|
-
}
|
|
193
|
-
)
|
|
194
|
-
|
|
195
|
-
const emits = defineEmits<UI_I_AddNetworkingEmits>()
|
|
196
|
-
|
|
197
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
198
|
-
|
|
199
|
-
const hostname = ref<string>('')
|
|
200
|
-
const title = computed<string>(
|
|
201
|
-
() => `${hostname.value} - ${localization.value.common.addNetworking}`
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
const wizard: Wizard = new Wizard(
|
|
205
|
-
stepsFunc(localization.value),
|
|
206
|
-
stepsSchemeInitial
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
210
|
-
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
211
|
-
|
|
212
|
-
const readyCompleteFields = ref<UI_I_ReadyCompleteFields[]>([])
|
|
213
|
-
|
|
214
|
-
// Step's content data (connectionType)
|
|
215
|
-
const connectionType = ref<string>('0')
|
|
216
|
-
|
|
217
|
-
const connectionTypeLocal = computed<string>({
|
|
218
|
-
get() {
|
|
219
|
-
return connectionType.value
|
|
220
|
-
},
|
|
221
|
-
set(newValue: string) {
|
|
222
|
-
wizard.resetAfterSelected()
|
|
223
|
-
connectionType.value = newValue
|
|
224
|
-
targetDevice.value.standardSwitch = props.selectedStandardSwitchId
|
|
225
|
-
targetDevice.value.switch = props.selectedSwitchId
|
|
226
|
-
},
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
// Step's content data (createStandardSwitch)
|
|
230
|
-
const addedAdapters = ref<string[]>([])
|
|
231
|
-
const coreAdapters = ref<string[]>([])
|
|
232
|
-
|
|
233
|
-
const onChangeAddedAdapters = (addedAdaptersNew: string[]): void => {
|
|
234
|
-
addedAdapters.value = addedAdaptersNew
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const adapterStatus = ref<UI_I_AdapterStatus>({
|
|
238
|
-
active: [],
|
|
239
|
-
standby: [],
|
|
240
|
-
unused: [],
|
|
241
|
-
})
|
|
242
|
-
const onChangeAdapterStatus = (adapterStatusNew: UI_I_AdapterStatus): void => {
|
|
243
|
-
adapterStatus.value = adapterStatusNew
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// Step's content data and changers (targetDevice)
|
|
247
|
-
const targetDevice = ref<UI_I_TargetDevice>(useDeepCopy(targetDeviceInitial))
|
|
248
|
-
const mtuFromSwitch = ref<number>(1500)
|
|
249
|
-
|
|
250
|
-
const onChangeTargetDevice = (newTargetDevice: UI_I_TargetDevice): void => {
|
|
251
|
-
const oldTargetDeviceSelected = useDeepCopy(targetDevice.value).selected
|
|
252
|
-
const newTargetDeviceSelected = newTargetDevice.selected
|
|
253
|
-
|
|
254
|
-
if (oldTargetDeviceSelected !== newTargetDeviceSelected) {
|
|
255
|
-
wizard.resetAfterSelected()
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
const selectedSwitch = props.standardSwitchesInitial.find(
|
|
259
|
-
(currentSwitch: UI_I_Switch) =>
|
|
260
|
-
newTargetDevice.standardSwitch === currentSwitch.name
|
|
261
|
-
)
|
|
262
|
-
|
|
263
|
-
if (newTargetDeviceSelected === '1' && selectedSwitch) {
|
|
264
|
-
mtuFromSwitch.value = selectedSwitch?.mtu || 1500
|
|
265
|
-
}
|
|
266
|
-
if (newTargetDeviceSelected === '3') {
|
|
267
|
-
mtuFromSwitch.value = newTargetDevice.mtu || 1500
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
targetDevice.value = useDeepCopy(newTargetDevice)
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// Step's content data and changers (portProperties)
|
|
274
|
-
const portProperties = ref<UI_I_PortProperties>(
|
|
275
|
-
useDeepCopy(portPropertiesInitial)
|
|
276
|
-
)
|
|
277
|
-
const onChangePortProperties = (newFields: UI_I_PortProperties): void => {
|
|
278
|
-
if (portProperties.value.tcp !== newFields.tcp) {
|
|
279
|
-
ipFourSettings.value.static.defaultGateway.value =
|
|
280
|
-
props.tcpStacks?.find((tcp: UI_I_TCPStack) => tcp.id === newFields.tcp)
|
|
281
|
-
.gateway || ''
|
|
282
|
-
}
|
|
283
|
-
portProperties.value = newFields
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// Step's content data and changers (ipFourSettings)
|
|
287
|
-
const ipFourSettings = ref<UI_I_IpFourSettings>(ipFourSettingsInitial)
|
|
288
|
-
const onChangeIpFourSettings = (newFields: UI_I_IpFourSettings): void => {
|
|
289
|
-
ipFourSettings.value = newFields
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
const gatewayFlag = ref<boolean>(false)
|
|
293
|
-
const onChangeGatewayFlag = (newValue: boolean) => {
|
|
294
|
-
gatewayFlag.value = newValue
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// Step's content data and changers (connectionSettings)
|
|
298
|
-
const connectionSettings = ref<UI_I_ConnectionSettings>(
|
|
299
|
-
connectionSettingsInitial
|
|
300
|
-
)
|
|
301
|
-
const onChangeConnectionSettings = (
|
|
302
|
-
newFields: UI_I_ConnectionSettings
|
|
303
|
-
): void => {
|
|
304
|
-
connectionSettings.value = newFields
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
const onHideAlert = (stepId: number): void => {
|
|
308
|
-
wizard.hideAlertMessagesByStepId(stepId)
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
let flagSwitch = ''
|
|
312
|
-
|
|
313
|
-
// Choosing Scheme
|
|
314
|
-
watch(
|
|
315
|
-
[connectionTypeLocal, targetDevice],
|
|
316
|
-
(
|
|
317
|
-
newValues: [string, UI_I_TargetDevice],
|
|
318
|
-
oldValues: [string, UI_I_TargetDevice]
|
|
319
|
-
) => {
|
|
320
|
-
const newCT = newValues[0] // -> newConnectionType
|
|
321
|
-
const oldCT = oldValues[0] // -> oldConnectionType
|
|
322
|
-
const newTD = newValues[1] // -> newTargetDevice
|
|
323
|
-
const oldTD = oldValues[1] // -> oldTargetDevice
|
|
324
|
-
if (!oldTD || oldTD.selected !== newTD.selected) {
|
|
325
|
-
flagSwitch = ''
|
|
326
|
-
addedAdapters.value = []
|
|
327
|
-
adapterStatus.value = {
|
|
328
|
-
active: [],
|
|
329
|
-
standby: [],
|
|
330
|
-
unused: [],
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
if (newCT !== oldCT) {
|
|
334
|
-
newCT === '0' && props.selectedStandardSwitchId
|
|
335
|
-
? (targetDevice.value.selected = '1')
|
|
336
|
-
: (targetDevice.value.selected = '0')
|
|
337
|
-
newCT === '1' && (targetDevice.value.selected = '1')
|
|
338
|
-
newCT === '2' && (targetDevice.value.selected = '2')
|
|
339
|
-
}
|
|
340
|
-
if (newCT === '0') {
|
|
341
|
-
;(newTD.selected === '0' || newTD.selected === '1') &&
|
|
342
|
-
wizard.changeScheme(0)
|
|
343
|
-
newTD.selected === '3' && wizard.changeScheme(1)
|
|
344
|
-
}
|
|
345
|
-
if (newCT === '1') {
|
|
346
|
-
newTD.selected === '1' && wizard.changeScheme(2)
|
|
347
|
-
newTD.selected === '3' && wizard.changeScheme(3)
|
|
348
|
-
}
|
|
349
|
-
if (newCT === '2') {
|
|
350
|
-
newTD.selected === '2' && wizard.changeScheme(4)
|
|
351
|
-
newTD.selected === '3' && wizard.changeScheme(5)
|
|
352
|
-
}
|
|
353
|
-
},
|
|
354
|
-
{ deep: true, immediate: true }
|
|
355
|
-
)
|
|
356
|
-
|
|
357
|
-
const onGetExistingStandardSwitches = (): void => {
|
|
358
|
-
emits('get-existing-standard-switches')
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
const onGetTcpStacks = (): void => {
|
|
362
|
-
emits('get-tcp-stacks')
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
watch(
|
|
366
|
-
() => wizard.selectedStepId,
|
|
367
|
-
(newSelectedStep: number) => {
|
|
368
|
-
if (newSelectedStep === 1) {
|
|
369
|
-
onGetExistingStandardSwitches()
|
|
370
|
-
}
|
|
371
|
-
if (newSelectedStep === 3) {
|
|
372
|
-
onGetTcpStacks()
|
|
373
|
-
}
|
|
374
|
-
if (newSelectedStep === 6 && flagSwitch !== targetDevice.value.switch) {
|
|
375
|
-
const nics: UI_I_AdapterStatus = props.standardSwitchesInitial.find(
|
|
376
|
-
(currentSwitch: UI_I_Switch) =>
|
|
377
|
-
currentSwitch.id === targetDevice.value.switch
|
|
378
|
-
).nics
|
|
379
|
-
|
|
380
|
-
const availableAdapters: UI_I_AvailableAdapters = getAvailableAdapters(
|
|
381
|
-
props.adapters,
|
|
382
|
-
nics
|
|
383
|
-
)
|
|
384
|
-
|
|
385
|
-
adapterStatus.value = {
|
|
386
|
-
active: availableAdapters.activeAdapters || [],
|
|
387
|
-
standby: availableAdapters.standbyAdapters || [],
|
|
388
|
-
unused: availableAdapters.unusedAdapters || [],
|
|
389
|
-
}
|
|
390
|
-
coreAdapters.value = [
|
|
391
|
-
...adapterStatus.value.active,
|
|
392
|
-
...adapterStatus.value.standby,
|
|
393
|
-
...adapterStatus.value.unused,
|
|
394
|
-
]
|
|
395
|
-
flagSwitch = targetDevice.value.switch
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
if (newSelectedStep !== 7) return // If last step
|
|
399
|
-
if (wizard.isSelectedScheme(0)) {
|
|
400
|
-
readyCompleteFields.value = createZeroSchemeReadyCompleteFunc(
|
|
401
|
-
targetDevice.value,
|
|
402
|
-
portProperties.value,
|
|
403
|
-
ipFourSettings.value,
|
|
404
|
-
localization.value
|
|
405
|
-
)
|
|
406
|
-
return
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (wizard.isSelectedScheme(1)) {
|
|
410
|
-
readyCompleteFields.value = createFirstSchemeReadyCompleteFunc(
|
|
411
|
-
targetDevice.value,
|
|
412
|
-
portProperties.value,
|
|
413
|
-
ipFourSettings.value,
|
|
414
|
-
addedAdapters.value,
|
|
415
|
-
localization.value
|
|
416
|
-
)
|
|
417
|
-
return
|
|
418
|
-
}
|
|
419
|
-
if (wizard.isSelectedScheme(2)) {
|
|
420
|
-
readyCompleteFields.value = createSecondSchemeReadyCompleteFunc(
|
|
421
|
-
connectionSettings.value,
|
|
422
|
-
targetDevice.value,
|
|
423
|
-
localization.value
|
|
424
|
-
)
|
|
425
|
-
return
|
|
426
|
-
}
|
|
427
|
-
if (wizard.isSelectedScheme(3)) {
|
|
428
|
-
readyCompleteFields.value = createThirdSchemeReadyCompleteFunc(
|
|
429
|
-
connectionSettings.value,
|
|
430
|
-
targetDevice.value,
|
|
431
|
-
addedAdapters.value,
|
|
432
|
-
localization.value
|
|
433
|
-
)
|
|
434
|
-
return
|
|
435
|
-
}
|
|
436
|
-
if (wizard.isSelectedScheme(4)) {
|
|
437
|
-
readyCompleteFields.value = createFourthSchemeReadyCompleteFunc(
|
|
438
|
-
targetDevice.value.switch,
|
|
439
|
-
props.diagramsData,
|
|
440
|
-
adapterStatus.value,
|
|
441
|
-
localization.value
|
|
442
|
-
)
|
|
443
|
-
return
|
|
444
|
-
}
|
|
445
|
-
if (wizard.isSelectedScheme(5)) {
|
|
446
|
-
readyCompleteFields.value = createFifthSchemeReadyCompleteFunc(
|
|
447
|
-
targetDevice.value,
|
|
448
|
-
adapterStatus.value,
|
|
449
|
-
localization.value
|
|
450
|
-
)
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
)
|
|
454
|
-
|
|
455
|
-
// Reset data
|
|
456
|
-
const reset = (): void => {
|
|
457
|
-
wizard.reset()
|
|
458
|
-
connectionTypeLocal.value = '0'
|
|
459
|
-
targetDevice.value = useDeepCopy(targetDeviceInitial)
|
|
460
|
-
connectionSettings.value = useDeepCopy(connectionSettingsInitial)
|
|
461
|
-
portProperties.value = useDeepCopy(portPropertiesInitial)
|
|
462
|
-
ipFourSettings.value = useDeepCopy(ipFourSettingsInitial)
|
|
463
|
-
coreAdapters.value = []
|
|
464
|
-
addedAdapters.value = []
|
|
465
|
-
adapterStatus.value = {
|
|
466
|
-
active: [],
|
|
467
|
-
standby: [],
|
|
468
|
-
unused: [],
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
const isShowNoConnectedActiveAdaptersModal = ref(false)
|
|
473
|
-
const isShowNoActiveAdaptersModal = ref(false)
|
|
474
|
-
|
|
475
|
-
const showNoConnectedActiveAdaptersModal = (): void => {
|
|
476
|
-
isShowNoConnectedActiveAdaptersModal.value = true
|
|
477
|
-
}
|
|
478
|
-
const onHideNoConnectedActiveAdaptersModal = (): void => {
|
|
479
|
-
isShowNoConnectedActiveAdaptersModal.value = false
|
|
480
|
-
}
|
|
481
|
-
const showNoActiveAdaptersModal = (): void => {
|
|
482
|
-
isShowNoActiveAdaptersModal.value = true
|
|
483
|
-
}
|
|
484
|
-
const onHideNoActiveAdaptersModal = (): void => {
|
|
485
|
-
isShowNoActiveAdaptersModal.value = false
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
const onConfirmNoActiveAdaptersModal = (): void => {
|
|
489
|
-
onHideNoConnectedActiveAdaptersModal()
|
|
490
|
-
onHideNoActiveAdaptersModal()
|
|
491
|
-
if (wizard.waitingStepId === 7) {
|
|
492
|
-
wizard.changeSteps(
|
|
493
|
-
wizard.selectedStepData(
|
|
494
|
-
wizard.stepsInSelectedSchemeWithStatus.value.find(
|
|
495
|
-
(step: UI_I_WizardStepNavigation) => step.id === 7
|
|
496
|
-
)
|
|
497
|
-
),
|
|
498
|
-
validationFunc,
|
|
499
|
-
finalValidationFunc,
|
|
500
|
-
true
|
|
501
|
-
)
|
|
502
|
-
wizard.waitingStepId = -1
|
|
503
|
-
return
|
|
504
|
-
}
|
|
505
|
-
wizard.selectStepHard(wizard.waitingStepId)
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
const onGetFreeAdapters = (showModal: () => void): void => {
|
|
509
|
-
emits('get-free-adapters', showModal)
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
const checkFinal = async (): Promise<UI_I_ArbitraryObject<string>> => {
|
|
513
|
-
let data:
|
|
514
|
-
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
515
|
-
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend
|
|
516
|
-
| UI_I_AddNetworkingFourthOrFifthSchemeDataSend
|
|
517
|
-
| API_UI_I_SwitchItem
|
|
518
|
-
| null = null
|
|
519
|
-
|
|
520
|
-
let type: 'network' | 'vmkernel' | 'adapter' | 'new-switch'
|
|
521
|
-
|
|
522
|
-
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
523
|
-
const vlan = getVlanId(portProperties.value.vlanId)
|
|
524
|
-
|
|
525
|
-
data = addNetworkingZeroOrFirstSchemeDataFunc(
|
|
526
|
-
targetDevice.value,
|
|
527
|
-
Number(vlan),
|
|
528
|
-
portProperties.value,
|
|
529
|
-
ipFourSettings.value,
|
|
530
|
-
wizard.isSelectedScheme(1),
|
|
531
|
-
adapterStatus.value
|
|
532
|
-
)
|
|
533
|
-
|
|
534
|
-
type = 'vmkernel'
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
538
|
-
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
539
|
-
|
|
540
|
-
data = addNetworkingSecondOrThirdSchemeDataFunc(
|
|
541
|
-
connectionSettings.value,
|
|
542
|
-
targetDevice.value,
|
|
543
|
-
Number(vlan),
|
|
544
|
-
wizard.isSelectedScheme(2),
|
|
545
|
-
adapterStatus.value
|
|
546
|
-
)
|
|
547
|
-
|
|
548
|
-
type = 'network'
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
552
|
-
data = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
553
|
-
targetDevice.value.switch,
|
|
554
|
-
wizard.isSelectedScheme(4),
|
|
555
|
-
adapterStatus.value,
|
|
556
|
-
props.diagramsData,
|
|
557
|
-
targetDevice.value.mtu
|
|
558
|
-
)
|
|
559
|
-
|
|
560
|
-
type = wizard.isSelectedScheme(4) ? 'adapter' : 'new-switch'
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
return new Promise((resolve, _reject) =>
|
|
564
|
-
emits(
|
|
565
|
-
'add-networking-data-validate',
|
|
566
|
-
data,
|
|
567
|
-
type,
|
|
568
|
-
(err_arg: UI_I_ArbitraryObject<string>): void => {
|
|
569
|
-
resolve(err_arg)
|
|
570
|
-
}
|
|
571
|
-
)
|
|
572
|
-
)
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
const finalValidationFunc = async (
|
|
576
|
-
value: UI_I_WizardStep[]
|
|
577
|
-
): Promise<UI_I_ValidationReturn> => {
|
|
578
|
-
let stepHasError = false
|
|
579
|
-
|
|
580
|
-
const validationFields: {
|
|
581
|
-
[key: string]: string
|
|
582
|
-
} = await checkFinal()
|
|
583
|
-
|
|
584
|
-
for (const fieldName in validationFields) {
|
|
585
|
-
const stepId = wizard.getStepIdByFieldName(fieldName)
|
|
586
|
-
|
|
587
|
-
if (stepId !== -1) {
|
|
588
|
-
stepHasError = wizard.setValidation(stepId, fieldName, {
|
|
589
|
-
fieldMessage: validationFields[fieldName],
|
|
590
|
-
alertMessage: validationFields[fieldName],
|
|
591
|
-
})
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
return {
|
|
596
|
-
stepHasError,
|
|
597
|
-
newValue: value,
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
const validationFunc = async (
|
|
602
|
-
value: UI_I_WizardStep[],
|
|
603
|
-
currentStep: UI_I_WizardStep,
|
|
604
|
-
nextStep: UI_I_WizardStep
|
|
605
|
-
): Promise<UI_I_ValidationReturn> => {
|
|
606
|
-
let stepHasError = false
|
|
607
|
-
let stepShouldStop = {
|
|
608
|
-
ifOnCurrentStep: false,
|
|
609
|
-
ifFromAnyStep: false,
|
|
610
|
-
stoppageStepId: -1,
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
|
|
614
|
-
const targetDeviceValidation = checkTargetDeviceSync(
|
|
615
|
-
localization.value,
|
|
616
|
-
targetDevice.value,
|
|
617
|
-
wizard,
|
|
618
|
-
value
|
|
619
|
-
)
|
|
620
|
-
|
|
621
|
-
value = targetDeviceValidation.newValue
|
|
622
|
-
|
|
623
|
-
stepHasError = stepHasError || targetDeviceValidation.stepHasError
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
|
|
627
|
-
wizard.waitingStepId = nextStep.id
|
|
628
|
-
|
|
629
|
-
const adapterValidation = checkAdaptersSync(
|
|
630
|
-
localization.value,
|
|
631
|
-
adapterStatus.value,
|
|
632
|
-
value,
|
|
633
|
-
currentStep.id,
|
|
634
|
-
nextStep.id,
|
|
635
|
-
props.freeAdapters,
|
|
636
|
-
showNoActiveAdaptersModal,
|
|
637
|
-
showNoConnectedActiveAdaptersModal,
|
|
638
|
-
2
|
|
639
|
-
)
|
|
640
|
-
|
|
641
|
-
value = adapterValidation.newValue
|
|
642
|
-
|
|
643
|
-
stepShouldStop = adapterValidation.stepShouldStop || stepShouldStop
|
|
644
|
-
|
|
645
|
-
stepHasError = stepHasError || adapterValidation.stepHasError
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
if (wizard.isValidateForStep(3, currentStep.id, nextStep.id)) {
|
|
649
|
-
const labelValidation = await checkNetworkAsync(
|
|
650
|
-
value,
|
|
651
|
-
portProperties.value.networkLabel,
|
|
652
|
-
3,
|
|
653
|
-
UI_E_ValidationFields.PORT_PROPERTIES_NETWORK,
|
|
654
|
-
emits,
|
|
655
|
-
localization.value,
|
|
656
|
-
wizard
|
|
657
|
-
)
|
|
658
|
-
|
|
659
|
-
value = labelValidation.newValue
|
|
660
|
-
|
|
661
|
-
const portPropertiesValidation = checkPortPropertiesSync(
|
|
662
|
-
localization.value,
|
|
663
|
-
portProperties.value,
|
|
664
|
-
wizard,
|
|
665
|
-
value
|
|
666
|
-
)
|
|
667
|
-
|
|
668
|
-
value = portPropertiesValidation.newValue
|
|
669
|
-
|
|
670
|
-
stepHasError =
|
|
671
|
-
stepHasError ||
|
|
672
|
-
labelValidation.stepHasError ||
|
|
673
|
-
portPropertiesValidation.stepHasError
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
if (wizard.isValidateForStep(4, currentStep.id, nextStep.id)) {
|
|
677
|
-
const ipValidation = checkIpFourSettingsSync(
|
|
678
|
-
localization.value,
|
|
679
|
-
ipFourSettings.value,
|
|
680
|
-
wizard,
|
|
681
|
-
value
|
|
682
|
-
)
|
|
683
|
-
|
|
684
|
-
value = ipValidation.newValue
|
|
685
|
-
|
|
686
|
-
stepHasError = stepHasError || ipValidation.stepHasError
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
if (wizard.isValidateForStep(5, currentStep.id, nextStep.id)) {
|
|
690
|
-
const labelValidation = await checkNetworkAsync(
|
|
691
|
-
value,
|
|
692
|
-
connectionSettings.value.networkLabel,
|
|
693
|
-
5,
|
|
694
|
-
UI_E_ValidationFields.CONNECTION_SETTINGS_NETWORK,
|
|
695
|
-
emits,
|
|
696
|
-
localization.value,
|
|
697
|
-
wizard
|
|
698
|
-
)
|
|
699
|
-
|
|
700
|
-
value = labelValidation.newValue
|
|
701
|
-
|
|
702
|
-
const connectionSettingsValidation = checkConnectionSettingsSync(
|
|
703
|
-
localization.value,
|
|
704
|
-
connectionSettings.value,
|
|
705
|
-
wizard,
|
|
706
|
-
value
|
|
707
|
-
)
|
|
708
|
-
|
|
709
|
-
value = connectionSettingsValidation.newValue
|
|
710
|
-
|
|
711
|
-
stepHasError =
|
|
712
|
-
stepHasError ||
|
|
713
|
-
labelValidation.stepHasError ||
|
|
714
|
-
connectionSettingsValidation.stepHasError
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
if (wizard.isValidateForStep(6, currentStep.id, nextStep.id)) {
|
|
718
|
-
wizard.waitingStepId = nextStep.id
|
|
719
|
-
|
|
720
|
-
const adapterValidation = checkAdaptersSync(
|
|
721
|
-
localization.value,
|
|
722
|
-
adapterStatus.value,
|
|
723
|
-
value,
|
|
724
|
-
currentStep.id,
|
|
725
|
-
nextStep.id,
|
|
726
|
-
props.adapters.items,
|
|
727
|
-
showNoActiveAdaptersModal,
|
|
728
|
-
showNoConnectedActiveAdaptersModal,
|
|
729
|
-
6
|
|
730
|
-
)
|
|
731
|
-
|
|
732
|
-
value = adapterValidation.newValue
|
|
733
|
-
|
|
734
|
-
stepShouldStop = adapterValidation.stepShouldStop || stepShouldStop
|
|
735
|
-
|
|
736
|
-
stepHasError = stepHasError || adapterValidation.stepHasError
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
return {
|
|
740
|
-
newValue: value,
|
|
741
|
-
stepHasError,
|
|
742
|
-
stepShouldStop,
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
|
|
747
|
-
wizard.changeSteps(value, validationFunc, finalValidationFunc)
|
|
748
|
-
|
|
749
|
-
const onHideAddNetworkingModal = (): void => {
|
|
750
|
-
emits('hide')
|
|
751
|
-
reset()
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
const onSubmit = async (): Promise<void> => {
|
|
755
|
-
let data:
|
|
756
|
-
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
757
|
-
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend
|
|
758
|
-
| UI_I_AddNetworkingFourthOrFifthSchemeDataSend
|
|
759
|
-
| API_UI_I_SwitchItem
|
|
760
|
-
| null = null
|
|
761
|
-
|
|
762
|
-
let type: 'network' | 'vmkernel' | 'adapter' | 'new-switch' = 'network'
|
|
763
|
-
|
|
764
|
-
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
765
|
-
const vlan = getVlanId(portProperties.value.vlanId)
|
|
766
|
-
type = 'vmkernel'
|
|
767
|
-
data = addNetworkingZeroOrFirstSchemeDataFunc(
|
|
768
|
-
targetDevice.value,
|
|
769
|
-
Number(vlan),
|
|
770
|
-
portProperties.value,
|
|
771
|
-
ipFourSettings.value,
|
|
772
|
-
wizard.isSelectedScheme(1),
|
|
773
|
-
adapterStatus.value
|
|
774
|
-
)
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
778
|
-
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
779
|
-
type = 'network'
|
|
780
|
-
data = addNetworkingSecondOrThirdSchemeDataFunc(
|
|
781
|
-
connectionSettings.value,
|
|
782
|
-
targetDevice.value,
|
|
783
|
-
Number(vlan),
|
|
784
|
-
wizard.isSelectedScheme(2),
|
|
785
|
-
adapterStatus.value
|
|
786
|
-
)
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
790
|
-
type = wizard.isSelectedScheme(4) ? 'adapter' : 'new-switch'
|
|
791
|
-
data = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
792
|
-
targetDevice.value.switch,
|
|
793
|
-
wizard.isSelectedScheme(4),
|
|
794
|
-
adapterStatus.value,
|
|
795
|
-
props.diagramsData,
|
|
796
|
-
targetDevice.value.mtu
|
|
797
|
-
)
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
data &&
|
|
801
|
-
emits('send-add-networking-data', data, type, onHideAddNetworkingModal)
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
onMounted(() => {
|
|
805
|
-
hostname.value = location.hostname
|
|
806
|
-
})
|
|
807
|
-
|
|
808
|
-
watch(
|
|
809
|
-
() => props.isNetworkingLoading,
|
|
810
|
-
(newValue: boolean) => {
|
|
811
|
-
wizard.setLoader(newValue)
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
immediate: true,
|
|
815
|
-
}
|
|
816
|
-
)
|
|
817
|
-
|
|
818
|
-
watch(
|
|
819
|
-
props.tcpStacks,
|
|
820
|
-
(newValue: UI_I_TCPStack[]) => {
|
|
821
|
-
portProperties.value.tcp = newValue?.[0]?.id || ''
|
|
822
|
-
ipFourSettings.value.static.defaultGateway.value =
|
|
823
|
-
newValue?.[0]?.gateway || ''
|
|
824
|
-
},
|
|
825
|
-
{ deep: true }
|
|
826
|
-
)
|
|
827
|
-
</script>
|
|
828
|
-
|
|
829
|
-
<style scoped lang="scss">
|
|
830
|
-
:deep(.modal) {
|
|
831
|
-
& > .modal-dialog > .modal-content > .modal-body {
|
|
832
|
-
height: calc(100% - 110px);
|
|
833
|
-
.disabled-on-time {
|
|
834
|
-
opacity: 0.4;
|
|
835
|
-
pointer-events: none;
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
:deep(.disabled-on-time) {
|
|
840
|
-
opacity: 0.4;
|
|
841
|
-
pointer-events: none;
|
|
842
|
-
}
|
|
843
|
-
:deep(.wizard-content-container.add-networking-step) {
|
|
844
|
-
padding: 0px 15px 10px 10px;
|
|
845
|
-
|
|
846
|
-
.danger-not-valid {
|
|
847
|
-
border: 2px solid red;
|
|
848
|
-
border-bottom: 1px solid #db2100;
|
|
849
|
-
}
|
|
850
|
-
.tooltip-field {
|
|
851
|
-
margin-right: 12px;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
.horizontal-flex-container {
|
|
855
|
-
margin-bottom: 5px;
|
|
856
|
-
min-height: 36px;
|
|
857
|
-
display: flex;
|
|
858
|
-
flex-direction: row;
|
|
859
|
-
}
|
|
860
|
-
.property-label-group {
|
|
861
|
-
width: 140px;
|
|
862
|
-
}
|
|
863
|
-
.disabled {
|
|
864
|
-
opacity: 0.4;
|
|
865
|
-
pointer-events: none;
|
|
866
|
-
}
|
|
867
|
-
.wizard-content-port {
|
|
868
|
-
.margin-left-property-value-group {
|
|
869
|
-
margin-left: 10px;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
.property-value-group {
|
|
873
|
-
padding-left: 23px;
|
|
874
|
-
}
|
|
875
|
-
.horizontal-flex-container {
|
|
876
|
-
min-height: 24px;
|
|
877
|
-
margin-bottom: 0;
|
|
878
|
-
}
|
|
879
|
-
.radio {
|
|
880
|
-
min-height: 39px;
|
|
881
|
-
margin: 10px 0;
|
|
882
|
-
}
|
|
883
|
-
.form-block {
|
|
884
|
-
margin: 12px 0 24px 0;
|
|
885
|
-
padding-left: 23px;
|
|
886
|
-
|
|
887
|
-
&.form-block-ipv {
|
|
888
|
-
input[type='text'] {
|
|
889
|
-
width: 143px;
|
|
890
|
-
}
|
|
891
|
-
.horizontal-flex-container > label {
|
|
892
|
-
margin-right: 50px;
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
.edit-vmkernel-adapter-section {
|
|
897
|
-
padding-top: 12px;
|
|
898
|
-
|
|
899
|
-
label {
|
|
900
|
-
input[type='checkbox'] {
|
|
901
|
-
margin-right: 4px;
|
|
902
|
-
transform: translateY(1px);
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
.horizontal-flex-container {
|
|
906
|
-
margin-bottom: 5px;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
.port-properties-network-label {
|
|
910
|
-
width: 280px;
|
|
911
|
-
}
|
|
912
|
-
.port-properties-padding {
|
|
913
|
-
padding-top: 8px;
|
|
914
|
-
}
|
|
915
|
-
.port-properties-mtu-selector {
|
|
916
|
-
margin-right: 12px;
|
|
917
|
-
}
|
|
918
|
-
.port-properties-mtu-container {
|
|
919
|
-
display: flex;
|
|
920
|
-
}
|
|
921
|
-
select {
|
|
922
|
-
height: 24px;
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
.nw-property-value-group {
|
|
926
|
-
display: inline;
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
:deep(.modal-body-content.modal-body-content__confirmation) {
|
|
931
|
-
display: flex;
|
|
932
|
-
.confirm-icon-container {
|
|
933
|
-
margin-right: 20px;
|
|
934
|
-
}
|
|
935
|
-
.preserve-newlines {
|
|
936
|
-
white-space: pre-line;
|
|
937
|
-
font-size: 15px;
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
.add-networking-wizard.is-dark {
|
|
942
|
-
:deep(.wizard-content-container.add-networking-step) {
|
|
943
|
-
.ready-complete-container {
|
|
944
|
-
background-color: var(--pannel-bg-color);
|
|
945
|
-
margin-top: 12px;
|
|
946
|
-
|
|
947
|
-
span {
|
|
948
|
-
color: var(--description-color);
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
.add-networking-radio-button-description {
|
|
953
|
-
color: var(--description-color);
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
.property-label-group {
|
|
957
|
-
color: var(--main-color-mode2);
|
|
958
|
-
}
|
|
959
|
-
.flex-property-label-group {
|
|
960
|
-
color: var(--main-color-mode2);
|
|
961
|
-
}
|
|
962
|
-
.flex-property-value-group {
|
|
963
|
-
select {
|
|
964
|
-
color: #fff;
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
.failover-order-master {
|
|
968
|
-
.secondary-title label {
|
|
969
|
-
color: #fff;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
.k-grid-content {
|
|
973
|
-
background-color: var(--modal-bg-color);
|
|
974
|
-
}
|
|
975
|
-
.vui-action-bar {
|
|
976
|
-
background-color: var(--pannel-bg-color);
|
|
977
|
-
color: var(--title-color);
|
|
978
|
-
padding: 8px 0 3px;
|
|
979
|
-
|
|
980
|
-
.action-link-container:not(.disabled) {
|
|
981
|
-
&:hover {
|
|
982
|
-
background-color: #29414e;
|
|
983
|
-
border: 1px solid #c7e9ff;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
svg {
|
|
988
|
-
fill: #fff;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
.k-grid.k-widget .k-grid-content {
|
|
993
|
-
border-left: 1px solid #485764;
|
|
994
|
-
border-right: 1px solid #485764;
|
|
995
|
-
border-top: 1px solid #ddd;
|
|
996
|
-
border-bottom: 1px solid #ddd;
|
|
997
|
-
|
|
998
|
-
tbody tr {
|
|
999
|
-
background-color: var(--modal-bg-color);
|
|
1000
|
-
|
|
1001
|
-
td {
|
|
1002
|
-
border-bottom: 1px solid #666666;
|
|
1003
|
-
border-color: #666666;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
&:hover {
|
|
1007
|
-
background-color: #324f61;
|
|
1008
|
-
color: var(--title-color);
|
|
1009
|
-
|
|
1010
|
-
td {
|
|
1011
|
-
border-bottom: 1px solid #ffffff;
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
&.k-state-selected {
|
|
1016
|
-
background-color: #d8e3e9;
|
|
1017
|
-
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
|
|
1018
|
-
|
|
1019
|
-
td span {
|
|
1020
|
-
color: #000;
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
.failover-order-details {
|
|
1027
|
-
&.relative-container .absolute-container {
|
|
1028
|
-
background-color: var(--pannel-bg-color);
|
|
1029
|
-
color: var(--main-color-mode2);
|
|
1030
|
-
|
|
1031
|
-
&:has(.no-items-selected-container) {
|
|
1032
|
-
background-color: transparent;
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
td span {
|
|
1037
|
-
color: var(--main-color-mode2);
|
|
1038
|
-
}
|
|
1039
|
-
button span {
|
|
1040
|
-
color: var(--main-color-mode2);
|
|
1041
|
-
|
|
1042
|
-
&:hover:not(.disabled) {
|
|
1043
|
-
background-color: transparent;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
button.active span {
|
|
1047
|
-
color: #fff;
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
.select-adapter-info span {
|
|
1053
|
-
color: var(--main-color-mode2);
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-wizard
|
|
3
|
+
v-model:show="props.show"
|
|
4
|
+
:wizard="wizard"
|
|
5
|
+
:selected-scheme="selectedScheme"
|
|
6
|
+
:title="title"
|
|
7
|
+
max-height="551px"
|
|
8
|
+
:localization="localization"
|
|
9
|
+
:class="[
|
|
10
|
+
'add-networking-wizard',
|
|
11
|
+
{
|
|
12
|
+
'is-dark': props.isDarkMode,
|
|
13
|
+
},
|
|
14
|
+
]"
|
|
15
|
+
test-id="add-networking-wizard"
|
|
16
|
+
@change-steps="onChangeSteps"
|
|
17
|
+
@hide="onHideAddNetworkingModal"
|
|
18
|
+
@submit="onSubmit"
|
|
19
|
+
>
|
|
20
|
+
<template #modalBody="{ selectedStep }">
|
|
21
|
+
<common-wizards-network-add-steps-select-connection-type
|
|
22
|
+
v-if="selectedStep.id === 0"
|
|
23
|
+
v-model="connectionTypeLocal"
|
|
24
|
+
/>
|
|
25
|
+
<common-wizards-network-add-steps-selected-target-device
|
|
26
|
+
v-if="selectedStep.id === 1"
|
|
27
|
+
:wizard="wizard"
|
|
28
|
+
:target-device="targetDevice"
|
|
29
|
+
:connection-type="connectionTypeLocal"
|
|
30
|
+
:standard-switches-initial="props.standardSwitchesInitial"
|
|
31
|
+
:messages-fields="selectedStep.fields"
|
|
32
|
+
:alert-messages="alertMessages[1]"
|
|
33
|
+
:selected-standard-switch-id="props.selectedStandardSwitchId"
|
|
34
|
+
:selected-switch-id="props.selectedSwitchId"
|
|
35
|
+
@hide-alert="onHideAlert"
|
|
36
|
+
@change-target-device="onChangeTargetDevice"
|
|
37
|
+
/>
|
|
38
|
+
<common-wizards-network-add-steps-create-standard-switch
|
|
39
|
+
v-if="selectedStep.id === 2 || selectedStep.id === 6"
|
|
40
|
+
:free-adapters="props.freeAdapters"
|
|
41
|
+
:added-adapters="addedAdapters"
|
|
42
|
+
:core-adapters="coreAdapters"
|
|
43
|
+
:adapter-status="adapterStatus"
|
|
44
|
+
:adapters="props.adapters"
|
|
45
|
+
:is-show-no-connected-active-adapters-modal="
|
|
46
|
+
isShowNoConnectedActiveAdaptersModal
|
|
47
|
+
"
|
|
48
|
+
:is-show-no-active-adapters-modal="isShowNoActiveAdaptersModal"
|
|
49
|
+
:is-dark-mode="props.isDarkMode"
|
|
50
|
+
@get-free-adapters="onGetFreeAdapters"
|
|
51
|
+
@change-added-adapters="onChangeAddedAdapters"
|
|
52
|
+
@change-adapter-status="onChangeAdapterStatus"
|
|
53
|
+
@confirm-no-active-adapters-modal="onConfirmNoActiveAdaptersModal"
|
|
54
|
+
@hide-no-connected-active-adapters-modal="
|
|
55
|
+
onHideNoConnectedActiveAdaptersModal
|
|
56
|
+
"
|
|
57
|
+
@hide-no-active-adapters-modal="onHideNoActiveAdaptersModal"
|
|
58
|
+
/>
|
|
59
|
+
<common-wizards-network-add-steps-port-properties
|
|
60
|
+
v-if="selectedStep.id === 3"
|
|
61
|
+
:wizard="wizard"
|
|
62
|
+
:port-properties="portProperties"
|
|
63
|
+
:mtu-from-switch="mtuFromSwitch"
|
|
64
|
+
:project="props.project"
|
|
65
|
+
:messages-fields="selectedStep.fields"
|
|
66
|
+
:alert-messages="alertMessages[3]"
|
|
67
|
+
:tcp-stacks="props.tcpStacks"
|
|
68
|
+
@change-gateway-flag="onChangeGatewayFlag"
|
|
69
|
+
@change-port-properties="onChangePortProperties"
|
|
70
|
+
@hide-alert="onHideAlert"
|
|
71
|
+
/>
|
|
72
|
+
<common-wizards-network-add-steps-ip-four-settings
|
|
73
|
+
v-if="selectedStep.id === 4"
|
|
74
|
+
:wizard="wizard"
|
|
75
|
+
:ip-four-settings="ipFourSettings"
|
|
76
|
+
:messages-fields="selectedStep.fields"
|
|
77
|
+
:alert-messages="alertMessages[4]"
|
|
78
|
+
:tcp-stacks="props.tcpStacks"
|
|
79
|
+
:tcp="portProperties.tcp"
|
|
80
|
+
:gateway-flag="gatewayFlag"
|
|
81
|
+
@change-gateway-flag="onChangeGatewayFlag"
|
|
82
|
+
@change-ip-four-settings="onChangeIpFourSettings"
|
|
83
|
+
@hide-alert="onHideAlert"
|
|
84
|
+
/>
|
|
85
|
+
<common-wizards-network-add-steps-connection-settings
|
|
86
|
+
v-if="selectedStep.id === 5"
|
|
87
|
+
:wizard="wizard"
|
|
88
|
+
:connection-settings="connectionSettings"
|
|
89
|
+
:messages-fields="selectedStep.fields"
|
|
90
|
+
:alert-messages="alertMessages[5]"
|
|
91
|
+
@change-connection-settings="onChangeConnectionSettings"
|
|
92
|
+
@hide-alert="onHideAlert"
|
|
93
|
+
/>
|
|
94
|
+
<!-- <common-wizards-network-add-steps-physical-adapter-->
|
|
95
|
+
<!-- v-if="selectedStep.id === 6"-->
|
|
96
|
+
<!-- />-->
|
|
97
|
+
<common-wizards-network-add-steps-ready-complete
|
|
98
|
+
v-if="selectedStep.id === 7"
|
|
99
|
+
:ready-complete-fields="readyCompleteFields"
|
|
100
|
+
/>
|
|
101
|
+
</template>
|
|
102
|
+
</atoms-wizard>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<script setup lang="ts">
|
|
106
|
+
import {
|
|
107
|
+
UI_I_ArbitraryObject,
|
|
108
|
+
UI_I_Localization,
|
|
109
|
+
UI_I_ItemsWithTotalCounts,
|
|
110
|
+
} from '~/lib/models/interfaces'
|
|
111
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
112
|
+
import {
|
|
113
|
+
UI_I_PortProperties,
|
|
114
|
+
UI_I_IpFourSettings,
|
|
115
|
+
UI_I_ConnectionSettings,
|
|
116
|
+
UI_I_TargetDevice,
|
|
117
|
+
UI_I_Switch,
|
|
118
|
+
UI_I_ReadyCompleteFields,
|
|
119
|
+
UI_I_AddNetworkingSecondOrThirdSchemeDataSend,
|
|
120
|
+
UI_I_AddNetworkingZeroOrFirstSchemeDataSend,
|
|
121
|
+
UI_I_AddNetworkingFourthOrFifthSchemeDataSend,
|
|
122
|
+
UI_I_AddNetworkingEmits,
|
|
123
|
+
UI_I_TCPStack,
|
|
124
|
+
} from '~/components/common/wizards/network/add/lib/models/interfaces'
|
|
125
|
+
import {
|
|
126
|
+
UI_I_Adapter,
|
|
127
|
+
UI_I_AdapterStatus,
|
|
128
|
+
UI_I_SwitchAdapterItem,
|
|
129
|
+
UI_I_DiagramData,
|
|
130
|
+
API_UI_I_SwitchItem,
|
|
131
|
+
UI_I_AvailableAdapters,
|
|
132
|
+
} from '~/components/common/diagramMain/lib/models/interfaces'
|
|
133
|
+
import { getAvailableAdapters } from '~/components/common/diagramMain/lib/utils/utils'
|
|
134
|
+
import {
|
|
135
|
+
UI_I_ValidationReturn,
|
|
136
|
+
UI_I_WizardStep,
|
|
137
|
+
UI_I_WizardStepNavigation,
|
|
138
|
+
} from '~/components/atoms/wizard/lib/models/interfaces'
|
|
139
|
+
import { UI_E_ValidationFields } from '~/components/common/wizards/network/add/lib/models/enums'
|
|
140
|
+
import { getVlanId } from '~/components/common/wizards/network/add/lib/utils/utils'
|
|
141
|
+
import Wizard from '~/components/atoms/wizard/lib/utils/utils'
|
|
142
|
+
import {
|
|
143
|
+
createZeroSchemeReadyCompleteFunc,
|
|
144
|
+
createFirstSchemeReadyCompleteFunc,
|
|
145
|
+
createSecondSchemeReadyCompleteFunc,
|
|
146
|
+
createThirdSchemeReadyCompleteFunc,
|
|
147
|
+
createFourthSchemeReadyCompleteFunc,
|
|
148
|
+
createFifthSchemeReadyCompleteFunc,
|
|
149
|
+
stepsSchemeInitial,
|
|
150
|
+
stepsFunc,
|
|
151
|
+
connectionSettingsInitial,
|
|
152
|
+
portPropertiesInitial,
|
|
153
|
+
ipFourSettingsInitial,
|
|
154
|
+
targetDeviceInitial,
|
|
155
|
+
addNetworkingZeroOrFirstSchemeDataFunc,
|
|
156
|
+
addNetworkingSecondOrThirdSchemeDataFunc,
|
|
157
|
+
addNetworkingFourthOrFifthSchemeDataFunc,
|
|
158
|
+
} from '~/components/common/wizards/network/add/lib/config/config'
|
|
159
|
+
import {
|
|
160
|
+
checkTargetDeviceSync,
|
|
161
|
+
checkAdaptersSync,
|
|
162
|
+
checkPortPropertiesSync,
|
|
163
|
+
checkIpFourSettingsSync,
|
|
164
|
+
checkConnectionSettingsSync,
|
|
165
|
+
checkNetworkAsync,
|
|
166
|
+
} from '~/components/common/wizards/network/add/validations/validations'
|
|
167
|
+
|
|
168
|
+
const props = withDefaults(
|
|
169
|
+
defineProps<{
|
|
170
|
+
show: boolean
|
|
171
|
+
adapters: UI_I_ItemsWithTotalCounts<UI_I_SwitchAdapterItem>
|
|
172
|
+
standardSwitchesInitial?: UI_I_Switch[]
|
|
173
|
+
freeAdapters?: UI_I_Adapter[]
|
|
174
|
+
project?: UI_T_Project
|
|
175
|
+
isDarkMode?: boolean
|
|
176
|
+
selectedStandardSwitchId?: string
|
|
177
|
+
selectedSwitchId?: string
|
|
178
|
+
tcpStacks?: UI_I_TCPStack[]
|
|
179
|
+
diagramsData?: UI_I_DiagramData[]
|
|
180
|
+
isNetworkingLoading?: boolean
|
|
181
|
+
}>(),
|
|
182
|
+
{
|
|
183
|
+
standardSwitchesInitial: () => [],
|
|
184
|
+
freeAdapters: () => [],
|
|
185
|
+
project: 'procurator',
|
|
186
|
+
isDarkMode: false,
|
|
187
|
+
selectedStandardSwitchId: '',
|
|
188
|
+
selectedSwitchId: '',
|
|
189
|
+
tcpStacks: () => [],
|
|
190
|
+
diagramsData: [],
|
|
191
|
+
isNetworkingLoading: false,
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
const emits = defineEmits<UI_I_AddNetworkingEmits>()
|
|
196
|
+
|
|
197
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
198
|
+
|
|
199
|
+
const hostname = ref<string>('')
|
|
200
|
+
const title = computed<string>(
|
|
201
|
+
() => `${hostname.value} - ${localization.value.common.addNetworking}`
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
const wizard: Wizard = new Wizard(
|
|
205
|
+
stepsFunc(localization.value),
|
|
206
|
+
stepsSchemeInitial
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
210
|
+
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
211
|
+
|
|
212
|
+
const readyCompleteFields = ref<UI_I_ReadyCompleteFields[]>([])
|
|
213
|
+
|
|
214
|
+
// Step's content data (connectionType)
|
|
215
|
+
const connectionType = ref<string>('0')
|
|
216
|
+
|
|
217
|
+
const connectionTypeLocal = computed<string>({
|
|
218
|
+
get() {
|
|
219
|
+
return connectionType.value
|
|
220
|
+
},
|
|
221
|
+
set(newValue: string) {
|
|
222
|
+
wizard.resetAfterSelected()
|
|
223
|
+
connectionType.value = newValue
|
|
224
|
+
targetDevice.value.standardSwitch = props.selectedStandardSwitchId
|
|
225
|
+
targetDevice.value.switch = props.selectedSwitchId
|
|
226
|
+
},
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
// Step's content data (createStandardSwitch)
|
|
230
|
+
const addedAdapters = ref<string[]>([])
|
|
231
|
+
const coreAdapters = ref<string[]>([])
|
|
232
|
+
|
|
233
|
+
const onChangeAddedAdapters = (addedAdaptersNew: string[]): void => {
|
|
234
|
+
addedAdapters.value = addedAdaptersNew
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const adapterStatus = ref<UI_I_AdapterStatus>({
|
|
238
|
+
active: [],
|
|
239
|
+
standby: [],
|
|
240
|
+
unused: [],
|
|
241
|
+
})
|
|
242
|
+
const onChangeAdapterStatus = (adapterStatusNew: UI_I_AdapterStatus): void => {
|
|
243
|
+
adapterStatus.value = adapterStatusNew
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Step's content data and changers (targetDevice)
|
|
247
|
+
const targetDevice = ref<UI_I_TargetDevice>(useDeepCopy(targetDeviceInitial))
|
|
248
|
+
const mtuFromSwitch = ref<number>(1500)
|
|
249
|
+
|
|
250
|
+
const onChangeTargetDevice = (newTargetDevice: UI_I_TargetDevice): void => {
|
|
251
|
+
const oldTargetDeviceSelected = useDeepCopy(targetDevice.value).selected
|
|
252
|
+
const newTargetDeviceSelected = newTargetDevice.selected
|
|
253
|
+
|
|
254
|
+
if (oldTargetDeviceSelected !== newTargetDeviceSelected) {
|
|
255
|
+
wizard.resetAfterSelected()
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const selectedSwitch = props.standardSwitchesInitial.find(
|
|
259
|
+
(currentSwitch: UI_I_Switch) =>
|
|
260
|
+
newTargetDevice.standardSwitch === currentSwitch.name
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
if (newTargetDeviceSelected === '1' && selectedSwitch) {
|
|
264
|
+
mtuFromSwitch.value = selectedSwitch?.mtu || 1500
|
|
265
|
+
}
|
|
266
|
+
if (newTargetDeviceSelected === '3') {
|
|
267
|
+
mtuFromSwitch.value = newTargetDevice.mtu || 1500
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
targetDevice.value = useDeepCopy(newTargetDevice)
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Step's content data and changers (portProperties)
|
|
274
|
+
const portProperties = ref<UI_I_PortProperties>(
|
|
275
|
+
useDeepCopy(portPropertiesInitial)
|
|
276
|
+
)
|
|
277
|
+
const onChangePortProperties = (newFields: UI_I_PortProperties): void => {
|
|
278
|
+
if (portProperties.value.tcp !== newFields.tcp) {
|
|
279
|
+
ipFourSettings.value.static.defaultGateway.value =
|
|
280
|
+
props.tcpStacks?.find((tcp: UI_I_TCPStack) => tcp.id === newFields.tcp)
|
|
281
|
+
.gateway || ''
|
|
282
|
+
}
|
|
283
|
+
portProperties.value = newFields
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Step's content data and changers (ipFourSettings)
|
|
287
|
+
const ipFourSettings = ref<UI_I_IpFourSettings>(ipFourSettingsInitial)
|
|
288
|
+
const onChangeIpFourSettings = (newFields: UI_I_IpFourSettings): void => {
|
|
289
|
+
ipFourSettings.value = newFields
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const gatewayFlag = ref<boolean>(false)
|
|
293
|
+
const onChangeGatewayFlag = (newValue: boolean) => {
|
|
294
|
+
gatewayFlag.value = newValue
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Step's content data and changers (connectionSettings)
|
|
298
|
+
const connectionSettings = ref<UI_I_ConnectionSettings>(
|
|
299
|
+
connectionSettingsInitial
|
|
300
|
+
)
|
|
301
|
+
const onChangeConnectionSettings = (
|
|
302
|
+
newFields: UI_I_ConnectionSettings
|
|
303
|
+
): void => {
|
|
304
|
+
connectionSettings.value = newFields
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const onHideAlert = (stepId: number): void => {
|
|
308
|
+
wizard.hideAlertMessagesByStepId(stepId)
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
let flagSwitch = ''
|
|
312
|
+
|
|
313
|
+
// Choosing Scheme
|
|
314
|
+
watch(
|
|
315
|
+
[connectionTypeLocal, targetDevice],
|
|
316
|
+
(
|
|
317
|
+
newValues: [string, UI_I_TargetDevice],
|
|
318
|
+
oldValues: [string, UI_I_TargetDevice]
|
|
319
|
+
) => {
|
|
320
|
+
const newCT = newValues[0] // -> newConnectionType
|
|
321
|
+
const oldCT = oldValues[0] // -> oldConnectionType
|
|
322
|
+
const newTD = newValues[1] // -> newTargetDevice
|
|
323
|
+
const oldTD = oldValues[1] // -> oldTargetDevice
|
|
324
|
+
if (!oldTD || oldTD.selected !== newTD.selected) {
|
|
325
|
+
flagSwitch = ''
|
|
326
|
+
addedAdapters.value = []
|
|
327
|
+
adapterStatus.value = {
|
|
328
|
+
active: [],
|
|
329
|
+
standby: [],
|
|
330
|
+
unused: [],
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (newCT !== oldCT) {
|
|
334
|
+
newCT === '0' && props.selectedStandardSwitchId
|
|
335
|
+
? (targetDevice.value.selected = '1')
|
|
336
|
+
: (targetDevice.value.selected = '0')
|
|
337
|
+
newCT === '1' && (targetDevice.value.selected = '1')
|
|
338
|
+
newCT === '2' && (targetDevice.value.selected = '2')
|
|
339
|
+
}
|
|
340
|
+
if (newCT === '0') {
|
|
341
|
+
;(newTD.selected === '0' || newTD.selected === '1') &&
|
|
342
|
+
wizard.changeScheme(0)
|
|
343
|
+
newTD.selected === '3' && wizard.changeScheme(1)
|
|
344
|
+
}
|
|
345
|
+
if (newCT === '1') {
|
|
346
|
+
newTD.selected === '1' && wizard.changeScheme(2)
|
|
347
|
+
newTD.selected === '3' && wizard.changeScheme(3)
|
|
348
|
+
}
|
|
349
|
+
if (newCT === '2') {
|
|
350
|
+
newTD.selected === '2' && wizard.changeScheme(4)
|
|
351
|
+
newTD.selected === '3' && wizard.changeScheme(5)
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
{ deep: true, immediate: true }
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
const onGetExistingStandardSwitches = (): void => {
|
|
358
|
+
emits('get-existing-standard-switches')
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const onGetTcpStacks = (): void => {
|
|
362
|
+
emits('get-tcp-stacks')
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
watch(
|
|
366
|
+
() => wizard.selectedStepId,
|
|
367
|
+
(newSelectedStep: number) => {
|
|
368
|
+
if (newSelectedStep === 1) {
|
|
369
|
+
onGetExistingStandardSwitches()
|
|
370
|
+
}
|
|
371
|
+
if (newSelectedStep === 3) {
|
|
372
|
+
onGetTcpStacks()
|
|
373
|
+
}
|
|
374
|
+
if (newSelectedStep === 6 && flagSwitch !== targetDevice.value.switch) {
|
|
375
|
+
const nics: UI_I_AdapterStatus = props.standardSwitchesInitial.find(
|
|
376
|
+
(currentSwitch: UI_I_Switch) =>
|
|
377
|
+
currentSwitch.id === targetDevice.value.switch
|
|
378
|
+
).nics
|
|
379
|
+
|
|
380
|
+
const availableAdapters: UI_I_AvailableAdapters = getAvailableAdapters(
|
|
381
|
+
props.adapters,
|
|
382
|
+
nics
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
adapterStatus.value = {
|
|
386
|
+
active: availableAdapters.activeAdapters || [],
|
|
387
|
+
standby: availableAdapters.standbyAdapters || [],
|
|
388
|
+
unused: availableAdapters.unusedAdapters || [],
|
|
389
|
+
}
|
|
390
|
+
coreAdapters.value = [
|
|
391
|
+
...adapterStatus.value.active,
|
|
392
|
+
...adapterStatus.value.standby,
|
|
393
|
+
...adapterStatus.value.unused,
|
|
394
|
+
]
|
|
395
|
+
flagSwitch = targetDevice.value.switch
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (newSelectedStep !== 7) return // If last step
|
|
399
|
+
if (wizard.isSelectedScheme(0)) {
|
|
400
|
+
readyCompleteFields.value = createZeroSchemeReadyCompleteFunc(
|
|
401
|
+
targetDevice.value,
|
|
402
|
+
portProperties.value,
|
|
403
|
+
ipFourSettings.value,
|
|
404
|
+
localization.value
|
|
405
|
+
)
|
|
406
|
+
return
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
if (wizard.isSelectedScheme(1)) {
|
|
410
|
+
readyCompleteFields.value = createFirstSchemeReadyCompleteFunc(
|
|
411
|
+
targetDevice.value,
|
|
412
|
+
portProperties.value,
|
|
413
|
+
ipFourSettings.value,
|
|
414
|
+
addedAdapters.value,
|
|
415
|
+
localization.value
|
|
416
|
+
)
|
|
417
|
+
return
|
|
418
|
+
}
|
|
419
|
+
if (wizard.isSelectedScheme(2)) {
|
|
420
|
+
readyCompleteFields.value = createSecondSchemeReadyCompleteFunc(
|
|
421
|
+
connectionSettings.value,
|
|
422
|
+
targetDevice.value,
|
|
423
|
+
localization.value
|
|
424
|
+
)
|
|
425
|
+
return
|
|
426
|
+
}
|
|
427
|
+
if (wizard.isSelectedScheme(3)) {
|
|
428
|
+
readyCompleteFields.value = createThirdSchemeReadyCompleteFunc(
|
|
429
|
+
connectionSettings.value,
|
|
430
|
+
targetDevice.value,
|
|
431
|
+
addedAdapters.value,
|
|
432
|
+
localization.value
|
|
433
|
+
)
|
|
434
|
+
return
|
|
435
|
+
}
|
|
436
|
+
if (wizard.isSelectedScheme(4)) {
|
|
437
|
+
readyCompleteFields.value = createFourthSchemeReadyCompleteFunc(
|
|
438
|
+
targetDevice.value.switch,
|
|
439
|
+
props.diagramsData,
|
|
440
|
+
adapterStatus.value,
|
|
441
|
+
localization.value
|
|
442
|
+
)
|
|
443
|
+
return
|
|
444
|
+
}
|
|
445
|
+
if (wizard.isSelectedScheme(5)) {
|
|
446
|
+
readyCompleteFields.value = createFifthSchemeReadyCompleteFunc(
|
|
447
|
+
targetDevice.value,
|
|
448
|
+
adapterStatus.value,
|
|
449
|
+
localization.value
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
// Reset data
|
|
456
|
+
const reset = (): void => {
|
|
457
|
+
wizard.reset()
|
|
458
|
+
connectionTypeLocal.value = '0'
|
|
459
|
+
targetDevice.value = useDeepCopy(targetDeviceInitial)
|
|
460
|
+
connectionSettings.value = useDeepCopy(connectionSettingsInitial)
|
|
461
|
+
portProperties.value = useDeepCopy(portPropertiesInitial)
|
|
462
|
+
ipFourSettings.value = useDeepCopy(ipFourSettingsInitial)
|
|
463
|
+
coreAdapters.value = []
|
|
464
|
+
addedAdapters.value = []
|
|
465
|
+
adapterStatus.value = {
|
|
466
|
+
active: [],
|
|
467
|
+
standby: [],
|
|
468
|
+
unused: [],
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
const isShowNoConnectedActiveAdaptersModal = ref(false)
|
|
473
|
+
const isShowNoActiveAdaptersModal = ref(false)
|
|
474
|
+
|
|
475
|
+
const showNoConnectedActiveAdaptersModal = (): void => {
|
|
476
|
+
isShowNoConnectedActiveAdaptersModal.value = true
|
|
477
|
+
}
|
|
478
|
+
const onHideNoConnectedActiveAdaptersModal = (): void => {
|
|
479
|
+
isShowNoConnectedActiveAdaptersModal.value = false
|
|
480
|
+
}
|
|
481
|
+
const showNoActiveAdaptersModal = (): void => {
|
|
482
|
+
isShowNoActiveAdaptersModal.value = true
|
|
483
|
+
}
|
|
484
|
+
const onHideNoActiveAdaptersModal = (): void => {
|
|
485
|
+
isShowNoActiveAdaptersModal.value = false
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
const onConfirmNoActiveAdaptersModal = (): void => {
|
|
489
|
+
onHideNoConnectedActiveAdaptersModal()
|
|
490
|
+
onHideNoActiveAdaptersModal()
|
|
491
|
+
if (wizard.waitingStepId === 7) {
|
|
492
|
+
wizard.changeSteps(
|
|
493
|
+
wizard.selectedStepData(
|
|
494
|
+
wizard.stepsInSelectedSchemeWithStatus.value.find(
|
|
495
|
+
(step: UI_I_WizardStepNavigation) => step.id === 7
|
|
496
|
+
)
|
|
497
|
+
),
|
|
498
|
+
validationFunc,
|
|
499
|
+
finalValidationFunc,
|
|
500
|
+
true
|
|
501
|
+
)
|
|
502
|
+
wizard.waitingStepId = -1
|
|
503
|
+
return
|
|
504
|
+
}
|
|
505
|
+
wizard.selectStepHard(wizard.waitingStepId)
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const onGetFreeAdapters = (showModal: () => void): void => {
|
|
509
|
+
emits('get-free-adapters', showModal)
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
const checkFinal = async (): Promise<UI_I_ArbitraryObject<string>> => {
|
|
513
|
+
let data:
|
|
514
|
+
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
515
|
+
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend
|
|
516
|
+
| UI_I_AddNetworkingFourthOrFifthSchemeDataSend
|
|
517
|
+
| API_UI_I_SwitchItem
|
|
518
|
+
| null = null
|
|
519
|
+
|
|
520
|
+
let type: 'network' | 'vmkernel' | 'adapter' | 'new-switch'
|
|
521
|
+
|
|
522
|
+
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
523
|
+
const vlan = getVlanId(portProperties.value.vlanId)
|
|
524
|
+
|
|
525
|
+
data = addNetworkingZeroOrFirstSchemeDataFunc(
|
|
526
|
+
targetDevice.value,
|
|
527
|
+
Number(vlan),
|
|
528
|
+
portProperties.value,
|
|
529
|
+
ipFourSettings.value,
|
|
530
|
+
wizard.isSelectedScheme(1),
|
|
531
|
+
adapterStatus.value
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
type = 'vmkernel'
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
538
|
+
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
539
|
+
|
|
540
|
+
data = addNetworkingSecondOrThirdSchemeDataFunc(
|
|
541
|
+
connectionSettings.value,
|
|
542
|
+
targetDevice.value,
|
|
543
|
+
Number(vlan),
|
|
544
|
+
wizard.isSelectedScheme(2),
|
|
545
|
+
adapterStatus.value
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
type = 'network'
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
552
|
+
data = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
553
|
+
targetDevice.value.switch,
|
|
554
|
+
wizard.isSelectedScheme(4),
|
|
555
|
+
adapterStatus.value,
|
|
556
|
+
props.diagramsData,
|
|
557
|
+
targetDevice.value.mtu
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
type = wizard.isSelectedScheme(4) ? 'adapter' : 'new-switch'
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return new Promise((resolve, _reject) =>
|
|
564
|
+
emits(
|
|
565
|
+
'add-networking-data-validate',
|
|
566
|
+
data,
|
|
567
|
+
type,
|
|
568
|
+
(err_arg: UI_I_ArbitraryObject<string>): void => {
|
|
569
|
+
resolve(err_arg)
|
|
570
|
+
}
|
|
571
|
+
)
|
|
572
|
+
)
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const finalValidationFunc = async (
|
|
576
|
+
value: UI_I_WizardStep[]
|
|
577
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
578
|
+
let stepHasError = false
|
|
579
|
+
|
|
580
|
+
const validationFields: {
|
|
581
|
+
[key: string]: string
|
|
582
|
+
} = await checkFinal()
|
|
583
|
+
|
|
584
|
+
for (const fieldName in validationFields) {
|
|
585
|
+
const stepId = wizard.getStepIdByFieldName(fieldName)
|
|
586
|
+
|
|
587
|
+
if (stepId !== -1) {
|
|
588
|
+
stepHasError = wizard.setValidation(stepId, fieldName, {
|
|
589
|
+
fieldMessage: validationFields[fieldName],
|
|
590
|
+
alertMessage: validationFields[fieldName],
|
|
591
|
+
})
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return {
|
|
596
|
+
stepHasError,
|
|
597
|
+
newValue: value,
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const validationFunc = async (
|
|
602
|
+
value: UI_I_WizardStep[],
|
|
603
|
+
currentStep: UI_I_WizardStep,
|
|
604
|
+
nextStep: UI_I_WizardStep
|
|
605
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
606
|
+
let stepHasError = false
|
|
607
|
+
let stepShouldStop = {
|
|
608
|
+
ifOnCurrentStep: false,
|
|
609
|
+
ifFromAnyStep: false,
|
|
610
|
+
stoppageStepId: -1,
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
|
|
614
|
+
const targetDeviceValidation = checkTargetDeviceSync(
|
|
615
|
+
localization.value,
|
|
616
|
+
targetDevice.value,
|
|
617
|
+
wizard,
|
|
618
|
+
value
|
|
619
|
+
)
|
|
620
|
+
|
|
621
|
+
value = targetDeviceValidation.newValue
|
|
622
|
+
|
|
623
|
+
stepHasError = stepHasError || targetDeviceValidation.stepHasError
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
|
|
627
|
+
wizard.waitingStepId = nextStep.id
|
|
628
|
+
|
|
629
|
+
const adapterValidation = checkAdaptersSync(
|
|
630
|
+
localization.value,
|
|
631
|
+
adapterStatus.value,
|
|
632
|
+
value,
|
|
633
|
+
currentStep.id,
|
|
634
|
+
nextStep.id,
|
|
635
|
+
props.freeAdapters,
|
|
636
|
+
showNoActiveAdaptersModal,
|
|
637
|
+
showNoConnectedActiveAdaptersModal,
|
|
638
|
+
2
|
|
639
|
+
)
|
|
640
|
+
|
|
641
|
+
value = adapterValidation.newValue
|
|
642
|
+
|
|
643
|
+
stepShouldStop = adapterValidation.stepShouldStop || stepShouldStop
|
|
644
|
+
|
|
645
|
+
stepHasError = stepHasError || adapterValidation.stepHasError
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (wizard.isValidateForStep(3, currentStep.id, nextStep.id)) {
|
|
649
|
+
const labelValidation = await checkNetworkAsync(
|
|
650
|
+
value,
|
|
651
|
+
portProperties.value.networkLabel,
|
|
652
|
+
3,
|
|
653
|
+
UI_E_ValidationFields.PORT_PROPERTIES_NETWORK,
|
|
654
|
+
emits,
|
|
655
|
+
localization.value,
|
|
656
|
+
wizard
|
|
657
|
+
)
|
|
658
|
+
|
|
659
|
+
value = labelValidation.newValue
|
|
660
|
+
|
|
661
|
+
const portPropertiesValidation = checkPortPropertiesSync(
|
|
662
|
+
localization.value,
|
|
663
|
+
portProperties.value,
|
|
664
|
+
wizard,
|
|
665
|
+
value
|
|
666
|
+
)
|
|
667
|
+
|
|
668
|
+
value = portPropertiesValidation.newValue
|
|
669
|
+
|
|
670
|
+
stepHasError =
|
|
671
|
+
stepHasError ||
|
|
672
|
+
labelValidation.stepHasError ||
|
|
673
|
+
portPropertiesValidation.stepHasError
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (wizard.isValidateForStep(4, currentStep.id, nextStep.id)) {
|
|
677
|
+
const ipValidation = checkIpFourSettingsSync(
|
|
678
|
+
localization.value,
|
|
679
|
+
ipFourSettings.value,
|
|
680
|
+
wizard,
|
|
681
|
+
value
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
value = ipValidation.newValue
|
|
685
|
+
|
|
686
|
+
stepHasError = stepHasError || ipValidation.stepHasError
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
if (wizard.isValidateForStep(5, currentStep.id, nextStep.id)) {
|
|
690
|
+
const labelValidation = await checkNetworkAsync(
|
|
691
|
+
value,
|
|
692
|
+
connectionSettings.value.networkLabel,
|
|
693
|
+
5,
|
|
694
|
+
UI_E_ValidationFields.CONNECTION_SETTINGS_NETWORK,
|
|
695
|
+
emits,
|
|
696
|
+
localization.value,
|
|
697
|
+
wizard
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
value = labelValidation.newValue
|
|
701
|
+
|
|
702
|
+
const connectionSettingsValidation = checkConnectionSettingsSync(
|
|
703
|
+
localization.value,
|
|
704
|
+
connectionSettings.value,
|
|
705
|
+
wizard,
|
|
706
|
+
value
|
|
707
|
+
)
|
|
708
|
+
|
|
709
|
+
value = connectionSettingsValidation.newValue
|
|
710
|
+
|
|
711
|
+
stepHasError =
|
|
712
|
+
stepHasError ||
|
|
713
|
+
labelValidation.stepHasError ||
|
|
714
|
+
connectionSettingsValidation.stepHasError
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
if (wizard.isValidateForStep(6, currentStep.id, nextStep.id)) {
|
|
718
|
+
wizard.waitingStepId = nextStep.id
|
|
719
|
+
|
|
720
|
+
const adapterValidation = checkAdaptersSync(
|
|
721
|
+
localization.value,
|
|
722
|
+
adapterStatus.value,
|
|
723
|
+
value,
|
|
724
|
+
currentStep.id,
|
|
725
|
+
nextStep.id,
|
|
726
|
+
props.adapters.items,
|
|
727
|
+
showNoActiveAdaptersModal,
|
|
728
|
+
showNoConnectedActiveAdaptersModal,
|
|
729
|
+
6
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
value = adapterValidation.newValue
|
|
733
|
+
|
|
734
|
+
stepShouldStop = adapterValidation.stepShouldStop || stepShouldStop
|
|
735
|
+
|
|
736
|
+
stepHasError = stepHasError || adapterValidation.stepHasError
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
return {
|
|
740
|
+
newValue: value,
|
|
741
|
+
stepHasError,
|
|
742
|
+
stepShouldStop,
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
|
|
747
|
+
wizard.changeSteps(value, validationFunc, finalValidationFunc)
|
|
748
|
+
|
|
749
|
+
const onHideAddNetworkingModal = (): void => {
|
|
750
|
+
emits('hide')
|
|
751
|
+
reset()
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
const onSubmit = async (): Promise<void> => {
|
|
755
|
+
let data:
|
|
756
|
+
| UI_I_AddNetworkingSecondOrThirdSchemeDataSend
|
|
757
|
+
| UI_I_AddNetworkingZeroOrFirstSchemeDataSend
|
|
758
|
+
| UI_I_AddNetworkingFourthOrFifthSchemeDataSend
|
|
759
|
+
| API_UI_I_SwitchItem
|
|
760
|
+
| null = null
|
|
761
|
+
|
|
762
|
+
let type: 'network' | 'vmkernel' | 'adapter' | 'new-switch' = 'network'
|
|
763
|
+
|
|
764
|
+
if (wizard.isSelectedScheme(0) || wizard.isSelectedScheme(1)) {
|
|
765
|
+
const vlan = getVlanId(portProperties.value.vlanId)
|
|
766
|
+
type = 'vmkernel'
|
|
767
|
+
data = addNetworkingZeroOrFirstSchemeDataFunc(
|
|
768
|
+
targetDevice.value,
|
|
769
|
+
Number(vlan),
|
|
770
|
+
portProperties.value,
|
|
771
|
+
ipFourSettings.value,
|
|
772
|
+
wizard.isSelectedScheme(1),
|
|
773
|
+
adapterStatus.value
|
|
774
|
+
)
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
if (wizard.isSelectedScheme(2) || wizard.isSelectedScheme(3)) {
|
|
778
|
+
const vlan = getVlanId(connectionSettings.value.vlanId)
|
|
779
|
+
type = 'network'
|
|
780
|
+
data = addNetworkingSecondOrThirdSchemeDataFunc(
|
|
781
|
+
connectionSettings.value,
|
|
782
|
+
targetDevice.value,
|
|
783
|
+
Number(vlan),
|
|
784
|
+
wizard.isSelectedScheme(2),
|
|
785
|
+
adapterStatus.value
|
|
786
|
+
)
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
if (wizard.isSelectedScheme(4) || wizard.isSelectedScheme(5)) {
|
|
790
|
+
type = wizard.isSelectedScheme(4) ? 'adapter' : 'new-switch'
|
|
791
|
+
data = addNetworkingFourthOrFifthSchemeDataFunc(
|
|
792
|
+
targetDevice.value.switch,
|
|
793
|
+
wizard.isSelectedScheme(4),
|
|
794
|
+
adapterStatus.value,
|
|
795
|
+
props.diagramsData,
|
|
796
|
+
targetDevice.value.mtu
|
|
797
|
+
)
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
data &&
|
|
801
|
+
emits('send-add-networking-data', data, type, onHideAddNetworkingModal)
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
onMounted(() => {
|
|
805
|
+
hostname.value = location.hostname
|
|
806
|
+
})
|
|
807
|
+
|
|
808
|
+
watch(
|
|
809
|
+
() => props.isNetworkingLoading,
|
|
810
|
+
(newValue: boolean) => {
|
|
811
|
+
wizard.setLoader(newValue)
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
immediate: true,
|
|
815
|
+
}
|
|
816
|
+
)
|
|
817
|
+
|
|
818
|
+
watch(
|
|
819
|
+
props.tcpStacks,
|
|
820
|
+
(newValue: UI_I_TCPStack[]) => {
|
|
821
|
+
portProperties.value.tcp = newValue?.[0]?.id || ''
|
|
822
|
+
ipFourSettings.value.static.defaultGateway.value =
|
|
823
|
+
newValue?.[0]?.gateway || ''
|
|
824
|
+
},
|
|
825
|
+
{ deep: true }
|
|
826
|
+
)
|
|
827
|
+
</script>
|
|
828
|
+
|
|
829
|
+
<style scoped lang="scss">
|
|
830
|
+
:deep(.modal) {
|
|
831
|
+
& > .modal-dialog > .modal-content > .modal-body {
|
|
832
|
+
height: calc(100% - 110px);
|
|
833
|
+
.disabled-on-time {
|
|
834
|
+
opacity: 0.4;
|
|
835
|
+
pointer-events: none;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
:deep(.disabled-on-time) {
|
|
840
|
+
opacity: 0.4;
|
|
841
|
+
pointer-events: none;
|
|
842
|
+
}
|
|
843
|
+
:deep(.wizard-content-container.add-networking-step) {
|
|
844
|
+
padding: 0px 15px 10px 10px;
|
|
845
|
+
|
|
846
|
+
.danger-not-valid {
|
|
847
|
+
border: 2px solid red;
|
|
848
|
+
border-bottom: 1px solid #db2100;
|
|
849
|
+
}
|
|
850
|
+
.tooltip-field {
|
|
851
|
+
margin-right: 12px;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.horizontal-flex-container {
|
|
855
|
+
margin-bottom: 5px;
|
|
856
|
+
min-height: 36px;
|
|
857
|
+
display: flex;
|
|
858
|
+
flex-direction: row;
|
|
859
|
+
}
|
|
860
|
+
.property-label-group {
|
|
861
|
+
width: 140px;
|
|
862
|
+
}
|
|
863
|
+
.disabled {
|
|
864
|
+
opacity: 0.4;
|
|
865
|
+
pointer-events: none;
|
|
866
|
+
}
|
|
867
|
+
.wizard-content-port {
|
|
868
|
+
.margin-left-property-value-group {
|
|
869
|
+
margin-left: 10px;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.property-value-group {
|
|
873
|
+
padding-left: 23px;
|
|
874
|
+
}
|
|
875
|
+
.horizontal-flex-container {
|
|
876
|
+
min-height: 24px;
|
|
877
|
+
margin-bottom: 0;
|
|
878
|
+
}
|
|
879
|
+
.radio {
|
|
880
|
+
min-height: 39px;
|
|
881
|
+
margin: 10px 0;
|
|
882
|
+
}
|
|
883
|
+
.form-block {
|
|
884
|
+
margin: 12px 0 24px 0;
|
|
885
|
+
padding-left: 23px;
|
|
886
|
+
|
|
887
|
+
&.form-block-ipv {
|
|
888
|
+
input[type='text'] {
|
|
889
|
+
width: 143px;
|
|
890
|
+
}
|
|
891
|
+
.horizontal-flex-container > label {
|
|
892
|
+
margin-right: 50px;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
.edit-vmkernel-adapter-section {
|
|
897
|
+
padding-top: 12px;
|
|
898
|
+
|
|
899
|
+
label {
|
|
900
|
+
input[type='checkbox'] {
|
|
901
|
+
margin-right: 4px;
|
|
902
|
+
transform: translateY(1px);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
.horizontal-flex-container {
|
|
906
|
+
margin-bottom: 5px;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
.port-properties-network-label {
|
|
910
|
+
width: 280px;
|
|
911
|
+
}
|
|
912
|
+
.port-properties-padding {
|
|
913
|
+
padding-top: 8px;
|
|
914
|
+
}
|
|
915
|
+
.port-properties-mtu-selector {
|
|
916
|
+
margin-right: 12px;
|
|
917
|
+
}
|
|
918
|
+
.port-properties-mtu-container {
|
|
919
|
+
display: flex;
|
|
920
|
+
}
|
|
921
|
+
select {
|
|
922
|
+
height: 24px;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
.nw-property-value-group {
|
|
926
|
+
display: inline;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
:deep(.modal-body-content.modal-body-content__confirmation) {
|
|
931
|
+
display: flex;
|
|
932
|
+
.confirm-icon-container {
|
|
933
|
+
margin-right: 20px;
|
|
934
|
+
}
|
|
935
|
+
.preserve-newlines {
|
|
936
|
+
white-space: pre-line;
|
|
937
|
+
font-size: 15px;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
.add-networking-wizard.is-dark {
|
|
942
|
+
:deep(.wizard-content-container.add-networking-step) {
|
|
943
|
+
.ready-complete-container {
|
|
944
|
+
background-color: var(--pannel-bg-color);
|
|
945
|
+
margin-top: 12px;
|
|
946
|
+
|
|
947
|
+
span {
|
|
948
|
+
color: var(--description-color);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
.add-networking-radio-button-description {
|
|
953
|
+
color: var(--description-color);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
.property-label-group {
|
|
957
|
+
color: var(--main-color-mode2);
|
|
958
|
+
}
|
|
959
|
+
.flex-property-label-group {
|
|
960
|
+
color: var(--main-color-mode2);
|
|
961
|
+
}
|
|
962
|
+
.flex-property-value-group {
|
|
963
|
+
select {
|
|
964
|
+
color: #fff;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
.failover-order-master {
|
|
968
|
+
.secondary-title label {
|
|
969
|
+
color: #fff;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
.k-grid-content {
|
|
973
|
+
background-color: var(--modal-bg-color);
|
|
974
|
+
}
|
|
975
|
+
.vui-action-bar {
|
|
976
|
+
background-color: var(--pannel-bg-color);
|
|
977
|
+
color: var(--title-color);
|
|
978
|
+
padding: 8px 0 3px;
|
|
979
|
+
|
|
980
|
+
.action-link-container:not(.disabled) {
|
|
981
|
+
&:hover {
|
|
982
|
+
background-color: #29414e;
|
|
983
|
+
border: 1px solid #c7e9ff;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
svg {
|
|
988
|
+
fill: #fff;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
.k-grid.k-widget .k-grid-content {
|
|
993
|
+
border-left: 1px solid #485764;
|
|
994
|
+
border-right: 1px solid #485764;
|
|
995
|
+
border-top: 1px solid #ddd;
|
|
996
|
+
border-bottom: 1px solid #ddd;
|
|
997
|
+
|
|
998
|
+
tbody tr {
|
|
999
|
+
background-color: var(--modal-bg-color);
|
|
1000
|
+
|
|
1001
|
+
td {
|
|
1002
|
+
border-bottom: 1px solid #666666;
|
|
1003
|
+
border-color: #666666;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
&:hover {
|
|
1007
|
+
background-color: #324f61;
|
|
1008
|
+
color: var(--title-color);
|
|
1009
|
+
|
|
1010
|
+
td {
|
|
1011
|
+
border-bottom: 1px solid #ffffff;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
&.k-state-selected {
|
|
1016
|
+
background-color: #d8e3e9;
|
|
1017
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
|
|
1018
|
+
|
|
1019
|
+
td span {
|
|
1020
|
+
color: #000;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.failover-order-details {
|
|
1027
|
+
&.relative-container .absolute-container {
|
|
1028
|
+
background-color: var(--pannel-bg-color);
|
|
1029
|
+
color: var(--main-color-mode2);
|
|
1030
|
+
|
|
1031
|
+
&:has(.no-items-selected-container) {
|
|
1032
|
+
background-color: transparent;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
td span {
|
|
1037
|
+
color: var(--main-color-mode2);
|
|
1038
|
+
}
|
|
1039
|
+
button span {
|
|
1040
|
+
color: var(--main-color-mode2);
|
|
1041
|
+
|
|
1042
|
+
&:hover:not(.disabled) {
|
|
1043
|
+
background-color: transparent;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
button.active span {
|
|
1047
|
+
color: #fff;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.select-adapter-info span {
|
|
1053
|
+
color: var(--main-color-mode2);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
</style>
|