Skip to content

Commit 896e1c2

Browse files
committed
Disable plugin upload feature
Comment out the backend import route and corresponding frontend upload UI to disable plugin uploads. Backend: commented out POST /Import route in packages/napcat-webui-backend/src/router/Plugin.ts. Frontend: removed (commented) the upload Button and hidden file input in packages/napcat-webui-frontend/src/pages/dashboard/plugin.tsx. This temporarily prevents users from uploading plugins.
1 parent cff07c7 commit 896e1c2

File tree

2 files changed

+3
-1
lines changed
  • packages

2 files changed

+3
-1
lines changed

packages/napcat-webui-backend/src/router/Plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ router.post('/Config', SetPluginConfigHandler);
6868
router.get('/Config/SSE', PluginConfigSSEHandler);
6969
router.post('/Config/Change', PluginConfigChangeHandler);
7070
router.post('/RegisterManager', RegisterPluginManagerHandler);
71-
router.post('/Import', upload.single('plugin'), ImportLocalPluginHandler);
71+
// router.post('/Import', upload.single('plugin'), ImportLocalPluginHandler); // 禁用插件上传
7272
router.get('/Icon/:pluginId', GetPluginIconHandler);
7373

7474
// 插件商店相关路由

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export default function PluginPage () {
182182
>
183183
<IoMdRefresh size={24} />
184184
</Button>
185+
{/* 禁用插件上传
185186
<Button
186187
className="bg-primary-100/50 hover:bg-primary-200/50 text-primary-700 backdrop-blur-md"
187188
radius='full'
@@ -197,6 +198,7 @@ export default function PluginPage () {
197198
className="hidden"
198199
onChange={handleFileChange}
199200
/>
201+
*/}
200202
</div>
201203

202204
{pluginManagerNotFound ? (

0 commit comments

Comments
 (0)