bfg-common 1.5.684 → 1.5.686
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 +1 -0
- package/assets/localization/local_en.json +1 -0
- package/assets/localization/local_hy.json +1 -0
- package/assets/localization/local_kk.json +1 -0
- package/assets/localization/local_ru.json +1 -0
- package/assets/localization/local_zh.json +1 -0
- package/assets/scss/components/auth.scss +15 -5
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue +90 -93
- package/components/common/layout/theHeader/userMenu/modals/changePassword/New.vue +186 -193
- package/components/common/layout/theHeader/userMenu/modals/changePassword/Old.vue +0 -2
- package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/utils.ts +1 -1
- package/components/common/wizards/vm/migrate/steps/selectStorage/SelectStorage.vue +4 -4
- package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/new/lib/config/diskTable.ts +6 -2
- package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/old/lib/config/diskTable.ts +18 -12
- package/package.json +1 -1
|
@@ -202,6 +202,7 @@
|
|
|
202
202
|
"changeComputeResourceOnly": "Змяніць толькі вылічальны рэсурс",
|
|
203
203
|
"changeIdentityProvider": "Змяніць пастаўшчыка пасведчанняў",
|
|
204
204
|
"changePassword": "Змяніць пароль",
|
|
205
|
+
"setYourPassword": "Усталюйце пароль",
|
|
205
206
|
"changePasswordError": "Няправільны пароль!",
|
|
206
207
|
"changeProviderTooltipContent": "Сервер VCENTER Server падтрымлівае знешніх пастаўшчыкоў пасведчанняў для кіравання карыстальнікамі і групамі. Вы можаце перайсці ад выкарыстання убудаванага пастаўшчыка пасведчанняў VCENTER Server да знешняга пастаўшчыку пасведчанняў. Дадатковыя звесткі гл. у дакументацыі vSphere.",
|
|
207
208
|
"changeRole": "Змяніць ролю",
|
|
@@ -201,6 +201,7 @@
|
|
|
201
201
|
"changeComputeResourceOnly": "Change compute resource only",
|
|
202
202
|
"changeIdentityProvider": "Change Identity Provider",
|
|
203
203
|
"changePassword": "Change Password",
|
|
204
|
+
"setYourPassword": "Set Your Password",
|
|
204
205
|
"changePasswordError": "Invalid password!",
|
|
205
206
|
"changeProviderTooltipContent": "Sphere Zone supports external identity providers to manage your users and groups. You can migrate from using the embedded Sphere Zone identity provider to an external identity provider. For more information, see the vSphere documentation.",
|
|
206
207
|
"changeRole": "Change Role",
|
|
@@ -201,6 +201,7 @@
|
|
|
201
201
|
"changeComputeResourceOnly": "Փոխեք միայն հաշվողական ռեսուրսը",
|
|
202
202
|
"changeIdentityProvider": "Փոխել ինքնության մատակարարին",
|
|
203
203
|
"changePassword": "Փոխել գաղտնաբառը",
|
|
204
|
+
"setYourPassword": "Սահմանեք ձեր գաղտնաբառը",
|
|
204
205
|
"changePasswordError": "Սխալ գաղտնաբառ!",
|
|
205
206
|
"changeProviderTooltipContent": "VCenter Server-ն աջակցում է արտաքին ինքնության մատակարարներին ՝ Ձեր օգտվողներին և խմբերին կառավարելու համար: Դուք կարող եք անցնել Sphere Zone-ի ներկառուցված ինքնության մատակարարից դեպի արտաքին ինքնության մատակարար: Լրացուցիչ տեղեկությունների համար տես vSphere փաստաթղթերը:",
|
|
206
207
|
"changeRole": "Փոխել դերը",
|
|
@@ -201,6 +201,7 @@
|
|
|
201
201
|
"changeComputeResourceOnly": "Тек ресурсты өзгертіңіз",
|
|
202
202
|
"changeIdentityProvider": "Идентификатор провайдерін өзгерту",
|
|
203
203
|
"changePassword": "Құпия сөзді өзгерту",
|
|
204
|
+
"setYourPassword": "Құпиясөзді орнатыңыз",
|
|
204
205
|
"changePasswordError": "Қате құпия сөз!",
|
|
205
206
|
"changeProviderTooltipContent": "VCenter сервері пайдаланушылар мен топтарды басқару үшін сыртқы жеке куәлік жеткізушілерін қолдайды. Кірістірілген Sphere Zone жеке куәлік провайдерін пайдаланудан Сыртқы жеке куәлік провайдеріне өтуге болады. Қосымша ақпарат алу үшін vSphere құжаттамасын қараңыз.",
|
|
206
207
|
"changeRole": "Рөлді өзгерту",
|
|
@@ -201,6 +201,7 @@
|
|
|
201
201
|
"changeComputeResourceOnly": "Изменить только вычислительный ресурс",
|
|
202
202
|
"changeIdentityProvider": "Изменить провайдера идентификации",
|
|
203
203
|
"changePassword": "Изменить пароль",
|
|
204
|
+
"setYourPassword": "Установите пароль",
|
|
204
205
|
"changePasswordError": "Неверный пароль!",
|
|
205
206
|
"changeProviderTooltipContent": "Сервер Sphere Zone поддерживает внешних поставщиков удостоверений для управления вашими пользователями и группами. Вы можете перейти от использования встроенного поставщика удостоверений Sphere Zone к внешнему поставщику удостоверений. Дополнительные сведения см. в документации vSphere.",
|
|
206
207
|
"changeRole": "Сменить роль",
|
|
@@ -201,6 +201,7 @@
|
|
|
201
201
|
"changeComputeResourceOnly": "仅编辑计算资源",
|
|
202
202
|
"changeIdentityProvider": "更改身份提供商",
|
|
203
203
|
"changePassword": "更改密码",
|
|
204
|
+
"setYourPassword": "设置您的密码",
|
|
204
205
|
"changePasswordError": "密码错误!",
|
|
205
206
|
"changeProviderTooltipContent": "Sphere Zoneは、ユーザーとグループを管理するための外部idプロバイダをサポートしています。 組み込みのSphere Zone idプロバイダを使用してから外部idプロバイダに移行できます。 詳細については、vSphereのドキュメントを参照してください。",
|
|
206
207
|
"changeRole": "改变角色",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
color: #000000;
|
|
170
170
|
font-size: 32px;
|
|
171
171
|
font-weight: 400;
|
|
172
|
-
line-height:
|
|
172
|
+
line-height: 44px;
|
|
173
173
|
margin-bottom: 48px;
|
|
174
174
|
span {
|
|
175
175
|
font-size: 32px;
|
|
@@ -180,8 +180,18 @@
|
|
|
180
180
|
margin-bottom: 48px;
|
|
181
181
|
}
|
|
182
182
|
&__input {
|
|
183
|
+
&:before {
|
|
184
|
+
content: '';
|
|
185
|
+
position: absolute;
|
|
186
|
+
top: 0;
|
|
187
|
+
left: 0;
|
|
188
|
+
right: 0;
|
|
189
|
+
bottom: 0;
|
|
190
|
+
background-color: var(--input-bg);
|
|
191
|
+
border-radius: 8px;
|
|
192
|
+
}
|
|
183
193
|
:deep(.ui-main-input) {
|
|
184
|
-
background-color:
|
|
194
|
+
background-color: var(--input-bg);
|
|
185
195
|
}
|
|
186
196
|
:deep(input.ui-main-input:-internal-autofill-selected),
|
|
187
197
|
:deep(input.ui-main-input:-internal-autofill-selected:hover),
|
|
@@ -189,7 +199,7 @@
|
|
|
189
199
|
:deep(input.ui-main-input:-internal-autofill-selected:focus) {
|
|
190
200
|
appearance: menulist-button;
|
|
191
201
|
background-image: none !important;
|
|
192
|
-
background-color:
|
|
202
|
+
background-color: var(--input-bg) !important;
|
|
193
203
|
color: fieldtext !important;
|
|
194
204
|
-webkit-background-clip: text;
|
|
195
205
|
}
|
|
@@ -210,11 +220,11 @@
|
|
|
210
220
|
}
|
|
211
221
|
}
|
|
212
222
|
&__checkbox {
|
|
213
|
-
margin-top:
|
|
223
|
+
margin-top: 16px;
|
|
214
224
|
}
|
|
215
225
|
&__button {
|
|
216
226
|
@include flex($just: center, $align: center);
|
|
217
|
-
margin-top:
|
|
227
|
+
margin-top: 32px;
|
|
218
228
|
height: 44px;
|
|
219
229
|
border-radius: 8px;
|
|
220
230
|
:deep(svg) {
|
package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue
CHANGED
|
@@ -1,93 +1,90 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="currentComponent"
|
|
4
|
-
v-model="form"
|
|
5
|
-
:subtitle="props.hostname"
|
|
6
|
-
:project="props.project"
|
|
7
|
-
|
|
8
|
-
@
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
UI_I_ChangePasswordForm,
|
|
19
|
-
} from '~/components/common/layout/theHeader/userMenu/modals/changePassword/lib/models/interfaces'
|
|
20
|
-
import type { UI_T_Project } from '~/lib/models/types'
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
new_password
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
isShowModalLocal.value = false
|
|
92
|
-
}
|
|
93
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model="form"
|
|
5
|
+
:subtitle="props.hostname"
|
|
6
|
+
:project="props.project"
|
|
7
|
+
@change-password="onChangePassword"
|
|
8
|
+
@hide="onHideModal"
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
14
|
+
import type { API_UI_I_Error } from '~/lib/models/store/interfaces'
|
|
15
|
+
import type {
|
|
16
|
+
UI_I_ChangePasswordBodyRequest,
|
|
17
|
+
UI_I_ChangePasswordFirstTimeBodyRequest,
|
|
18
|
+
UI_I_ChangePasswordForm,
|
|
19
|
+
} from '~/components/common/layout/theHeader/userMenu/modals/changePassword/lib/models/interfaces'
|
|
20
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
21
|
+
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
hostname: string
|
|
24
|
+
project: UI_T_Project
|
|
25
|
+
}>()
|
|
26
|
+
const isShowModalLocal = defineModel<boolean>({ required: true })
|
|
27
|
+
|
|
28
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
29
|
+
const { $store }: any = useNuxtApp()
|
|
30
|
+
|
|
31
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
32
|
+
const currentComponent = computed(() =>
|
|
33
|
+
isNewView.value
|
|
34
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
35
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
const form = ref<UI_I_ChangePasswordForm>({
|
|
39
|
+
current_password: '',
|
|
40
|
+
new_password: '',
|
|
41
|
+
confirm_password: '',
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const onChangePassword = async (): Promise<void> => {
|
|
45
|
+
const { current_password, new_password } = form.value
|
|
46
|
+
|
|
47
|
+
onHideModal()
|
|
48
|
+
|
|
49
|
+
let sendData:
|
|
50
|
+
| UI_I_ChangePasswordBodyRequest
|
|
51
|
+
| UI_I_ChangePasswordFirstTimeBodyRequest = {
|
|
52
|
+
current_password,
|
|
53
|
+
new_password,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let url = ''
|
|
57
|
+
if (props.project === 'sphere') {
|
|
58
|
+
sendData = {
|
|
59
|
+
password: new_password,
|
|
60
|
+
}
|
|
61
|
+
url = 'ui/users/current/change_password'
|
|
62
|
+
} else if (props.project === 'procurator') {
|
|
63
|
+
url = '/ui/passwd'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const { error } = await useMyFetch<never, API_UI_I_Error>(url, {
|
|
67
|
+
method: 'POST',
|
|
68
|
+
body: sendData,
|
|
69
|
+
key: Date.now().toString(),
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
if (error.value?.data && error.value.data.error_code !== 0) {
|
|
73
|
+
const errorText = error.value.data?.error_message || error.value.data
|
|
74
|
+
|
|
75
|
+
$store.dispatch('main/A_SHOW_NOTIFICATION', {
|
|
76
|
+
status: 'error',
|
|
77
|
+
headline: localization.value.common.operationFailed,
|
|
78
|
+
messages: [
|
|
79
|
+
{
|
|
80
|
+
title: localization.value.common.error,
|
|
81
|
+
descriptions: [errorText],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const onHideModal = (): void => {
|
|
88
|
+
isShowModalLocal.value = false
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
@@ -1,193 +1,186 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ui-modal
|
|
3
|
-
:title="localization.common.changePassword"
|
|
4
|
-
:texts="modalTexts"
|
|
5
|
-
:subtitle="props.subtitle"
|
|
6
|
-
width="560px"
|
|
7
|
-
test-id="change-password-modal"
|
|
8
|
-
show
|
|
9
|
-
@submit="onSubmit"
|
|
10
|
-
@hide="onHideModal"
|
|
11
|
-
>
|
|
12
|
-
<template #content>
|
|
13
|
-
<ui-modal-block-standard>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<ui-input
|
|
29
|
-
v-model="modelLocal.
|
|
30
|
-
:label="localization.common.
|
|
31
|
-
:error="
|
|
32
|
-
|
|
33
|
-
type="password"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
})
|
|
130
|
-
const confirmPasswordErrorText = computed<string>(() => {
|
|
131
|
-
if (!initValidationFields.value.confirmPassword) return ''
|
|
132
|
-
const { new_password, confirm_password } = modelLocal.value
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
&
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
&__form {
|
|
188
|
-
@include flex($dir: column);
|
|
189
|
-
row-gap: 16px;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<ui-modal
|
|
3
|
+
:title="localization.common.changePassword"
|
|
4
|
+
:texts="modalTexts"
|
|
5
|
+
:subtitle="props.subtitle"
|
|
6
|
+
width="560px"
|
|
7
|
+
test-id="change-password-modal"
|
|
8
|
+
show
|
|
9
|
+
@submit="onSubmit"
|
|
10
|
+
@hide="onHideModal"
|
|
11
|
+
>
|
|
12
|
+
<template #content>
|
|
13
|
+
<ui-modal-block-standard>
|
|
14
|
+
<p class="change-password__description">
|
|
15
|
+
{{ description }}
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<div class="change-password__form">
|
|
19
|
+
<ui-input
|
|
20
|
+
v-model="modelLocal.current_password"
|
|
21
|
+
:label="localization.common.currentPassword"
|
|
22
|
+
:error="passwordErrorText"
|
|
23
|
+
:autocomplete="'new-password'"
|
|
24
|
+
type="password"
|
|
25
|
+
test-id="change-password-password-field"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<ui-input
|
|
29
|
+
v-model="modelLocal.new_password"
|
|
30
|
+
:label="localization.common.newPassword"
|
|
31
|
+
:error="newPasswordErrorText"
|
|
32
|
+
test-id="change-password-new-password-field"
|
|
33
|
+
type="password"
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<ui-input
|
|
37
|
+
v-model="modelLocal.confirm_password"
|
|
38
|
+
:label="localization.common.confirmNewPassword"
|
|
39
|
+
:error="confirmPasswordErrorText"
|
|
40
|
+
test-id="change-password-confirm-password-field"
|
|
41
|
+
type="password"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</ui-modal-block-standard>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<template #footerLeftContent><span /></template>
|
|
48
|
+
</ui-modal>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import type { UI_I_ModalTexts } from '~/node_modules/bfg-uikit/components/ui/modal/models/interfaces'
|
|
53
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
54
|
+
import type { UI_I_ChangePasswordForm } from '~/components/common/layout/theHeader/userMenu/modals/changePassword/lib/models/interfaces'
|
|
55
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
56
|
+
import type { UI_I_InitialValidationFields } from '~/components/common/layout/theHeader/userMenu/modals/changePassword/lib/models/interfaces'
|
|
57
|
+
import {
|
|
58
|
+
validateField,
|
|
59
|
+
getPasswordMismatchError,
|
|
60
|
+
} from '~/components/common/layout/theHeader/userMenu/modals/changePassword/lib/utils'
|
|
61
|
+
|
|
62
|
+
const props = defineProps<{
|
|
63
|
+
project: UI_T_Project
|
|
64
|
+
subtitle: string
|
|
65
|
+
}>()
|
|
66
|
+
const emits = defineEmits<{
|
|
67
|
+
(event: 'hide'): void
|
|
68
|
+
(event: 'change-password'): void
|
|
69
|
+
}>()
|
|
70
|
+
const modelLocal = defineModel<UI_I_ChangePasswordForm>({ required: true })
|
|
71
|
+
|
|
72
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
73
|
+
|
|
74
|
+
const description = ref<string>(localization.value.common.changePasswordDesc)
|
|
75
|
+
|
|
76
|
+
const modalTexts = computed<UI_I_ModalTexts>(() => {
|
|
77
|
+
return {
|
|
78
|
+
button1: localization.value.common.cancel,
|
|
79
|
+
button2: localization.value.common.save,
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const initValidationFields = ref<UI_I_InitialValidationFields>({
|
|
84
|
+
currentPassword: false,
|
|
85
|
+
newPassword: false,
|
|
86
|
+
confirmPassword: false,
|
|
87
|
+
})
|
|
88
|
+
const initValidation = (types: string[]): boolean => {
|
|
89
|
+
types.forEach((type) => (initValidationFields.value[type] = true))
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
!!passwordErrorText.value ||
|
|
93
|
+
!!newPasswordErrorText.value ||
|
|
94
|
+
!!confirmPasswordErrorText.value
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const passwordErrorText = computed<string>(() => {
|
|
99
|
+
if (!initValidationFields.value.currentPassword) return ''
|
|
100
|
+
|
|
101
|
+
if (!modelLocal.value.current_password) {
|
|
102
|
+
return localization.value.common.fieldRequired
|
|
103
|
+
} else {
|
|
104
|
+
return ''
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
const newPasswordErrorText = computed<string>(() => {
|
|
108
|
+
if (!initValidationFields.value.newPassword) return ''
|
|
109
|
+
|
|
110
|
+
const { current_password, new_password, confirm_password } = modelLocal.value
|
|
111
|
+
|
|
112
|
+
const validateText = validateField(
|
|
113
|
+
localization.value,
|
|
114
|
+
current_password,
|
|
115
|
+
new_password
|
|
116
|
+
)
|
|
117
|
+
const mismatchError = getPasswordMismatchError(
|
|
118
|
+
localization.value,
|
|
119
|
+
new_password,
|
|
120
|
+
confirm_password
|
|
121
|
+
)
|
|
122
|
+
if (!new_password) {
|
|
123
|
+
return localization.value.common.fieldRequired
|
|
124
|
+
} else if (validateText) {
|
|
125
|
+
return validateText
|
|
126
|
+
} else if (mismatchError) {
|
|
127
|
+
return mismatchError
|
|
128
|
+
} else return ''
|
|
129
|
+
})
|
|
130
|
+
const confirmPasswordErrorText = computed<string>(() => {
|
|
131
|
+
if (!initValidationFields.value.confirmPassword) return ''
|
|
132
|
+
const { new_password, confirm_password } = modelLocal.value
|
|
133
|
+
|
|
134
|
+
if (!confirm_password) {
|
|
135
|
+
return localization.value.common.fieldRequired
|
|
136
|
+
} else {
|
|
137
|
+
return getPasswordMismatchError(
|
|
138
|
+
localization.value,
|
|
139
|
+
new_password,
|
|
140
|
+
confirm_password
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
const onSubmit = (): void => {
|
|
145
|
+
const isFieldValid = initValidation([
|
|
146
|
+
'currentPassword',
|
|
147
|
+
'newPassword',
|
|
148
|
+
'confirmPassword',
|
|
149
|
+
])
|
|
150
|
+
|
|
151
|
+
!isFieldValid && emits('change-password')
|
|
152
|
+
}
|
|
153
|
+
const onHideModal = (): void => {
|
|
154
|
+
emits('hide')
|
|
155
|
+
}
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<style lang="scss" scoped>
|
|
159
|
+
@import 'assets/scss/common/mixins.scss';
|
|
160
|
+
.modal-container-standard {
|
|
161
|
+
padding-top: 8px;
|
|
162
|
+
padding-bottom: 8px;
|
|
163
|
+
|
|
164
|
+
.change-password {
|
|
165
|
+
&__description {
|
|
166
|
+
color: #9da6ad;
|
|
167
|
+
font-size: 12px;
|
|
168
|
+
font-weight: 400;
|
|
169
|
+
line-height: 14.52px;
|
|
170
|
+
margin-bottom: 20px;
|
|
171
|
+
}
|
|
172
|
+
&__alert {
|
|
173
|
+
padding: 10px 12px;
|
|
174
|
+
margin-bottom: 12px;
|
|
175
|
+
:deep(svg) {
|
|
176
|
+
width: 16px;
|
|
177
|
+
height: 16px;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
&__form {
|
|
181
|
+
@include flex($dir: column);
|
|
182
|
+
row-gap: 16px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</style>
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
@submit="onChangePassword"
|
|
11
11
|
>
|
|
12
12
|
<template #modalBody>
|
|
13
|
-
<p v-if="props.firstTime">{{ localization.common.firstTimeChangePasswordDesc }}</p>
|
|
14
13
|
<form id="change-password-form" class="compact" @submit.prevent>
|
|
15
14
|
<section class="form-block">
|
|
16
15
|
<div class="form-group">
|
|
@@ -98,7 +97,6 @@ import { defaultFormFunc } from '~/components/common/layout/theHeader/userMenu/m
|
|
|
98
97
|
const props = defineProps<{
|
|
99
98
|
hostname: string
|
|
100
99
|
project: UI_T_Project
|
|
101
|
-
firstTime: boolean
|
|
102
100
|
}>()
|
|
103
101
|
const emits = defineEmits<{
|
|
104
102
|
(event: 'hide'): void
|
|
@@ -80,10 +80,10 @@ const onApplyChanges = (): void => {
|
|
|
80
80
|
/* TODO сделать рефакторинг потом */
|
|
81
81
|
model.value.configure.disks.forEach((disk) => {
|
|
82
82
|
const selectedDisk = selectedPerDisks.value.find(
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
(selectedDisk) =>
|
|
84
|
+
selectedDisk.virtual_machine === disk.virtual_machine &&
|
|
85
|
+
selectedDisk.extra.disk_source === disk.extra.disk_source &&
|
|
86
|
+
selectedDisk.extra.datastore_id === disk.extra.datastore_id
|
|
87
87
|
)!
|
|
88
88
|
|
|
89
89
|
if (selectedDisk) {
|
|
@@ -158,12 +158,16 @@ export const getBodyDataFunc = (
|
|
|
158
158
|
bodyData: UI_I_StorageConfigurePerDiskItem[],
|
|
159
159
|
localization: UI_I_Localization
|
|
160
160
|
): UI_I_DataTableBody[] => {
|
|
161
|
-
const { $binary }: any = useNuxtApp()
|
|
162
161
|
|
|
163
162
|
return bodyData.map((disk, index: number) => {
|
|
164
163
|
const diskFormat =
|
|
165
164
|
index === 0 ? 'N/A' : UI_E_SelectStorageDiskFormat[disk.disk_format]
|
|
166
165
|
|
|
166
|
+
const file =
|
|
167
|
+
disk.extra.disk_source === 'meta'
|
|
168
|
+
? disk.file
|
|
169
|
+
: `${disk.extra.disk_source} (${disk.extra.disk_size} ${localization.common.mb} )`
|
|
170
|
+
|
|
167
171
|
const diskSharingKey = disk.extra.sharing
|
|
168
172
|
? E_DiskSharing.Active
|
|
169
173
|
: E_DiskSharing.Inactive
|
|
@@ -198,7 +202,7 @@ export const getBodyDataFunc = (
|
|
|
198
202
|
},
|
|
199
203
|
{
|
|
200
204
|
col: 'col2',
|
|
201
|
-
text:
|
|
205
|
+
text: file,
|
|
202
206
|
},
|
|
203
207
|
{
|
|
204
208
|
col: 'col3',
|
|
@@ -66,32 +66,38 @@ export const bodyItems = (
|
|
|
66
66
|
data: UI_I_StorageConfigurePerDiskItem[]
|
|
67
67
|
): UI_I_BodyItem[][] => {
|
|
68
68
|
const bodyItems: UI_I_BodyItem[][] = []
|
|
69
|
+
const localization = useLocal()
|
|
69
70
|
|
|
70
|
-
data.forEach((
|
|
71
|
+
data.forEach((disk: UI_I_StorageConfigurePerDiskItem, key: number) => {
|
|
71
72
|
const diskFormat =
|
|
72
73
|
key === 0
|
|
73
74
|
? 'N/A'
|
|
74
|
-
: UI_E_SelectStorageDiskFormat[
|
|
75
|
+
: UI_E_SelectStorageDiskFormat[disk[vmMigrateDiskTableItemKeys[4]]]
|
|
76
|
+
|
|
77
|
+
const file =
|
|
78
|
+
disk.extra.disk_source === 'meta'
|
|
79
|
+
? disk[vmMigrateDiskTableItemKeys[2]]
|
|
80
|
+
: `${disk.extra.disk_source} (${disk.extra.disk_size} ${localization.common.mb} )`
|
|
75
81
|
|
|
76
82
|
bodyItems.push([
|
|
77
83
|
{
|
|
78
84
|
key: 'col0',
|
|
79
|
-
text:
|
|
85
|
+
text: disk[vmMigrateDiskTableItemKeys[0]],
|
|
80
86
|
id: key,
|
|
81
87
|
},
|
|
82
88
|
{
|
|
83
89
|
key: 'col1',
|
|
84
|
-
text:
|
|
90
|
+
text: disk[vmMigrateDiskTableItemKeys[1]],
|
|
85
91
|
id: key,
|
|
86
92
|
},
|
|
87
93
|
{
|
|
88
94
|
key: 'col2',
|
|
89
|
-
text:
|
|
95
|
+
text: file,
|
|
90
96
|
id: key,
|
|
91
97
|
},
|
|
92
98
|
{
|
|
93
99
|
key: 'col3',
|
|
94
|
-
text:
|
|
100
|
+
text: disk[vmMigrateDiskTableItemKeys[3]],
|
|
95
101
|
id: key,
|
|
96
102
|
},
|
|
97
103
|
{
|
|
@@ -101,33 +107,33 @@ export const bodyItems = (
|
|
|
101
107
|
},
|
|
102
108
|
{
|
|
103
109
|
key: 'col5',
|
|
104
|
-
text:
|
|
110
|
+
text: disk.extra[vmMigrateDiskTableItemKeys[5]],
|
|
105
111
|
id: key,
|
|
106
112
|
},
|
|
107
113
|
|
|
108
114
|
{
|
|
109
115
|
key: 'col6',
|
|
110
|
-
text:
|
|
116
|
+
text: disk.extra[vmMigrateDiskTableItemKeys[6]],
|
|
111
117
|
id: key,
|
|
112
118
|
},
|
|
113
119
|
{
|
|
114
120
|
key: 'col7',
|
|
115
|
-
text:
|
|
121
|
+
text: disk.extra[vmMigrateDiskTableItemKeys[7]],
|
|
116
122
|
id: key,
|
|
117
123
|
},
|
|
118
124
|
{
|
|
119
125
|
key: 'col8',
|
|
120
|
-
text:
|
|
126
|
+
text: disk.extra[vmMigrateDiskTableItemKeys[8]],
|
|
121
127
|
id: key,
|
|
122
128
|
},
|
|
123
129
|
{
|
|
124
130
|
key: 'col9',
|
|
125
|
-
text:
|
|
131
|
+
text: disk.extra[vmMigrateDiskTableItemKeys[9]],
|
|
126
132
|
id: key,
|
|
127
133
|
},
|
|
128
134
|
{
|
|
129
135
|
key: 'col10',
|
|
130
|
-
text:
|
|
136
|
+
text: disk.extra[vmMigrateDiskTableItemKeys[10]],
|
|
131
137
|
id: key,
|
|
132
138
|
},
|
|
133
139
|
])
|