From 7c59b56c80c78000e43e3955c98c5b37ba8af800 Mon Sep 17 00:00:00 2001 From: ds Date: Sun, 28 Jun 2026 18:37:44 +0000 Subject: [PATCH] =?UTF-8?q?src/api.ts=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/api.ts diff --git a/src/api.ts b/src/api.ts new file mode 100644 index 0000000..27a4382 --- /dev/null +++ b/src/api.ts @@ -0,0 +1,21 @@ +export async function fetchPods(namespace: string) { + const res = await fetch( + `/api/v1/namespaces/${namespace}/pods` + ); + return res.json(); +} + +export async function fetchLogs({ + namespace, + pod, + container +}: { + namespace: string; + pod: string; + container: string; +}) { + const url = `/api/v1/namespaces/${namespace}/pods/${pod}/log?container=${container}&tailLines=200`; + + const res = await fetch(url); + return res.text(); +} \ No newline at end of file