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:
Reditus committed 2026-05-25 03:08:02 +01:00
1 parent d7ac8a6641
commit 011ba8c8b4
52 files changed
+5901 -2444

No files matched your search

@@ -1,21 +1,70 @@
import { Box, Flex, Text, Tooltip, VStack, Circle } from '@chakra-ui/react'
import { FiWifi, FiWifiOff } from 'react-icons/fi'
import { useApp } from '../../stores/AppContext'
const SERVICES = [
{ key: 'database' as const, label: 'Database' },
{ key: 'ssh' as const, label: 'SSH Tunnel' },
{ key: 'bgd' as const, label: 'BG Director' },
{ key: 'rmq' as const, label: 'RMQ' },
]
export default function ConnectionBadge() {
const { state } = useApp()
const { database, ssh, bgd, rmq } = state.connectionStatus
const allOk = database && ssh && bgd && rmq
const someDown = !allOk && (database || ssh || bgd || rmq)
const statuses = SERVICES.map((s) => state.connectionStatus[s.key])
const upCount = statuses.filter(Boolean).length
const allUp = upCount === statuses.length
const allDown = upCount === 0
const dotColor = allUp ? 'success.DEFAULT' : allDown ? 'danger.DEFAULT' : 'warning.DEFAULT'
return (
<div className="flex items-center gap-2">
<div
className="w-2.5 h-2.5 rounded-full"
style={{
backgroundColor: allOk ? '#27ae60' : someDown ? '#f39c12' : '#c0392b',
boxShadow: `0 0 6px ${allOk ? '#27ae60' : someDown ? '#f39c12' : '#c0392b'}`,
}}
title={`DB: ${database ? 'OK' : 'DOWN'} | SSH: ${ssh ? 'OK' : 'DOWN'} | BGD: ${bgd ? 'OK' : 'DOWN'} | RMQ: ${rmq ? 'OK' : 'DOWN'}`}
/>
</div>
<Tooltip.Root>
<Tooltip.Trigger asChild>
<Flex
align="center"
gap={1.5}
px={2.5}
py={1}
borderRadius="full"
bg="bg.subtle"
border="1px solid"
borderColor="border.subtle"
cursor="default"
>
{allUp ? (
<FiWifi size={14} color="currentColor" />
) : (
<FiWifiOff size={14} color="currentColor" />
)}
<Circle size="6px" bg={dotColor} />
</Flex>
</Tooltip.Trigger>
<Tooltip.Positioner>
<Tooltip.Content bg="card.bg" border="1px solid" borderColor="border" borderRadius="md" p={3}>
<VStack align="stretch" gap={2} minW="160px">
<Text fontSize="xs" fontWeight="semibold" color="fg" mb={1}>
Service Status
</Text>
{SERVICES.map((s) => (
<Flex key={s.key} justify="space-between" align="center" gap={4}>
<Text fontSize="xs" color="fg.muted">
{s.label}
</Text>
<Flex align="center" gap={1.5}>
<Circle
size="6px"
bg={state.connectionStatus[s.key] ? 'success.DEFAULT' : 'danger.DEFAULT'}
/>
<Text fontSize="2xs" color="fg.muted">
{state.connectionStatus[s.key] ? 'OK' : 'DOWN'}
</Text>
</Flex>
</Flex>
))}
</VStack>
</Tooltip.Content>
</Tooltip.Positioner>
</Tooltip.Root>
)
}