From 797bada4e746c74296e3ae24993d4afcffc0566a Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Thu, 13 Aug 2026 04:20:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(system):=20GERP=E7=B3=BB=E7=BB=9F=E8=BF=90?= =?UTF-8?q?=E7=BB=B4=E6=8E=A7=E5=88=B6=E5=8F=B0=EF=BC=88=E7=8A=B6=E6=80=81?= =?UTF-8?q?/=E6=97=B6=E5=BA=8F/secrets.ini/=E8=BF=90=E8=A1=8C=E6=97=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=89+=20=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/systemOps.ts | 78 +++++ src/router/index.ts | 7 + src/views/system/GerpSystem.vue | 534 ++++++++++++++++++++++++++++++++ 3 files changed, 619 insertions(+) create mode 100644 src/api/systemOps.ts create mode 100644 src/views/system/GerpSystem.vue diff --git a/src/api/systemOps.ts b/src/api/systemOps.ts new file mode 100644 index 0000000..6340215 --- /dev/null +++ b/src/api/systemOps.ts @@ -0,0 +1,78 @@ +import { get, post } from './request' + +/** 系统状态 */ +export interface GerpSystemStatus { + Host: string + PID: number + StartTime: string + UptimeSeconds: number + BootTime: string + Python: string + Django: string + Gvsdsdk: string + MemoryMB: number + CPUPercent: number + Redis: string + Database: string + Celery: string + LogLevel: string +} + +/** 系统时序:beat 调度项 */ +export interface ScheduleItem { + Name: string + Task: string + Schedule: string + Enabled: boolean +} + +/** 可手动触发任务 */ +export interface TriggerableItem { + Name: string + Task: string +} + +/** secrets.ini 键值(脱敏信息) */ +export interface SecretEntry { + Value: string + Masked: boolean +} + +/** secrets.ini 结构:{section: {key: SecretEntry}} */ +export type SecretSections = Record> + +/** 运行时调整信息 */ +export interface RuntimeInfo { + Current: string + Persisted: string | null + Available: string[] +} + +/** GERP系统 运维 API 客户端(全部接口仅 admin:super 可访问) */ +export const gerpSystemApi = { + /** 系统状态总览 */ + status: (): Promise => get('/API/GERPSystem/Status'), + + /** 系统时序(beat 调度 + 可触发任务) */ + schedules: (): Promise<{ Schedules: ScheduleItem[]; Triggerable: TriggerableItem[] }> => + get<{ Schedules: ScheduleItem[]; Triggerable: TriggerableItem[] }>('/API/GERPSystem/Schedules'), + + /** 手动触发定时任务 */ + trigger: (Name: string): Promise<{ Async: boolean; Result?: unknown }> => + post<{ Async: boolean; Result?: unknown }>('/API/GERPSystem/Schedules/Trigger', { Name }), + + /** secrets.ini 读取(脱敏) */ + secrets: (): Promise<{ FilePath: string; Sections: SecretSections }> => + get<{ FilePath: string; Sections: SecretSections }>('/API/GERPSystem/Secrets'), + + /** secrets.ini 保存(值 '******' 视为未修改) */ + saveSecrets: (Sections: Record>): Promise<{ Updated: string[] }> => + post<{ Updated: string[] }>('/API/GERPSystem/Secrets', { Sections }), + + /** 运行时信息(日志级别) */ + runtime: (): Promise => get('/API/GERPSystem/Runtime'), + + /** 切换日志级别 */ + setLogLevel: (LogLevel: string): Promise<{ LogLevel: string }> => + post<{ LogLevel: string }>('/API/GERPSystem/Runtime', { LogLevel }), +} diff --git a/src/router/index.ts b/src/router/index.ts index 717619d..938159a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -285,6 +285,13 @@ export const staticRoutes: RouteRecordRaw[] = [ component: () => import('@/views/system/DbTable.vue'), meta: { title: '表结构管理', requiresAuth: true }, }, + // === GERP系统(系统管理员 admin:super 专属运维控制台) === + { + path: 'system/gerp-system', + name: 'SystemGerpSystem', + component: () => import('@/views/system/GerpSystem.vue'), + meta: { title: 'GERP系统', icon: 'Setting', requiresAuth: true, menuGuarded: true }, + }, // === 枢机协律(CreateE):旧页面 iframe 直载(LegacyPage) === { path: 'private/CreateE/shop', diff --git a/src/views/system/GerpSystem.vue b/src/views/system/GerpSystem.vue new file mode 100644 index 0000000..91c6852 --- /dev/null +++ b/src/views/system/GerpSystem.vue @@ -0,0 +1,534 @@ + + + + +