bfg-common 1.5.77 → 1.5.79
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/wizards/datastore/add/Add.vue +17 -20
- package/components/common/wizards/datastore/add/New.vue +7 -12
- package/components/common/wizards/datastore/add/Old.vue +6 -7
- package/components/common/wizards/datastore/add/lib/config/steps.ts +9 -8
- package/components/common/wizards/datastore/add/lib/validations.ts +32 -16
- package/components/common/wizards/datastore/add/steps/common/tooltipInfo/TooltipInfo.vue +20 -30
- package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigure.vue +22 -164
- package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue +199 -19
- package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureOld.vue +114 -117
- package/package.json +1 -1
- package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +0 -92
- package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +0 -142
|
@@ -42,9 +42,10 @@ import {
|
|
|
42
42
|
stepsFunc,
|
|
43
43
|
stepsSchemeInitial,
|
|
44
44
|
getStepScheme,
|
|
45
|
+
dynamicSteps,
|
|
45
46
|
} from '~/components/common/wizards/datastore/add/lib/config/steps'
|
|
46
47
|
import { datastoreDefaultFormFunc } from '~/components/common/wizards/datastore/add/lib/config/createDatastore'
|
|
47
|
-
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
|
|
48
|
+
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
|
|
48
49
|
import * as validation from '~/components/common/wizards/datastore/add/lib/validations'
|
|
49
50
|
|
|
50
51
|
const props = defineProps<{
|
|
@@ -84,28 +85,18 @@ const validationFunc = async (
|
|
|
84
85
|
): Promise<UI_I_ValidationReturn> => {
|
|
85
86
|
let stepHasError = false
|
|
86
87
|
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
1,
|
|
93
|
-
'datastoreName',
|
|
94
|
-
wizard,
|
|
95
|
-
props.project
|
|
88
|
+
if (
|
|
89
|
+
wizard.isValidateForStep(
|
|
90
|
+
dynamicSteps.nameAndDevice,
|
|
91
|
+
currentStep.id,
|
|
92
|
+
nextStep.id
|
|
96
93
|
)
|
|
97
|
-
|
|
98
|
-
value = nameValidation.newValue
|
|
99
|
-
|
|
100
|
-
stepHasError = nameValidation.stepHasError
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
|
|
94
|
+
) {
|
|
104
95
|
const nameValidation = await validation.checkDatastoreNameAsync(
|
|
105
96
|
localization.value,
|
|
106
97
|
value,
|
|
107
98
|
form.value,
|
|
108
|
-
|
|
99
|
+
dynamicSteps.nameAndDevice,
|
|
109
100
|
'datastoreName',
|
|
110
101
|
wizard,
|
|
111
102
|
props.project
|
|
@@ -127,12 +118,18 @@ const validationFunc = async (
|
|
|
127
118
|
stepHasError = nameValidation.stepHasError || lunDiskValidation.stepHasError
|
|
128
119
|
}
|
|
129
120
|
|
|
130
|
-
if (
|
|
121
|
+
if (
|
|
122
|
+
wizard.isValidateForStep(
|
|
123
|
+
dynamicSteps.nameAndConfigure,
|
|
124
|
+
currentStep.id,
|
|
125
|
+
nextStep.id
|
|
126
|
+
)
|
|
127
|
+
) {
|
|
131
128
|
const nameValidation = await validation.checkDatastoreNameAsync(
|
|
132
129
|
localization.value,
|
|
133
130
|
value,
|
|
134
131
|
form.value,
|
|
135
|
-
|
|
132
|
+
dynamicSteps.nameAndConfigure,
|
|
136
133
|
'name',
|
|
137
134
|
wizard,
|
|
138
135
|
props.project
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
v-model="formModelLocal"
|
|
91
91
|
:project="props.project"
|
|
92
92
|
:messages-fields="selectedStep.fields"
|
|
93
|
-
@hide-alert="(e) => emits('hide-alert', e)"
|
|
94
93
|
/>
|
|
95
94
|
</template>
|
|
96
95
|
</ui-wizard-block>
|
|
@@ -103,7 +102,9 @@
|
|
|
103
102
|
<div ref="subTitleBlock3">
|
|
104
103
|
<div class="subtitle-block">
|
|
105
104
|
<ui-alert
|
|
106
|
-
v-if="
|
|
105
|
+
v-if="
|
|
106
|
+
props.alertMessages[dynamicSteps.hostAccessibility].length
|
|
107
|
+
"
|
|
107
108
|
test-id="add-host-assign-license-error-alert"
|
|
108
109
|
type="error"
|
|
109
110
|
size="md"
|
|
@@ -127,25 +128,19 @@
|
|
|
127
128
|
</ui-wizard-block>
|
|
128
129
|
|
|
129
130
|
<ui-wizard-block
|
|
130
|
-
v-if="selectedStep.id === dynamicSteps.
|
|
131
|
+
v-if="selectedStep.id === dynamicSteps.readyComplete"
|
|
131
132
|
:sub-title-height="height4"
|
|
132
133
|
>
|
|
133
134
|
<template #subTitle>
|
|
134
135
|
<div ref="subTitleBlock4">
|
|
135
136
|
<div class="subtitle-block">
|
|
136
137
|
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
137
|
-
<ui-wizard-subtitle
|
|
138
|
-
:sub-title="localization.common.whenEnabledLockdown"
|
|
139
|
-
/>
|
|
140
|
-
<ui-wizard-subtitle
|
|
141
|
-
:sub-title="localization.common.leaveLockdownDefault"
|
|
142
|
-
/>
|
|
143
138
|
</div>
|
|
144
139
|
</div>
|
|
145
140
|
</template>
|
|
146
141
|
<template #content>
|
|
147
|
-
<common-wizards-datastore-add-ready-complete
|
|
148
|
-
v-
|
|
142
|
+
<common-wizards-datastore-add-steps-ready-complete
|
|
143
|
+
v-if="selectedStep.id === dynamicSteps.readyComplete"
|
|
149
144
|
:data-ready-view="dataReadyView"
|
|
150
145
|
/>
|
|
151
146
|
</template>
|
|
@@ -167,7 +162,7 @@ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datasto
|
|
|
167
162
|
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
168
163
|
import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
169
164
|
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
170
|
-
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
|
|
165
|
+
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
|
|
171
166
|
import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
|
|
172
167
|
|
|
173
168
|
const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
@hide-alert="(e) => emits('hide-alert', e)"
|
|
41
41
|
/>
|
|
42
42
|
|
|
43
|
-
|
|
44
43
|
<common-wizards-datastore-add-steps-host-accessibility
|
|
45
44
|
v-if="selectedStep.id === dynamicSteps.hostAccessibility"
|
|
46
45
|
v-model="formModelLocal.hosts"
|
|
@@ -49,6 +48,11 @@
|
|
|
49
48
|
@hide-alert="(e) => emits('hide-alert', e)"
|
|
50
49
|
/>
|
|
51
50
|
|
|
51
|
+
<common-wizards-datastore-add-steps-ready-complete
|
|
52
|
+
v-if="selectedStep.id === dynamicSteps.readyComplete"
|
|
53
|
+
:data-ready-view="dataReadyView"
|
|
54
|
+
/>
|
|
55
|
+
|
|
52
56
|
<common-wizards-datastore-add-shared-storm
|
|
53
57
|
v-if="datastoreType === 'shared-storm'"
|
|
54
58
|
v-model="formModelLocal"
|
|
@@ -73,11 +77,6 @@
|
|
|
73
77
|
:messages-fields="selectedStep.fields"
|
|
74
78
|
:hosts="props.nfsHosts"
|
|
75
79
|
/>
|
|
76
|
-
|
|
77
|
-
<common-wizards-datastore-add-ready-complete
|
|
78
|
-
v-show="selectedStep.id === 11"
|
|
79
|
-
:data-ready-view="dataReadyView"
|
|
80
|
-
/>
|
|
81
80
|
</template>
|
|
82
81
|
</atoms-wizard>
|
|
83
82
|
</div>
|
|
@@ -92,7 +91,7 @@ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datasto
|
|
|
92
91
|
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
93
92
|
import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
94
93
|
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
95
|
-
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
|
|
94
|
+
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
|
|
96
95
|
import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
|
|
97
96
|
|
|
98
97
|
const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
|
|
@@ -4,14 +4,11 @@ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/inter
|
|
|
4
4
|
import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
|
|
5
5
|
import type { UI_I_ChangeStepsSchemes } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
6
6
|
import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
7
|
-
|
|
8
7
|
export const dynamicSteps = {
|
|
9
8
|
type: 0,
|
|
10
9
|
nameAndDevice: 1,
|
|
11
10
|
nameAndConfigure: 2,
|
|
12
11
|
hostAccessibility: 3,
|
|
13
|
-
lockdownMode: 4,
|
|
14
|
-
vmLocation: 5,
|
|
15
12
|
readyComplete: 6,
|
|
16
13
|
}
|
|
17
14
|
export const stepsFunc = (
|
|
@@ -131,7 +128,7 @@ export const stepsFunc = (
|
|
|
131
128
|
// testId: 'select-kerberos-authentication',
|
|
132
129
|
// },
|
|
133
130
|
{
|
|
134
|
-
id:
|
|
131
|
+
id: dynamicSteps.readyComplete,
|
|
135
132
|
title: localization.common.readyComplete,
|
|
136
133
|
subTitle: localization.common.readyCompleteDesc,
|
|
137
134
|
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
@@ -142,14 +139,18 @@ export const stepsFunc = (
|
|
|
142
139
|
]
|
|
143
140
|
|
|
144
141
|
export const stepsSchemeInitial: number[][] = [
|
|
145
|
-
[dynamicSteps.type, dynamicSteps.nameAndDevice,
|
|
146
|
-
[
|
|
147
|
-
|
|
142
|
+
[dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Procurator Scheme for "shared-storm" type
|
|
143
|
+
[
|
|
144
|
+
dynamicSteps.type,
|
|
145
|
+
dynamicSteps.nameAndConfigure,
|
|
146
|
+
dynamicSteps.readyComplete,
|
|
147
|
+
], // Procurator Scheme for "nfs" type
|
|
148
|
+
[dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Sphere Scheme for "shared-storm" type
|
|
148
149
|
[
|
|
149
150
|
dynamicSteps.type,
|
|
150
151
|
dynamicSteps.nameAndConfigure,
|
|
151
152
|
dynamicSteps.hostAccessibility,
|
|
152
|
-
|
|
153
|
+
dynamicSteps.readyComplete,
|
|
153
154
|
], // Sphere Scheme for "nfs" type (not used from <host Context Menu>)
|
|
154
155
|
]
|
|
155
156
|
|
|
@@ -8,7 +8,7 @@ import type Wizard from '~/components/atoms/wizard/lib/utils/utils'
|
|
|
8
8
|
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
9
9
|
import type { UI_T_Project } from '~/lib/models/types'
|
|
10
10
|
import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
|
|
11
|
-
|
|
11
|
+
import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
|
|
12
12
|
const checkName = async (
|
|
13
13
|
form: UI_I_CreateDatastoreForm,
|
|
14
14
|
localization: UI_I_Localization,
|
|
@@ -83,14 +83,14 @@ export const checkSelectedLunDiskSync = (
|
|
|
83
83
|
if (!lunDisk.length && name) {
|
|
84
84
|
const isErrorTextForSphere =
|
|
85
85
|
project === 'sphere' && !hostId && !hosts.length
|
|
86
|
-
stepHasError = wizard.setValidation(
|
|
86
|
+
stepHasError = wizard.setValidation(dynamicSteps.nameAndDevice, 'lunDisk', {
|
|
87
87
|
fieldMessage: '',
|
|
88
88
|
alertMessage: isErrorTextForSphere
|
|
89
89
|
? localization.common.selectHostToContinueAlert
|
|
90
90
|
: localization.common.selectDiskToContinueAlert,
|
|
91
91
|
})
|
|
92
|
-
} else if (wizard.hasMessage(
|
|
93
|
-
value = wizard.removeValidation(
|
|
92
|
+
} else if (wizard.hasMessage(dynamicSteps.nameAndDevice, 'lunDisk')) {
|
|
93
|
+
value = wizard.removeValidation(dynamicSteps.nameAndDevice, 'lunDisk', value)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
return {
|
|
@@ -108,12 +108,20 @@ export const checkNfsFolderSync = (
|
|
|
108
108
|
let stepHasError = false
|
|
109
109
|
|
|
110
110
|
if (!name) {
|
|
111
|
-
stepHasError = wizard.setValidation(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
stepHasError = wizard.setValidation(
|
|
112
|
+
dynamicSteps.nameAndConfigure,
|
|
113
|
+
'folder',
|
|
114
|
+
{
|
|
115
|
+
fieldMessage: localization.common.specifyFolderName,
|
|
116
|
+
alertMessage: '',
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
} else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'folder')) {
|
|
120
|
+
value = wizard.removeValidation(
|
|
121
|
+
dynamicSteps.nameAndConfigure,
|
|
122
|
+
'folder',
|
|
123
|
+
value
|
|
124
|
+
)
|
|
117
125
|
}
|
|
118
126
|
|
|
119
127
|
return {
|
|
@@ -131,12 +139,20 @@ export const checkNfsServerSync = (
|
|
|
131
139
|
let stepHasError = false
|
|
132
140
|
|
|
133
141
|
if (!name) {
|
|
134
|
-
stepHasError = wizard.setValidation(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
stepHasError = wizard.setValidation(
|
|
143
|
+
dynamicSteps.nameAndConfigure,
|
|
144
|
+
'server',
|
|
145
|
+
{
|
|
146
|
+
fieldMessage: localization.common.specifyServerName,
|
|
147
|
+
alertMessage: '',
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
} else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'server')) {
|
|
151
|
+
value = wizard.removeValidation(
|
|
152
|
+
dynamicSteps.nameAndConfigure,
|
|
153
|
+
'server',
|
|
154
|
+
value
|
|
155
|
+
)
|
|
140
156
|
}
|
|
141
157
|
|
|
142
158
|
return {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="tooltip-info">
|
|
3
3
|
<ui-icon
|
|
4
|
-
:id="
|
|
4
|
+
:id="`${props.id}-info-trigger`"
|
|
5
5
|
name="info"
|
|
6
|
-
width="
|
|
7
|
-
height="
|
|
8
|
-
:class="['
|
|
9
|
-
@click.stop="
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
:class="['tooltip-info__icon pointer', { active: isShowInfo }]"
|
|
9
|
+
@click.stop="isShowInfo = !isShowInfo"
|
|
10
10
|
/>
|
|
11
11
|
<ui-popup-window
|
|
12
12
|
v-model="isShowInfo"
|
|
13
13
|
top
|
|
14
14
|
left
|
|
15
|
-
|
|
15
|
+
width="272px"
|
|
16
|
+
:elem-id="`${props.id}-info-trigger`"
|
|
16
17
|
>
|
|
17
18
|
<div class="common-widget-info">
|
|
18
|
-
<div class="
|
|
19
|
-
<div class="flex
|
|
19
|
+
<div class="flex justify-between">
|
|
20
|
+
<div class="flex">
|
|
20
21
|
<ui-icon name="info-2" width="16px" height="16px" />
|
|
21
22
|
<span class="title"> {{ localization.common.information }}</span>
|
|
22
23
|
</div>
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
class="pointer hide-icon"
|
|
26
27
|
width="16px"
|
|
27
28
|
height="16px"
|
|
28
|
-
@click.stop="
|
|
29
|
+
@click.stop="isShowInfo = false"
|
|
29
30
|
/>
|
|
30
31
|
</div>
|
|
31
32
|
|
|
@@ -44,42 +45,30 @@ const props = withDefaults(
|
|
|
44
45
|
defineProps<{
|
|
45
46
|
id: string
|
|
46
47
|
info: string
|
|
47
|
-
openedError: string
|
|
48
48
|
}>(),
|
|
49
49
|
{}
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
(event: 'toggle-error', value: string): void
|
|
56
|
-
}>()
|
|
57
|
-
|
|
58
|
-
const isShowInfo = computed<boolean>({
|
|
59
|
-
get() {
|
|
60
|
-
return props.openedError === props.id
|
|
61
|
-
},
|
|
62
|
-
set() {
|
|
63
|
-
emits('toggle-error', '')
|
|
64
|
-
},
|
|
65
|
-
})
|
|
54
|
+
const isShowInfo = ref<boolean>(false)
|
|
66
55
|
</script>
|
|
67
56
|
|
|
68
57
|
<style lang="scss" scoped>
|
|
58
|
+
@import 'assets/scss/common/mixins.scss';
|
|
69
59
|
.tooltip-info {
|
|
70
|
-
|
|
60
|
+
@include flex($align: center);
|
|
61
|
+
&__icon {
|
|
71
62
|
color: var(--form-icon-color);
|
|
72
|
-
|
|
73
63
|
&:hover {
|
|
74
64
|
color: var(--close-icon);
|
|
75
65
|
}
|
|
76
|
-
&.
|
|
66
|
+
&.active {
|
|
77
67
|
color: var(--btn-primary-fill-bg-color);
|
|
78
68
|
}
|
|
79
69
|
}
|
|
80
70
|
|
|
81
71
|
.common-widget-info {
|
|
82
|
-
width: 232px;
|
|
83
72
|
padding: 16px;
|
|
84
73
|
|
|
85
74
|
.title {
|
|
@@ -90,16 +79,17 @@ const isShowInfo = computed<boolean>({
|
|
|
90
79
|
margin-left: 8px;
|
|
91
80
|
}
|
|
92
81
|
|
|
93
|
-
.hide-icon {
|
|
94
|
-
color: var(--alert-icon);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
82
|
.common-widget-info-description {
|
|
98
83
|
font-size: 13px;
|
|
99
84
|
line-height: 15.73px;
|
|
100
85
|
color: var(--zabbix-text-color);
|
|
101
86
|
margin-top: 12px;
|
|
102
87
|
}
|
|
88
|
+
|
|
89
|
+
svg {
|
|
90
|
+
color: var(--alert-icon);
|
|
91
|
+
min-width: 16px;
|
|
92
|
+
}
|
|
103
93
|
}
|
|
104
94
|
}
|
|
105
95
|
</style>
|
|
@@ -1,185 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@remove="alertInfo = false"
|
|
18
|
-
/>
|
|
19
|
-
<h6 class="nd-mt-0">{{ localization.common.nfsShareDetails }}</h6>
|
|
20
|
-
|
|
21
|
-
<div class="clr-form-control clr-row">
|
|
22
|
-
<label for="" class="clr-control-label clr-col-md-2">
|
|
23
|
-
{{ localization.common.name }}
|
|
24
|
-
</label>
|
|
25
|
-
|
|
26
|
-
<div
|
|
27
|
-
class="clr-control-container"
|
|
28
|
-
:class="nameErrorText && 'clr-error'"
|
|
29
|
-
>
|
|
30
|
-
<div class="flex-align-center">
|
|
31
|
-
<input
|
|
32
|
-
id="configuration-name-input"
|
|
33
|
-
v-model="model.name"
|
|
34
|
-
data-id="configuration-name-input"
|
|
35
|
-
type="text"
|
|
36
|
-
class="clr-input"
|
|
37
|
-
@blur="initValidation(true, ['name'])"
|
|
38
|
-
@input="initValidation(false, ['name'])"
|
|
39
|
-
/>
|
|
40
|
-
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div class="clr-subtext" data-id="nfs-datastore-name-field-require">
|
|
44
|
-
{{ nameErrorText }}
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div class="clr-form-control clr-row">
|
|
50
|
-
<label class="clr-control-label clr-col-md-2">
|
|
51
|
-
{{ localization.common.folder }}
|
|
52
|
-
</label>
|
|
53
|
-
|
|
54
|
-
<div
|
|
55
|
-
class="clr-control-container"
|
|
56
|
-
:class="folderErrorText && 'clr-error'"
|
|
57
|
-
>
|
|
58
|
-
<div class="flex-align-center">
|
|
59
|
-
<input
|
|
60
|
-
id="configuration-folder-input"
|
|
61
|
-
v-model="model.folder"
|
|
62
|
-
data-id="configuration-folder-input"
|
|
63
|
-
type="text"
|
|
64
|
-
class="clr-input"
|
|
65
|
-
@blur="initValidation(true, ['folder'])"
|
|
66
|
-
@input="initValidation(false, ['folder'])"
|
|
67
|
-
/>
|
|
68
|
-
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div
|
|
72
|
-
v-if="folderErrorText"
|
|
73
|
-
class="clr-subtext"
|
|
74
|
-
data-id="folder-name-field-require"
|
|
75
|
-
>
|
|
76
|
-
{{ folderErrorText }}
|
|
77
|
-
</div>
|
|
78
|
-
<div v-else class="clr-subtext">E.g: /vols/vol0/datastore-001</div>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
|
|
82
|
-
<div class="nd-mt-0 clr-form-control clr-row">
|
|
83
|
-
<label class="clr-control-label clr-col-md-2">
|
|
84
|
-
{{ localization.common.server }}
|
|
85
|
-
</label>
|
|
86
|
-
|
|
87
|
-
<div
|
|
88
|
-
class="clr-control-container"
|
|
89
|
-
:class="serverErrorText && 'clr-error'"
|
|
90
|
-
>
|
|
91
|
-
<div class="flex-align-center input-action-wrapper">
|
|
92
|
-
<input
|
|
93
|
-
id="configuration-server-input"
|
|
94
|
-
v-model="model.server"
|
|
95
|
-
data-id="configuration-server-input"
|
|
96
|
-
type="text"
|
|
97
|
-
class="clr-input"
|
|
98
|
-
@blur="initValidation(true, ['server'])"
|
|
99
|
-
@input="initValidation(false, ['server'])"
|
|
100
|
-
/>
|
|
101
|
-
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
102
|
-
</div>
|
|
103
|
-
<div
|
|
104
|
-
v-if="serverErrorText"
|
|
105
|
-
class="clr-subtext"
|
|
106
|
-
data-id="server-name-field-require"
|
|
107
|
-
>
|
|
108
|
-
{{ serverErrorText }}
|
|
109
|
-
</div>
|
|
110
|
-
<div v-else class="clr-subtext">
|
|
111
|
-
E.g: nas, nas.it.com or 192.168.0.1
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
2
|
+
<common-wizards-datastore-add-steps-name-and-configure-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model="formModel"
|
|
5
|
+
v-model:alert-info="isShowAlertInfo"
|
|
6
|
+
:messages-fields="props.messagesFields"
|
|
7
|
+
/>
|
|
8
|
+
|
|
9
|
+
<common-wizards-datastore-add-steps-name-and-configure-old
|
|
10
|
+
v-else
|
|
11
|
+
v-model="formModel"
|
|
12
|
+
v-model:alert-info="isShowAlertInfo"
|
|
13
|
+
:alert-messages="props.alertMessages"
|
|
14
|
+
:messages-fields="props.messagesFields"
|
|
15
|
+
@hide-alert="(e) => emits('hide-alert', e)"
|
|
16
|
+
/>
|
|
117
17
|
</template>
|
|
118
18
|
|
|
119
19
|
<script lang="ts" setup>
|
|
120
20
|
import type { UI_T_Project } from '~/lib/models/types'
|
|
121
|
-
import type {
|
|
122
|
-
|
|
123
|
-
UI_I_ArbitraryObject,
|
|
124
|
-
} from '~/lib/models/interfaces'
|
|
125
|
-
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
126
|
-
import type { UI_I_InitialValidationFields } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
|
|
21
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
22
|
+
import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
127
23
|
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
128
24
|
|
|
25
|
+
const formModel = defineModel<UI_I_CreateDatastoreForm>({ required: true })
|
|
129
26
|
const props = defineProps<{
|
|
130
27
|
project: UI_T_Project
|
|
131
28
|
alertMessages: string[]
|
|
132
|
-
messagesFields:
|
|
29
|
+
messagesFields: UI_I_WizardStep['fields']
|
|
133
30
|
}>()
|
|
134
|
-
const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
|
|
135
31
|
const emits = defineEmits<{
|
|
136
32
|
(event: 'hide-alert', value: number): void
|
|
137
33
|
}>()
|
|
138
34
|
|
|
139
35
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
36
|
+
const { $store }: any = useNuxtApp()
|
|
140
37
|
|
|
141
|
-
const
|
|
142
|
-
name: false,
|
|
143
|
-
folder: false,
|
|
144
|
-
server: false,
|
|
145
|
-
})
|
|
146
|
-
const initValidation = (onlyBlur = false, types: string[]): void => {
|
|
147
|
-
onlyBlur && types.forEach((type) => (initValidationFields.value[type] = true))
|
|
148
|
-
}
|
|
38
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
149
39
|
|
|
150
|
-
|
|
151
|
-
const nameErrorText = computed<string>(() => {
|
|
152
|
-
if (props.messagesFields?.name?.field && !model.value.name) {
|
|
153
|
-
return props.messagesFields.name.field
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (!initValidationFields.value.name) return ''
|
|
157
|
-
return !model.value.name ? localization.value.common.specifyDatastoreName : ''
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
/* Validation error text for Folder input field */
|
|
161
|
-
const folderErrorText = computed<string>(() => {
|
|
162
|
-
if (props.messagesFields.folder?.field && !model.value.folder) {
|
|
163
|
-
return props.messagesFields.folder.field
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (!initValidationFields.value.folder) return ''
|
|
167
|
-
return !model.value.folder ? localization.value.common.specifyFolderName : ''
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
/* Validation error text for Server input field */
|
|
171
|
-
const serverErrorText = computed<string>(() => {
|
|
172
|
-
if (props.messagesFields.server?.field && !model.value.server) {
|
|
173
|
-
return props.messagesFields.server.field
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (!initValidationFields.value.server) return ''
|
|
177
|
-
return !model.value.server ? localization.value.common.specifyServerName : ''
|
|
178
|
-
})
|
|
179
|
-
const onHideAlert = (): void => {
|
|
180
|
-
emits('hide-alert', 5)
|
|
181
|
-
}
|
|
182
|
-
const alertInfo = ref<boolean>(props.project === 'procurator')
|
|
40
|
+
const isShowAlertInfo = ref<boolean>(props.project === 'procurator')
|
|
183
41
|
</script>
|
|
184
42
|
|
|
185
43
|
<style lang="scss" scoped>
|