diff --git a/app/globals.css b/app/globals.css index ac68442..7b06b6d 100644 --- a/app/globals.css +++ b/app/globals.css @@ -2,85 +2,50 @@ @tailwind components; @tailwind utilities; -body { - font-family: Arial, Helvetica, sans-serif; -} - -@layer utilities { - .text-balance { - text-wrap: balance; - } -} - @layer base { :root { --background: 0 0% 100%; - --foreground: 0 0% 3.9%; + --foreground: 222.2 84% 4.9%; --card: 0 0% 100%; - --card-foreground: 0 0% 3.9%; + --card-foreground: 222.2 84% 4.9%; --popover: 0 0% 100%; - --popover-foreground: 0 0% 3.9%; - --primary: 0 0% 9%; - --primary-foreground: 0 0% 98%; - --secondary: 0 0% 96.1%; - --secondary-foreground: 0 0% 9%; - --muted: 0 0% 96.1%; - --muted-foreground: 0 0% 45.1%; - --accent: 0 0% 96.1%; - --accent-foreground: 0 0% 9%; + --popover-foreground: 222.2 84% 4.9%; + --primary: 221.2 83.2% 53.3%; + --primary-foreground: 210 40% 98%; + --secondary: 210 40% 96%; + --secondary-foreground: 222.2 84% 4.9%; + --muted: 210 40% 96%; + --muted-foreground: 215.4 16.3% 46.9%; + --accent: 210 40% 96%; + --accent-foreground: 222.2 84% 4.9%; --destructive: 0 84.2% 60.2%; - --destructive-foreground: 0 0% 98%; - --border: 0 0% 89.8%; - --input: 0 0% 89.8%; - --ring: 0 0% 3.9%; - --chart-1: 12 76% 61%; - --chart-2: 173 58% 39%; - --chart-3: 197 37% 24%; - --chart-4: 43 74% 66%; - --chart-5: 27 87% 67%; + --destructive-foreground: 210 40% 98%; + --border: 214.3 31.8% 91.4%; + --input: 214.3 31.8% 91.4%; + --ring: 221.2 83.2% 53.3%; --radius: 0.5rem; - --sidebar-background: 0 0% 98%; - --sidebar-foreground: 240 5.3% 26.1%; - --sidebar-primary: 240 5.9% 10%; - --sidebar-primary-foreground: 0 0% 98%; - --sidebar-accent: 240 4.8% 95.9%; - --sidebar-accent-foreground: 240 5.9% 10%; - --sidebar-border: 220 13% 91%; - --sidebar-ring: 217.2 91.2% 59.8%; } + .dark { - --background: 0 0% 3.9%; - --foreground: 0 0% 98%; - --card: 0 0% 3.9%; - --card-foreground: 0 0% 98%; - --popover: 0 0% 3.9%; - --popover-foreground: 0 0% 98%; - --primary: 0 0% 98%; - --primary-foreground: 0 0% 9%; - --secondary: 0 0% 14.9%; - --secondary-foreground: 0 0% 98%; - --muted: 0 0% 14.9%; - --muted-foreground: 0 0% 63.9%; - --accent: 0 0% 14.9%; - --accent-foreground: 0 0% 98%; + --background: 222.2 84% 4.9%; + --foreground: 210 40% 98%; + --card: 222.2 84% 4.9%; + --card-foreground: 210 40% 98%; + --popover: 222.2 84% 4.9%; + --popover-foreground: 210 40% 98%; + --primary: 217.2 91.2% 59.8%; + --primary-foreground: 222.2 84% 4.9%; + --secondary: 217.2 32.6% 17.5%; + --secondary-foreground: 210 40% 98%; + --muted: 217.2 32.6% 17.5%; + --muted-foreground: 215 20.2% 65.1%; + --accent: 217.2 32.6% 17.5%; + --accent-foreground: 210 40% 98%; --destructive: 0 62.8% 30.6%; - --destructive-foreground: 0 0% 98%; - --border: 0 0% 14.9%; - --input: 0 0% 14.9%; - --ring: 0 0% 83.1%; - --chart-1: 220 70% 50%; - --chart-2: 160 60% 45%; - --chart-3: 30 80% 55%; - --chart-4: 280 65% 60%; - --chart-5: 340 75% 55%; - --sidebar-background: 240 5.9% 10%; - --sidebar-foreground: 240 4.8% 95.9%; - --sidebar-primary: 224.3 76.3% 48%; - --sidebar-primary-foreground: 0 0% 100%; - --sidebar-accent: 240 3.7% 15.9%; - --sidebar-accent-foreground: 240 4.8% 95.9%; - --sidebar-border: 240 3.7% 15.9%; - --sidebar-ring: 217.2 91.2% 59.8%; + --destructive-foreground: 210 40% 98%; + --border: 217.2 32.6% 17.5%; + --input: 217.2 32.6% 17.5%; + --ring: 224.3 76.3% 94.1%; } } diff --git a/app/page.tsx b/app/page.tsx index 7bc9ede..2fe72c6 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -4,6 +4,7 @@ import * as React from "react" import { LoginForm } from "@/components/login-form" import { AdminDashboard } from "@/components/admin-dashboard" import { Toaster } from "@/components/ui/toaster" +import { ThemeProvider } from "@/components/theme-provider" export default function Page() { const [token, setToken] = React.useState(null) @@ -37,9 +38,9 @@ export default function Page() { } return ( - <> + {!token ? : } - + ) } diff --git a/components/admin-dashboard.tsx b/components/admin-dashboard.tsx index 201469b..816bff0 100644 --- a/components/admin-dashboard.tsx +++ b/components/admin-dashboard.tsx @@ -1,7 +1,7 @@ "use client" import * as React from "react" -import { Table, Settings, Shield, LogOut, FileText, RefreshCw } from "lucide-react" +import { Table, Settings, Shield, LogOut, FileText, RefreshCw, ExternalLink } from "lucide-react" import { Sidebar, SidebarContent, @@ -22,6 +22,7 @@ import { SettingsSection } from "./settings/settings-section" import { LogsSection } from "./logs/logs-section" import { SyncSection } from "./sync/sync-section" import { useToast } from "@/hooks/use-toast" +import { ThemeToggle } from "./theme-toggle" interface AdminDashboardProps { token: string @@ -144,6 +145,17 @@ export function AdminDashboard({ token, onLogout }: AdminDashboardProps) { + + + + + Documentation + + + + + + diff --git a/components/database/column-visibility-dropdown.tsx b/components/database/column-visibility-dropdown.tsx index 06f56f0..d66f626 100644 --- a/components/database/column-visibility-dropdown.tsx +++ b/components/database/column-visibility-dropdown.tsx @@ -1,5 +1,5 @@ "use client" -import { Eye, EyeOff, Settings } from "lucide-react" +import { Eye, EyeOff } from "lucide-react" import { Button } from "@/components/ui/button" import { @@ -40,7 +40,7 @@ export function ColumnVisibilityDropdown({ table, visibleColumns, onVisibilityCh diff --git a/components/database/edit-item-drawer.tsx b/components/database/edit-item-drawer.tsx index b0d9d0c..af3e2b6 100644 --- a/components/database/edit-item-drawer.tsx +++ b/components/database/edit-item-drawer.tsx @@ -29,10 +29,12 @@ interface EditItemDrawerProps { export function EditItemDrawer({ table, item, apiClient, open, onClose, onItemUpdate }: EditItemDrawerProps) { const [formData, setFormData] = React.useState({}) const [isLoading, setIsLoading] = React.useState(false) + const [hasUnsavedChanges, setHasUnsavedChanges] = React.useState(false) React.useEffect(() => { if (open && item) { setFormData({ ...item }) + setHasUnsavedChanges(false) } }, [open, item]) @@ -57,14 +59,26 @@ export function EditItemDrawer({ table, item, apiClient, open, onClose, onItemUp ...prev, [fieldName]: value, })) + setHasUnsavedChanges(true) } const isSystemField = (fieldName: string) => { return ["id", "created", "updated"].includes(fieldName) } + const handleClose = () => { + if (hasUnsavedChanges) { + if (confirm("You have unsaved changes. Are you sure you want to close?")) { + setHasUnsavedChanges(false) + onClose() + } + } else { + onClose() + } + } + return ( - +
@@ -72,7 +86,7 @@ export function EditItemDrawer({ table, item, apiClient, open, onClose, onItemUp Edit Record
- @@ -110,7 +124,7 @@ export function EditItemDrawer({ table, item, apiClient, open, onClose, onItemUp
- + + + {columns.map((column, index) => { + const isSystem = isSystemColumn(column.name) + if (!isSystem) return null + return ( +
+
+ {/* Basic Info */} +
+
+ +
+ updateColumn(index, "name", e.target.value)} + disabled={isSystem} + className={`flex-1 ${isSystem ? "bg-muted" : ""}`} + /> + {isSystem && ( + + System + + )} +
+
+
+ + +
+
+ + {/* Basic Properties */} +
+
+ updateColumn(index, "primaryKey", e.target.checked)} + disabled={isSystem} + className="rounded" + /> + +
+
+ updateColumn(index, "nullable", !e.target.checked)} + disabled={isSystem} + className="rounded" + /> + +
+
+ updateColumn(index, "unique", e.target.checked)} + disabled={isSystem} + className="rounded" + /> + +
+
+ updateColumn(index, "isFile", e.target.checked)} + disabled={isSystem} + className="rounded" + /> + +
+
+ + {/* Advanced Options - Collapsible */} + + + + + +
+
+ + +
+
+ + +
+
+
+ +