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 @@ + + + + +