bfg-common 1.3.453 → 1.3.455
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/lib/config/states.ts +34 -0
- package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +8 -12
- package/components/common/wizards/datastoreNew/add/Add.vue +1 -1
- package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +2 -2
- package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +68 -69
- package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts +6 -3
- package/package.json +1 -1
|
@@ -124,3 +124,37 @@ export const resourcePoolIconByState = [
|
|
|
124
124
|
'resourcePoolAlert',
|
|
125
125
|
'resourcePoolAlert',
|
|
126
126
|
]
|
|
127
|
+
|
|
128
|
+
export const backupStorageLocalizationByState = [
|
|
129
|
+
'unknown',
|
|
130
|
+
'connected',
|
|
131
|
+
'warning',
|
|
132
|
+
'error',
|
|
133
|
+
'maintenance',
|
|
134
|
+
'inaccessible',
|
|
135
|
+
'disconnected',
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
export const backupStorageIconByState = [
|
|
139
|
+
'datastore-error',
|
|
140
|
+
'datastore',
|
|
141
|
+
'datastore-warning',
|
|
142
|
+
'datastore-error',
|
|
143
|
+
'datastore-maintenance',
|
|
144
|
+
'datastore-inaccessible',
|
|
145
|
+
'datastore-unmount', // 'datastore-disconnected',
|
|
146
|
+
]
|
|
147
|
+
|
|
148
|
+
export const bucketLocalizationByState = [
|
|
149
|
+
'unknown',
|
|
150
|
+
'connected',
|
|
151
|
+
'warning',
|
|
152
|
+
'error',
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
export const bucketIconByState = [
|
|
156
|
+
'vm-error',
|
|
157
|
+
'vm',
|
|
158
|
+
'vm-warning',
|
|
159
|
+
'vm-error',
|
|
160
|
+
]
|
|
@@ -144,26 +144,22 @@
|
|
|
144
144
|
</template>
|
|
145
145
|
|
|
146
146
|
<script lang="ts" setup>
|
|
147
|
-
import type { UI_T_Project } from '~/lib/models/types'
|
|
148
147
|
import { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
|
|
149
|
-
import
|
|
150
|
-
UI_I_Localization,
|
|
151
|
-
UI_I_ArbitraryObject,
|
|
152
|
-
} from '~/lib/models/interfaces'
|
|
153
|
-
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
148
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
154
149
|
import {
|
|
155
150
|
UI_I_DataServersListItem,
|
|
156
151
|
UI_I_FormValidationConfiguration,
|
|
157
152
|
} from '~/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/models/interfaces'
|
|
158
|
-
import {
|
|
153
|
+
import {
|
|
154
|
+
UI_T_NfsType,
|
|
155
|
+
UI_T_WizardDatastoreMode,
|
|
156
|
+
} from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
159
157
|
import { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
|
|
160
158
|
import { defaultFormFunc } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/config/defaultForm'
|
|
161
159
|
import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
|
|
162
160
|
|
|
163
161
|
const props = defineProps<{
|
|
164
|
-
|
|
165
|
-
alertMessages: string[]
|
|
166
|
-
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
162
|
+
mode: UI_T_WizardDatastoreMode
|
|
167
163
|
nfsVersion: UI_T_NfsType
|
|
168
164
|
nfsConfigurationSubmit: number
|
|
169
165
|
}>()
|
|
@@ -267,7 +263,7 @@ const dataServers = ref<UI_I_DataServersListItem[]>([])
|
|
|
267
263
|
// // if (nfsVersion === 'nfs-4.1') server.value = ''
|
|
268
264
|
// }
|
|
269
265
|
|
|
270
|
-
const alertInfo = ref<boolean>(props.
|
|
266
|
+
const alertInfo = ref<boolean>(props.mode === 'procurator')
|
|
271
267
|
|
|
272
268
|
const resetValidation = (): void => {
|
|
273
269
|
isInitNameValidation.value =
|
|
@@ -299,7 +295,7 @@ const submit = async (): Promise<void> => {
|
|
|
299
295
|
|
|
300
296
|
emits('loading', true)
|
|
301
297
|
|
|
302
|
-
const { valid, msg } = await checkValidityName(name.value, props.
|
|
298
|
+
const { valid, msg } = await checkValidityName(name.value, props.mode)
|
|
303
299
|
|
|
304
300
|
emits('loading', false)
|
|
305
301
|
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
v-model="model.nfsVersion"
|
|
6
6
|
/>
|
|
7
7
|
|
|
8
|
-
<common-wizards-datastore-add-nfs-configuration
|
|
8
|
+
<common-wizards-datastore-new-add-nfs-configuration
|
|
9
9
|
v-show="props.stepId === 5"
|
|
10
|
+
v-model="model"
|
|
10
11
|
:project="props.project"
|
|
11
12
|
:alert-messages="props.alertMessages"
|
|
12
13
|
:messages-fields="props.selectedStep"
|
|
13
|
-
:nfs-version="model.nfsVersion"
|
|
14
14
|
:nfs-configuration-submit="nfsConfigurationSubmit"
|
|
15
15
|
@loading="(e) => emits('loading', e)"
|
|
16
16
|
@next="onChangeConfigurationAndNext"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
<h6 class="nd-mt-0">{{ localization.nfsShareDetails }}</h6>
|
|
20
20
|
|
|
21
21
|
<div class="clr-form-control clr-row">
|
|
22
|
-
<label for="" class="clr-control-label clr-col-md-2">
|
|
23
|
-
localization.name
|
|
24
|
-
|
|
22
|
+
<label for="" class="clr-control-label clr-col-md-2">
|
|
23
|
+
{{ localization.name }}
|
|
24
|
+
</label>
|
|
25
25
|
|
|
26
26
|
<div
|
|
27
27
|
class="clr-control-container"
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
<div class="flex-align-center">
|
|
31
31
|
<input
|
|
32
32
|
id="configuration-name-input"
|
|
33
|
-
v-model="
|
|
33
|
+
v-model="model.name"
|
|
34
34
|
data-id="configuration-name-input"
|
|
35
35
|
type="text"
|
|
36
36
|
class="clr-input"
|
|
37
|
-
@blur="
|
|
38
|
-
@input="
|
|
37
|
+
@blur="initValidation(true, ['name'])"
|
|
38
|
+
@input="initValidation(false, ['name'])"
|
|
39
39
|
/>
|
|
40
40
|
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
41
41
|
</div>
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
49
|
<div class="clr-form-control clr-row">
|
|
50
|
-
<label class="clr-control-label clr-col-md-2">
|
|
51
|
-
localization.folder
|
|
52
|
-
|
|
50
|
+
<label class="clr-control-label clr-col-md-2">
|
|
51
|
+
{{ localization.folder }}
|
|
52
|
+
</label>
|
|
53
53
|
|
|
54
54
|
<div
|
|
55
55
|
class="clr-control-container"
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
<div class="flex-align-center">
|
|
59
59
|
<input
|
|
60
60
|
id="configuration-folder-input"
|
|
61
|
-
v-model="
|
|
61
|
+
v-model="model.folder"
|
|
62
62
|
data-id="configuration-folder-input"
|
|
63
63
|
type="text"
|
|
64
64
|
class="clr-input"
|
|
65
|
-
@blur="
|
|
66
|
-
@input="
|
|
65
|
+
@blur="initValidation(true, ['folder'])"
|
|
66
|
+
@input="initValidation(false, ['folder'])"
|
|
67
67
|
/>
|
|
68
68
|
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
69
69
|
</div>
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
</div>
|
|
77
77
|
|
|
78
78
|
<div class="nd-mt-0 clr-form-control clr-row">
|
|
79
|
-
<label class="clr-control-label clr-col-md-2">
|
|
80
|
-
localization.server
|
|
81
|
-
|
|
79
|
+
<label class="clr-control-label clr-col-md-2">
|
|
80
|
+
{{ localization.server }}
|
|
81
|
+
</label>
|
|
82
82
|
|
|
83
83
|
<div
|
|
84
84
|
class="clr-control-container"
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
<div class="flex-align-center input-action-wrapper">
|
|
88
88
|
<input
|
|
89
89
|
id="configuration-folder-input"
|
|
90
|
-
v-model="
|
|
90
|
+
v-model="model.server"
|
|
91
91
|
data-id="configuration-folder-input"
|
|
92
92
|
type="text"
|
|
93
93
|
class="clr-input"
|
|
94
|
-
@blur="
|
|
95
|
-
@input="
|
|
94
|
+
@blur="initValidation(true, ['server'])"
|
|
95
|
+
@input="initValidation(false, ['server'])"
|
|
96
96
|
/>
|
|
97
97
|
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
98
98
|
</div>
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
116
|
<div
|
|
117
|
-
v-show="
|
|
117
|
+
v-show="model.nfsVersion === 'nfs-4.1' && false"
|
|
118
118
|
class="configuration__servers-list"
|
|
119
119
|
>
|
|
120
120
|
<common-wizards-datastore-add-nfs-configuration-servers-list
|
|
@@ -144,30 +144,37 @@
|
|
|
144
144
|
</template>
|
|
145
145
|
|
|
146
146
|
<script lang="ts" setup>
|
|
147
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
147
148
|
import { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
|
|
148
|
-
import {
|
|
149
|
+
import type {
|
|
150
|
+
UI_I_Localization,
|
|
151
|
+
UI_I_ArbitraryObject,
|
|
152
|
+
} from '~/lib/models/interfaces'
|
|
153
|
+
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
149
154
|
import {
|
|
150
155
|
UI_I_DataServersListItem,
|
|
151
156
|
UI_I_FormValidationConfiguration,
|
|
152
157
|
} from '~/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/models/interfaces'
|
|
153
158
|
import {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
} from '~/components/common/wizards/
|
|
157
|
-
import { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
|
|
159
|
+
UI_I_ConfigurationSendDataNfs,
|
|
160
|
+
UI_I_InitialValidationFields,
|
|
161
|
+
} from '~/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces'
|
|
158
162
|
import { defaultFormFunc } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/config/defaultForm'
|
|
159
163
|
import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
|
|
160
164
|
|
|
161
165
|
const props = defineProps<{
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
project: UI_T_Project
|
|
167
|
+
alertMessages: string[]
|
|
168
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
164
169
|
nfsConfigurationSubmit: number
|
|
165
170
|
}>()
|
|
166
|
-
const
|
|
171
|
+
const model = defineModel<any>()
|
|
167
172
|
const emits = defineEmits<{
|
|
168
173
|
(event: 'loading', value: boolean): void
|
|
169
174
|
(event: 'next', value: UI_I_ConfigurationSendDataNfs): void
|
|
170
175
|
}>()
|
|
176
|
+
|
|
177
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
171
178
|
const { $validation } = useNuxtApp()
|
|
172
179
|
|
|
173
180
|
const validation = $validation.call({})
|
|
@@ -183,56 +190,48 @@ setForm()
|
|
|
183
190
|
|
|
184
191
|
const validForm = ref<UI_I_ValidationTouchResult | null>(null)
|
|
185
192
|
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
const isInitNameValidation = ref<boolean>(false) // Удалить
|
|
194
|
+
const isInitFolderValidation = ref<boolean>(false) // Удалить
|
|
195
|
+
const isInitServerValidation = ref<boolean>(false) // Удалить
|
|
196
|
+
const initValidationFields = ref<UI_I_InitialValidationFields>({
|
|
197
|
+
name: false,
|
|
198
|
+
folder: false,
|
|
199
|
+
server: false,
|
|
200
|
+
})
|
|
201
|
+
const initValidation = (onlyBlur = false, types: string[]): void => {
|
|
202
|
+
onlyBlur && types.forEach((type) => (initValidationFields.value[type] = true))
|
|
194
203
|
}
|
|
195
204
|
|
|
205
|
+
/* Validation error text for Name input field */
|
|
196
206
|
const nameErrorText = computed<string>(() => {
|
|
197
|
-
if (!
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
/* Validation Name input end */
|
|
207
|
+
if (props.messagesFields?.name?.field && !model.value.name) {
|
|
208
|
+
return props.messagesFields.name.field
|
|
209
|
+
}
|
|
201
210
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
validForm.value = validation.touch()
|
|
206
|
-
isInitFolderValidation.value = true
|
|
207
|
-
}
|
|
208
|
-
const onInputFolder = (): void => {
|
|
209
|
-
validForm.value = validation.touch()
|
|
210
|
-
}
|
|
211
|
+
if (!initValidationFields.value.name) return ''
|
|
212
|
+
return !model.value.name ? localization.value.specifyDatastoreName : ''
|
|
213
|
+
})
|
|
211
214
|
|
|
215
|
+
/* Validation error text for Folder input field */
|
|
212
216
|
const folderErrorText = computed<string>(() => {
|
|
213
|
-
if (!
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
/* Validation Folder input end */
|
|
217
|
+
if (props.messagesFields.folder?.field && !model.value.folder) {
|
|
218
|
+
return props.messagesFields.folder.field
|
|
219
|
+
}
|
|
217
220
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
validForm.value = validation.touch()
|
|
222
|
-
isInitServerValidation.value = true
|
|
223
|
-
}
|
|
224
|
-
const onInputServer = (): void => {
|
|
225
|
-
validForm.value = validation.touch()
|
|
226
|
-
isInitServerValidation.value = true
|
|
227
|
-
}
|
|
221
|
+
if (!initValidationFields.value.folder) return ''
|
|
222
|
+
return !model.value.folder ? localization.value.specifyDatastoreName : ''
|
|
223
|
+
})
|
|
228
224
|
|
|
225
|
+
/* Validation error text for Server input field */
|
|
229
226
|
const serverErrorText = computed<string>(() => {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
})
|
|
227
|
+
if (props.messagesFields.server?.field && !model.value.server) {
|
|
228
|
+
return props.messagesFields.server.field
|
|
229
|
+
}
|
|
234
230
|
|
|
235
|
-
|
|
231
|
+
// if (!initValidationFields.value.server || dataServers.value.length) return ''
|
|
232
|
+
if (!initValidationFields.value.server) return ''
|
|
233
|
+
return !model.value.server ? localization.value.specifyDatastoreName : ''
|
|
234
|
+
})
|
|
236
235
|
|
|
237
236
|
const accessMode = ref<boolean>(false)
|
|
238
237
|
|
|
@@ -263,7 +262,7 @@ const dataServers = ref<UI_I_DataServersListItem[]>([])
|
|
|
263
262
|
// // if (nfsVersion === 'nfs-4.1') server.value = ''
|
|
264
263
|
// }
|
|
265
264
|
|
|
266
|
-
const alertInfo = ref<boolean>(props.
|
|
265
|
+
const alertInfo = ref<boolean>(props.project === 'procurator')
|
|
267
266
|
|
|
268
267
|
const resetValidation = (): void => {
|
|
269
268
|
isInitNameValidation.value =
|
|
@@ -295,7 +294,7 @@ const submit = async (): Promise<void> => {
|
|
|
295
294
|
|
|
296
295
|
emits('loading', true)
|
|
297
296
|
|
|
298
|
-
const { valid, msg } = await checkValidityName(name.value, props.
|
|
297
|
+
const { valid, msg } = await checkValidityName(name.value, props.project)
|
|
299
298
|
|
|
300
299
|
emits('loading', false)
|
|
301
300
|
|
package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { UI_I_DataServersListItem } from '~/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/models/interfaces'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export interface UI_I_InitialValidationFields {
|
|
4
|
+
name: boolean
|
|
5
|
+
folder: boolean
|
|
6
|
+
server: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
6
9
|
export interface UI_I_ConfigurationSendDataNfs {
|
|
7
10
|
name: string
|
|
8
11
|
folder: string
|