feat: tree view for cached objects, top-files stats on dashboard (#48)

- Objects page renders paths as a collapsible tree instead of flat list
  with expand/collapse all, aggregated size/hits per directory
- Dashboard gains top-files-by-hits and top-files-by-bandwidth tables
- Backend: new /api/v2/stats/top-files-by-hits and
  /api/v2/stats/top-files-by-bandwidth endpoints
- Raised per_page max to 5000 for objects listing

---------

Co-authored-by: Ben Vincent <ben@unkin.net>
Reviewed-on: #48
This commit was merged in pull request #48.
This commit is contained in:
2026-06-22 22:49:56 +10:00
parent b46c116f6b
commit a481a5c3b7
9 changed files with 508 additions and 101 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
import type { Remote, Virtual, Artifact, OverviewStats, RemoteStatRow, HealthStatus, ProbeResult } from './types';
import type { Remote, Virtual, Artifact, OverviewStats, RemoteStatRow, FileStatRow, BandwidthStatRow, HealthStatus, ProbeResult } from './types';
const BASE = '';
@@ -19,6 +19,8 @@ export const api = {
health: () => fetchJSON<HealthStatus>('/api/v2/health'),
stats: () => fetchJSON<OverviewStats>('/api/v2/stats'),
topRemotes: () => fetchJSON<RemoteStatRow[]>('/api/v2/stats/top-remotes'),
topFilesByHits: () => fetchJSON<FileStatRow[]>('/api/v2/stats/top-files-by-hits'),
topFilesByBandwidth: () => fetchJSON<BandwidthStatRow[]>('/api/v2/stats/top-files-by-bandwidth'),
listRemotes: () => fetchJSON<Remote[]>('/api/v2/remotes'),
getRemote: (name: string) => fetchJSON<Remote>(`/api/v2/remotes/${name}`),