diff --git a/apps/kai-sa-cam/src/App.tsx b/apps/kai-sa-cam/src/App.tsx index 6d3a699..6e99ec5 100644 --- a/apps/kai-sa-cam/src/App.tsx +++ b/apps/kai-sa-cam/src/App.tsx @@ -51,7 +51,10 @@ export function App() { const handleSnapshot = async () => { try { - const res = await fetch("/api/media/snapshots", { method: "POST" }); + const res = await fetch("/api/media/snapshots", { + method: "POST", + credentials: "include", + }); if (!res.ok) throw new Error("Snapshot failed"); const data = await res.json(); setSnapshots((prev) => [data.filename, ...prev]); @@ -95,33 +98,29 @@ export function App() { -
- - - {(recError || talkError) && ( -
- {recError || talkError} -
- )} -
- -
+ {activeTab === "live" ? ( +
+ + + {(recError || talkError) && ( +
+ {recError || talkError} +
+ )} +
+ ) : ( -
+ )} ); diff --git a/apps/kai-sa-cam/src/components/MediaGallery.tsx b/apps/kai-sa-cam/src/components/MediaGallery.tsx index 166871d..f3f3979 100644 --- a/apps/kai-sa-cam/src/components/MediaGallery.tsx +++ b/apps/kai-sa-cam/src/components/MediaGallery.tsx @@ -16,7 +16,7 @@ export function MediaGallery() { const fetchMedia = async () => { try { - const res = await fetch("/api/media"); + const res = await fetch("/api/media", { credentials: "include" }); if (!res.ok) throw new Error(); const data = await res.json(); setMedia(data); @@ -31,7 +31,10 @@ export function MediaGallery() { const handleDelete = async (filename: string) => { try { - const res = await fetch(`/api/media/${filename}`, { method: "DELETE" }); + const res = await fetch(`/api/media/${filename}`, { + method: "DELETE", + credentials: "include", + }); if (!res.ok) throw new Error(); setMedia((prev) => prev.filter((m) => m.filename !== filename)); setItemToDelete(null); @@ -42,7 +45,10 @@ export function MediaGallery() { const handleExportAll = async () => { try { - const res = await fetch("/api/media/export", { method: "POST" }); + const res = await fetch("/api/media/export", { + method: "POST", + credentials: "include", + }); if (!res.ok) throw new Error(); const blob = await res.blob(); const url = window.URL.createObjectURL(blob); @@ -63,14 +69,22 @@ export function MediaGallery() {
{media.length} fichiers - {media.length > 0 && ( +
- )} + {media.length > 0 && ( + + )} +
{error &&
{error}
}
@@ -97,12 +111,21 @@ export function MediaGallery() { {item.filename} - +
+ + DL + + +
))}