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

View File

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