feat: Add admin experiment management pages and components
- Implemented ExperimentPage for viewing and editing individual experiments. - Created ExperimentsAdminPage for managing all experiments with a list and a modal for creating new experiments. - Developed AnnotatePage for annotating experiments with different views based on annotation tools. - Added CreateExperimentModal for creating new experiments with dataset selection. - Introduced DeleteExperimentButton for confirming and executing experiment deletions. - Built EditableExperimentHeader for editing experiment details. - Created ExperimentsList component to display a list of experiments with links to their details.
This commit is contained in:
37
src/app/admin/experiments/page.tsx
Normal file
37
src/app/admin/experiments/page.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import Link from 'next/link';
|
||||
import ExperimentsList from '@/components/ExperimentsList';
|
||||
import CreateExperimentModal from '@/components/CreateExperimentModal';
|
||||
import { requireAdmin } from '@/lib/auth';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export default async function ExperimentsAdminPage() {
|
||||
const result = await requireAdmin();
|
||||
|
||||
if (!result.authenticated) {
|
||||
redirect("/user/sign-in");
|
||||
}
|
||||
|
||||
if (!result.admin) {
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="px-4 sm:px-6 lg:px-8 py-8">
|
||||
<Link
|
||||
href="/admin"
|
||||
className="text-blue-500 hover:text-blue-600 mb-6 inline-block"
|
||||
>
|
||||
← Back to Admin
|
||||
</Link>
|
||||
|
||||
<div className="mb-8">
|
||||
<h1 className="text-3xl font-bold mb-4">Experiments Management</h1>
|
||||
<p className="text-gray-600">Manage all experiments across datasets</p>
|
||||
</div>
|
||||
|
||||
<CreateExperimentModal />
|
||||
|
||||
<ExperimentsList />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user