Files
Sankofa/portal/src/app/vms/page.tsx
defiQUG 85fe29adc1 portal: Apollo dashboard queries, strict TypeScript build, UI primitives
- Add GraphQL dashboard operations, ApolloProvider, CardDescription, label/checkbox/alert
- Fix case-sensitive UI imports, Crossplane VM metadata uid, VMList spec parsing
- Extend next-auth session user (id, role); fairness filters as unknown; ESLint relax to warnings
- Remove unused session destructure across pages; next.config without skip TS/ESLint

api: GraphQL/WebSocket hardening, logger import in websocket service
Made-with: Cursor
2026-03-25 20:46:57 -07:00

46 lines
1.4 KiB
TypeScript

'use client';
import { useSession } from 'next-auth/react';
import { signIn } from 'next-auth/react';
import VMList from '@/components/vms/VMList';
export default function VMsPage() {
const { status } = useSession();
if (status === 'loading') {
return (
<div className="flex min-h-screen items-center justify-center bg-gray-900">
<div className="text-center">
<div className="mb-4 h-8 w-8 animate-spin rounded-full border-4 border-gray-300 border-t-blue-600 mx-auto"></div>
<p className="text-gray-400">Loading...</p>
</div>
</div>
);
}
if (status === 'unauthenticated') {
return (
<div className="flex min-h-screen items-center justify-center bg-gray-900">
<div className="text-center max-w-md mx-auto p-8">
<h1 className="text-2xl font-bold text-white mb-4">Authentication Required</h1>
<p className="text-gray-400 mb-6">Please sign in to view virtual machines</p>
<button
onClick={() => signIn()}
className="px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
>
Sign In
</button>
</div>
</div>
);
}
return (
<div className="container mx-auto px-4 py-8">
<h1 className="text-3xl font-bold mb-6">Virtual Machines</h1>
<VMList />
</div>
);
}