mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
Session detail view link
This commit is contained in:
23
src/components/ListTable/formatters/RouterFormatter.vue
Normal file
23
src/components/ListTable/formatters/RouterFormatter.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<template>
|
||||||
|
<el-link class="detail" :type="col.type || 'success'" @click="goDetail">{{ col.linkName }}</el-link>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseFormatter from './base'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'RouterFormatter',
|
||||||
|
extends: BaseFormatter,
|
||||||
|
methods: {
|
||||||
|
goDetail() {
|
||||||
|
const routeName = this.col.route || ''
|
||||||
|
this.$router.push({ name: routeName, params: { id: this.cellValue }})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@@ -4,3 +4,5 @@ export { default as BooleanFormatter } from './ChoicesFormatter'
|
|||||||
export { default as ActionsFormatter } from './ActionsFormatter'
|
export { default as ActionsFormatter } from './ActionsFormatter'
|
||||||
export { default as ExpandPreFormatter } from './ExpandPreFormatter'
|
export { default as ExpandPreFormatter } from './ExpandPreFormatter'
|
||||||
export { default as LengthFormatter } from './LengthFormatter'
|
export { default as LengthFormatter } from './LengthFormatter'
|
||||||
|
export { default as RouterFormatter } from './RouterFormatter'
|
||||||
|
export { default as OutputExpandFormatter } from './OutputExpandFormatter'
|
||||||
|
@@ -87,6 +87,7 @@ const cn = {
|
|||||||
'Sessions': '会话管理',
|
'Sessions': '会话管理',
|
||||||
'SessionOnline': '在线会话',
|
'SessionOnline': '在线会话',
|
||||||
'SessionOffline': '历史会话',
|
'SessionOffline': '历史会话',
|
||||||
|
'SessionDetail': '会话详情',
|
||||||
'Commands': '命令记录',
|
'Commands': '命令记录',
|
||||||
'WebTerminal': 'Web终端',
|
'WebTerminal': 'Web终端',
|
||||||
'FileManager': '文件管理',
|
'FileManager': '文件管理',
|
||||||
@@ -380,7 +381,8 @@ const cn = {
|
|||||||
'active': '激活中',
|
'active': '激活中',
|
||||||
'alive': '在线',
|
'alive': '在线',
|
||||||
'StorageConfiguration': '存储配置',
|
'StorageConfiguration': '存储配置',
|
||||||
'join': '加入'
|
'join': '加入',
|
||||||
|
'goto': '转到'
|
||||||
},
|
},
|
||||||
jobcenter: {
|
jobcenter: {
|
||||||
'RunTimes': '执行次数',
|
'RunTimes': '执行次数',
|
||||||
|
@@ -18,7 +18,11 @@ const en = {
|
|||||||
'assets': 'Assets',
|
'assets': 'Assets',
|
||||||
'applications': 'Applications',
|
'applications': 'Applications',
|
||||||
'perms': 'Perms',
|
'perms': 'Perms',
|
||||||
'sessions': 'Sessions',
|
'Sessions': 'Sessions',
|
||||||
|
'SessionOnline': 'Session Online',
|
||||||
|
'SessionOffline': 'Session Offline',
|
||||||
|
'SessionDetail': 'Session Detail',
|
||||||
|
'Goto': 'Goto',
|
||||||
'jobcenter': 'Job Center'
|
'jobcenter': 'Job Center'
|
||||||
},
|
},
|
||||||
users: {
|
users: {
|
||||||
@@ -289,7 +293,8 @@ const en = {
|
|||||||
'terminate_session': 'Terminate session',
|
'terminate_session': 'Terminate session',
|
||||||
'confirm': 'Confirm',
|
'confirm': 'Confirm',
|
||||||
'commands': 'Commands',
|
'commands': 'Commands',
|
||||||
'join': 'join'
|
'join': 'join',
|
||||||
|
'goto': 'Goto'
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
'setting': 'System Setting',
|
'setting': 'System Setting',
|
||||||
|
@@ -274,6 +274,13 @@ export const constantRoutes = [
|
|||||||
component: () => import('@/views/sessions/CommandList'),
|
component: () => import('@/views/sessions/CommandList'),
|
||||||
meta: { title: 'Commands' }
|
meta: { title: 'Commands' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'sessions/:id',
|
||||||
|
name: 'SessionDetail',
|
||||||
|
component: () => import('@/views/sessions/SessionDetail'),
|
||||||
|
meta: { title: 'SessionDetail' },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'luna',
|
path: 'luna',
|
||||||
name: 'WebTerminal',
|
name: 'WebTerminal',
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { GenericListPage } from '@/layout/components'
|
import { GenericListPage } from '@/layout/components'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
import OutputExpandFormatter from '@/components/ListTable/formatters/OutputExpandFormatter'
|
import { RouterFormatter, OutputExpandFormatter } from '@/components/ListTable/formatters'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -42,7 +42,10 @@ export default {
|
|||||||
label: this.$t('sessions.systemUser')
|
label: this.$t('sessions.systemUser')
|
||||||
},
|
},
|
||||||
session: {
|
session: {
|
||||||
label: this.$t('sessions.session')
|
label: this.$t('sessions.session'),
|
||||||
|
formatter: RouterFormatter,
|
||||||
|
route: 'SessionDetail',
|
||||||
|
linkName: this.$t('sessions.goto')
|
||||||
},
|
},
|
||||||
timestamp: {
|
timestamp: {
|
||||||
label: this.$t('sessions.date'),
|
label: this.$t('sessions.date'),
|
||||||
|
13
src/views/sessions/SessionDetail.vue
Normal file
13
src/views/sessions/SessionDetail.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<div>SessionDetail</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'SessionDetail'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@@ -22,8 +22,10 @@ export default {
|
|||||||
],
|
],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
index: {
|
index: {
|
||||||
type: 'index',
|
label: this.$t('sessions.id'),
|
||||||
label: this.$t('sessions.id')
|
formatter: function(row, column, cellValue, index) {
|
||||||
|
return <a class='detail el-link el-link--success is-underline' href= { '/terminal/sessions/' + row.id }>{ index + 1}</a>
|
||||||
|
}
|
||||||
},
|
},
|
||||||
command_amount: {
|
command_amount: {
|
||||||
label: this.$t('sessions.command')
|
label: this.$t('sessions.command')
|
||||||
|
@@ -22,8 +22,10 @@ export default {
|
|||||||
],
|
],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
index: {
|
index: {
|
||||||
type: 'index',
|
label: this.$t('sessions.id'),
|
||||||
label: this.$t('sessions.id')
|
formatter: function(row, column, cellValue, index) {
|
||||||
|
return <a class='detail el-link el-link--success is-underline' href= { '/terminal/sessions/' + row.id }>{ index + 1}</a>
|
||||||
|
}
|
||||||
},
|
},
|
||||||
command_amount: {
|
command_amount: {
|
||||||
label: this.$t('sessions.command')
|
label: this.$t('sessions.command')
|
||||||
|
Reference in New Issue
Block a user