merge: with remote

This commit is contained in:
ibuler
2022-11-01 11:50:21 +08:00
47 changed files with 641 additions and 888 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'],
@@ -58,7 +58,7 @@ export default {
}
}
},
password: {
secret: {
label: this.$t('assets.Password'),
component: UpdateToken,
hidden: (formValue) => formValue.secret_type !== 'password'

View File

@@ -26,7 +26,7 @@ export default {
visible: false,
width: '60%',
tableConfig: {
url: `/api/v1/assets/accounts-historys?id=${this.account.id}`,
url: `/api/v1/assets/account-secrets/${this.account.id}/histories/`,
columns: [
'name', 'version', 'password', 'date_created'
],

View File

@@ -188,7 +188,7 @@ export default {
},
{
title: this.$t('accounts.HistoryPassword'),
can: this.$hasPerm('assets.change_assetaccountsecret') && !this.$store.getters.currentOrgIsRoot,
can: this.$hasPerm('assets.view_accountsecret') && !this.$store.getters.currentOrgIsRoot,
callback: ({ row }) => {
vm.account = row
vm.showPasswordHistoryDialog = false
@@ -207,7 +207,7 @@ export default {
hasMoreActions: true,
hasCreate: false,
hasImport: true,
hasExport: this.$hasPerm('assets.view_assetaccountsecret'),
hasExport: this.$hasPerm('assets.view_account'),
exportOptions: {
url: this.exportUrl,
mfaVerifyRequired: true

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,6 +32,10 @@ export default {
return this.$t('common.Update')
}
},
showInput: {
type: Boolean,
default: true
},
placeholder: {
type: String,
default: () => ''
@@ -39,13 +43,13 @@ export default {
},
data() {
return {
isShow: false,
isShow: this.showInput,
curValue: this.value
}
},
created() {
if (this.$route.path.indexOf('/create') !== -1) {
this.isShow = true
if (this.$route.path.indexOf('/update') !== -1) {
this.isShow = false
}
},
methods: {

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