src/api.ts hinzugefügt
This commit is contained in:
+21
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user