refactor: ChakraUI v3 frontend + direct SQL backend services
Frontend: - Replace Tailwind CSS with ChakraUI v3 (react, recharts, fontsource) - 24 themes (12 Dune factions x day/night variants) - Collapsible sidebar navigation with 6 groups - Recharts AreaChart/PieChart for CPU/RAM/metrics - New Experimental page (ports legacy admin_experimental.html) - Common components: DataTable, Modal, Badge, Toaster Backend: - Fix services to use direct SQL (dune.* schema) instead of stored procedures - PlayerService, EconomyService, GuildService, WorldService rewritten - Auto-login for SPA development in factory.py - Fix settings.yaml path resolution Launcher: - Add option [7] Start New Dashboard in launcher.ps1 and start.sh - Auto-installs pip + npm dependencies - Sets up SSH tunnels + kubectl port-forwards - Starts backend API + frontend Vite dev server Security: - Sanitize hardcoded RMQ password in config.py - Add frontend/dist/ to .gitignore
This commit is contained in:
1 parent
d7ac8a6641
commit
011ba8c8b4
52 files changed
+5901
-2444
No files matched your search
@@ -1,30 +1,70 @@
|
||||
import { ReactNode } from 'react'
|
||||
import {
|
||||
Dialog,
|
||||
Portal,
|
||||
IconButton,
|
||||
} from '@chakra-ui/react'
|
||||
import { FiX } from 'react-icons/fi'
|
||||
|
||||
interface ModalProps {
|
||||
open: boolean
|
||||
title: string
|
||||
onClose: () => void
|
||||
children: React.ReactNode
|
||||
maxWidth?: string
|
||||
title: string
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
export default function Modal({ open, title, onClose, children, maxWidth = '500px' }: ModalProps) {
|
||||
if (!open) return null
|
||||
export default function Modal({ open, onClose, title, children }: ModalProps) {
|
||||
return (
|
||||
<div className="fixed inset-0 z-[70] flex items-center justify-center bg-black/60 backdrop-blur-sm">
|
||||
<div
|
||||
className="bg-card-bg border border-border rounded-xl shadow-2xl w-full mx-4"
|
||||
style={{ maxWidth }}
|
||||
>
|
||||
<div className="flex items-center justify-between px-5 py-4 border-b border-border">
|
||||
<h3 className="font-serif text-lg text-text-primary">{title}</h3>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="text-text-muted hover:text-text-primary text-xl leading-none"
|
||||
<Dialog.Root open={open} onOpenChange={(e) => { if (!e.open) onClose() }}>
|
||||
<Portal>
|
||||
<Dialog.Backdrop bg="black/60" backdropFilter="blur(4px)" />
|
||||
<Dialog.Positioner>
|
||||
<Dialog.Content
|
||||
bg="card.bg"
|
||||
border="1px solid"
|
||||
borderColor="border"
|
||||
borderRadius="xl"
|
||||
boxShadow="card"
|
||||
maxW="600px"
|
||||
w="full"
|
||||
mx={4}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</div>
|
||||
<div className="p-5 max-h-[80vh] overflow-auto">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
<Dialog.Header
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="space-between"
|
||||
borderBottom="1px solid"
|
||||
borderColor="border"
|
||||
px={6}
|
||||
py={4}
|
||||
>
|
||||
<Dialog.Title
|
||||
fontSize="lg"
|
||||
fontWeight="semibold"
|
||||
fontFamily="Playfair Display, serif"
|
||||
color="primary.DEFAULT"
|
||||
>
|
||||
{title}
|
||||
</Dialog.Title>
|
||||
<Dialog.CloseTrigger asChild>
|
||||
<IconButton
|
||||
aria-label="Close"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={onClose}
|
||||
color="fg.muted"
|
||||
_hover={{ color: 'fg' }}
|
||||
>
|
||||
<FiX />
|
||||
</IconButton>
|
||||
</Dialog.CloseTrigger>
|
||||
</Dialog.Header>
|
||||
<Dialog.Body px={6} py={4}>
|
||||
{children}
|
||||
</Dialog.Body>
|
||||
</Dialog.Content>
|
||||
</Dialog.Positioner>
|
||||
</Portal>
|
||||
</Dialog.Root>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user