From 69dbf2f5dad559e27db61d6ae9d3facf8d051e65 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 11 Aug 2023 16:42:32 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E6=9A=82=E5=81=9C=E7=9A=84=E7=BB=84=E4=BB=B6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/jms.js | 2 +- src/views/sessions/SessionList/OnlineList.vue | 8 +++++--- src/views/tickets/components/Session.vue | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/utils/jms.js b/src/utils/jms.js index 8b281314c..d09a51322 100644 --- a/src/utils/jms.js +++ b/src/utils/jms.js @@ -152,6 +152,6 @@ export function toM2MJsonParams(attrFilter) { } export function IsSupportPauseSessionType(terminalType) { - const supportedType = ['koko', 'lion', 'magnus', 'chen', 'kael'] + const supportedType = ['koko', 'lion', 'chen', 'kael'] return supportedType.includes(terminalType) } diff --git a/src/views/sessions/SessionList/OnlineList.vue b/src/views/sessions/SessionList/OnlineList.vue index 1aa336808..752bd664a 100644 --- a/src/views/sessions/SessionList/OnlineList.vue +++ b/src/views/sessions/SessionList/OnlineList.vue @@ -40,7 +40,8 @@ export default { type: 'warning', can: ({ row }) => { const terminalType = row['terminal']['type'] - const supportedType = IsSupportPauseSessionType(terminalType) + const isNormalSession = row['type']['value'] === 'normal' + const supportedType = IsSupportPauseSessionType(terminalType) && isNormalSession return supportedType && vm.$hasPerm('terminal.terminate_session') }, has: ({ row }) => !row['is_locked'], @@ -63,7 +64,8 @@ export default { type: 'warning', can: ({ row }) => { const terminalType = row['terminal']['type'] - const supportedType = IsSupportPauseSessionType(terminalType) + const isNormalSession = row['type']['value'] === 'normal' + const supportedType = IsSupportPauseSessionType(terminalType) && isNormalSession return supportedType && vm.$hasPerm('terminal.terminate_session') }, has: ({ row }) => row['is_locked'], @@ -94,7 +96,7 @@ export default { }, callback: function({ row, tableData }) { const monitorUrl = '/luna/monitor/' + row.id - window.open(monitorUrl, '_blank', 'height=600, width=800, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no') + window.open(monitorUrl, '_blank', 'height=600, width=850, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no') } } ] diff --git a/src/views/tickets/components/Session.vue b/src/views/tickets/components/Session.vue index c1d1e6cf5..71604bba2 100644 --- a/src/views/tickets/components/Session.vue +++ b/src/views/tickets/components/Session.vue @@ -109,7 +109,8 @@ export default { }).then(res => { this.session = res || {} const terminalType = res['terminal']['type'] - this.supportedLock = IsSupportPauseSessionType(terminalType) + const isNormalSession = res['type']['value'] === 'normal' + this.supportedLock = IsSupportPauseSessionType(terminalType) && isNormalSession }).catch(err => { this.curTimer = setTimeout(() => { this.init() @@ -133,7 +134,7 @@ export default { }, onMonitor() { const joinUrl = `/luna/monitor/${this.session.id}?ticket_id=${this.object.id}` - window.open(joinUrl, 'height=600, width=800, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no') + window.open(joinUrl, 'height=600, width=850, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no') }, onToggleLock() { const url = '/api/v1/terminal/tasks/toggle-lock-session-for-ticket/'