feat: modernize PodMan frontend command center

This commit is contained in:
Yahya Alhinai
2026-06-28 00:28:04 +00:00
parent 549895292c
commit 80cc89072f
6 changed files with 524 additions and 170 deletions
+11
View File
@@ -2,6 +2,13 @@ import type { InterventionOutcome, Pod, PodInput } from '@podman/shared';
const BACKEND_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:8787';
export interface MemoryStats {
observations: number;
collisions: number;
interventions: number;
outcomes: number;
}
async function json<T>(res: Response): Promise<T> {
if (!res.ok) {
const body = (await res.json().catch(() => ({}))) as { error?: string };
@@ -46,6 +53,10 @@ export async function getPresence(): Promise<Record<string, string[]>> {
return json(await fetch(`${BACKEND_URL}/api/presence`));
}
export async function getMemoryStats(): Promise<MemoryStats> {
return json(await fetch(`${BACKEND_URL}/api/memory/stats`));
}
export async function createPod(input: PodInput): Promise<Pod> {
return json(
await fetch(`${BACKEND_URL}/api/pods`, {