Merge branch 'master' of github.com:jumpserver/lina

This commit is contained in:
ibuler
2020-04-10 18:45:13 +08:00
5 changed files with 87 additions and 21 deletions

View File

@@ -379,7 +379,10 @@ const cn = {
'join': '加入', 'join': '加入',
'goto': '转到', 'goto': '转到',
'sessionDetail': '会话详情', 'sessionDetail': '会话详情',
'quickModify': '快速修改' 'quickModify': '快速修改',
'replaySession': '回放会话:',
'downloadReplay': '下载录像:',
'go': '执行'
}, },
jobcenter: { jobcenter: {
'RunTimes': '执行次数', 'RunTimes': '执行次数',

View File

@@ -279,22 +279,29 @@ const en = {
'command': 'Command', 'command': 'Command',
'dateStart': 'Date start', 'dateStart': 'Date start',
'duration': 'Duration', 'duration': 'Duration',
'terminate': 'Terminate',
'dateEnd': 'Date end',
'commands': 'Commands',
'replay': 'replay',
'download': 'download',
'riskLevel': 'Risk level',
'session': 'session',
'action': 'Action', 'action': 'Action',
'search': 'Search', 'search': 'Search',
'terminate_selected': 'Terminate selected', 'terminate_selected': 'Terminate selected',
'confirm_finished': 'Confirm finished', 'confirm_finished': 'Confirm finished',
'submit': 'Submit', 'submit': 'Submit',
'terminate': 'Terminate',
'command_list': 'Command list', 'command_list': 'Command list',
'dateEnd': 'Date end',
'quick_modify': 'Quick modify', 'quick_modify': 'Quick modify',
'terminate_session': 'Terminate session', 'terminate_session': 'Terminate session',
'confirm': 'Confirm', 'confirm': 'Confirm',
'commands': 'Commands',
'join': 'join', 'join': 'join',
'goto': 'Goto', 'goto': 'Goto',
'sessionDetail': 'Session Detail', 'sessionDetail': 'Session Detail',
'quickModify': 'Quick Modify' 'quickModify': 'Quick Modify',
'replaySession': 'Replay session:',
'downloadReplay': 'Download replay:',
'go': 'Go'
}, },
setting: { setting: {
'setting': 'System Setting', 'setting': 'System Setting',

View File

@@ -284,13 +284,13 @@ export const constantRoutes = [
{ {
path: 'luna', path: 'luna',
name: 'WebTerminal', name: 'WebTerminal',
component: () => import('@/views/tree/index'), component: () => window.open(`/luna/?_=${Date.now()}`),
meta: { title: 'WebTerminal' } meta: { title: 'WebTerminal' }
}, },
{ {
path: 'sftp', path: 'sftp',
name: 'FileManager', name: 'FileManager',
component: () => import('@/views/tree/index'), component: () => window.open(`/koko/elfinder/sftp/?`),
meta: { title: 'FileManager' } meta: { title: 'FileManager' }
}, },
{ {

View File

@@ -8,9 +8,19 @@
<el-col :span="10"> <el-col :span="10">
<el-card class="box-card primary"> <el-card class="box-card primary">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<i class="fa fa-user" /> <i class="fa fa-info" />
<span>{{ cardActions }}</span> <span>{{ cardActions }}</span>
</div> </div>
<el-table class="el-table" :data="cardActionData" :show-header="false">
<el-table-column prop="name" />
<el-table-column prop="button" align="right">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleButtonAction(scope.$index, scope.row)">
{{ scope.row.button }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
@@ -20,14 +30,6 @@
<el-col :span="14"> <el-col :span="14">
<ListTable :table-config="tableConfig" :header-actions="headerActions" /> <ListTable :table-config="tableConfig" :header-actions="headerActions" />
</el-col> </el-col>
<el-col :span="10">
<el-card class="box-card primary">
<div slot="header" class="clearfix">
<i class="fa fa-user" />
<span>{{ cardActions }}</span>
</div>
</el-card>
</el-col>
</el-row> </el-row>
</div> </div>
</GenericDetailPage> </GenericDetailPage>
@@ -101,14 +103,15 @@ export default {
name: 'command' name: 'command'
} }
] ]
} }
}, },
computed: { computed: {
title() { title() {
return this.$t('sessions.sessionDetail') return this.$t('sessions.sessionDetail')
}, },
cardTitle() { return this.sessionData.id }, cardTitle() {
return this.sessionData.id
},
cardActions() { cardActions() {
return this.$t('sessions.quickModify') return this.$t('sessions.quickModify')
}, },
@@ -147,6 +150,20 @@ export default {
value: this.sessionData.date_end value: this.sessionData.date_end
} }
] ]
},
cardActionData() {
return [
{
name: this.$t('sessions.replaySession'),
button: this.$t('sessions.go'),
value: 'replay'
},
{
name: this.$t('sessions.downloadReplay'),
button: this.$t('sessions.download'),
value: 'download'
}
]
} }
}, },
mounted() { mounted() {
@@ -159,10 +176,49 @@ export default {
}) })
}, },
methods: { methods: {
handleButtonAction: function(index, row) {
switch (row.value) {
case 'replay':
this.openReplaySession(this.sessionData.id)
break
case 'download':
this.openReplayDownload(this.sessionData.id)
break
default:
console.log('No Match button action: ' + row.value)
}
},
openReplaySession: function(id) {
const replayUrl = '/luna/replay/' + id
window.open(replayUrl)
},
openReplayDownload: function(id) {
const downloadUrl = '/terminal/session/00000000-0000-0000-0000-000000000000/replay/download/'
.replace('00000000-0000-0000-0000-000000000000', id)
window.open(downloadUrl)
}
} }
} }
</script> </script>
<style scoped> <style lang="less" scoped>
.el-table /deep/ .el-table__row > td {
line-height: 1.5;
padding: 8px 0;
}
.el-table /deep/ .el-table__row > td> div > span {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-table /deep/ .el-table__header > thead > tr >th {
padding: 8px 0;
background-color: #F5F5F6;
font-size: 13px;
line-height: 1.5;
}
.table{
margin-top: 15px;
}
</style> </style>

View File

@@ -73,7 +73,7 @@ export default {
type: 'primary', type: 'primary',
callback: function({ cellValue, tableData }) { callback: function({ cellValue, tableData }) {
// 跳转下载页面 // 跳转下载页面
const downloadUrl = 'terminal/session/00000000-0000-0000-0000-000000000000/replay/download/' const downloadUrl = '/terminal/session/00000000-0000-0000-0000-000000000000/replay/download/'
.replace('00000000-0000-0000-0000-000000000000', cellValue) .replace('00000000-0000-0000-0000-000000000000', cellValue)
window.open(downloadUrl) window.open(downloadUrl)
} }