feat(frontend,backend): storage panel with weight rows and trash, heavy media streams by url in the viewer

This commit is contained in:
hh committed 2026-10-14 03:09:37 +02:00
1 parent f2c245707a
commit 55634984fd
19 files changed
+1822 -24

No files matched your search

+44
View File
@@ -31,7 +31,12 @@ import type {
ReactionView,
ResponseStats,
SearchHit,
StorageFile,
StorageGroupName,
StorageSummary,
StoryView,
TrashItem,
TrashOutcome,
VolumeBucket,
Watch,
WatchedBot,
@@ -581,3 +586,42 @@ export function addWatchedBot(token: string): Promise<WatchedBot> {
export function removeWatchedBot(botId: number): Promise<void> {
return request<void>(`/bots/${botId}`, { method: "DELETE" });
}
export function getStorageSummary(): Promise<StorageSummary> {
return request<StorageSummary>("/storage/summary", { account: true });
}
export function getStorageFiles(
group: StorageGroupName | null,
page: Page = {}
): Promise<StorageFile[]> {
return request<StorageFile[]>("/storage/files", {
account: true,
query: { group, ...page },
});
}
export function getTrash(): Promise<TrashItem[]> {
return request<TrashItem[]>("/storage/trash", { account: true });
}
export function moveToTrash(mediaIds: number[]): Promise<TrashOutcome> {
return request<TrashOutcome>("/storage/trash", {
body: { account_id: accounts.selectedId, media_ids: mediaIds },
method: "POST",
});
}
export function restoreFromTrash(keys: string[]): Promise<TrashOutcome> {
return request<TrashOutcome>("/storage/trash/restore", {
body: { account_id: accounts.selectedId, keys },
method: "POST",
});
}
export function purgeTrash(keys: string[] | null): Promise<TrashOutcome> {
return request<TrashOutcome>("/storage/trash/purge", {
body: { account_id: accounts.selectedId, keys },
method: "POST",
});
}