feat(frontend): storage shows the heaviest chats, a chat opens its own files with selective cleanup and a whole-chat move to trash

This commit is contained in:
hh committed 2026-10-14 05:02:06 +02:00
1 parent 5eacabd101
commit 7f124059be
9 files changed
+671 -232

No files matched your search

+20 -3
View File
@@ -34,6 +34,7 @@ import type {
ResponseStats,
ScopeTarget,
SearchHit,
StorageChat,
StorageFile,
StorageGroupName,
StorageScope,
@@ -608,15 +609,31 @@ 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 getStorageSummary(
chatId: number | null = null
): Promise<StorageSummary> {
return request<StorageSummary>("/storage/summary", {
account: true,
query: { chat_id: chatId },
});
}
export function getStorageFiles(
group: StorageGroupName | null,
page: Page = {}
page: Page = {},
chatId: number | null = null
): Promise<StorageFile[]> {
return request<StorageFile[]>("/storage/files", {
account: true,
query: { chat_id: chatId, group, ...page },
});
}
export function getStorageChats(
group: StorageGroupName | null,
page: Page = {}
): Promise<StorageChat[]> {
return request<StorageChat[]>("/storage/chats", {
account: true,
query: { group, ...page },
});
+7
View File
@@ -598,6 +598,13 @@ export interface StorageSummary {
trash_files: number;
}
export interface StorageChat {
bytes: number;
chat_id: number;
files: number;
groups: StorageGroup[];
}
export interface StorageFile {
chat_id: number;
date: string | null;