perf: 优化创建资产时模版导入账号

This commit is contained in:
“huailei000”
2022-10-31 17:05:30 +08:00
committed by huailei
parent 8551426619
commit 89de63edcd
7 changed files with 93 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ export default {
form: this.account || { },
fields: [
[this.$t('common.Basic'), ['name', 'username', 'privileged']],
[this.$t('assets.Secret'), ['secret_type', 'password', 'ssh_key', 'token', 'api_key', 'passphrase']],
[this.$t('assets.Secret'), ['secret_type', 'secret', 'ssh_key', 'token', 'api_key', 'passphrase']],
[this.$t('common.Other'), ['push_now', 'comment']]
],
defaultPrivilegedAccounts: ['root', 'administrator'],

View File

@@ -110,7 +110,7 @@ export default {
{
prop: 'protocols',
formatter: function(row) {
return <span> {row.protocols.toString()} </span>
return <span> {row.protocols?.toString()} </span>
},
label: this.$t('assets.Protocols')
}

View File

@@ -32,7 +32,7 @@ export default {
},
cellValue: {
type: [String, Number],
default: null
default: ''
},
hasShow: {
type: Boolean,
@@ -56,7 +56,7 @@ export default {
methods: {
switchShowValue() {
const value = this.value || this.cellValue
return '******' + value.replace(/[\s\S]/g, '')
return value ? '******' + value.replace(/[\s\S]/g, '') : ''
},
onShow() {
const { currentValue, switchShowValue } = this