Change Directory For Charts
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
import { useState } from "react";
|
||||
import FilterTahunAngkatan from "@/components/FilterTahunAngkatan";
|
||||
import FilterJenisBeasiswa from "@/components/FilterJenisBeasiswa";
|
||||
import TotalBeasiswaChart from "@/components/TotalBeasiswaChart";
|
||||
import TotalBeasiswaPieChart from "@/components/TotalBeasiswaPieChart";
|
||||
import NamaBeasiswaChart from "@/components/NamaBeasiswaChart";
|
||||
import NamaBeasiswaPieChart from "@/components/NamaBeasiswaPieChart";
|
||||
import JenisPendaftaranBeasiswaChart from "@/components/JenisPendaftaranBeasiswaChart";
|
||||
import JenisPendaftaranBeasiswaPieChart from "@/components/JenisPendaftaranBeasiswaPieChart";
|
||||
import AsalDaerahBeasiswaChart from "@/components/AsalDaerahBeasiswaChart";
|
||||
import IPKBeasiswaChart from "@/components/IPKBeasiswaChart";
|
||||
import TotalBeasiswaChart from "@/components/charts/TotalBeasiswaChart";
|
||||
import TotalBeasiswaPieChart from "@/components/charts/TotalBeasiswaPieChart";
|
||||
import NamaBeasiswaChart from "@/components/charts/NamaBeasiswaChart";
|
||||
import NamaBeasiswaPieChart from "@/components/charts/NamaBeasiswaPieChart";
|
||||
import JenisPendaftaranBeasiswaChart from "@/components/charts/JenisPendaftaranBeasiswaChart";
|
||||
import JenisPendaftaranBeasiswaPieChart from "@/components/charts/JenisPendaftaranBeasiswaPieChart";
|
||||
import AsalDaerahBeasiswaChart from "@/components/charts/AsalDaerahBeasiswaChart";
|
||||
import IPKBeasiswaChart from "@/components/charts/IPKBeasiswaChart";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
export default function BeasiswaMahasiswaPage() {
|
||||
|
||||
@@ -4,14 +4,14 @@ import { useState } from "react";
|
||||
import FilterTahunAngkatan from "@/components/FilterTahunAngkatan";
|
||||
import FilterJenisPrestasi from "@/components/FilterJenisPrestasi";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import TotalPrestasiChart from "@/components/TotalPrestasiChart";
|
||||
import TotalPrestasiPieChart from "@/components/TotalPrestasiPieChart";
|
||||
import TingkatPrestasiChart from "@/components/TingkatPrestasiChart";
|
||||
import TingkatPrestasiPieChart from "@/components/TingkatPrestasiPieChart";
|
||||
import JenisPendaftaranPrestasiChart from "@/components/JenisPendaftaranPrestasiChart";
|
||||
import JenisPendaftaranPrestasiPieChart from "@/components/JenisPendaftaranPrestasiPieChart";
|
||||
import AsalDaerahPrestasiChart from "@/components/AsalDaerahPrestasiChart";
|
||||
import IPKPrestasiChart from "@/components/IPKPrestasiChart";
|
||||
import TotalPrestasiChart from "@/components/charts/TotalPrestasiChart";
|
||||
import TotalPrestasiPieChart from "@/components/charts/TotalPrestasiPieChart";
|
||||
import TingkatPrestasiChart from "@/components/charts/TingkatPrestasiChart";
|
||||
import TingkatPrestasiPieChart from "@/components/charts/TingkatPrestasiPieChart";
|
||||
import JenisPendaftaranPrestasiChart from "@/components/charts/JenisPendaftaranPrestasiChart";
|
||||
import JenisPendaftaranPrestasiPieChart from "@/components/charts/JenisPendaftaranPrestasiPieChart";
|
||||
import AsalDaerahPrestasiChart from "@/components/charts/AsalDaerahPrestasiChart";
|
||||
import IPKPrestasiChart from "@/components/charts/IPKPrestasiChart";
|
||||
|
||||
export default function BerprestasiMahasiswaPage() {
|
||||
const [selectedYear, setSelectedYear] = useState<string>("all");
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
import { useState } from "react";
|
||||
import FilterTahunAngkatan from "@/components/FilterTahunAngkatan";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import LulusTepatWaktuChart from "@/components/LulusTepatWaktuChart";
|
||||
import LulusTepatWaktuPieChart from "@/components/LulusTepatWaktuPieChart";
|
||||
import JenisPendaftaranLulusChart from "@/components/JenisPendaftaranLulusChart";
|
||||
import JenisPendaftaranLulusPieChart from "@/components/JenisPendaftaranLulusPieChart";
|
||||
import AsalDaerahLulusChart from "@/components/AsalDaerahLulusChart";
|
||||
import IPKLulusTepatChart from "@/components/IPKLulusTepatChart";
|
||||
import LulusTepatWaktuChart from "@/components/charts/LulusTepatWaktuChart";
|
||||
import LulusTepatWaktuPieChart from "@/components/charts/LulusTepatWaktuPieChart";
|
||||
import JenisPendaftaranLulusChart from "@/components/charts/JenisPendaftaranLulusChart";
|
||||
import JenisPendaftaranLulusPieChart from "@/components/charts/JenisPendaftaranLulusPieChart";
|
||||
import AsalDaerahLulusChart from "@/components/charts/AsalDaerahLulusChart";
|
||||
import IPKLulusTepatChart from "@/components/charts/IPKLulusTepatChart";
|
||||
|
||||
export default function LulusTepatWaktuPage() {
|
||||
const [selectedYear, setSelectedYear] = useState<string>("all");
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
import { useState } from "react";
|
||||
import FilterTahunAngkatan from "@/components/FilterTahunAngkatan";
|
||||
import FilterStatusKuliah from "@/components/FilterStatusKuliah";
|
||||
import StatusMahasiswaFilterChart from "@/components/StatusMahasiswaFilterChart";
|
||||
import StatusMahasiswaFilterPieChart from "@/components/StatusMahasiswaFilterPieChart";
|
||||
import JenisPendaftaranStatusChart from "@/components/JenisPendaftaranStatusChart";
|
||||
import JenisPendaftaranStatusPieChart from "@/components/JenisPendaftaranStatusPieChart";
|
||||
import AsalDaerahStatusChart from '@/components/AsalDaerahStatusChart';
|
||||
import IpkStatusChart from '@/components/IpkStatusChart';
|
||||
import StatusMahasiswaFilterChart from "@/components/charts/StatusMahasiswaFilterChart";
|
||||
import StatusMahasiswaFilterPieChart from "@/components/charts/StatusMahasiswaFilterPieChart";
|
||||
import JenisPendaftaranStatusChart from "@/components/charts/JenisPendaftaranStatusChart";
|
||||
import JenisPendaftaranStatusPieChart from "@/components/charts/JenisPendaftaranStatusPieChart";
|
||||
import AsalDaerahStatusChart from '@/components/charts/AsalDaerahStatusChart';
|
||||
import IpkStatusChart from '@/components/charts/IpkStatusChart';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
export default function StatusMahasiswaPage() {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from "react";
|
||||
import StatistikMahasiswaChart from "@/components/StatistikMahasiswaChart";
|
||||
import StatistikPerAngkatanChart from "@/components/StatistikPerAngkatanChart";
|
||||
import JenisPendaftaranChart from "@/components/JenisPendaftaranChart";
|
||||
import AsalDaerahChart from "@/components/AsalDaerahChart";
|
||||
import IPKChart from "@/components/IPKChart";
|
||||
import StatistikMahasiswaChart from "@/components/charts/StatistikMahasiswaChart";
|
||||
import StatistikPerAngkatanChart from "@/components/charts/StatistikPerAngkatanChart";
|
||||
import JenisPendaftaranChart from "@/components/charts/JenisPendaftaranChart";
|
||||
import AsalDaerahChart from "@/components/charts/AsalDaerahChart";
|
||||
import IPKChart from "@/components/charts/IPKChart";
|
||||
import FilterTahunAngkatan from "@/components/FilterTahunAngkatan";
|
||||
import JenisPendaftaranPerAngkatanChart from "@/components/JenisPendaftaranPerAngkatanChart";
|
||||
import AsalDaerahPerAngkatanChart from "@/components/AsalDaerahPerAngkatanChart";
|
||||
import IPKJenisKelaminChart from "@/components/IPKJenisKelaminChart";
|
||||
import JenisPendaftaranPerAngkatanChart from "@/components/charts/JenisPendaftaranPerAngkatanChart";
|
||||
import AsalDaerahPerAngkatanChart from "@/components/charts/AsalDaerahPerAngkatanChart";
|
||||
import IPKJenisKelaminChart from "@/components/charts/IPKJenisKelaminChart";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
export default function TotalMahasiswaPage() {
|
||||
|
||||
@@ -4,11 +4,11 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Users, GraduationCap, Trophy, BookOpen } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTheme } from "next-themes";
|
||||
import StatusMahasiswaChart from "@/components/StatusMahasiswaChart";
|
||||
import StatistikMahasiswaChart from "@/components/StatistikMahasiswaChart";
|
||||
import JenisPendaftaranChart from "@/components/JenisPendaftaranChart";
|
||||
import AsalDaerahChart from "@/components/AsalDaerahChart";
|
||||
import IPKChart from '@/components/IPKChart';
|
||||
import StatusMahasiswaChart from "@/components/charts/StatusMahasiswaChart";
|
||||
import StatistikMahasiswaChart from "@/components/charts/StatistikMahasiswaChart";
|
||||
import JenisPendaftaranChart from "@/components/charts/JenisPendaftaranChart";
|
||||
import AsalDaerahChart from "@/components/charts/AsalDaerahChart";
|
||||
import IPKChart from '@/components/charts/IPKChart';
|
||||
|
||||
interface MahasiswaTotal {
|
||||
total_mahasiswa: number;
|
||||
|
||||
438
app/page.tsx
438
app/page.tsx
@@ -1,22 +1,22 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
|
||||
import { Loader2, Eye, EyeOff, LogIn, UserPlus } from "lucide-react";
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import { Loader2, Eye, EyeOff } from "lucide-react";
|
||||
import { ThemeProvider } from '@/components/theme-provider';
|
||||
import { Toaster } from '@/components/ui/toaster';
|
||||
|
||||
export default function LandingPage() {
|
||||
const router = useRouter();
|
||||
const [isLoginOpen, setIsLoginOpen] = useState(false);
|
||||
const [isLoginOpen, setIsLoginOpen] = useState(true);
|
||||
const [isRegisterOpen, setIsRegisterOpen] = useState(false);
|
||||
const [activeTab, setActiveTab] = useState('admin');
|
||||
const [activeTab, setActiveTab] = useState('dosen');
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
@@ -146,6 +146,16 @@ export default function LandingPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const openRegister = () => {
|
||||
setIsLoginOpen(false);
|
||||
setIsRegisterOpen(true);
|
||||
};
|
||||
|
||||
const openLogin = () => {
|
||||
setIsRegisterOpen(false);
|
||||
setIsLoginOpen(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
@@ -154,220 +164,226 @@ export default function LandingPage() {
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800">
|
||||
<div className="container mx-auto px-4 py-16">
|
||||
<div className="text-center mb-12">
|
||||
<h1 className="text-4xl md:text-6xl font-bold text-gray-900 dark:text-white mb-4">
|
||||
Portal Data Informatika
|
||||
</h1>
|
||||
<p className="text-xl text-gray-600 dark:text-gray-300 mb-8">
|
||||
Visualisasi Data Akademik Mahasiswa Jurusan Informatika
|
||||
</p>
|
||||
<div className="flex flex-col sm:flex-row gap-4 justify-center">
|
||||
<Dialog open={isLoginOpen} onOpenChange={setIsLoginOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Button size="lg" className="flex items-center gap-2">
|
||||
<LogIn className="h-5 w-5" />
|
||||
Login
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Login Portal Data Informatika</DialogTitle>
|
||||
<DialogDescription>
|
||||
Silakan login sesuai dengan role Anda
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab} className="w-full">
|
||||
<TabsList className="grid w-full grid-cols-2">
|
||||
<TabsTrigger value="admin">Admin</TabsTrigger>
|
||||
<TabsTrigger value="dosen">Dosen</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="admin" className="space-y-4">
|
||||
<form onSubmit={handleAdminLogin} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="username">Username</Label>
|
||||
<Input
|
||||
id="username"
|
||||
type="text"
|
||||
placeholder="Masukkan username"
|
||||
value={adminForm.username}
|
||||
onChange={(e) => setAdminForm({ ...adminForm, username: e.target.value })}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="admin-password">Password</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
id="admin-password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Masukkan password"
|
||||
value={adminForm.password}
|
||||
onChange={(e) => setAdminForm({ ...adminForm, password: e.target.value })}
|
||||
required
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
>
|
||||
{showPassword ? (
|
||||
<EyeOff className="h-4 w-4" />
|
||||
) : (
|
||||
<Eye className="h-4 w-4" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Button type="submit" className="w-full" disabled={loading}>
|
||||
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
||||
Login sebagai Admin
|
||||
</Button>
|
||||
</form>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="dosen" className="space-y-4">
|
||||
<form onSubmit={handleDosenLogin} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="nip">NIP</Label>
|
||||
<Input
|
||||
id="nip"
|
||||
type="text"
|
||||
placeholder="Masukkan NIP"
|
||||
value={dosenForm.nip}
|
||||
onChange={(e) => setDosenForm({ ...dosenForm, nip: e.target.value })}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="dosen-password">Password</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
id="dosen-password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Masukkan password"
|
||||
value={dosenForm.password}
|
||||
onChange={(e) => setDosenForm({ ...dosenForm, password: e.target.value })}
|
||||
required
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
>
|
||||
{showPassword ? (
|
||||
<EyeOff className="h-4 w-4" />
|
||||
) : (
|
||||
<Eye className="h-4 w-4" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Button type="submit" className="w-full" disabled={loading}>
|
||||
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
||||
Login sebagai Dosen
|
||||
</Button>
|
||||
</form>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
{error && (
|
||||
<Alert className="mt-4">
|
||||
<AlertDescription className="text-red-600">
|
||||
{error}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<Dialog open={isRegisterOpen} onOpenChange={setIsRegisterOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Button variant="outline" size="lg" className="flex items-center gap-2">
|
||||
<UserPlus className="h-5 w-5" />
|
||||
Register
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Registrasi Dosen</DialogTitle>
|
||||
<DialogDescription>
|
||||
Daftar akun baru untuk dosen Portal Data Informatika
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<form onSubmit={handleRegister} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="register-nip">NIP</Label>
|
||||
{/* Login Dialog */}
|
||||
<Dialog open={isLoginOpen} onOpenChange={() => {}}>
|
||||
<DialogContent className="sm:max-w-md" hideClose>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Login Portal Data Informatika</DialogTitle>
|
||||
<DialogDescription>
|
||||
Silakan login sesuai dengan role Anda
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab} className="w-full">
|
||||
<TabsList className="grid w-full grid-cols-2">
|
||||
<TabsTrigger value="dosen">Dosen</TabsTrigger>
|
||||
<TabsTrigger value="admin">Admin</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="dosen" className="space-y-4">
|
||||
<form onSubmit={handleDosenLogin} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="nip">NIP</Label>
|
||||
<Input
|
||||
id="nip"
|
||||
type="text"
|
||||
placeholder="Masukkan NIP"
|
||||
value={dosenForm.nip}
|
||||
onChange={(e) => setDosenForm({ ...dosenForm, nip: e.target.value })}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="dosen-password">Password</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
id="register-nip"
|
||||
type="text"
|
||||
placeholder="Masukkan NIP"
|
||||
value={registerForm.nip}
|
||||
onChange={(e) => setRegisterForm({ ...registerForm, nip: e.target.value })}
|
||||
id="dosen-password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Masukkan password"
|
||||
value={dosenForm.password}
|
||||
onChange={(e) => setDosenForm({ ...dosenForm, password: e.target.value })}
|
||||
required
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
>
|
||||
{showPassword ? (
|
||||
<EyeOff className="h-4 w-4" />
|
||||
) : (
|
||||
<Eye className="h-4 w-4" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="register-password">Password</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
id="register-password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Masukkan password (min. 6 karakter)"
|
||||
value={registerForm.password}
|
||||
onChange={(e) => setRegisterForm({ ...registerForm, password: e.target.value })}
|
||||
required
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
>
|
||||
{showPassword ? (
|
||||
<EyeOff className="h-4 w-4" />
|
||||
) : (
|
||||
<Eye className="h-4 w-4" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="confirm-password">Konfirmasi Password</Label>
|
||||
</div>
|
||||
<Button type="submit" className="w-full" disabled={loading}>
|
||||
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
||||
Login sebagai Dosen
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
<div className="text-center pt-4 border-t">
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400 inline">
|
||||
Belum punya akun?{' '}
|
||||
</p>
|
||||
<Button
|
||||
type="button"
|
||||
variant="link"
|
||||
className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 p-0 h-auto inline"
|
||||
onClick={openRegister}
|
||||
>
|
||||
Daftar disini
|
||||
</Button>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="admin" className="space-y-4">
|
||||
<form onSubmit={handleAdminLogin} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="username">Username</Label>
|
||||
<Input
|
||||
id="username"
|
||||
type="text"
|
||||
placeholder="Masukkan username"
|
||||
value={adminForm.username}
|
||||
onChange={(e) => setAdminForm({ ...adminForm, username: e.target.value })}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="admin-password">Password</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
id="confirm-password"
|
||||
type="password"
|
||||
placeholder="Konfirmasi password"
|
||||
value={registerForm.confirmPassword}
|
||||
onChange={(e) => setRegisterForm({ ...registerForm, confirmPassword: e.target.value })}
|
||||
id="admin-password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Masukkan password"
|
||||
value={adminForm.password}
|
||||
onChange={(e) => setAdminForm({ ...adminForm, password: e.target.value })}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" className="w-full" disabled={loading}>
|
||||
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
||||
Daftar sebagai Dosen
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
{error && (
|
||||
<Alert className="mt-4">
|
||||
<AlertDescription className="text-red-600">
|
||||
{error}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
>
|
||||
{showPassword ? (
|
||||
<EyeOff className="h-4 w-4" />
|
||||
) : (
|
||||
<Eye className="h-4 w-4" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Button type="submit" className="w-full" disabled={loading}>
|
||||
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
||||
Login sebagai Admin
|
||||
</Button>
|
||||
</form>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
{error && (
|
||||
<Alert className="mt-4">
|
||||
<AlertDescription className="text-red-600">
|
||||
{error}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
{/* Register Dialog */}
|
||||
<Dialog open={isRegisterOpen} onOpenChange={() => {}}>
|
||||
<DialogContent className="sm:max-w-md" hideClose>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Registrasi Dosen</DialogTitle>
|
||||
<DialogDescription>
|
||||
Daftar akun baru untuk dosen Portal Data Informatika
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<form onSubmit={handleRegister} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="register-nip">NIP</Label>
|
||||
<Input
|
||||
id="register-nip"
|
||||
type="text"
|
||||
placeholder="Masukkan NIP"
|
||||
value={registerForm.nip}
|
||||
onChange={(e) => setRegisterForm({ ...registerForm, nip: e.target.value })}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="register-password">Password</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
id="register-password"
|
||||
type={showPassword ? "text" : "password"}
|
||||
placeholder="Masukkan password (min. 6 karakter)"
|
||||
value={registerForm.password}
|
||||
onChange={(e) => setRegisterForm({ ...registerForm, password: e.target.value })}
|
||||
required
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
||||
onClick={() => setShowPassword(!showPassword)}
|
||||
>
|
||||
{showPassword ? (
|
||||
<EyeOff className="h-4 w-4" />
|
||||
) : (
|
||||
<Eye className="h-4 w-4" />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="confirm-password">Konfirmasi Password</Label>
|
||||
<Input
|
||||
id="confirm-password"
|
||||
type="password"
|
||||
placeholder="Konfirmasi password"
|
||||
value={registerForm.confirmPassword}
|
||||
onChange={(e) => setRegisterForm({ ...registerForm, confirmPassword: e.target.value })}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" className="w-full" disabled={loading}>
|
||||
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
||||
Daftar sebagai Dosen
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
<div className="text-center pt-4 border-t">
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400 inline">
|
||||
Sudah punya akun?{' '}
|
||||
</p>
|
||||
<Button
|
||||
type="button"
|
||||
variant="link"
|
||||
className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 p-0 h-auto inline"
|
||||
onClick={openLogin}
|
||||
>
|
||||
Login
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
<Alert className="mt-4">
|
||||
<AlertDescription className="text-red-600">
|
||||
{error}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
<Toaster />
|
||||
</ThemeProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user