cap 与系统信息

This commit is contained in:
ryan
2026-06-08 09:28:12 +08:00
parent 9d0f9f0576
commit 72d72810b2
33 changed files with 3324 additions and 98 deletions
@@ -11,6 +11,7 @@ import type {
ListUsersRequest,
ListUsersResponse,
SystemConfig,
SystemStatus,
TaskExecution,
TaskMeta,
TaskTypeResponse,
@@ -318,4 +319,14 @@ export class AdminService extends BaseService {
static async createUser(request: CreateUserRequest): Promise<AdminUser> {
return this.post<AdminUser>('/users', request);
}
/**
* 获取系统状态
* @returns 系统状态指标数据
* @throws {UnauthorizedError} 当未登录时
* @throws {ForbiddenError} 当无管理员权限时
*/
static async getSystemStatus(): Promise<SystemStatus> {
return this.get<SystemStatus>('/status');
}
}
+1
View File
@@ -38,4 +38,5 @@ export type {
ListUsersRequest,
ListUsersResponse,
UpdateUserStatusRequest,
SystemStatus,
} from './types';
+34
View File
@@ -254,3 +254,37 @@ export interface AuthSourceRequest {
export interface ToggleAuthSourceRequest {
is_active: boolean;
}
/**
* 系统状态信息
*/
export interface SystemStatus {
uptime: string;
num_goroutine: number;
alloc: string;
total_alloc: string;
sys: string;
lookups: number;
mallocs: number;
frees: number;
heap_alloc: string;
heap_sys: string;
heap_idle: string;
heap_inuse: string;
heap_released: string;
heap_objects: number;
stack_inuse: string;
stack_sys: string;
mspan_inuse: string;
mspan_sys: string;
mcache_inuse: string;
mcache_sys: string;
buck_hash_sys: string;
gc_sys: string;
other_sys: string;
next_gc: string;
last_gc_time: string;
pause_total_ns: string;
last_pause: string;
num_gc: number;
}