From 6273a9498e9d36973bf67744f6052c6faecbddd9 Mon Sep 17 00:00:00 2001 From: chaos-zhu Date: Mon, 21 Oct 2024 21:11:42 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E8=BD=AF=E9=94=AE=E7=9B=98=E5=BC=B9=E8=B5=B7UI?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/index.html | 2 + web/src/components/float-menu/index.vue | 56 +++++++++---------- web/src/components/top-bar.vue | 2 +- web/src/composables/useMobileWidth.js | 2 - web/src/store/index.js | 6 +- web/src/views/index.vue | 4 +- web/src/views/server/components/host-form.vue | 1 + .../views/server/components/host-table.vue | 3 - .../views/terminal/components/terminal.vue | 4 -- web/src/views/terminal/index.vue | 2 +- 10 files changed, 37 insertions(+), 45 deletions(-) diff --git a/web/index.html b/web/index.html index 9eb9ad2..2d185a8 100644 --- a/web/index.html +++ b/web/index.html @@ -13,6 +13,8 @@
+ \ No newline at end of file diff --git a/web/src/components/float-menu/index.vue b/web/src/components/float-menu/index.vue index b619566..70d1706 100644 --- a/web/src/components/float-menu/index.vue +++ b/web/src/components/float-menu/index.vue @@ -17,18 +17,6 @@ :modal="false" modal-class="keyboard_drawer" > - 组合键 - - 功能键 @@ -73,6 +63,14 @@ let showMenu = computed({ const { LONG_PRESS, SINGLE_PRESS } = virtualKeyType const keys = ref([ + { key: 'Ctrl+C', ascii: null, type: SINGLE_PRESS, ansi: '\x03' }, + { key: 'Ctrl+A', ascii: null, type: SINGLE_PRESS, ansi: '\x01' }, + { key: 'Ctrl+E', ascii: null, type: SINGLE_PRESS, ansi: '\x05' }, + { key: 'Ctrl+L', ascii: null, type: SINGLE_PRESS, ansi: '\x0C' }, + { key: 'Ctrl+R', ascii: null, type: SINGLE_PRESS, ansi: '\x12' }, + { key: ':wq', ascii: null, type: SINGLE_PRESS, ansi: ':wq\r' }, + { key: ':q!', ascii: null, type: SINGLE_PRESS, ansi: ':q!\r' }, + { key: 'dd', ascii: null, type: SINGLE_PRESS, ansi: 'dd\r' }, { key: 'Esc', ascii: 27, type: SINGLE_PRESS, ansi: '\x1B' }, { key: 'Tab', ascii: 9, type: SINGLE_PRESS, ansi: '\x09' }, { key: 'Ctrl', ascii: null, type: LONG_PRESS, ansi: '' }, @@ -101,17 +99,6 @@ const keys = ref([ { key: 'PageDown', ascii: 34, type: SINGLE_PRESS, ansi: '\x1B[6~' }, ]) -const keyGroup = ref([ - { key: 'Ctrl+C', ascii: null, type: SINGLE_PRESS, ansi: '\x03' }, - { key: 'Ctrl+A', ascii: null, type: SINGLE_PRESS, ansi: '\x01' }, - { key: 'Ctrl+E', ascii: null, type: SINGLE_PRESS, ansi: '\x05' }, - { key: 'Ctrl+L', ascii: null, type: SINGLE_PRESS, ansi: '\x0C' }, - { key: 'Ctrl+R', ascii: null, type: SINGLE_PRESS, ansi: '\x12' }, - { key: ':wq', ascii: null, type: SINGLE_PRESS, ansi: ':wq\r' }, - { key: ':q!', ascii: null, type: SINGLE_PRESS, ansi: ':q!\r' }, - { key: 'dd', ascii: null, type: SINGLE_PRESS, ansi: 'dd\r' }, -]) - const handleClickKey = (key) => { emit('click-key', key) } @@ -203,6 +190,13 @@ onMounted(() => { y.value = window.innerHeight - radius * 2 styleObject.value.top = `${ y.value }px` styleObject.value.left = `${ x.value }px` + + window.addEventListener('resize', () => { + x.value = window.innerWidth - radius * 2 + y.value = window.innerHeight - radius * 2 + styleObject.value.top = `${ y.value }px` + styleObject.value.left = `${ x.value }px` + }) }) @@ -218,31 +212,35 @@ onMounted(() => { } .keyboard_drawer { - height: 25vh; + height: 150px; .el-drawer { height: 100%!important; .el-drawer__header { margin-bottom: 10px; } .el-drawer__body { - padding: 0 20px; + padding: 10px 15px; } } .keyboard { list-style: none; display: flex; flex-wrap: wrap; + justify-content: space-around; padding: 0; + .key.placeholder { + opacity: 0; + } .key { - width: 80px; + width: 76px; + min-height: 15px; font-size: 12px; box-sizing: border-box; - padding: 10px; + padding: 8px; text-align: center; - margin-right: 12px; + margin-right: 8px; margin-bottom: 6px; border: 1px solid #ccc; - min-height: 15px; } .long_press { .active { diff --git a/web/src/components/top-bar.vue b/web/src/components/top-bar.vue index 35fc313..6200341 100644 --- a/web/src/components/top-bar.vue +++ b/web/src/components/top-bar.vue @@ -103,7 +103,7 @@ const handleCollapse = () => { } const handleLogout = () => { - $store.clearJwtToken() + $store.removeJwtToken() $message({ type: 'success', message: '已安全退出', center: true }) $router.push('/login') } diff --git a/web/src/composables/useMobileWidth.js b/web/src/composables/useMobileWidth.js index 8bd9936..923de29 100644 --- a/web/src/composables/useMobileWidth.js +++ b/web/src/composables/useMobileWidth.js @@ -6,8 +6,6 @@ export default function useMobileWidth(maxWidth = 968) { isMobileScreen.value = window.innerWidth < maxWidth } onMounted(() => { - console.log('window.innerWidth: ', window.innerWidth) - console.log('window.innerWidth: ', window.innerWidth) window.addEventListener('resize', updateScreenWidth) }) diff --git a/web/src/store/index.js b/web/src/store/index.js index 5c08b6d..cdda01a 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -58,9 +58,9 @@ const useStore = defineStore({ async setTitle(title) { this.$patch({ title }) }, - async clearJwtToken() { - localStorage.clear('token') - sessionStorage.clear('token') + async removeJwtToken() { + localStorage.removeItem('token') + sessionStorage.removeItem('token') this.$patch({ token: null }) }, async getMainData() { diff --git a/web/src/views/index.vue b/web/src/views/index.vue index 637ef75..c171cfb 100644 --- a/web/src/views/index.vue +++ b/web/src/views/index.vue @@ -46,10 +46,10 @@ onBeforeMount(async () => { height: 100vh; .main_container { flex: 1; - height: 100vh; + height: 100%; overflow: auto; .router_box { - min-height: calc(100vh - 60px - 20px); + height: calc(100% - 60px - 20px); background-color: #fff; border-radius: 6px; margin: 10px; diff --git a/web/src/views/server/components/host-form.vue b/web/src/views/server/components/host-form.vue index 895e3bf..36b8023 100644 --- a/web/src/views/server/components/host-form.vue +++ b/web/src/views/server/components/host-form.vue @@ -194,6 +194,7 @@ 服务商控制台 - - {{ row.clientPort }} -
客户端监控服务未安装或连接失败,无法获取实例监控数据。去安装 diff --git a/web/src/views/terminal/components/terminal.vue b/web/src/views/terminal/components/terminal.vue index eb49839..6443799 100644 --- a/web/src/views/terminal/components/terminal.vue +++ b/web/src/views/terminal/components/terminal.vue @@ -101,12 +101,8 @@ />
- - {