perf: 添加可中断API字段

This commit is contained in:
Orange
2020-11-11 18:48:30 +08:00
committed by Jiangjie.Bai
parent 5772430761
commit 1bb94824df
2 changed files with 6 additions and 0 deletions

View File

@@ -106,6 +106,9 @@ export default {
type: 'danger', type: 'danger',
label: this.$t('sessions.terminate') label: this.$t('sessions.terminate')
}, },
can: () => {
return vm.sessionData.can_terminate
},
callbacks: { callbacks: {
click: function() { click: function() {
// 终断 session reload // 终断 session reload

View File

@@ -19,6 +19,9 @@ export default {
name: 'terminate', name: 'terminate',
title: this.$t('sessions.terminate'), title: this.$t('sessions.terminate'),
type: 'danger', type: 'danger',
can: (row, cellValue) => {
return row.can_terminate
},
callback: function({ reload, cellValue, tableData }) { callback: function({ reload, cellValue, tableData }) {
// 终断 session reload // 终断 session reload
const data = [cellValue] const data = [cellValue]