From 139b36d672a51b3a3795188bed8706840186e580 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Sun, 5 Jul 2026 22:22:05 +0200 Subject: [PATCH 1/2] chore(webpanel): removed padding from layout and let pages handle it -> also fixes responsiveness for table pages (players, admins, whitelit) --- apps/webpanel/package.json | 84 ++++---- .../webpanel/src/components/sidebar/index.tsx | 2 +- .../src/components/sidebar/server-status.tsx | 3 +- apps/webpanel/src/pages/console/index.tsx | 2 +- apps/webpanel/src/pages/dashboard/index.tsx | 7 +- .../src/pages/dashboard/playerList.tsx | 15 +- apps/webpanel/src/pages/performance/index.tsx | 70 +++--- apps/webpanel/src/pages/players/index.tsx | 142 ++++++------- .../webpanel/src/pages/players/playerview.tsx | 92 ++++---- apps/webpanel/src/pages/resources/index.tsx | 8 +- .../src/pages/settings/admincreate.tsx | 2 +- .../src/pages/settings/adminmanagement.tsx | 129 ++++++----- .../webpanel/src/pages/settings/adminview.tsx | 30 +-- .../webpanel/src/pages/settings/auditlogs.tsx | 4 +- .../src/pages/settings/configeditor.tsx | 2 +- .../src/pages/settings/groupmanagement.tsx | 164 +++++++------- apps/webpanel/src/pages/settings/index.tsx | 2 +- apps/webpanel/src/pages/whitelist/index.tsx | 200 +++++++++--------- 18 files changed, 475 insertions(+), 483 deletions(-) diff --git a/apps/webpanel/package.json b/apps/webpanel/package.json index 80b3b6d6..67b60a06 100644 --- a/apps/webpanel/package.json +++ b/apps/webpanel/package.json @@ -1,44 +1,44 @@ { - "name": "@fxmanager/webpanel", - "version": "0.2.1", - "type": "module", - "private": true, - "scripts": { - "dev": "vite", - "build": "tsc -b && vite build", - "lint": "biome check .", - "format": "biome format --write .", - "typecheck": "tsc --noEmit", - "preview": "vite preview" - }, - "dependencies": { - "@codemirror/commands": "^6.10.4", - "@codemirror/language": "^6.12.4", - "@codemirror/state": "^6.7.0", - "@codemirror/theme-one-dark": "^6.1.3", - "@codemirror/view": "^6.43.4", - "@fxmanager/shared": "workspace:*", - "@fxmanager/ui": "workspace:*", - "@lezer/highlight": "^1.2.3", - "ansi-to-react": "^6.2.6", - "codemirror": "^6.0.2", - "date-fns": "^4.2.1", - "lucide-react": "^1.0.1", - "react": "^19.2.4", - "react-day-picker": "^10.0.1", - "react-dom": "^19.2.4", - "react-router-dom": "^7.13.2", - "recharts": "3.8.0", - "sonner": "^2.0.7" - }, - "devDependencies": { - "@fxmanager/database": "workspace:*", - "@tailwindcss/vite": "^4.1.18", - "@types/node": "^25.1.0", - "@types/react": "^19.2.10", - "@types/react-dom": "^19.2.3", - "@vitejs/plugin-react": "^5.1.1", - "typescript": "^5.9.3", - "vite": "^7.2.4" - } + "name": "@fxmanager/webpanel", + "version": "0.2.1", + "type": "module", + "private": true, + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "biome check .", + "format": "biome format --write .", + "typecheck": "tsc --noEmit", + "preview": "vite preview" + }, + "dependencies": { + "@codemirror/commands": "^6.10.4", + "@codemirror/language": "^6.12.4", + "@codemirror/state": "^6.7.0", + "@codemirror/theme-one-dark": "^6.1.3", + "@codemirror/view": "^6.43.4", + "@fxmanager/shared": "workspace:*", + "@fxmanager/ui": "workspace:*", + "@lezer/highlight": "^1.2.3", + "ansi-to-react": "^6.2.6", + "codemirror": "^6.0.2", + "date-fns": "^4.2.1", + "lucide-react": "^1.0.1", + "react": "^19.2.4", + "react-day-picker": "^10.0.1", + "react-dom": "^19.2.4", + "react-router-dom": "^7.13.2", + "recharts": "3.8.0", + "sonner": "^2.0.7" + }, + "devDependencies": { + "@fxmanager/database": "workspace:*", + "@tailwindcss/vite": "^4.1.18", + "@types/node": "^25.1.0", + "@types/react": "^19.2.10", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "typescript": "^5.9.3", + "vite": "^7.2.4" + } } diff --git a/apps/webpanel/src/components/sidebar/index.tsx b/apps/webpanel/src/components/sidebar/index.tsx index 9931a2e3..1bd27a81 100644 --- a/apps/webpanel/src/components/sidebar/index.tsx +++ b/apps/webpanel/src/components/sidebar/index.tsx @@ -10,7 +10,7 @@ export default function AppLayout() { -
+
diff --git a/apps/webpanel/src/components/sidebar/server-status.tsx b/apps/webpanel/src/components/sidebar/server-status.tsx index 3d1a91d3..4356f3ad 100644 --- a/apps/webpanel/src/components/sidebar/server-status.tsx +++ b/apps/webpanel/src/components/sidebar/server-status.tsx @@ -256,7 +256,8 @@ export function ServerStatusCard() { > - {version.latest} available + {version.latest}{' '} + available diff --git a/apps/webpanel/src/pages/console/index.tsx b/apps/webpanel/src/pages/console/index.tsx index 824838bd..6a6e5e62 100644 --- a/apps/webpanel/src/pages/console/index.tsx +++ b/apps/webpanel/src/pages/console/index.tsx @@ -156,7 +156,7 @@ export default function Console() { }, []); return ( -
+
diff --git a/apps/webpanel/src/pages/dashboard/index.tsx b/apps/webpanel/src/pages/dashboard/index.tsx index f8996358..ed27bc21 100644 --- a/apps/webpanel/src/pages/dashboard/index.tsx +++ b/apps/webpanel/src/pages/dashboard/index.tsx @@ -133,8 +133,8 @@ export default function DashboardPage() { ]; return ( - -
+ +
+ {' '} + {/* The cards in this section have their edges cropped out */}
@@ -246,7 +248,6 @@ export default function DashboardPage() {
-
diff --git a/apps/webpanel/src/pages/dashboard/playerList.tsx b/apps/webpanel/src/pages/dashboard/playerList.tsx index c7f1004c..914a5a87 100644 --- a/apps/webpanel/src/pages/dashboard/playerList.tsx +++ b/apps/webpanel/src/pages/dashboard/playerList.tsx @@ -68,16 +68,17 @@ export default function PlayerListPage() { const { players, loading } = usePlayerlistSocket(); return ( -
+
- -
- - + + +
+
+ # Player @@ -97,8 +98,8 @@ export default function PlayerListPage() { - - + + {loading ? ( Array.from({ length: 6 }).map((_, i) => ( // biome-ignore lint/suspicious/noArrayIndexKey: indexes are immutable diff --git a/apps/webpanel/src/pages/performance/index.tsx b/apps/webpanel/src/pages/performance/index.tsx index f6039e0e..03f7e119 100644 --- a/apps/webpanel/src/pages/performance/index.tsx +++ b/apps/webpanel/src/pages/performance/index.tsx @@ -10,6 +10,7 @@ import type { PerfInspect } from './components/perf-series'; import { usePerfSocket } from '@/hooks/ws-channels/use-perf'; import { usePerfSeries } from '@/hooks/ws-channels/use-perf-series'; import { useWsChannel } from '@/hooks/ws-channels/use-ws-core'; +import { ScrollArea, ScrollBar } from '@fxmanager/ui/components/scroll-area'; export default function PerformancePage() { const { samples } = usePerfSocket(); @@ -65,42 +66,45 @@ export default function PerformancePage() { }, [inspect, selected, isLive, snapshots]); return ( -
- + +
+ - + -
- - -
+
+ + +
-
- +
+ +
-
+ +
); } diff --git a/apps/webpanel/src/pages/players/index.tsx b/apps/webpanel/src/pages/players/index.tsx index 1167a8aa..6f5296ed 100644 --- a/apps/webpanel/src/pages/players/index.tsx +++ b/apps/webpanel/src/pages/players/index.tsx @@ -22,7 +22,7 @@ import { QueryService } from '@/lib/query'; import { useDebounce } from '@/hooks/use-debounce'; import { formatDuration } from '@/lib/utils'; import { useNavigate, useSearchParams } from 'react-router-dom'; -import { ScrollArea } from '@fxmanager/ui/components/scroll-area'; +import { ScrollArea, ScrollBar } from '@fxmanager/ui/components/scroll-area'; import { usePlayerAction } from '@/hooks/use-player-actions'; import { PlayerActionDialog } from '@/components/player-actions-dialog'; import { PageHeader } from '@/components/page-header'; @@ -133,11 +133,11 @@ export default function Players() { }, [debouncedSearch, sortBy, sortOrder, page, pageSize]); return ( -
+
-
-
+
+
- {/* ToDo: - find a solution for mobile display as this fucks up, options: - * Dynamically display columns on mobile (only show active filter) - * Don't show extra columns - - */} - -
-
- + + +
+ Name @@ -194,71 +188,75 @@ export default function Players() { + - - {loading ? ( - - - Loading... + {loading ? ( + + + Loading... + + + ) : players.length === 0 ? ( + + + {search + ? `No players matching "${search}"` + : 'No players found'} + + + ) : ( + players.map((p) => ( + navigate(`/players/${p.id}`)} + > + + {p.name} + {p.isStaff && ( + + Staff + + )} - - ) : players.length === 0 ? ( - - - {search - ? `No players matching "${search}"` - : 'No players found'} + + {new Date(p.firstSeen).toLocaleDateString()} + + + {new Date(p.lastSeen).toLocaleString()} + + + {formatDuration(p.playtime)} + + + - ) : ( - players.map((p) => ( - navigate(`/players/${p.id}`)} - > - - {p.name} - {p.isStaff && ( - - Staff - - )} - - - {new Date(p.firstSeen).toLocaleDateString()} - - - {new Date(p.lastSeen).toLocaleString()} - - - {formatDuration(p.playtime)} - - - - - - )) - )} - + )) + )}
-
-
+ + + +
-
+
+
@@ -197,35 +197,37 @@ export default function PlayerView() {
- -
-
- - - - 0 ? ( - {totalPunishments} - ) : ( - 'None' - ) - } - /> + +
+
+
+ + + + 0 ? ( + {totalPunishments} + ) : ( + 'None' + ) + } + /> +
@@ -256,7 +258,7 @@ export default function PlayerView() { - + Bans @@ -319,7 +321,7 @@ export default function PlayerView() { - + - + - + - + @@ -363,7 +365,7 @@ export default function PlayerView() { - + @@ -372,15 +374,15 @@ export default function PlayerView() {
- -
+ +
); } diff --git a/apps/webpanel/src/pages/resources/index.tsx b/apps/webpanel/src/pages/resources/index.tsx index 3dbdb794..5fc5a6eb 100644 --- a/apps/webpanel/src/pages/resources/index.tsx +++ b/apps/webpanel/src/pages/resources/index.tsx @@ -213,7 +213,7 @@ export function ResourceList() { } return ( -
+
{loading || state.status === 'starting' ? ( ) : state.status === 'running' ? ( - +
{displayedResources.length > 0 ? ( displayedResources.map((res) => ( @@ -413,7 +413,7 @@ export function ResourceList() {
) : ( -
+
diff --git a/apps/webpanel/src/pages/settings/admincreate.tsx b/apps/webpanel/src/pages/settings/admincreate.tsx index c837886b..1419908c 100644 --- a/apps/webpanel/src/pages/settings/admincreate.tsx +++ b/apps/webpanel/src/pages/settings/admincreate.tsx @@ -64,7 +64,7 @@ export default function AdminCreate() { } return ( -
+
+
- {/* ToDo: - find a solution for mobile display as this fucks up, options: - * Dynamically display columns on mobile (only show active filter) - * Don't show extra columns - */} - - -
- - + + +
+ Name @@ -206,68 +200,69 @@ export default function AdminManagementList() { + - - {loading ? ( - - - Loading... + {loading ? ( + + + Loading... + + + ) : admins.length === 0 ? ( + + + {search + ? `No admins matching "${search}"` + : 'No admins found'} + + + ) : ( + admins.map((a) => ( + navigate(`/settings/admins/${a.id}`)} + > + + {a.username} - - ) : admins.length === 0 ? ( - - - {search - ? `No admins matching "${search}"` - : 'No admins found'} + + {a.group && } + + + {new Date(a.createdAt).toLocaleDateString()} + + + {a.lastLoginAt + ? new Date(a.lastLoginAt).toLocaleString() + : 'N/A'} + + + - ) : ( - admins.map((a) => ( - navigate(`/settings/admins/${a.id}`)} - > - - {a.username} - - - {a.group && } - - - {new Date(a.createdAt).toLocaleDateString()} - - - {a.lastLoginAt - ? new Date(a.lastLoginAt).toLocaleString() - : 'N/A'} - - - - - - )) - )} - + )) + )}
-
-
+ + + +
-
-
+
+
+
@@ -306,8 +306,8 @@ export default function AdminView() {
-
-
+
+
- + Recent Activity Permissions - - + + Action Recap - + {!hasPermission(UserPermissions.AUDIT_LOG) ? ( - - + + Permissions Editor - + {isMaster ? ( +
-
+