Merge pull request #2737 from jumpserver/pr@dev@perf_account_history

perf: 优化账号,去掉 version
This commit is contained in:
老广
2023-02-22 11:47:13 +08:00
committed by GitHub
4 changed files with 15 additions and 12 deletions

View File

@@ -139,9 +139,6 @@ export default {
}
}
},
version: {
width: '70px'
},
secret_type: {
width: '100px',
formatter: function(row) {

View File

@@ -28,7 +28,7 @@ export default {
width: '60%',
tableConfig: {
url: `/api/v1/accounts/account-secrets/${this.account.id}/histories/`,
columns: ['secret', 'secret_type', 'version'],
columns: ['secret', 'secret_type', 'history_date'],
columnsMeta: {
secret: {
formatter: ShowKeyCopyFormatter,

View File

@@ -2,20 +2,20 @@
<div>
<UserConfirmDialog
:url="url"
@UserConfirmDone="getAuthInfo"
@UserConfirmCancel="exit"
@UserConfirmDone="getAuthInfo"
/>
<Dialog
:title="dialogTitle"
:show-cancel="false"
:destroy-on-close="true"
:width="'50'"
:show-cancel="false"
:title="dialogTitle"
:visible.sync="showSecret"
:width="'50'"
v-bind="$attrs"
@confirm="showSecret = false"
v-on="$listeners"
>
<el-form class="password-form" label-position="right" label-width="100px" :model="secretInfo">
<el-form :model="secretInfo" class="password-form" label-position="right" label-width="100px">
<el-form-item :label="$tc('assets.Name')">
<span>{{ account['name'] }}</span>
</el-form-item>
@@ -45,9 +45,8 @@
type="text"
@click="onShowPasswordHistory"
>
{{ secretInfo.version }}
{{ historyCount }}
</el-button>
</el-form-item>
</el-form>
</Dialog>
@@ -97,6 +96,7 @@ export default {
secretInfo: {},
showSecret: false,
sshKeyFingerprint: '',
historyCount: 0,
showPasswordHistoryDialog: false
}
},
@@ -108,6 +108,12 @@ export default {
return this.account['secret_type'].value
}
},
mounted() {
const url = `/api/v1/accounts/account-secrets/${this.account.id}/histories/?limit=1`
this.$axios.get(url).then(resp => {
this.historyCount = resp.count
})
},
methods: {
getAuthInfo() {
this.$axios.get(this.url, { disableFlashErrorMsg: true }).then(resp => {

View File

@@ -48,7 +48,7 @@ export default {
return {
templateDialogVisible: false,
columns: [
'name', 'username', 'version', 'privileged', 'connectivity',
'name', 'username', 'privileged', 'connectivity',
'is_active', 'date_created', 'date_updated', 'actions'
],
headerExtraActions: [