Add content

This commit is contained in:
2025-02-06 01:52:01 -05:00
parent 788ebcf255
commit 2ff728f7b8
11 changed files with 1553 additions and 134 deletions

View File

@@ -1,34 +1,325 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Separator } from "@/components/ui/separator"
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
import { Button } from "@/components/ui/button"
import { Moon, Sun } from "lucide-react"
import { useTheme } from "@/components/theme-provider"
import {
Server,
Box,
Play,
Activity,
Shield,
Database,
Download,
Home,
Tv,
Globe,
Gauge,
HardDrive,
Search,
Settings,
LayoutDashboard,
Package,
Smartphone
} from "lucide-react"
function App() {
const [count, setCount] = useState(0)
interface ServiceCard {
name: string
description: string
url: string
icon: React.ReactNode
category: 'system' | 'media' | 'monitoring' | 'tools' | 'acot' | 'home'
}
const services: ServiceCard[] = [
{
name: "Portainer",
description: "Container Management",
url: "https://portainer.kent.pw",
icon: <Box className="h-6 w-6" />,
category: "system"
},
{
name: "Gitea",
description: "Git Server",
url: "https://gitea.kent.pw",
icon: <Server className="h-6 w-6" />,
category: "system"
},
{
name: "Cockpit",
description: "Server Management",
url: "https://cockpit.kent.pw",
icon: <Settings className="h-6 w-6" />,
category: "system"
},
{
name: "DiskStation",
description: "Synology NAS",
url: "https://diskstation.kent.pw",
icon: <HardDrive className="h-6 w-6" />,
category: "system"
},
{
name: "Plex",
description: "Media Server",
url: "https://plex.kent.pw",
icon: <Play className="h-6 w-6" />,
category: "media"
},
{
name: "Sonarr",
description: "TV Show Management",
url: "https://sonarr.kent.pw",
icon: <Tv className="h-6 w-6" />,
category: "media"
},
{
name: "Jackett",
description: "Torrent Indexer",
url: "https://jackett.kent.pw",
icon: <Search className="h-6 w-6" />,
category: "media"
},
{
name: "Deluge",
description: "Torrent Client",
url: "https://deluge.kent.pw",
icon: <Download className="h-6 w-6" />,
category: "media"
},
{
name: "Uptime",
description: "Service Monitoring",
url: "https://uptime.kent.pw",
icon: <Activity className="h-6 w-6" />,
category: "monitoring"
},
{
name: "AdGuard",
description: "Network Ad Blocking",
url: "https://adguard.kent.pw",
icon: <Shield className="h-6 w-6" />,
category: "system"
},
{
name: "NocoDB",
description: "Database Platform",
url: "https://noco.kent.pw",
icon: <Database className="h-6 w-6" />,
category: "tools"
},
{
name: "IT Tools",
description: "Developer Utilities",
url: "https://ittools.kent.pw",
icon: <Settings className="h-6 w-6" />,
category: "tools"
},
{
name: "Firefox",
description: "Browser Instance",
url: "https://firefox.kent.pw",
icon: <Globe className="h-6 w-6" />,
category: "tools"
},
{
name: "Speedtest",
description: "Network Speed Monitor",
url: "https://speedtest.kent.pw",
icon: <Gauge className="h-6 w-6" />,
category: "monitoring"
},
{
name: "Drive",
description: "File Storage",
url: "https://drive.kent.pw",
icon: <HardDrive className="h-6 w-6" />,
category: "tools"
},
{
name: "Dashboard",
description: "ACOT Dashboard",
url: "https://dashboard.kent.pw",
icon: <LayoutDashboard className="h-6 w-6" />,
category: "acot"
},
{
name: "Inventory",
description: "ACOT Inventory",
url: "https://inventory.kent.pw",
icon: <Package className="h-6 w-6" />,
category: "acot"
},
{
name: "Homebridge",
description: "HomeKit Bridge",
url: "https://homebridge.kent.pw",
icon: <Home className="h-6 w-6" />,
category: "home"
},
{
name: "Scrypted",
description: "Smart Home Integration",
url: "https://scrypted.kent.pw",
icon: <Smartphone className="h-6 w-6" />,
category: "home"
}
]
function ThemeToggle() {
const { setTheme } = useTheme()
return (
<>
<div>
<a href="https://vite.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" size="icon">
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
Light
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("dark")}>
Dark
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("system")}>
System
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
)
}
function ServiceSection({ title, services }: { title: string, services: ServiceCard[] }) {
return (
<div className="space-y-4">
<div className="flex items-center">
<h2 className="text-2xl font-bold">{title}</h2>
<Separator className="flex-1 ml-4" />
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
<div className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4">
{services.map((service) => {
// Get background color based on service
const bgColor = (() => {
switch (service.name) {
case "Portainer":
return "bg-blue-50 dark:bg-blue-950/30" // Portainer blue
case "Gitea":
return "bg-green-50 dark:bg-green-950/30" // Gitea green
case "Plex":
return "bg-orange-50 dark:bg-orange-950/30" // Plex orange
case "Sonarr":
return "bg-blue-50 dark:bg-blue-950/30" // Sonarr blue
case "AdGuard":
return "bg-emerald-50 dark:bg-emerald-950/30" // AdGuard green
case "Homebridge":
return "bg-purple-50 dark:bg-purple-950/30" // Homebridge purple
case "Scrypted":
return "bg-indigo-50 dark:bg-indigo-950/30" // Scrypted blue/purple
case "Dashboard":
case "Inventory":
return "bg-sky-50 dark:bg-sky-950/30" // ACOT blue
case "DiskStation":
return "bg-slate-50 dark:bg-slate-950/30" // Synology gray
case "Deluge":
return "bg-green-50 dark:bg-green-950/30" // Deluge green
case "Firefox":
return "bg-orange-50 dark:bg-orange-950/30" // Firefox orange
case "Uptime":
return "bg-emerald-50 dark:bg-emerald-950/30" // Uptime green (success color)
case "Speedtest":
return "bg-blue-50 dark:bg-blue-950/30" // Speedtest blue
default:
return "bg-gray-50 dark:bg-gray-950/30" // Default subtle background
}
})()
// Get icon color based on service
const iconColor = (() => {
switch (service.name) {
case "Portainer":
return "text-blue-600 dark:text-blue-400"
case "Gitea":
return "text-green-600 dark:text-green-400"
case "Plex":
return "text-orange-600 dark:text-orange-400"
case "Sonarr":
return "text-blue-600 dark:text-blue-400"
case "AdGuard":
return "text-emerald-600 dark:text-emerald-400"
case "Homebridge":
return "text-purple-600 dark:text-purple-400"
case "Scrypted":
return "text-indigo-600 dark:text-indigo-400"
case "Dashboard":
case "Inventory":
return "text-sky-600 dark:text-sky-400"
case "DiskStation":
return "text-slate-600 dark:text-slate-400"
case "Deluge":
return "text-green-600 dark:text-green-400"
case "Firefox":
return "text-orange-600 dark:text-orange-400"
case "Uptime":
return "text-emerald-600 dark:text-emerald-400"
case "Speedtest":
return "text-blue-600 dark:text-blue-400"
default:
return "text-gray-600 dark:text-gray-400"
}
})()
return (
<a
key={service.name}
href={service.url}
target="_blank"
rel="noopener noreferrer"
className="transition-transform hover:scale-105"
>
<Card className={bgColor}>
<CardHeader className="flex flex-row items-center space-y-0 pb-2">
<div className={iconColor}>{service.icon}</div>
<CardTitle className="ml-2">{service.name}</CardTitle>
</CardHeader>
<CardContent>
<CardDescription>{service.description}</CardDescription>
</CardContent>
</Card>
</a>
)
})}
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</>
</div>
)
}
function App() {
const systemServices = services.filter(s => s.category === 'system')
const mediaServices = services.filter(s => s.category === 'media')
const monitoringServices = services.filter(s => s.category === 'monitoring')
const toolServices = services.filter(s => s.category === 'tools')
const acotServices = services.filter(s => s.category === 'acot')
const homeServices = services.filter(s => s.category === 'home')
return (
<div className="min-h-screen bg-gray-100 dark:bg-background p-8 space-y-8">
<div className="flex justify-between items-center">
<h1 className="text-4xl font-bold">Kent.pw Homepage</h1>
<ThemeToggle />
</div>
<ServiceSection title="System" services={systemServices} />
<ServiceSection title="Media" services={mediaServices} />
<ServiceSection title="Monitoring" services={monitoringServices} />
<ServiceSection title="Tools" services={toolServices} />
<ServiceSection title="ACOT" services={acotServices} />
<ServiceSection title="Home" services={homeServices} />
</div>
)
}