Skip to content

Commit

Permalink
fix: bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
FU-design committed Feb 21, 2025
1 parent 3fc2812 commit a48c504
Showing 1 changed file with 15 additions and 15 deletions.
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

0 comments on commit a48c504

Please sign in to comment.