From 57b8be698dbbecb7340396e9e1654f19c0942685 Mon Sep 17 00:00:00 2001 From: Saravana Achu Mac Date: Sat, 9 May 2026 01:16:06 -0700 Subject: [PATCH] refactor(ui): refine admin console controls --- web/src/index.css | 117 ++++++++++++++++++++++++++++++++++++++ web/src/tabs/AdminTab.tsx | 91 +++++++++++++++-------------- 2 files changed, 165 insertions(+), 43 deletions(-) diff --git a/web/src/index.css b/web/src/index.css index 8cd26fe..48d6961 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -825,6 +825,123 @@ body { } } +.admin-console { + width: min(100%, 1120px); + margin: 0 auto; + display: grid; + gap: 24px; +} + +.admin-console-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 20px; +} + +.admin-console-brand { + display: flex; + min-width: 0; + align-items: center; + gap: 14px; +} + +.admin-console-icon { + display: grid; + width: 44px; + height: 44px; + flex: 0 0 auto; + place-items: center; + border-radius: 14px; +} + +.admin-console-brand h2 { + margin: 0; + color: var(--foreground); + font-size: 20px; + font-weight: 760; + line-height: 1.2; +} + +.admin-console-brand p { + margin: 5px 0 0; + color: var(--muted-foreground); + font-size: 13px; + line-height: 1.45; +} + +.admin-status-row { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + gap: 10px; +} + +.admin-status-pill { + display: inline-flex; + min-height: 34px; + align-items: center; + gap: 8px; + border-radius: 999px; + padding: 0 12px; +} + +.admin-subnav { + display: flex; + flex-wrap: wrap; + gap: 6px; + border-radius: 16px; + padding: 6px; +} + +.admin-subnav-button { + gap: 8px; + border-radius: 12px; +} + +.admin-subnav-button[data-active='true'] { + background: var(--card); + color: var(--foreground); + box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); +} + +.admin-control-button { + width: 100%; + gap: 8px; +} + +.admin-control-button--pause:not(:disabled) { + border-color: color-mix(in oklab, var(--bl-warning) 28%, var(--border)); + background: color-mix(in oklab, var(--bl-warning) 10%, transparent); + color: var(--bl-warning); +} + +.admin-control-button--resume:not(:disabled) { + border-color: color-mix(in oklab, var(--bl-success) 28%, var(--border)); + background: color-mix(in oklab, var(--bl-success) 10%, transparent); + color: var(--bl-success); +} + +@media (max-width: 760px) { + .admin-console-header { + align-items: stretch; + flex-direction: column; + } + + .admin-status-row { + justify-content: flex-start; + } + + .admin-subnav { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .admin-subnav-button { + justify-content: flex-start; + } +} + .ux-field-label { color: var(--muted-foreground); font-size: 11px; diff --git a/web/src/tabs/AdminTab.tsx b/web/src/tabs/AdminTab.tsx index 4be7fa7..0058421 100644 --- a/web/src/tabs/AdminTab.tsx +++ b/web/src/tabs/AdminTab.tsx @@ -17,6 +17,7 @@ import { fetchDynamicConfigItems, upsertDynamicConfigItems } from '../lib/dynami import { getPlatformAccessToken } from '../lib/authSession'; import { createRequestId } from '../../../shared/request-id.js'; import { tradingRuntime } from '../lib/runtime'; +import { Button } from '../components/ui/Primitives'; interface AdminTabProps { botState: BotState; @@ -373,13 +374,16 @@ export const AdminTab = ({ botState, socket }: AdminTabProps) => {

Operational Events

- +
Buffer: {operationalEvents.length || 0} events @@ -778,30 +782,30 @@ export const AdminTab = ({ botState, socket }: AdminTabProps) => { {/* Control Buttons */}
- - +
{/* Error Display */} @@ -843,6 +847,10 @@ export const AdminTab = ({ botState, socket }: AdminTabProps) => {

Persistent sync of bot state to Supabase

+ @@ -905,30 +913,29 @@ export const AdminTab = ({ botState, socket }: AdminTabProps) => { if (profile?.role !== 'admin') { return ( -
+
-

Access Denied

+

Access Denied

You do not have administrative privileges to access this area.

); } return ( -
- {/* Header */} -
-
-
+
+
+
+
-

Admin Panel

-

System configuration & rule pipeline

+

Admin Panel

+

System configuration, rule pipeline, and runtime controls.

-
-
+
+
{botConfig ? ( <> @@ -942,8 +949,7 @@ export const AdminTab = ({ botState, socket }: AdminTabProps) => { )}
- {/* System Status Badge */} -
+
System: {systemBadgeLabel} @@ -952,28 +958,27 @@ export const AdminTab = ({ botState, socket }: AdminTabProps) => {
- {/* Sub Navigation */} -