Merge pull request #2643 from jumpserver/pr@dev@replay_storage

perf: replay storage
This commit is contained in:
feng626 2023-02-15 15:14:02 +08:00 committed by GitHub
commit 53f48e7483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View File

@ -33,9 +33,12 @@ export default {
app: 'terminal',
resource: 'replaystorage'
},
columnsExclude: ['meta'],
columns: [
'name', 'type', 'comment', 'is_default', 'actions'
],
columnsShow: {
min: ['name', 'type', 'actions'],
default: ['name', 'type', 'comment', 'is_default', 'actions']
min: ['name', 'type', 'actions']
},
columnsMeta: {
name: {
@ -54,9 +57,8 @@ export default {
sortable: 'custom'
},
actions: {
prop: 'id',
formatterArgs: {
onUpdate: function({ row, col }) {
onUpdate: function({ row }) {
this.$router.push({ name: 'ReplayStorageUpdate', params: { id: row.id }, query: { type: row.type }})
},
canUpdate: function({ row }) {

View File

@ -1,15 +1,12 @@
<template>
<GenericCreateUpdatePage
v-bind="$data"
:create-success-next-route="successUrl"
:update-success-next-route="successUrl"
:has-detail-in-msg="false"
/>
</template>
<script>
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
import { STORAGE_TYPE_META_MAP } from '../../../sessions/const'
import { GenericCreateUpdatePage } from '@/layout/components'
import { STORAGE_TYPE_META_MAP } from '@/views/sessions/const'
import { UpdateToken } from '@/components/FormFields'
import { encryptPassword } from '@/utils/crypto'
@ -19,8 +16,8 @@ export default {
GenericCreateUpdatePage
},
data() {
const storageType = this.$route.query.type || 's3'
const storageTypeMeta = STORAGE_TYPE_META_MAP[storageType]
const storageType = this.$route.query.type || { 'value': 's3' }
const storageTypeMeta = STORAGE_TYPE_META_MAP[[storageType.value]]
return {
successUrl: { name: 'TerminalSetting', params: { activeMenu: 'RelayStorage' }},
url: `/api/v1/terminal/replay-storages/`,
@ -36,7 +33,7 @@ export default {
if (params.id) {
url = `${url}${params.id}/`
}
return `${url}?type=${storageType}`
return `${url}?type=${storageType.value}`
},
fields: [
[this.$t('common.Basic'), ['name', 'type']],