bfg-common 1.5.211 → 1.5.213
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/components/common/backup/lib/utils/getBackupOrBackupStorageId.ts +29 -0
- package/components/common/backup/storage/actions/add/Add.vue +36 -0
- package/components/common/backup/storage/actions/add/temp/Add.vue +508 -0
- package/components/common/backup/storage/actions/add/temp/lib/config/stepItems.ts +203 -0
- package/components/common/backup/storage/actions/add/temp/lib/models/interfaces.ts +58 -0
- package/components/common/backup/storage/actions/add/temp/lib/models/types.ts +14 -0
- package/components/common/backup/storage/actions/add/temp/lib/utils.ts +70 -0
- package/components/common/backup/storage/actions/add/temp/local/Local.vue +65 -0
- package/components/common/backup/storage/actions/add/temp/local/createName/CreateName.vue +158 -0
- package/components/common/backup/storage/actions/add/temp/local/createName/lib/config/defaultForm.ts +15 -0
- package/components/common/backup/storage/actions/add/temp/nfs/Nfs.vue +106 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/Accessibility.vue +104 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/config/tabsPannel.ts +25 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/models/interfaces.ts +9 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/models/types.ts +5 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/TablesView.vue +141 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
- package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/Configuration.vue +469 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/lib/config/defaultForm.ts +51 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/lib/models/interfaces.ts +14 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/DeletePopover.vue +99 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/ServersList.vue +125 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/config/serversListConfig.ts +40 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/config/tableKeys.ts +3 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/models/interfaces.ts +13 -0
- package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/models/types.ts +1 -0
- package/components/common/backup/storage/actions/add/temp/nfs/kerberosAuthentication/KerberosAuthentication.vue +55 -0
- package/components/common/backup/storage/actions/add/temp/nfs/kerberosAuthentication/lib/config/radioOptions.ts +27 -0
- package/components/common/backup/storage/actions/add/temp/nfs/version/Version.vue +42 -0
- package/components/common/backup/storage/actions/add/temp/nfs/version/lib/config/versionOptions.ts +22 -0
- package/components/common/backup/storage/actions/add/temp/readyComplete/ReadyComplete.vue +85 -0
- package/components/common/backup/storage/actions/add/temp/readyComplete/lib/config/propertiesDetails.ts +139 -0
- package/components/common/backup/storage/actions/add/temp/readyComplete/lib/models/interfaces.ts +4 -0
- package/components/common/backup/storage/actions/add/temp/samba/Samba.vue +95 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/Accessibility.vue +104 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/config/tabsPannel.ts +25 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/models/interfaces.ts +9 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/models/types.ts +5 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/TablesView.vue +141 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
- package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/Configuration.vue +470 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/lib/config/defaultForm.ts +51 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/lib/models/interfaces.ts +14 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/DeletePopover.vue +99 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/ServersList.vue +124 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/config/serversListConfig.ts +40 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/config/tableKeys.ts +3 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/models/interfaces.ts +13 -0
- package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/models/types.ts +1 -0
- package/components/common/backup/storage/actions/add/temp/samba/kerberosAuthentication/KerberosAuthentication.vue +55 -0
- package/components/common/backup/storage/actions/add/temp/samba/kerberosAuthentication/lib/config/radioOptions.ts +27 -0
- package/components/common/backup/storage/actions/add/temp/sharedStorm/SharedStorm.vue +80 -0
- package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/CreateName.vue +156 -0
- package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/lib/config/defaultForm.ts +15 -0
- package/components/common/backup/storage/actions/add/temp/sharedStorm/storage/Storage.vue +71 -0
- package/components/common/backup/storage/actions/add/temp/sharedStorm/storage/lib/config/defaultForm.ts +15 -0
- package/components/common/backup/storage/actions/add/temp/types/Types.vue +78 -0
- package/components/common/backup/storage/actions/add/temp/types/lib/config/typeOptions.ts +52 -0
- package/components/common/backup/storage/actions/delete/Delete.vue +65 -0
- package/components/common/backup/storage/actions/delete/lib/models/interfaces.ts +5 -0
- package/components/common/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- 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/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
- 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/port/IpvFourSettings.vue +346 -346
- package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
- package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
- package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
- package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
- package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
- package/components/common/diagramMain/port/Ports.vue +47 -47
- package/components/common/pages/shortcuts/block/BlockNew.vue +2 -7
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// В дереве бэкапов элементы соделжат в поле "id" все "id" родителей разделенной "_".
|
|
2
|
+
// Пример: 0_y3bxahpr_ngzjnhdm(hostId_storageId_bucketId) или 0_y3bxahpr(hostId_storageId)
|
|
3
|
+
export const getBackupTreeNodeIdByTypeFromRoute = (type: 'host' | 'backupStorage' | 'bucket' | 'last'): string => {
|
|
4
|
+
const idFromRoute = useRoute().params.id?.toString() || ''
|
|
5
|
+
|
|
6
|
+
let result = ''
|
|
7
|
+
// if typeFromRoute === 'bucket' ids === [hostId, storageId, bucketId|vmId]
|
|
8
|
+
// if typeFromRoute === 'backup' ids === [hostId, storageId]
|
|
9
|
+
// if typeFromRoute === 'vm' ids === [bucketId|vmId]
|
|
10
|
+
// vmId === bucketId
|
|
11
|
+
|
|
12
|
+
const ids = idFromRoute.split('_')
|
|
13
|
+
switch(type) {
|
|
14
|
+
case 'host':
|
|
15
|
+
result = ids[0]
|
|
16
|
+
break
|
|
17
|
+
case 'backupStorage':
|
|
18
|
+
result = ids[1] || ''
|
|
19
|
+
break
|
|
20
|
+
case 'bucket':
|
|
21
|
+
result = ids[2] || ids[0]
|
|
22
|
+
break
|
|
23
|
+
case 'last':
|
|
24
|
+
result = ids[2] || ids[1] || ids[0]
|
|
25
|
+
break
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return result
|
|
29
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="new-datastore">
|
|
3
|
+
<common-backup-storage-actions-add-temp-add
|
|
4
|
+
mode="procurator"
|
|
5
|
+
:finish-func="onFinish"
|
|
6
|
+
@hide="onHideModal"
|
|
7
|
+
/>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import type {
|
|
13
|
+
// UI_T_DatastoreType,
|
|
14
|
+
UI_T_NfsType,
|
|
15
|
+
} from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
16
|
+
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
17
|
+
|
|
18
|
+
const emits = defineEmits<{
|
|
19
|
+
(event: 'create', value: any): void
|
|
20
|
+
(event: 'hide'): void
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const onFinish = async (
|
|
24
|
+
form: UI_I_CreateDatastoreForm,
|
|
25
|
+
mode: UI_T_DatastoreType,
|
|
26
|
+
version: UI_T_NfsType
|
|
27
|
+
): Promise<void> => {
|
|
28
|
+
emits('create', { form, mode, version })
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const onHideModal = (): void => {
|
|
32
|
+
emits('hide')
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="new-datastore">
|
|
3
|
+
<atoms-modal-by-steps
|
|
4
|
+
test-id="add-datastore-wizard"
|
|
5
|
+
:show="true"
|
|
6
|
+
:title="localization.common.newDatastore"
|
|
7
|
+
:step-items="stepItems"
|
|
8
|
+
:step-position="stepPosition"
|
|
9
|
+
:loading="loading"
|
|
10
|
+
@finish="onAddDatastore"
|
|
11
|
+
@next="onNextStep"
|
|
12
|
+
@back="back"
|
|
13
|
+
@change-step="onChangeStep"
|
|
14
|
+
@hide="onHideModal"
|
|
15
|
+
>
|
|
16
|
+
<template #modalBody>
|
|
17
|
+
<div class="new-datastore__body flex flex-col h-full pl-6">
|
|
18
|
+
<common-backup-storage-actions-add-temp-types
|
|
19
|
+
v-show="stepPosition === 0"
|
|
20
|
+
v-model:type="datastoreType"
|
|
21
|
+
:project="props.mode"
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<common-backup-storage-actions-add-temp-local
|
|
25
|
+
v-show="datastoreType === 'local' && !isShowCompleteBlock"
|
|
26
|
+
:mode="props.mode"
|
|
27
|
+
:step-position="stepPosition"
|
|
28
|
+
:datastore-type="datastoreType"
|
|
29
|
+
:local-create-name-submit="localCreateNameSubmit"
|
|
30
|
+
:datacenter-hosts="props.datacenterHosts"
|
|
31
|
+
:is-main-filter="props.isMainFilter"
|
|
32
|
+
@loading="(e) => (loading = e)"
|
|
33
|
+
@submit="onSaveNameAndNextLocal"
|
|
34
|
+
@main-filter="emits('main-filter', $event)"
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
<common-backup-storage-actions-add-temp-nfs
|
|
38
|
+
v-show="datastoreType === 'nfs' && !isShowCompleteBlock"
|
|
39
|
+
:mode="props.mode"
|
|
40
|
+
:step-position="stepPosition"
|
|
41
|
+
:datastore-type="datastoreType"
|
|
42
|
+
:nfs-configuration-submit="nfsConfigurationSubmit"
|
|
43
|
+
:host-accessibility-submit="hostAccessibilitySubmit"
|
|
44
|
+
:hosts="props.nfsHosts"
|
|
45
|
+
@loading="(e) => (loading = e)"
|
|
46
|
+
@change-nfs-version="updateNfsVersion"
|
|
47
|
+
@submit="saveChangesAndNextNfs"
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
<common-backup-storage-actions-add-temp-samba
|
|
51
|
+
v-show="datastoreType === 'samba' && !isShowCompleteBlock"
|
|
52
|
+
:mode="props.mode"
|
|
53
|
+
:step-position="stepPosition"
|
|
54
|
+
:datastore-type="datastoreType"
|
|
55
|
+
:nfs-configuration-submit="nfsConfigurationSubmit"
|
|
56
|
+
:host-accessibility-submit="hostAccessibilitySubmit"
|
|
57
|
+
:hosts="props.nfsHosts"
|
|
58
|
+
@loading="(e) => (loading = e)"
|
|
59
|
+
@change-nfs-version="updateNfsVersion"
|
|
60
|
+
@submit="saveChangesAndNextSamba"
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<common-backup-storage-actions-add-temp-shared-storm
|
|
64
|
+
v-show="datastoreType === 'shared-storm' && !isShowCompleteBlock"
|
|
65
|
+
:mode="props.mode"
|
|
66
|
+
:step-position="stepPosition"
|
|
67
|
+
:datastore-type="datastoreType"
|
|
68
|
+
:create-name-submit="sharedStormCreateNameSubmit"
|
|
69
|
+
:storage-submit="storageSubmit"
|
|
70
|
+
@loading="(e) => (loading = e)"
|
|
71
|
+
@submit="saveChangesAndNextSharedStorm"
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<common-backup-storage-actions-add-temp-ready-complete
|
|
75
|
+
v-show="isShowCompleteBlock"
|
|
76
|
+
:data-ready-view="dataReadyView"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
</atoms-modal-by-steps>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script setup lang="ts">
|
|
85
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
86
|
+
import type { UI_I_VerticalStepItem } from '~/components/atoms/lib/models/interfaces'
|
|
87
|
+
import type {
|
|
88
|
+
UI_T_DatastoreType,
|
|
89
|
+
UI_T_NfsType,
|
|
90
|
+
UI_T_WizardDatastoreMode,
|
|
91
|
+
} from '~/components/common/backup/storage/actions/add/temp/lib/models/types'
|
|
92
|
+
import type {
|
|
93
|
+
I_SharedStormData,
|
|
94
|
+
UI_I_CreateDatastoreForm,
|
|
95
|
+
} from '~/components/common/backup/storage/actions/add/temp/lib/models/interfaces'
|
|
96
|
+
import { stepItemsFunc } from '~/components/common/backup/storage/actions/add/temp/lib/config/stepItems'
|
|
97
|
+
import { constructDataReadyViewFunc } from '~/components/common/backup/storage/actions/add/temp/readyComplete/lib/config/propertiesDetails'
|
|
98
|
+
|
|
99
|
+
const props = defineProps<{
|
|
100
|
+
// TODO refactoring to project
|
|
101
|
+
mode: UI_T_WizardDatastoreMode
|
|
102
|
+
finishFunc: (
|
|
103
|
+
datastoreForm: UI_I_CreateDatastoreForm,
|
|
104
|
+
datastoreType: UI_T_DatastoreType,
|
|
105
|
+
version: UI_T_NfsType
|
|
106
|
+
) => Promise<void>
|
|
107
|
+
datacenterHosts?: any[]
|
|
108
|
+
nfsHosts?: any
|
|
109
|
+
isMainFilter?: boolean
|
|
110
|
+
hostId?: string
|
|
111
|
+
}>()
|
|
112
|
+
const emits = defineEmits<{
|
|
113
|
+
(event: 'hide'): void
|
|
114
|
+
(event: 'global-refresh'): void
|
|
115
|
+
(event: 'main-filter', value: string): void
|
|
116
|
+
}>()
|
|
117
|
+
|
|
118
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
119
|
+
|
|
120
|
+
const loading = ref<boolean>(false)
|
|
121
|
+
const datastoreType = ref<UI_T_DatastoreType>(
|
|
122
|
+
props.mode === 'procurator' ? 'local' : 'shared-storm'
|
|
123
|
+
)
|
|
124
|
+
const nfsVersion = ref<UI_T_NfsType>('nfs-4.1')
|
|
125
|
+
|
|
126
|
+
const stepPosition = ref<number>(0)
|
|
127
|
+
const dataReadyView = ref<any>([])
|
|
128
|
+
|
|
129
|
+
// TODO move to config
|
|
130
|
+
const datastoreForm = ref<UI_I_CreateDatastoreForm>({
|
|
131
|
+
local: {
|
|
132
|
+
name: '',
|
|
133
|
+
hosts: [],
|
|
134
|
+
type_code: 1,
|
|
135
|
+
},
|
|
136
|
+
nfs: {
|
|
137
|
+
name: '',
|
|
138
|
+
server: '',
|
|
139
|
+
folder: '',
|
|
140
|
+
user: '',
|
|
141
|
+
password: '',
|
|
142
|
+
readonly: false,
|
|
143
|
+
version: nfsVersion.value,
|
|
144
|
+
type_code: 2,
|
|
145
|
+
hosts: [],
|
|
146
|
+
},
|
|
147
|
+
samba: {
|
|
148
|
+
name: '',
|
|
149
|
+
server: '',
|
|
150
|
+
folder: '',
|
|
151
|
+
user: '',
|
|
152
|
+
password: '',
|
|
153
|
+
readonly: false,
|
|
154
|
+
type_code: 3,
|
|
155
|
+
hosts: [],
|
|
156
|
+
},
|
|
157
|
+
sharedStorm: {
|
|
158
|
+
name: '',
|
|
159
|
+
storm_id: '',
|
|
160
|
+
type_code: 4,
|
|
161
|
+
},
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
const stepItems = computed<UI_I_VerticalStepItem[]>(() =>
|
|
165
|
+
stepItemsFunc(localization.value, datastoreType.value, props.mode)
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
let cashStep = -1
|
|
169
|
+
const onNextStep = (force = false): void => {
|
|
170
|
+
const isValid = checkSubmit(force)
|
|
171
|
+
|
|
172
|
+
if (!isValid) {
|
|
173
|
+
return
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const isDisabled = stepItems.value[cashStep]?.disabled
|
|
177
|
+
if (cashStep !== -1 && !isDisabled) {
|
|
178
|
+
stepPosition.value = cashStep
|
|
179
|
+
cashStep = -1
|
|
180
|
+
return
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
stepItems.value[stepPosition.value].complete = true
|
|
184
|
+
stepItems.value[stepPosition.value + 1].disabled = false
|
|
185
|
+
stepPosition.value++
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const back = (): void => {
|
|
189
|
+
stepPosition.value--
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const onChangeStep = (key: number): void => {
|
|
193
|
+
if (key < stepPosition.value) {
|
|
194
|
+
stepPosition.value = key
|
|
195
|
+
return
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const isValid = checkSubmit()
|
|
199
|
+
|
|
200
|
+
if (!isValid) {
|
|
201
|
+
cashStep = key
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
stepPosition.value = key
|
|
206
|
+
}
|
|
207
|
+
const onHideModal = (): void => {
|
|
208
|
+
emits('hide')
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const updateNfsVersion = (event: UI_T_NfsType): void => {
|
|
212
|
+
nfsVersion.value = event
|
|
213
|
+
const { name, server, folder, user, password, hosts } =
|
|
214
|
+
datastoreForm.value.nfs
|
|
215
|
+
saveChangesAndNextNfs({ name, server, folder, user, password, hosts }, false)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const localCreateNameSubmit = ref<number>(0)
|
|
219
|
+
const nfsConfigurationSubmit = ref<number>(0)
|
|
220
|
+
const hostAccessibilitySubmit = ref<number>(0)
|
|
221
|
+
const sharedStormCreateNameSubmit = ref<number>(0)
|
|
222
|
+
const storageSubmit = ref<number>(0)
|
|
223
|
+
|
|
224
|
+
const checkSubmit = (force = false): boolean => {
|
|
225
|
+
if (datastoreType.value === 'local') {
|
|
226
|
+
if (stepPosition.value === 1 && !force) {
|
|
227
|
+
localCreateNameSubmit.value++
|
|
228
|
+
return false
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (datastoreType.value === 'nfs') {
|
|
233
|
+
if (stepPosition.value === 1 && !force) {
|
|
234
|
+
nfsConfigurationSubmit.value++
|
|
235
|
+
return false
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (props.mode === 'sphere' && stepPosition.value === 2 && !force) {
|
|
239
|
+
hostAccessibilitySubmit.value++
|
|
240
|
+
return false
|
|
241
|
+
}
|
|
242
|
+
// if (
|
|
243
|
+
// ((stepPosition.value === 4 && nfsVersion.value === 'nfs-4.1') ||
|
|
244
|
+
// (stepPosition.value === 3 && nfsVersion.value === 'nfs-3')) &&
|
|
245
|
+
// !force
|
|
246
|
+
// ) {
|
|
247
|
+
// hostAccessibilitySubmit.value++
|
|
248
|
+
// return false
|
|
249
|
+
// }
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (datastoreType.value === 'samba') {
|
|
253
|
+
if (stepPosition.value === 1 && !force) {
|
|
254
|
+
nfsConfigurationSubmit.value++
|
|
255
|
+
return false
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (props.mode === 'sphere' && stepPosition.value === 2 && !force) {
|
|
259
|
+
hostAccessibilitySubmit.value++
|
|
260
|
+
return false
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (datastoreType.value === 'shared-storm') {
|
|
265
|
+
if (stepPosition.value === 1 && !force) {
|
|
266
|
+
sharedStormCreateNameSubmit.value++
|
|
267
|
+
return false
|
|
268
|
+
}
|
|
269
|
+
if (stepPosition.value === 2 && !force) {
|
|
270
|
+
storageSubmit.value++
|
|
271
|
+
return false
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return true
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const isWizardModeForSphere = computed<boolean>(() => props.mode === 'sphere')
|
|
279
|
+
|
|
280
|
+
const onSaveNameAndNextLocal = (event: any): void => {
|
|
281
|
+
const { local } = datastoreForm.value
|
|
282
|
+
|
|
283
|
+
if (isWizardModeForSphere.value) {
|
|
284
|
+
local.name = event.name
|
|
285
|
+
local.hosts.push(event.host)
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!isWizardModeForSphere.value) {
|
|
289
|
+
local.name = event
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
dataReadyView.value = constructDataReadyViewFunc(
|
|
293
|
+
localization.value,
|
|
294
|
+
'local',
|
|
295
|
+
event,
|
|
296
|
+
isWizardModeForSphere.value
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
onNextStep(true)
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const saveChangesAndNextNfs = (event: any, next = true): void => {
|
|
303
|
+
const { nfs } = datastoreForm.value
|
|
304
|
+
nfs.name = event.name
|
|
305
|
+
nfs.folder = event.folder
|
|
306
|
+
nfs.server = event.server
|
|
307
|
+
nfs.user = event.user
|
|
308
|
+
nfs.password = event.password
|
|
309
|
+
nfs.hosts = event.hosts
|
|
310
|
+
|
|
311
|
+
// TODO refactoring
|
|
312
|
+
const hostsNames = props.nfsHosts
|
|
313
|
+
? props.nfsHosts.items
|
|
314
|
+
.filter((host) => event.hosts.includes(host.id))
|
|
315
|
+
.map((host) => host.host)
|
|
316
|
+
: []
|
|
317
|
+
|
|
318
|
+
dataReadyView.value = constructDataReadyViewFunc(
|
|
319
|
+
localization.value,
|
|
320
|
+
'nfs',
|
|
321
|
+
{
|
|
322
|
+
...event,
|
|
323
|
+
hosts: hostsNames,
|
|
324
|
+
version: nfsVersion.value,
|
|
325
|
+
},
|
|
326
|
+
isWizardModeForSphere.value
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
next && onNextStep(true)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const saveChangesAndNextSamba = (event: any, next = true): void => {
|
|
333
|
+
const { samba } = datastoreForm.value
|
|
334
|
+
samba.name = event.name
|
|
335
|
+
samba.folder = event.folder
|
|
336
|
+
samba.server = event.server
|
|
337
|
+
samba.user = event.user
|
|
338
|
+
samba.password = event.password
|
|
339
|
+
samba.hosts = event.hosts
|
|
340
|
+
|
|
341
|
+
// TODO refactoring
|
|
342
|
+
const hostsNames = props.nfsHosts
|
|
343
|
+
? props.nfsHosts.items
|
|
344
|
+
.filter((host) => event.hosts.includes(host.id))
|
|
345
|
+
.map((host) => host.host)
|
|
346
|
+
: []
|
|
347
|
+
|
|
348
|
+
dataReadyView.value = constructDataReadyViewFunc(
|
|
349
|
+
localization.value,
|
|
350
|
+
'samba',
|
|
351
|
+
{
|
|
352
|
+
...event,
|
|
353
|
+
hosts: hostsNames,
|
|
354
|
+
},
|
|
355
|
+
isWizardModeForSphere.value
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
next && onNextStep(true)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const saveChangesAndNextSharedStorm = (
|
|
362
|
+
event: I_SharedStormData,
|
|
363
|
+
next = true
|
|
364
|
+
): void => {
|
|
365
|
+
const { sharedStorm } = datastoreForm.value
|
|
366
|
+
sharedStorm.name = event.name
|
|
367
|
+
sharedStorm.storm_id = event.storm_id
|
|
368
|
+
|
|
369
|
+
dataReadyView.value = constructDataReadyViewFunc(
|
|
370
|
+
localization.value,
|
|
371
|
+
'shared-storm',
|
|
372
|
+
{
|
|
373
|
+
...event,
|
|
374
|
+
},
|
|
375
|
+
isWizardModeForSphere.value
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
next && onNextStep(true)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const isShowCompleteBlock = computed<boolean>(() => {
|
|
382
|
+
// TODO refactoring
|
|
383
|
+
const localStep = datastoreType.value === 'local' && stepPosition.value === 2
|
|
384
|
+
|
|
385
|
+
let nfsFirst
|
|
386
|
+
if (props.mode === 'procurator') {
|
|
387
|
+
nfsFirst =
|
|
388
|
+
datastoreType.value === 'nfs' &&
|
|
389
|
+
nfsVersion.value === 'nfs-3' &&
|
|
390
|
+
stepPosition.value === 3
|
|
391
|
+
} else {
|
|
392
|
+
nfsFirst =
|
|
393
|
+
datastoreType.value === 'nfs' &&
|
|
394
|
+
nfsVersion.value === 'nfs-3' &&
|
|
395
|
+
stepPosition.value === 4
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
let nfsSecond
|
|
399
|
+
if (props.mode === 'procurator') {
|
|
400
|
+
nfsSecond =
|
|
401
|
+
datastoreType.value === 'nfs' &&
|
|
402
|
+
nfsVersion.value === 'nfs-4.1' &&
|
|
403
|
+
stepPosition.value === 2
|
|
404
|
+
} else {
|
|
405
|
+
nfsSecond =
|
|
406
|
+
datastoreType.value === 'nfs' &&
|
|
407
|
+
nfsVersion.value === 'nfs-4.1' &&
|
|
408
|
+
stepPosition.value === 3
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
let samba
|
|
412
|
+
if (props.mode === 'procurator') {
|
|
413
|
+
samba = datastoreType.value === 'samba' && stepPosition.value === 2
|
|
414
|
+
} else {
|
|
415
|
+
samba = datastoreType.value === 'samba' && stepPosition.value === 3
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
let sharedStorm
|
|
419
|
+
if (props.mode === 'procurator') {
|
|
420
|
+
sharedStorm =
|
|
421
|
+
datastoreType.value === 'shared-storm' && stepPosition.value === 3
|
|
422
|
+
} else {
|
|
423
|
+
sharedStorm =
|
|
424
|
+
datastoreType.value === 'shared-storm' && stepPosition.value === 4
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return localStep || nfsFirst || nfsSecond || samba || sharedStorm
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
const onAddDatastore = async (): Promise<void> => {
|
|
431
|
+
loading.value = true
|
|
432
|
+
|
|
433
|
+
props
|
|
434
|
+
.finishFunc(datastoreForm.value, datastoreType.value, nfsVersion.value)
|
|
435
|
+
.then(() => {
|
|
436
|
+
emits('global-refresh')
|
|
437
|
+
loading.value = false
|
|
438
|
+
onHideModal()
|
|
439
|
+
})
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// const createDatastoreFromLocal = async (): Promise<API_UI_I_Error> => {
|
|
443
|
+
// const { local } = datastoreForm.value
|
|
444
|
+
//
|
|
445
|
+
// return await createDatastore<Omit<UI_I_CreateDatastoreBodyRequest, 'pool_name'>>(
|
|
446
|
+
// local
|
|
447
|
+
// )
|
|
448
|
+
// }
|
|
449
|
+
// const createDatastoreFromSharedStorm = async (): Promise<API_UI_I_Error> => {
|
|
450
|
+
// const {
|
|
451
|
+
// sharedStorm: { dev_names: disks, ...sendData },
|
|
452
|
+
// } = datastoreForm.value
|
|
453
|
+
//
|
|
454
|
+
// const { data, msg } = await getStoragePoolName<{ dev_names: string[] }>(
|
|
455
|
+
// '/psm/api/v1/storage/lvm/create',
|
|
456
|
+
// { dev_names: disks }
|
|
457
|
+
// )
|
|
458
|
+
//
|
|
459
|
+
// if (!data && msg) return msg
|
|
460
|
+
//
|
|
461
|
+
// sendData.pool_name = data?.pool_name || ''
|
|
462
|
+
//
|
|
463
|
+
// return await createDatastore(sendData)
|
|
464
|
+
// }
|
|
465
|
+
|
|
466
|
+
// const createDatastoreFromNfs = async (): Promise<API_UI_I_Error> => {
|
|
467
|
+
// const {
|
|
468
|
+
// nfs: { server, folder, readonly, name, type_code: type },
|
|
469
|
+
// } = datastoreForm.value
|
|
470
|
+
//
|
|
471
|
+
// const sendDataOne = {
|
|
472
|
+
// server,
|
|
473
|
+
// folder,
|
|
474
|
+
// readonly,
|
|
475
|
+
// version: nfsVersion.value === 'nfs-4.1' ? 4.1 : 3.0,
|
|
476
|
+
// }
|
|
477
|
+
//
|
|
478
|
+
// const { data, msg } = await getStoragePoolName<UI_I_NfsPoolNameForm>(
|
|
479
|
+
// '/psm/api/v1/storage/cnfs',
|
|
480
|
+
// sendDataOne
|
|
481
|
+
// )
|
|
482
|
+
//
|
|
483
|
+
// if (!data && msg) return msg
|
|
484
|
+
//
|
|
485
|
+
// const sendDataTwo = {
|
|
486
|
+
// name,
|
|
487
|
+
// type_code: type,
|
|
488
|
+
// pool_name: data?.pool_name || '',
|
|
489
|
+
// }
|
|
490
|
+
//
|
|
491
|
+
// return await createDatastore(sendDataTwo)
|
|
492
|
+
// }
|
|
493
|
+
</script>
|
|
494
|
+
|
|
495
|
+
<style scoped lang="scss">
|
|
496
|
+
.finish-block {
|
|
497
|
+
padding: 18px 24px 24px 24px;
|
|
498
|
+
|
|
499
|
+
.add-hosts-ready-to-complete-mt-12 {
|
|
500
|
+
margin-top: 12px;
|
|
501
|
+
|
|
502
|
+
.add-hosts-ready-to-complete-bold {
|
|
503
|
+
line-height: 18px;
|
|
504
|
+
font-weight: 700;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
</style>
|