fix: bw/stats 404, gateway links, history crash

- swr.ts: remove useBandwidth(), drop bw from useDashboard()
- events/route.ts: skip bandwidth SSE (Kubo 0.28.0 unsupported)
- usage/page.tsx: remove getBWStats call + bw references
- helpers.ts: gatewayLink -> ipfs.maos.dedyn.io (subdomain only)
- upload/page.tsx: fix local gatewayLink (subdomain only)
- storage.ts: update default gatewayUrl, add defensive getHistory()
This commit is contained in:
maikrolf
2026-07-05 16:57:29 +02:00
parent c9432a16ba
commit 99c113b6f5
42 changed files with 10081 additions and 263 deletions
+6 -1
View File
@@ -85,7 +85,12 @@ export async function uploadFile(file: File): Promise<{ cid: string; size: numbe
credentials: 'include',
});
if (!res.ok) throw new Error(`Upload failed: ${res.statusText}`);
return res.json();
const data = await res.json();
// Kubo API returns { Hash, Size, Name }, normalize to { cid, size }
return {
cid: data.cid || data.Hash || data.hash || '',
size: data.size || data.Size || 0,
};
}
export async function listFiles(): Promise<{ name: string; cid: string; size: number; modified: string }[]> {