Introduces a unified plugin configuration schema and API in the backend, with endpoints for getting and setting plugin config. Updates the frontend to support plugin config modals, including a UI for editing plugin settings. Also adds support for uninstalling plugins with optional data cleanup, and updates dependencies to use napcat-types@0.0.5.
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { Router } from 'express';
|
|
import {
|
|
GetPluginListHandler,
|
|
ReloadPluginHandler,
|
|
SetPluginStatusHandler,
|
|
UninstallPluginHandler,
|
|
GetPluginConfigHandler,
|
|
SetPluginConfigHandler
|
|
} from '@/napcat-webui-backend/src/api/Plugin';
|
|
import {
|
|
GetPluginStoreListHandler,
|
|
GetPluginStoreDetailHandler,
|
|
InstallPluginFromStoreHandler,
|
|
InstallPluginFromStoreSSEHandler
|
|
} from '@/napcat-webui-backend/src/api/PluginStore';
|
|
|
|
const router: Router = Router();
|
|
|
|
router.get('/List', GetPluginListHandler);
|
|
router.post('/Reload', ReloadPluginHandler);
|
|
router.post('/SetStatus', SetPluginStatusHandler);
|
|
router.post('/Uninstall', UninstallPluginHandler);
|
|
router.get('/Config', GetPluginConfigHandler);
|
|
router.post('/Config', SetPluginConfigHandler);
|
|
|
|
// 插件商店相关路由
|
|
router.get('/Store/List', GetPluginStoreListHandler);
|
|
router.get('/Store/Detail/:id', GetPluginStoreDetailHandler);
|
|
router.post('/Store/Install', InstallPluginFromStoreHandler);
|
|
router.get('/Store/Install/SSE', InstallPluginFromStoreSSEHandler);
|
|
|
|
export { router as PluginRouter };
|