bfg-common 1.5.442 → 1.5.443
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 -3
- package/assets/localization/local_en.json +17 -11
- package/assets/localization/local_hy.json +9 -3
- package/assets/localization/local_kk.json +9 -3
- package/assets/localization/local_ru.json +9 -3
- package/assets/localization/local_zh.json +9 -3
- package/components/atoms/wizard/Wizard.vue +2 -2
- package/components/atoms/wizard/step/Step.vue +1 -1
- package/components/common/backup/storage/actions/add/Add.vue +5 -5
- package/components/common/backup/storage/actions/add/Old.vue +1 -1
- package/components/common/backup/storage/actions/add/lib/config/steps.ts +2 -2
- package/components/common/backup/storage/actions/add/lib/validations.ts +4 -4
- package/components/common/backup/storage/actions/add/steps/name/Name.vue +1 -1
- package/components/common/backup/storage/actions/add/steps/name/New.vue +1 -1
- package/components/common/backup/storage/actions/add/steps/name/Old.vue +1 -1
- package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigure.vue +1 -1
- package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureNew.vue +1 -1
- package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureOld.vue +1 -1
- package/components/common/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- package/components/common/countdownTimer/CountdownTimer.vue +26 -15
- 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/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 +5 -5
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +2 -2
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +2 -2
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +5 -5
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +2 -2
- 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/modals/{reconnect/Reconnect.vue → Reconnect.vue} +56 -43
- package/components/common/pages/backups/modals/Modals.vue +1 -1
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +5 -2
- package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +2 -2
- package/components/common/pages/backups/modals/restore/Restore.vue +3 -3
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +2 -2
- package/components/common/vm/actions/add/Add.vue +5 -5
- package/components/common/vm/actions/add/New.vue +2 -2
- package/components/common/vm/actions/add/Old.vue +2 -2
- package/components/common/vm/actions/add/lib/config/steps.ts +2 -2
- package/components/common/vm/actions/clone/Clone.vue +5 -5
- package/components/common/vm/actions/clone/lib/config/steps.ts +2 -2
- package/components/common/vm/actions/clone/toTemplate/ToTemplate.vue +5 -5
- package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +2 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSize.vue +23 -23
- package/components/common/vmt/actions/add/Add.vue +5 -5
- package/components/common/vmt/actions/add/New.vue +2 -3
- package/components/common/vmt/actions/add/Old.vue +2 -2
- package/components/common/vmt/actions/add/lib/config/steps.ts +2 -2
- package/components/common/wizards/datastore/add/Add.vue +2 -2
- package/components/common/wizards/datastore/add/Old.vue +2 -2
- package/components/common/wizards/datastore/add/lib/config/steps.ts +2 -2
- package/components/common/wizards/datastore/add/lib/utils.ts +1 -1
- package/components/common/wizards/datastore/add/lib/validations.ts +3 -3
- package/components/common/wizards/datastore/add/steps/_local/Local.vue +1 -1
- package/components/common/wizards/datastore/add/steps/_local/createName/CreateName.vue +1 -1
- package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigure.vue +2 -1
- package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue +1 -1
- package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureOld.vue +1 -1
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDevice.vue +1 -1
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +1 -1
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceOld.vue +1 -1
- package/components/common/wizards/network/add/Add.vue +109 -333
- package/components/common/wizards/network/add/AddNew.vue +514 -0
- package/components/common/wizards/network/add/AddOld.vue +457 -0
- package/components/common/wizards/network/add/lib/config/config.ts +11 -1
- package/components/common/wizards/network/add/lib/config/selectConnectionTypeStep.ts +31 -0
- package/components/common/wizards/network/add/lib/config/selectSwitch.ts +217 -0
- package/components/common/wizards/network/add/lib/config/steps.ts +5 -5
- package/components/common/wizards/network/add/lib/models/interfaces.ts +9 -0
- package/components/common/wizards/network/add/steps/ConnectionSettings.vue +2 -2
- package/components/common/wizards/network/add/steps/IpFourSettings.vue +2 -2
- package/components/common/wizards/network/add/steps/PortProperties.vue +2 -2
- package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionType.vue +35 -0
- package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionTypeNew.vue +104 -0
- package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionTypeOld.vue +80 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDevice.vue +183 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +393 -0
- package/components/common/wizards/network/add/steps/{SelectedTargetDevice.vue → selectTargetDevice/SelectTargetDeviceOld.vue} +42 -139
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/Modals.vue +55 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectNetwork.vue +64 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectStandardSwitch.vue +64 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectSwitch.vue +64 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectNetwork.vue +163 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectStandardSwitch.vue +163 -0
- package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectSwitch.vue +163 -0
- package/components/common/wizards/network/add/{modals → steps/selectTargetDevice/modals/old}/SelectNetwork.vue +53 -56
- package/components/common/wizards/network/add/{modals → steps/selectTargetDevice/modals/old}/SelectStandardSwitch.vue +37 -52
- package/components/common/wizards/network/add/{modals → steps/selectTargetDevice/modals/old}/SelectSwitch.vue +38 -42
- package/components/common/wizards/network/add/validations/connectionSettings.ts +5 -5
- package/components/common/wizards/network/add/validations/createStandardSwitch.ts +4 -4
- package/components/common/wizards/network/add/validations/ipFourSettings.ts +5 -5
- package/components/common/wizards/network/add/validations/networkValidation.ts +4 -4
- package/components/common/wizards/network/add/validations/physicalAdapter.ts +4 -4
- package/components/common/wizards/network/add/validations/portProperties.ts +2 -2
- package/components/common/wizards/network/add/validations/targetDevice.ts +11 -10
- package/components/common/wizards/vm/migrate/Migrate.vue +2 -2
- package/components/common/wizards/vm/migrate/lib/config/steps.ts +2 -2
- package/components/common/wizards/vm/migrate/lib/validations.ts +3 -3
- package/components/common/wizards/vm/migrate/select/targetServer/new/New.vue +1 -1
- package/components/common/wizards/vm/migrate/select/targetServer/targetServer.vue +1 -1
- package/package.json +2 -2
- package/components/atoms/wizard/lib/models/enums.ts +0 -8
- package/components/atoms/wizard/lib/models/interfaces.ts +0 -59
- package/components/atoms/wizard/lib/utils/utils.ts +0 -954
- package/components/common/countdownTimer/CountdownTimerNew.vue +0 -53
- package/components/common/countdownTimer/CountdownTimerOld.vue +0 -33
- package/components/common/layout/theHeader/modals/reconnect/ReconnectNew.vue +0 -74
- package/components/common/layout/theHeader/modals/reconnect/ReconnectOld.vue +0 -67
- package/components/common/wizards/network/add/steps/SelectConnectionType.vue +0 -112
@@ -0,0 +1,183 @@
|
|
1
|
+
<template>
|
2
|
+
<common-wizards-network-add-steps-select-target-device-new
|
3
|
+
v-if="isNewView"
|
4
|
+
v-model:fields="fields"
|
5
|
+
:wizard="props.wizard"
|
6
|
+
:connection-type="props.connectionType"
|
7
|
+
:messages-fields="props.messagesFields"
|
8
|
+
:is-connection-type-first-two="isConnectionTypeFirstTwo"
|
9
|
+
:standard-switches-initial="props.standardSwitchesInitial"
|
10
|
+
:selected-switch-id="props.selectedSwitchId"
|
11
|
+
@show-modal="onShowModal"
|
12
|
+
@change-target-device="onChangeTargetDevice"
|
13
|
+
/>
|
14
|
+
<common-wizards-network-add-steps-select-target-device-old
|
15
|
+
v-else
|
16
|
+
v-model:fields="fields"
|
17
|
+
:wizard="props.wizard"
|
18
|
+
:connection-type="props.connectionType"
|
19
|
+
:messages-fields="props.messagesFields"
|
20
|
+
:is-connection-type-first-two="isConnectionTypeFirstTwo"
|
21
|
+
:alert-messages="props.alertMessages"
|
22
|
+
@hide-alert="onHideAlert"
|
23
|
+
@show-modal="onShowModal"
|
24
|
+
@change-target-device="onChangeTargetDevice"
|
25
|
+
/>
|
26
|
+
<common-wizards-network-add-steps-select-target-device-modals
|
27
|
+
:standard-switches-initial="props.standardSwitchesInitial"
|
28
|
+
:is-show-standard-switch-modal="isShowStandardSwitchModal"
|
29
|
+
:is-show-switch-modal="isShowSwitchModal"
|
30
|
+
:is-show-network-modal="isShowNetworkModal"
|
31
|
+
@hide-modal="onHideModal"
|
32
|
+
@select-standard-switch="onSelectStandardSwitch"
|
33
|
+
@select-switch="onSelectSwitch"
|
34
|
+
@select-network="onSelectNetwork"
|
35
|
+
/>
|
36
|
+
</template>
|
37
|
+
|
38
|
+
<script setup lang="ts">
|
39
|
+
import type { UI_I_ErrorFields } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
40
|
+
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
41
|
+
import type {
|
42
|
+
UI_I_ArbitraryObject,
|
43
|
+
UI_I_Localization,
|
44
|
+
} from '~/lib/models/interfaces'
|
45
|
+
import type {
|
46
|
+
UI_I_TargetDevice,
|
47
|
+
UI_I_Switch,
|
48
|
+
} from '~/components/common/wizards/network/add/lib/models/interfaces'
|
49
|
+
import { UI_E_ValidationFields } from '~/components/common/wizards/network/add/lib/models/enums'
|
50
|
+
import { validateMtuTargetDeviceLocal } from '~/components/common/wizards/network/add/validations/validations'
|
51
|
+
|
52
|
+
const props = defineProps<{
|
53
|
+
wizard: Wizard
|
54
|
+
targetDevice: UI_I_TargetDevice
|
55
|
+
connectionType: string
|
56
|
+
standardSwitchesInitial: UI_I_Switch[]
|
57
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
58
|
+
alertMessages: string[]
|
59
|
+
selectedStandardSwitchId: string
|
60
|
+
selectedSwitchId: string
|
61
|
+
}>()
|
62
|
+
|
63
|
+
const { $store }: any = useNuxtApp()
|
64
|
+
|
65
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
66
|
+
|
67
|
+
const emits = defineEmits<{
|
68
|
+
(event: 'change-target-device', value: UI_I_TargetDevice): void
|
69
|
+
(event: 'hide-alert', value: 1): void
|
70
|
+
}>()
|
71
|
+
|
72
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
73
|
+
|
74
|
+
const isConnectionTypeFirstTwo = computed<boolean>(() =>
|
75
|
+
['0', '1'].includes(props.connectionType)
|
76
|
+
)
|
77
|
+
|
78
|
+
const isShowStandardSwitchModal = ref<boolean>(false)
|
79
|
+
const isShowSwitchModal = ref<boolean>(false)
|
80
|
+
const isShowNetworkModal = ref<boolean>(false)
|
81
|
+
|
82
|
+
const onShowModal = (value: string): void => {
|
83
|
+
switch (value) {
|
84
|
+
case 'select-standard-switch':
|
85
|
+
isShowStandardSwitchModal.value = true
|
86
|
+
break
|
87
|
+
case 'select-switch':
|
88
|
+
isShowSwitchModal.value = true
|
89
|
+
break
|
90
|
+
case 'select-network':
|
91
|
+
isShowNetworkModal.value = true
|
92
|
+
break
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
const onHideModal = (value: string): void => {
|
97
|
+
switch (value) {
|
98
|
+
case 'select-standard-switch':
|
99
|
+
isShowStandardSwitchModal.value = false
|
100
|
+
break
|
101
|
+
case 'select-switch':
|
102
|
+
isShowSwitchModal.value = false
|
103
|
+
break
|
104
|
+
case 'select-network':
|
105
|
+
isShowNetworkModal.value = false
|
106
|
+
break
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
const onHideAlert = (): void => {
|
111
|
+
emits('hide-alert', 1)
|
112
|
+
}
|
113
|
+
|
114
|
+
const onChangeTargetDevice = (value: UI_I_TargetDevice): void => {
|
115
|
+
emits('change-target-device', value)
|
116
|
+
}
|
117
|
+
|
118
|
+
const fields = ref<UI_I_TargetDevice>(useDeepCopy(props.targetDevice))
|
119
|
+
|
120
|
+
const onSelectStandardSwitch = (value: string): void => {
|
121
|
+
fields.value.standardSwitch = value
|
122
|
+
onHideModal('select-standard-switch')
|
123
|
+
}
|
124
|
+
const onSelectSwitch = (value: string): void => {
|
125
|
+
fields.value.switch = value
|
126
|
+
onHideModal('select-switch')
|
127
|
+
}
|
128
|
+
const onSelectNetwork = (value: string): void => {
|
129
|
+
fields.value.network = value
|
130
|
+
onHideModal('select-network')
|
131
|
+
}
|
132
|
+
|
133
|
+
let prevValue = useDeepCopy(fields.value)
|
134
|
+
|
135
|
+
watch(
|
136
|
+
fields,
|
137
|
+
(newFields: UI_I_TargetDevice) => {
|
138
|
+
newFields.standardSwitch &&
|
139
|
+
!prevValue.standardSwitch &&
|
140
|
+
props.wizard.removeValidationLocal(
|
141
|
+
1,
|
142
|
+
UI_E_ValidationFields.TARGET_DEVICE_STANDARD_SWITCH
|
143
|
+
)
|
144
|
+
|
145
|
+
if (newFields.selected !== prevValue.selected) {
|
146
|
+
props.wizard.removeValidationLocal(
|
147
|
+
1,
|
148
|
+
UI_E_ValidationFields.TARGET_DEVICE_STANDARD_SWITCH
|
149
|
+
)
|
150
|
+
props.wizard.removeValidationLocal(
|
151
|
+
1,
|
152
|
+
UI_E_ValidationFields.TARGET_DEVICE_NETWORK
|
153
|
+
)
|
154
|
+
props.wizard.removeValidationLocal(
|
155
|
+
1,
|
156
|
+
UI_E_ValidationFields.TARGET_DEVICE_SWITCH
|
157
|
+
)
|
158
|
+
props.wizard.removeValidationLocal(
|
159
|
+
1,
|
160
|
+
UI_E_ValidationFields.TARGET_DEVICE_MTU
|
161
|
+
)
|
162
|
+
}
|
163
|
+
|
164
|
+
;(newFields.mtu !== prevValue.mtu ||
|
165
|
+
(prevValue.selected !== '3' && newFields.selected === '3')) &&
|
166
|
+
validateMtuTargetDeviceLocal(localization.value, newFields, props.wizard)
|
167
|
+
|
168
|
+
prevValue = useDeepCopy(newFields)
|
169
|
+
|
170
|
+
emits('change-target-device', newFields)
|
171
|
+
},
|
172
|
+
{ deep: true }
|
173
|
+
)
|
174
|
+
|
175
|
+
onMounted(() => {
|
176
|
+
!fields.value.standardSwitch &&
|
177
|
+
(fields.value.standardSwitch = props.selectedStandardSwitchId)
|
178
|
+
|
179
|
+
!fields.value.switch && (fields.value.switch = props.selectedSwitchId)
|
180
|
+
})
|
181
|
+
</script>
|
182
|
+
|
183
|
+
<style scoped lang="scss"></style>
|
package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue
ADDED
@@ -0,0 +1,393 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="content">
|
3
|
+
<div>
|
4
|
+
<h4 class="content-subtitle">{{ localization.common.targetDevice }}</h4>
|
5
|
+
|
6
|
+
<div class="radio-container">
|
7
|
+
<div
|
8
|
+
v-show="props.connectionType === '0'"
|
9
|
+
:class="['radio-block', { selected: fieldsLocal.selected === '0' }]"
|
10
|
+
@click="fieldsLocal.selected = '0'"
|
11
|
+
>
|
12
|
+
<ui-radio
|
13
|
+
v-model="fieldsLocal.selected"
|
14
|
+
:label="localization.common.existingNetwork"
|
15
|
+
value="0"
|
16
|
+
test-id="existing-network-radio"
|
17
|
+
size="md"
|
18
|
+
/>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div
|
22
|
+
v-show="props.isConnectionTypeFirstTwo"
|
23
|
+
:class="['radio-block', { selected: fieldsLocal.selected === '1' }]"
|
24
|
+
@click="fieldsLocal.selected = '1'"
|
25
|
+
>
|
26
|
+
<ui-radio
|
27
|
+
v-model="fieldsLocal.selected"
|
28
|
+
:label="localization.common.existingStandardSwitch"
|
29
|
+
value="1"
|
30
|
+
test-id="existing-standard-switch-radio"
|
31
|
+
size="md"
|
32
|
+
/>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div
|
36
|
+
v-show="props.connectionType === '2'"
|
37
|
+
:class="['radio-block', { selected: fieldsLocal.selected === '2' }]"
|
38
|
+
@click="fieldsLocal.selected = '2'"
|
39
|
+
>
|
40
|
+
<ui-radio
|
41
|
+
v-model="fieldsLocal.selected"
|
42
|
+
:label="localization.common.existingSwitch"
|
43
|
+
value="2"
|
44
|
+
test-id="existing-switch-radio"
|
45
|
+
size="md"
|
46
|
+
/>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<!-- v-permission="'Networks.CreateSwitch'" -->
|
50
|
+
<div
|
51
|
+
:class="['radio-block', { selected: fieldsLocal.selected === '3' }]"
|
52
|
+
@click="fieldsLocal.selected = '3'"
|
53
|
+
>
|
54
|
+
<ui-radio
|
55
|
+
v-model="fieldsLocal.selected"
|
56
|
+
:label="localization.common.newStandardSwitch"
|
57
|
+
value="3"
|
58
|
+
test-id="standard-switch-radio"
|
59
|
+
size="md"
|
60
|
+
/>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
<ui-line margin="0 0 16px" />
|
64
|
+
|
65
|
+
<div
|
66
|
+
v-show="props.connectionType === '0' && fieldsLocal.selected === '0'"
|
67
|
+
>
|
68
|
+
<div class="col">
|
69
|
+
<h4 class="content-subtitle col-left">
|
70
|
+
{{ localization.common.network }}
|
71
|
+
</h4>
|
72
|
+
<div class="col-right">
|
73
|
+
<ui-select
|
74
|
+
v-model="fieldsLocal.network"
|
75
|
+
:items="[
|
76
|
+
{
|
77
|
+
text: localization.common.browseDoted,
|
78
|
+
value: 'browse',
|
79
|
+
selected: false,
|
80
|
+
disabled: true,
|
81
|
+
iconName: 'browse',
|
82
|
+
},
|
83
|
+
]"
|
84
|
+
select-width="100%"
|
85
|
+
show-text
|
86
|
+
test-id="network-input"
|
87
|
+
:placeholder="localization.common.selectANetwork"
|
88
|
+
:error="!!props.messagesFields.network.field"
|
89
|
+
:error-text="
|
90
|
+
!!props.messagesFields.network.field &&
|
91
|
+
localization.common.fieldRequired
|
92
|
+
"
|
93
|
+
>
|
94
|
+
<template #row="{ item }">
|
95
|
+
<div v-if="item.iconName" class="browse-btn">
|
96
|
+
<ui-button
|
97
|
+
test-id="button-1"
|
98
|
+
type="primary"
|
99
|
+
variant="text"
|
100
|
+
size="lg"
|
101
|
+
is-without-sizes
|
102
|
+
min-width="100%"
|
103
|
+
@click="onShowModal('select-network')"
|
104
|
+
>
|
105
|
+
<span>{{ item.text }}</span>
|
106
|
+
</ui-button>
|
107
|
+
</div>
|
108
|
+
</template>
|
109
|
+
</ui-select>
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<div
|
115
|
+
v-show="props.isConnectionTypeFirstTwo && fieldsLocal.selected === '1'"
|
116
|
+
>
|
117
|
+
<div class="col">
|
118
|
+
<h4 class="content-subtitle col-left">
|
119
|
+
{{ localization.common.standardSwitch }}
|
120
|
+
</h4>
|
121
|
+
<div class="col-right">
|
122
|
+
<ui-select
|
123
|
+
v-model="fieldsLocal.standardSwitch"
|
124
|
+
:items="selectItems"
|
125
|
+
select-width="100%"
|
126
|
+
show-text
|
127
|
+
test-id="standard-switch-input"
|
128
|
+
:placeholder="localization.common.selectASwitch"
|
129
|
+
:error="!!props.messagesFields.switch.field"
|
130
|
+
:error-text="
|
131
|
+
!!props.messagesFields.switch.field &&
|
132
|
+
localization.common.fieldRequired
|
133
|
+
"
|
134
|
+
>
|
135
|
+
<template #row="{ item }">
|
136
|
+
<div v-if="item.iconName" class="browse-btn">
|
137
|
+
<ui-button
|
138
|
+
test-id="button-1"
|
139
|
+
type="primary"
|
140
|
+
variant="text"
|
141
|
+
size="lg"
|
142
|
+
is-without-sizes
|
143
|
+
min-width="100%"
|
144
|
+
@click="onShowModal('select-standard-switch')"
|
145
|
+
>
|
146
|
+
<span>{{ item.text }}</span>
|
147
|
+
</ui-button>
|
148
|
+
</div>
|
149
|
+
</template>
|
150
|
+
</ui-select>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div
|
156
|
+
v-show="props.connectionType === '2' && fieldsLocal.selected === '2'"
|
157
|
+
>
|
158
|
+
<div class="col">
|
159
|
+
<h4 class="content-subtitle col-left">
|
160
|
+
{{ localization.common.switch }}
|
161
|
+
</h4>
|
162
|
+
<div class="col-right">
|
163
|
+
<ui-select
|
164
|
+
v-model="fieldsLocal.switch"
|
165
|
+
:items="selectItems"
|
166
|
+
select-width="100%"
|
167
|
+
show-text
|
168
|
+
test-id="switch-input"
|
169
|
+
:placeholder="localization.common.selectASwitch"
|
170
|
+
:error="!!props.messagesFields.switch2.field"
|
171
|
+
:error-text="
|
172
|
+
!!props.messagesFields.switch2.field &&
|
173
|
+
localization.common.fieldRequired
|
174
|
+
"
|
175
|
+
>
|
176
|
+
<template #row="{ item }">
|
177
|
+
<div v-if="item.iconName" class="browse-btn">
|
178
|
+
<ui-button
|
179
|
+
test-id="button-1"
|
180
|
+
type="primary"
|
181
|
+
variant="text"
|
182
|
+
size="lg"
|
183
|
+
is-without-sizes
|
184
|
+
min-width="100%"
|
185
|
+
@click="onShowModal('select-switch')"
|
186
|
+
>
|
187
|
+
<span>{{ item.text }}</span>
|
188
|
+
</ui-button>
|
189
|
+
</div>
|
190
|
+
</template>
|
191
|
+
</ui-select>
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
<div v-show="fieldsLocal.selected === '3'">
|
197
|
+
<!-- v-permission="'Networks.CreateSwitch'" -->
|
198
|
+
|
199
|
+
<div class="col">
|
200
|
+
<h4 class="content-subtitle col-left">
|
201
|
+
{{ localization.common.mtuBytes }}
|
202
|
+
</h4>
|
203
|
+
<div class="col-right">
|
204
|
+
<ui-input
|
205
|
+
id="mtu"
|
206
|
+
v-model="fieldsLocal.mtu"
|
207
|
+
test-id="mtu-input"
|
208
|
+
type="number"
|
209
|
+
:placeholder="localization.common.mtuBytes"
|
210
|
+
size="md"
|
211
|
+
:error="props.messagesFields['new_switch.mtu'].field"
|
212
|
+
/>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
</template>
|
219
|
+
|
220
|
+
<script setup lang="ts">
|
221
|
+
import type { UI_I_ErrorFields } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
222
|
+
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
223
|
+
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/select/lib/models/interfaces'
|
224
|
+
import type {
|
225
|
+
UI_I_ArbitraryObject,
|
226
|
+
UI_I_Localization,
|
227
|
+
} from '~/lib/models/interfaces'
|
228
|
+
import type {
|
229
|
+
UI_I_TargetDevice,
|
230
|
+
UI_I_Switch,
|
231
|
+
} from '~/components/common/wizards/network/add/lib/models/interfaces'
|
232
|
+
|
233
|
+
const props = defineProps<{
|
234
|
+
fields: UI_I_TargetDevice
|
235
|
+
connectionType: string
|
236
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
237
|
+
wizard: Wizard
|
238
|
+
isConnectionTypeFirstTwo: boolean
|
239
|
+
standardSwitchesInitial: UI_I_Switch[]
|
240
|
+
selectedSwitchId: string
|
241
|
+
}>()
|
242
|
+
|
243
|
+
const emits = defineEmits<{
|
244
|
+
(event: 'change-target-device', targetDevice: UI_I_TargetDevice): void
|
245
|
+
(event: 'show-modal', modalName: string): void
|
246
|
+
(event: 'update:fields', value: UI_I_TargetDevice): void
|
247
|
+
}>()
|
248
|
+
|
249
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
250
|
+
|
251
|
+
const onShowModal = (value: string): void => {
|
252
|
+
emits('show-modal', value)
|
253
|
+
}
|
254
|
+
|
255
|
+
const fieldsLocal = computed({
|
256
|
+
get() {
|
257
|
+
return props.fields
|
258
|
+
},
|
259
|
+
set(value: UI_I_TargetDevice) {
|
260
|
+
emits('update:fields', value)
|
261
|
+
},
|
262
|
+
})
|
263
|
+
|
264
|
+
const selectItems = ref<UI_I_Dropdown[]>([])
|
265
|
+
|
266
|
+
watch(
|
267
|
+
() => props.standardSwitchesInitial,
|
268
|
+
(newValue) => {
|
269
|
+
selectItems.value = [
|
270
|
+
...newValue.map((item) => ({
|
271
|
+
text: item.name,
|
272
|
+
value: item.id,
|
273
|
+
selected: props.selectedSwitchId === item.id,
|
274
|
+
})),
|
275
|
+
{
|
276
|
+
text: localization.value.common.browseDoted,
|
277
|
+
value: 'browse',
|
278
|
+
selected: false,
|
279
|
+
disabled: true,
|
280
|
+
iconName: 'browse',
|
281
|
+
},
|
282
|
+
]
|
283
|
+
},
|
284
|
+
{ immediate: true, deep: true }
|
285
|
+
)
|
286
|
+
</script>
|
287
|
+
|
288
|
+
<style scoped lang="scss">
|
289
|
+
.content {
|
290
|
+
padding: 16px 0;
|
291
|
+
|
292
|
+
&-subtitle {
|
293
|
+
font-weight: 400;
|
294
|
+
font-size: 13px;
|
295
|
+
line-height: 20px;
|
296
|
+
letter-spacing: 0;
|
297
|
+
vertical-align: middle;
|
298
|
+
color: var(--title-form-first-color);
|
299
|
+
}
|
300
|
+
|
301
|
+
.radio-container {
|
302
|
+
display: flex;
|
303
|
+
column-gap: 12px;
|
304
|
+
margin: 16px 0;
|
305
|
+
}
|
306
|
+
|
307
|
+
.col {
|
308
|
+
display: flex;
|
309
|
+
align-items: center;
|
310
|
+
column-gap: 16px;
|
311
|
+
|
312
|
+
&-left {
|
313
|
+
width: calc((100% - 8px) / 3);
|
314
|
+
}
|
315
|
+
|
316
|
+
&-right {
|
317
|
+
width: calc(((100% - 8px) / 3) * 2);
|
318
|
+
}
|
319
|
+
}
|
320
|
+
|
321
|
+
:deep(.ui-dropdown-menu-item.disabled) {
|
322
|
+
opacity: 1 !important;
|
323
|
+
}
|
324
|
+
|
325
|
+
.browse-btn {
|
326
|
+
width: 100%;
|
327
|
+
|
328
|
+
:deep(.ui-btn) {
|
329
|
+
justify-content: flex-start;
|
330
|
+
height: 32px;
|
331
|
+
|
332
|
+
span {
|
333
|
+
text-align: left;
|
334
|
+
color: var(--select-text);
|
335
|
+
}
|
336
|
+
|
337
|
+
&:hover {
|
338
|
+
span {
|
339
|
+
color: var(--dropdown-item-hover-color);
|
340
|
+
}
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
|
345
|
+
:root.dark-theme {
|
346
|
+
.radio-block:not(.selected).disabled {
|
347
|
+
background-color: #1b2a371f;
|
348
|
+
opacity: unset;
|
349
|
+
}
|
350
|
+
}
|
351
|
+
.radio-block {
|
352
|
+
width: 100%;
|
353
|
+
background-color: var(--radio-block-bg-color);
|
354
|
+
box-shadow: inset 0 0 0 1px var(--radio-block-border-color);
|
355
|
+
transition: box-shadow 0.1s ease-in-out;
|
356
|
+
padding: 12px;
|
357
|
+
border-radius: 8px;
|
358
|
+
|
359
|
+
&:not(.selected):not(.disabled) {
|
360
|
+
&:hover {
|
361
|
+
box-shadow: inset 0 0 0 1px var(--radio-block-border-hover-color);
|
362
|
+
}
|
363
|
+
}
|
364
|
+
|
365
|
+
&:not(.disabled) {
|
366
|
+
cursor: pointer;
|
367
|
+
}
|
368
|
+
|
369
|
+
&:not(.selected).disabled {
|
370
|
+
background-color: #ffffff;
|
371
|
+
opacity: 0.6;
|
372
|
+
}
|
373
|
+
|
374
|
+
&.selected {
|
375
|
+
background-color: var(--radio-block-selected-bg-color);
|
376
|
+
box-shadow: inset 0 0 0 1.5px var(--radio-block-selected-border-color);
|
377
|
+
}
|
378
|
+
}
|
379
|
+
|
380
|
+
:deep(.radio-label__container) {
|
381
|
+
align-items: unset !important;
|
382
|
+
}
|
383
|
+
}
|
384
|
+
|
385
|
+
@media (max-width: 896px) {
|
386
|
+
.radio-container {
|
387
|
+
display: flex;
|
388
|
+
flex-direction: column;
|
389
|
+
row-gap: 12px;
|
390
|
+
margin: 16px 0;
|
391
|
+
}
|
392
|
+
}
|
393
|
+
</style>
|