Backend listings now emit broken_link: true placeholder entries with nullable mtime for dangling symlinks. Update ManagedFileEntry to match, render broken links with an Unlink icon and a destructive badge, disable download for them, and keep delete enabled so users can remove the dead link from the UI.
43 lines
1009 B
TypeScript
43 lines
1009 B
TypeScript
// Managed-files API types for the dashboard Files page. Moved out of api.ts so
|
|
// that facade stays under its code-health line cap (the interfaces keep their
|
|
// own cap here, per AGENTS.md § code health ratchet).
|
|
|
|
export interface ManagedFileEntry {
|
|
name: string;
|
|
path: string;
|
|
is_directory: boolean;
|
|
broken_link?: boolean;
|
|
size: number | null;
|
|
mtime: number | null;
|
|
mime_type: string | null;
|
|
}
|
|
|
|
export interface ManagedFilesResponse {
|
|
root: string | null;
|
|
path: string;
|
|
parent: string | null;
|
|
locked_root: string | null;
|
|
can_change_path: boolean;
|
|
entries: ManagedFileEntry[];
|
|
}
|
|
|
|
export interface ManagedFileReadResponse {
|
|
name: string;
|
|
path: string;
|
|
size: number;
|
|
mime_type: string;
|
|
data_url: string;
|
|
root: string | null;
|
|
locked_root: string | null;
|
|
can_change_path: boolean;
|
|
}
|
|
|
|
export interface ManagedFileWriteResponse {
|
|
ok: boolean;
|
|
path: string;
|
|
entry: ManagedFileEntry;
|
|
root: string | null;
|
|
locked_root: string | null;
|
|
can_change_path: boolean;
|
|
}
|