feat: 搭建控制面管理前端并剥离底座管理功能

1. 新增controlplane/frontend Vue3管理前端,实现登录、账号CRUD、插件上传/管理、权限授权
2. 为controlplane/app.py添加CORS中间件并挂载前端静态产物
3. 重构环境变量加载,统一使用app/common/env.load_app_env()
4. 剥离webhost/的管理UI与代理接口,仅保留基础登录能力
5. 新增环境隔离规范文档与架构蓝图说明
This commit is contained in:
2026-09-09 17:10:12 +08:00
parent 65540fb121
commit 3f901d3882
31 changed files with 2865 additions and 337 deletions
+1 -31
View File
@@ -39,7 +39,7 @@ export function connectWS(onEvent) {
return ws
}
// ===== 控制面管理(统一后端数据库 API,经底座后端代理) =====
// ===== 统一账户登录/会话(底座仅保留认证与个人密码,管理走中心机控制面) =====
export async function adminMe() {
return j('/api/admin/me')
}
@@ -52,9 +52,6 @@ export async function adminLogout() {
export async function adminPassword(body) {
return jj('/api/admin/password', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
}
export async function adminOverview() {
return j('/api/admin/overview')
}
async function jj(url, opts) {
const r = await fetch(url, opts)
if (!r.ok) {
@@ -63,31 +60,4 @@ async function jj(url, opts) {
throw new Error(m)
}
return r.json()
}
export async function adminGrant(body) {
return jj('/api/admin/account_plugins', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
}
export async function adminAccounts() {
return j('/api/admin/accounts')
}
export async function adminAccountCreate(body) {
return jj('/api/admin/account', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
}
export async function adminAccountUpdate(body) {
return jj('/api/admin/account/update', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
}
export async function adminAccountReset(body) {
return jj('/api/admin/account/reset_pwd', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
}
export async function adminAccountDelete(body) {
return jj('/api/admin/account/delete', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
}
export async function adminPluginDelete(body) {
return jj('/api/admin/plugin/delete', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
}
export async function adminUpload(pluginId, name, version, file) {
const fd = new FormData()
fd.append('upload', file)
const qs = new URLSearchParams({ plugin_id: pluginId, name, version })
return jj('/api/admin/pkg?' + qs.toString(), { method: 'POST', body: fd })
}