Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 4,436 Bytes
f555806 56abe7f 5d9965c 56abe7f b65933f 56abe7f f555806 56abe7f f555806 56abe7f 4ee5618 56abe7f f555806 56abe7f f555806 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
'use client';
import JobsTable from '@/components/JobsTable';
import { TopBar, MainContent } from '@/components/layout';
import Link from 'next/link';
import { useAuth } from '@/contexts/AuthContext';
import HFLoginButton from '@/components/HFLoginButton';
export default function Dashboard() {
const { status: authStatus, namespace } = useAuth();
const isAuthenticated = authStatus === 'authenticated';
return (
<>
<TopBar>
<div>
<h1 className="text-lg">Dashboard</h1>
</div>
<div className="flex-1" />
</TopBar>
<MainContent>
<div className="mb-6">
<img
src="https://d112y698adiu2z.cloudfront.net/photos/production/challenge_photos/003/754/358/datas/full_width.png"
alt="FLUX.1 Kontext Dev Hackathon banner"
className="w-full rounded-lg border border-gray-800"
/>
</div>
<div className="border border-gray-800 rounded-xl bg-gray-900 p-6 flex flex-col gap-4">
<div>
<h2 className="text-xl font-semibold text-gray-100">
{isAuthenticated ? `Welcome back, ${namespace || 'creator'}!` : 'Welcome to Ostris AI Toolkit'}
</h2>
<p className="text-sm text-gray-400 mt-2">
{isAuthenticated
? 'You are signed in with Hugging Face and can manage jobs, datasets, and submissions.'
: 'Authenticate with Hugging Face or add a personal access token to create jobs, upload datasets, and launch training.'}
</p>
</div>
{isAuthenticated ? (
<div className="flex flex-wrap items-center gap-3 text-sm">
<Link
href="/jobs/new"
className="px-4 py-2 rounded-md bg-blue-600 hover:bg-blue-500 text-white transition-colors"
>
Create a Training Job
</Link>
<Link
href="/datasets"
className="px-4 py-2 rounded-md bg-gray-800 hover:bg-gray-700 text-gray-200 transition-colors"
>
Manage Datasets
</Link>
<Link
href="/settings"
className="px-4 py-2 rounded-md border border-gray-700 text-gray-300 hover:border-gray-600 transition-colors"
>
Settings
</Link>
</div>
) : (
<div className="flex flex-col gap-4 text-sm">
<p className="text-sm text-gray-300">
If you are joining for the hackathon, please join this{' '}
<a
href="https://huggingface.co/organizations/lora-training-frenzi/share/kEyyVNQXBPWqmARdwHFVdIiFqqONHZPOtz"
target="_blank"
rel="noopener noreferrer"
className="text-blue-400 underline"
>
organization
</a>{' '}
and authorize the <code className="bg-gray-800 px-1 rounded">lorafrenzi</code> organization when logging in.
</p>
<div className="flex flex-wrap items-start gap-4">
<HFLoginButton size="md" />
<img
src="https://huggingface.co/spaces/multimodalart/ai-toolkit/resolve/main/add_org_to_oauth.png"
alt="Authorize lorafrenzi organization"
className="max-w-xs rounded border border-gray-800"
/>
</div>
<Link
href="/settings"
className="text-xs text-blue-400 hover:text-blue-300"
>
Or manage tokens in Settings
</Link>
</div>
)}
</div>
<div className="w-full mt-6">
<div className="flex justify-between items-center mb-2">
<h1 className="text-md">Active Jobs</h1>
<div className="text-xs text-gray-500">
<Link href="/jobs">View All</Link>
</div>
</div>
{isAuthenticated ? (
<JobsTable onlyActive />
) : (
<div className="border border-gray-800 rounded-lg p-6 bg-gray-900 text-gray-400 text-sm">
Sign in with Hugging Face or add an access token in Settings to view and manage jobs.
</div>
)}
</div>
</MainContent>
</>
);
}
|