Skip to content

Commit c3b29f1

Browse files
committed
Improve extension tab UI and add /plugin proxy
Update dashboard extension UI to prevent title overflow: add truncate and max-width to the tab title, include the plugin name in the title tooltip, and hide the plugin-name label on small screens (visible from md+). Also add a '/plugin' proxy entry to the Vite dev server config so plugin requests are forwarded to the backend debug URL.
1 parent 3e85d18 commit c3b29f1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/napcat-webui-frontend/src/pages/dashboard/extension.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,16 @@ export default function ExtensionPage () {
132132
<div className='flex items-center gap-2'>
133133
{tab.icon && <span>{tab.icon}</span>}
134134
<span
135-
className='cursor-pointer hover:underline'
136-
title='点击在新窗口打开'
135+
className='cursor-pointer hover:underline truncate max-w-[6rem] md:max-w-none'
136+
title={`插件:${tab.pluginName}\n点击在新窗口打开`}
137137
onClick={(e) => {
138138
e.stopPropagation();
139139
openInNewWindow(tab.pluginId, tab.path);
140140
}}
141141
>
142142
{tab.title}
143143
</span>
144-
<span className='text-xs text-default-400'>({tab.pluginName})</span>
144+
<span className='text-xs text-default-400 hidden md:inline'>({tab.pluginName})</span>
145145
</div>
146146
}
147147
/>

packages/napcat-webui-frontend/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default defineConfig(({ mode }) => {
3030
},
3131
'/api': backendDebugUrl,
3232
'/files': backendDebugUrl,
33+
'/plugin': backendDebugUrl,
3334
'/webui/fonts/CustomFont.woff': backendDebugUrl,
3435
'/webui/sw.js': backendDebugUrl,
3536
},

0 commit comments

Comments
 (0)