[Update] 修改会话列表自定义按钮

This commit is contained in:
jym503558564
2020-04-02 18:15:54 +08:00
parent 45dcb1e9f5
commit 36af2d0ea8
3 changed files with 38 additions and 6 deletions

View File

@@ -354,7 +354,9 @@ const cn = {
'quick_modify': '快速修改', 'quick_modify': '快速修改',
'terminate_session': '终止会话', 'terminate_session': '终止会话',
'confirm': '确认', 'confirm': '确认',
'commands': '命令记录' 'commands': '命令记录',
'replay': '回放',
'download': '下载'
}, },
setting: { setting: {
'setting': '系统设置', 'setting': '系统设置',

View File

@@ -23,7 +23,10 @@ export default {
}, },
url: '/api/v1/terminal/sessions/', url: '/api/v1/terminal/sessions/',
columns: [ columns: [
{ type: 'index' }, {
label: this.$t('sessions.id'),
type: 'index'
},
{ {
prop: 'user', prop: 'user',
label: this.$t('sessions.user'), label: this.$t('sessions.user'),
@@ -64,8 +67,25 @@ export default {
], ],
tableActions: { tableActions: {
hasEdit: false, hasEdit: false,
hadDelete: false hasDelete: false
} },
extraButtons: [
{
type: 'warning',
text: this.$t('sessions.replay'),
// 必须使用箭头函数
atClick: (row) => {
this.$router.push({ name: '404' })
}
},
{
type: 'primary',
text: this.$t('sessions.download'),
atClick: (row) => {
this.$router.push({ name: '404' })
}
}
]
}, },
headerActions: { headerActions: {
hasCreate: false, hasCreate: false,

View File

@@ -63,8 +63,18 @@ export default {
], ],
tableActions: { tableActions: {
hasEdit: false, hasEdit: false,
hadDelete: false hasDelete: false
} },
extraButtons: [
{
type: 'danger',
text: this.$t('sessions.terminate'),
// 必须使用箭头函数
atClick: (row) => {
this.$router.push({ name: '404' })
}
}
]
}, },
headerActions: { headerActions: {
hasCreate: false, hasCreate: false,