feat(webui): unify file preview actions
This commit is contained in:
1 parent
af5acabb33
commit
05bee21b10
24 files changed
+542
-10
No files matched your search
@@ -8,6 +8,7 @@ import type {
|
||||
ChatSummary,
|
||||
CliAppsPayload,
|
||||
FilePreviewPayload,
|
||||
FileReferenceMetadata,
|
||||
ImageGenerationSettingsUpdate,
|
||||
McpPresetsPayload,
|
||||
McpOAuthFlowPayload,
|
||||
@@ -460,6 +461,20 @@ export async function fetchFilePreview(
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchFileReferenceMetadata(
|
||||
token: string,
|
||||
key: string,
|
||||
path: string,
|
||||
): Promise<FileReferenceMetadata> {
|
||||
const query = new URLSearchParams({ path, metadata: "1" });
|
||||
return request<FileReferenceMetadata>(
|
||||
`/api/sessions/${encodeURIComponent(key)}/file-preview?${query}`,
|
||||
token,
|
||||
{ cache: "no-store" },
|
||||
API_READ_TIMEOUT_MS,
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchFilePreviewAvailability(
|
||||
token: string,
|
||||
key: string,
|
||||
|
||||
@@ -1607,6 +1607,11 @@ export interface WebuiThreadTraceDetailPayload {
|
||||
events: ThreadProjectionEvent[];
|
||||
}
|
||||
|
||||
export interface FileReferenceMetadata {
|
||||
path: string;
|
||||
relative_path: string | null;
|
||||
}
|
||||
|
||||
interface FilePreviewMetadata {
|
||||
path: string;
|
||||
display_path: string;
|
||||
|
||||
Reference in new issue
Block a user