Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIGTOP-4378: Fix invalid secondary confirmation for key passphrase #186

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions bigtop-manager-ui/src/pages/cluster-manage/hosts/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
const { locale } = storeToRefs(localeStore)
const isEdit = computed(() => mode.value === 'EDIT')

const checkPassword = async (_rule: Rule, value: string) => {
const checkSshPassword = async (_rule: Rule, value: string) => {
if (!value) {
return Promise.reject(t('common.enter_error', [`${t('host.confirm_password')}`.toLowerCase()]))
}
if (value != formValue.value?.sshKeyPassword) {
if (value != formValue.value?.sshPassword) {
return Promise.reject(t('common.password_not_match'))
} else {
return Promise.resolve()
Expand All @@ -71,12 +71,12 @@
}
}

const formItemsForPassword = computed((): FormItemState[] => [
const formItemsForSshPassword = computed((): FormItemState[] => [
{
type: 'inputPassword',
field: 'sshKeyPassword',
field: 'sshPassword',
formItemProps: {
name: 'sshKeyPassword',
name: 'sshPassword',
label: t('host.password_auth'),
rules: [
{
Expand All @@ -92,14 +92,14 @@
},
{
type: 'inputPassword',
field: 'sshKeyPasswordAgain',
field: 'sshPasswordAgain',
formItemProps: {
name: 'sshKeyPasswordAgain',
name: 'sshPasswordAgain',
label: t('host.confirm_password'),
rules: [
{
required: true,
validator: checkPassword,
validator: checkSshPassword,
trigger: 'blur'
}
]
Expand All @@ -110,7 +110,7 @@
}
])

const formItemsForKey = computed((): FormItemState[] => [
const formItemsForSshKeyPassword = computed((): FormItemState[] => [
{
type: 'radio',
field: 'inputType',
Expand Down Expand Up @@ -164,9 +164,9 @@
},
{
type: 'input',
field: 'keyPassword',
field: 'sshKeyPassword',
formItemProps: {
name: 'keyPassword',
name: 'sshKeyPassword',
label: t('host.key_password')
},
controlProps: {
Expand All @@ -175,9 +175,9 @@
},
{
type: 'textarea',
field: 'keyPasswordAgain',
field: 'sshKeyPasswordAgain',
formItemProps: {
name: 'keyPasswordAgain',
name: 'sshKeyPasswordAgain',
label: t('host.confirm_key_password'),
rules: [
{
Expand Down Expand Up @@ -296,11 +296,11 @@
const filterFormItems = computed((): FormItemState[] => {
if (formValue.value.authType === '1') {
const data = [...formItems.value]
data.splice(2, 0, ...formItemsForPassword.value)
data.splice(2, 0, ...formItemsForSshPassword.value)
return data
} else if (formValue.value.authType === '2') {
const data = [...formItems.value]
data.splice(2, 0, ...formItemsForKey.value)
data.splice(2, 0, ...formItemsForSshKeyPassword.value)
return data
}
return [...formItems.value]
Expand Down
Loading