Skip to content

Commit

Permalink
Perf: Disabled Password Input And Hidden Template Username Input
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoJiSen committed Jan 7, 2025
1 parent 3bb3361 commit 25ba669
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/components/Apps/AccountCreateUpdateForm/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export const accountFieldsMeta = (vm) => {
}
}
}
},
hidden: () => {
return vm.addTemplate
}
},
username: {
Expand Down Expand Up @@ -129,6 +132,9 @@ export const accountFieldsMeta = (vm) => {
password: {
label: vm.$t('Password'),
component: UpdateToken,
el: {
disabled: isPam
},
hidden: (formValue) => {
return formValue.secret_type !== 'password' || vm.addTemplate
}
Expand Down
7 changes: 6 additions & 1 deletion src/components/Form/FormFields/UpdateToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
v-model.trim="curValue"
:placeholder="placeholder"
:type="type"
:disabled="disabled"
class="password-input"
show-password
@change="onChange"
/>
<el-button size="small" type="text" @click="randomPassword">
<el-button size="small" type="text" :disabled="disabled" @click="randomPassword">
<i class="fa fa-retweet" />
</el-button>
</div>
Expand Down Expand Up @@ -44,6 +45,10 @@ export default {
placeholder: {
type: String,
default: () => ''
},
disabled: {
type: Boolean,
default: false
}
},
data() {
Expand Down

0 comments on commit 25ba669

Please sign in to comment.