refactor(web): adopt modular Vue architecture and isolate bearer sessions

This commit is contained in:
eezd committed 2026-10-25 20:47:32 +08:00
1 parent 1b2b2b12ff
commit 3cd641a380
379 files changed
+19736 -8712

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import type { InstalledPlugin } from './type'
import { requestJSON } from '@/http/axios'
export const pluginsApi = {
plugins: async () => (await requestJSON<{ plugins: InstalledPlugin[] }>('GET', '/plugins', { errorOwner: 'caller' })).plugins,
installPlugin: (file: File) => {
const body = new FormData()
body.append('file', file)
return requestJSON<InstalledPlugin>('POST', '/plugins', { errorOwner: 'caller', body })
},
togglePlugin: (id: string, enabled: boolean) => requestJSON<InstalledPlugin>('PATCH', `/plugins/${encodeURIComponent(id)}`, { errorOwner: 'caller', json: { enabled } }),
uninstallPlugin: (id: string) => requestJSON('DELETE', `/plugins/${encodeURIComponent(id)}`, { errorOwner: 'caller' }),
pluginData: (id: string) => requestJSON<{ data: unknown }>('GET', `/plugins/${encodeURIComponent(id)}/data`, { errorOwner: 'caller' }),
savePluginData: (id: string, data: unknown) => requestJSON('PUT', `/plugins/${encodeURIComponent(id)}/data`, { errorOwner: 'caller', json: { data } }),
}
+8
View File
@@ -0,0 +1,8 @@
export interface InstalledPlugin {
id: string
name: string
version: string
apiVersion: 1
revision: string
enabled: boolean
}