feat(TRUEREF-0015): implement web UI repository dashboard
- Repository list with state badges, stats, and action buttons - Add repository modal for GitHub URLs and local paths - Live indexing progress bar polling every 2s - Confirm dialog for destructive actions - Repository detail page with versions and recent jobs - Settings page placeholder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
26
src/routes/repos/[id]/+page.server.ts
Normal file
26
src/routes/repos/[id]/+page.server.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: PageServerLoad = async ({ fetch, params }) => {
|
||||
const id = params.id;
|
||||
const res = await fetch(`/api/v1/libs/${encodeURIComponent(id)}`);
|
||||
|
||||
if (res.status === 404) {
|
||||
error(404, 'Repository not found');
|
||||
}
|
||||
|
||||
if (!res.ok) {
|
||||
error(res.status, 'Failed to load repository');
|
||||
}
|
||||
|
||||
const repo = await res.json();
|
||||
|
||||
// Fetch recent jobs
|
||||
const jobsRes = await fetch(`/api/v1/jobs?repositoryId=${encodeURIComponent(id)}&limit=5`);
|
||||
const jobsData = jobsRes.ok ? await jobsRes.json() : { jobs: [] };
|
||||
|
||||
return {
|
||||
repo,
|
||||
recentJobs: jobsData.jobs ?? []
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user