src/api.ts hinzugefügt

This commit is contained in:
ds
2026-06-28 18:37:44 +00:00
parent ec2337d441
commit 7c59b56c80
+21
View File
@@ -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();
}