From 1ea80f4447eaf3ba2631d5dca30965d0cb26987f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=B8=E5=87=A4=E5=AD=A4=E5=87=B0?= <3100542635@qq.com> Date: Wed, 27 Nov 2024 18:16:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dwebui=E5=B7=B2=E7=9F=A5bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- napcat.webui/src/App.vue | 6 +- napcat.webui/src/main.ts | 2 + napcat.webui/src/pages/NetWork.vue | 110 ++++++++++++++--------------- 3 files changed, 57 insertions(+), 61 deletions(-) diff --git a/napcat.webui/src/App.vue b/napcat.webui/src/App.vue index b9fb5e52..d26b9165 100644 --- a/napcat.webui/src/App.vue +++ b/napcat.webui/src/App.vue @@ -35,9 +35,9 @@ enum ThemeMode { Auto = 'auto', } const themeLabelMap: Record = { - 浅色: ThemeMode.Light, - 深色: ThemeMode.Dark, - 自动: ThemeMode.Auto, + "浅色": ThemeMode.Light, + "深色": ThemeMode.Dark, + "自动": ThemeMode.Auto, }; const show = ref(true); const createSetThemeAttributeFunction = () => { diff --git a/napcat.webui/src/main.ts b/napcat.webui/src/main.ts index 1155759a..0236749d 100644 --- a/napcat.webui/src/main.ts +++ b/napcat.webui/src/main.ts @@ -39,6 +39,7 @@ import { Footer as TFooter, Aside as TAside, Popconfirm as Tpopconfirm, + Empty as TEmpty, } from 'tdesign-vue-next'; import { router } from './router'; import 'tdesign-vue-next/es/style/index.css'; @@ -82,4 +83,5 @@ app.use(TContent); app.use(TFooter); app.use(TAside); app.use(Tpopconfirm); +app.use(TEmpty); app.mount('#app'); diff --git a/napcat.webui/src/pages/NetWork.vue b/napcat.webui/src/pages/NetWork.vue index 7f067680..3fce5bd1 100644 --- a/napcat.webui/src/pages/NetWork.vue +++ b/napcat.webui/src/pages/NetWork.vue @@ -35,25 +35,37 @@ 'var(--td-success-color)' : 'var(--td-error-color)') }"> - - {{ item.host }} - {{ item.url }} - :{{ item.port }} -
- +
+ + {{ item.host }}:{{ item.port }} + +
+
+ + {{ item.url }} + +
-
- {{ showToken ? item.token : '*******' }} - + {{ showToken ? item.token : '******' }} + -
+
+ + 点击查看 + + +
{{ item.messagePostFormat }}
@@ -61,7 +73,7 @@ - + {{ item.debug ? '开启' : '关闭' }} @@ -93,13 +105,13 @@
- -
暂无网络配置
+ + -
+ :show-in-attached-element="true" placement="center" :on-confirm="saveConfig" class=".t-dialog__ctx .t-dialog--defaul"> +
@@ -354,7 +366,7 @@ const handleResize = () => { // } else { // infoOneCol.value= false // } - tabsWidth.value = window.innerWidth - 40 - menuWidth.value; + tabsWidth.value = window.innerWidth - 41 - menuWidth.value; if (mediumScreen.matches) { cardWidth.value = (tabsWidth.value - 20) / 2; } else if (largeScreen.matches) { @@ -364,7 +376,7 @@ const handleResize = () => { } loadPage.value = true; setTimeout(() => { - cardHeight.value = window.innerHeight - (headerBox.value?.offsetHeight ?? 0) - (setting.value?.offsetHeight ?? 0) - 20; + cardHeight.value = window.innerHeight - (headerBox.value?.offsetHeight ?? 0) - (setting.value?.offsetHeight ?? 0) - 21; }, 300); }; emitter.on('sendWidth', (width) => { @@ -409,70 +421,58 @@ onUnmounted(() => { .setting-card { width: 100%; + text-align: left; } .setting-content { width: 100%; - text-align: left; } .card-address svg { fill: var(--td-brand-color); - margin-right: 10px; cursor: pointer; } -.setting-address { +.local-box { display: flex; margin-top: 2px; } - +.local-icon{ + flex: 1; +} .local { - flex: 5.5; - margin-bottom: 1px; + flex: 6; + margin: 0 10px 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.none-box { - flex: 0.5; + +.copy-icon { + flex: 1; + cursor: pointer; + flex-direction: row; } -.port { - flex: 4; - margin-top: 1px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.setting-status { - display: flex; - margin-top: 2px; -} - -.status-deBug { - display: flex; - flex: 4; -} - -.status-tag { - display: flex; - flex: 5.5; -} .token-view { display: flex; - flex-direction: row; align-items: center; } .token-view span { - flex: 1; - margin-right: 20%; + flex: 5; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.browse-icon{ + flex: 2; +} +:global(.t-dialog__ctx .t-dialog--defaul) { + margin: 0 20px; } - @media (max-width: 1024px) { .setting-box { grid-template-columns: 1fr 1fr; @@ -484,9 +484,6 @@ onUnmounted(() => { grid-template-columns: 1fr; } - .setting-address { - display: block; - } } .card-box { @@ -494,12 +491,9 @@ onUnmounted(() => { } .card-none { - line-height: 200px; + line-height: 400px !important; } -.card-noneText { - font-size: 16px; -} .dialog-body { max-height: 60vh;