From e5b2bd700878ec033e1128b378e55ef1f468d4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 19 Apr 2022 18:15:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5button=20=E6=8C=89=E9=92=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E4=BD=8D=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/TabPage/index.vue | 2 +- src/views/sessions/SessionDetail/SessionDetailInfo.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layout/components/TabPage/index.vue b/src/layout/components/TabPage/index.vue index b5a40808f..ec5733533 100644 --- a/src/layout/components/TabPage/index.vue +++ b/src/layout/components/TabPage/index.vue @@ -117,7 +117,7 @@ export default { ] for (const preTab of preActiveTabs) { - const currentTab = typeof preTab === 'object' ? preTab.name : preTab + const currentTab = typeof preTab === 'object' ? preTab?.name : preTab for (const tabName of this.tabIndices) { const currentTabName = tabName?.name || '' if (currentTab?.toLowerCase() === currentTabName?.toLowerCase()) { diff --git a/src/views/sessions/SessionDetail/SessionDetailInfo.vue b/src/views/sessions/SessionDetail/SessionDetailInfo.vue index b824c1859..1bb503e75 100644 --- a/src/views/sessions/SessionDetail/SessionDetailInfo.vue +++ b/src/views/sessions/SessionDetail/SessionDetailInfo.vue @@ -40,7 +40,7 @@ export default { attrs: { type: 'danger', label: this.$t('sessions.terminate'), - disabled: !this.session['can_terminate'] + disabled: !this.session['can_terminate'] || !vm.$hasPerm('terminal.terminate_session') }, callbacks: { click: function() { @@ -60,7 +60,7 @@ export default { attrs: { type: 'primary', label: this.$t('sessions.Monitor'), - disabled: !this.session['can_join'] + disabled: !this.session['can_join'] || !vm.$hasPerm('terminal.monitor_session') }, callbacks: { click: function() {