mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-07 05:11:51 +08:00
feat: add container resource monitoring
This commit is contained in:
1 parent
5527120089
commit
5366160a5d
6 files changed
+199
-1
No files matched your search
@@ -116,6 +116,7 @@ import type {
|
||||
UsageStats,
|
||||
WorkspaceFile,
|
||||
WorkspaceListing,
|
||||
SystemMetrics,
|
||||
} from "@/lib/types";
|
||||
|
||||
function getToken(): string | null {
|
||||
@@ -292,6 +293,7 @@ function schedulePayload(input: ScheduleInput) {
|
||||
export const api = {
|
||||
// 后端应用版本号(release 时由 ldflags 注入,默认 "dev")。
|
||||
health: () => get<{ ok: boolean; service: string; version: string }>("/health"),
|
||||
systemMetrics: () => get<SystemMetrics>("/system/metrics"),
|
||||
|
||||
// ---- auth ----
|
||||
authStatus: () => get<{ initialized: boolean }>("/auth/status"),
|
||||
|
||||
@@ -1331,6 +1331,22 @@ export interface Stats {
|
||||
active_task?: Partial<Task>;
|
||||
}
|
||||
|
||||
export interface SystemMetricValue {
|
||||
used_bytes: number;
|
||||
total_bytes: number;
|
||||
percent: number;
|
||||
}
|
||||
|
||||
export interface SystemMetrics {
|
||||
scope: "container" | string;
|
||||
timestamp: string;
|
||||
container_metrics: boolean;
|
||||
cpu: SystemMetricValue;
|
||||
memory: SystemMetricValue;
|
||||
disk: SystemMetricValue;
|
||||
data_disk: SystemMetricValue;
|
||||
}
|
||||
|
||||
// ---- Intercept Rules ----
|
||||
export type InterceptAction = "allow" | "deny" | "ask";
|
||||
export type InterceptMatchTarget = "tool_name" | "tool_input";
|
||||
|
||||
Reference in new issue
Block a user