feat: admin jobs en products pagina's
- /admin/jobs: overzicht van de laatste 100 Claude jobs met cancel/delete - /admin/products: overzicht van alle producten met archive/delete - JobsTable component met statusbadges en acties per job - ProductsTable component met eigenaar, leden/PBI-telling en acties Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fbf58d4e44
commit
474a8da053
4 changed files with 308 additions and 0 deletions
30
app/(app)/admin/jobs/page.tsx
Normal file
30
app/(app)/admin/jobs/page.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { requireAdmin } from '@/lib/auth-guard'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { JobsTable } from '@/components/admin/jobs-table'
|
||||
|
||||
export default async function AdminJobsPage() {
|
||||
await requireAdmin()
|
||||
|
||||
const jobs = await prisma.claudeJob.findMany({
|
||||
orderBy: { created_at: 'desc' },
|
||||
take: 100,
|
||||
select: {
|
||||
id: true,
|
||||
kind: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
branch: true,
|
||||
pr_url: true,
|
||||
error: true,
|
||||
user: { select: { username: true } },
|
||||
product: { select: { name: true } },
|
||||
},
|
||||
})
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold mb-4">Claude Jobs</h1>
|
||||
<JobsTable jobs={jobs} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
26
app/(app)/admin/products/page.tsx
Normal file
26
app/(app)/admin/products/page.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { requireAdmin } from '@/lib/auth-guard'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { ProductsTable } from '@/components/admin/products-table'
|
||||
|
||||
export default async function AdminProductsPage() {
|
||||
await requireAdmin()
|
||||
|
||||
const products = await prisma.product.findMany({
|
||||
orderBy: { created_at: 'desc' },
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
archived: true,
|
||||
created_at: true,
|
||||
user: { select: { username: true } },
|
||||
_count: { select: { members: true, pbis: true } },
|
||||
},
|
||||
})
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold mb-4">Producten</h1>
|
||||
<ProductsTable products={products} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue