High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
feat: new NavBar from Poseidon + rename to Monitoring
Boschebde5e4b95af
diff --git a/dashboard/src/App.tsx b/dashboard/src/App.tsxindex 16e7c774..58659116 100644--- a/dashboard/src/App.tsx+++ b/dashboard/src/App.tsx@@ -1,8 +1,8 @@import { useEffect } from 'react'import { HashRouter, Routes, Route, Navigate } from 'react-router-dom'import { useAppStore } from './stores/useAppStore'-import { Header } from './components/molecules'-import { ProfilesPage, InstancesPage, AgentsPage, SettingsPage } from './pages'+import { NavBar } from './components/molecules'+import { MonitoringPage, ProfilesPage, AgentsPage, SettingsPage } from './pages'import * as api from './services/api'function AppContent() {@@ -33,12 +33,10 @@ function AppContent() {},onSystem: async (event) => {console.log('System event:', event)- // Refresh instances on any instance eventif (event.type.startsWith('instance.')) {try {const instances = await api.fetchInstances()setInstances(instances)- // Also refresh profiles to update running statusconst profiles = await api.fetchProfiles()setProfiles(profiles)} catch (e) {@@ -48,7 +46,6 @@ function AppContent() {},onAgent: (event) => {console.log('Agent event:', event)- // Could update agent activity here},})@@ -57,12 +54,12 @@ function AppContent() {return (<div className="flex h-screen flex-col bg-bg-app">- <Header />+ <NavBar /><main className="flex flex-1 overflow-hidden"><Routes>- <Route path="/" element={<Navigate to="/profiles" replace />} />+ <Route path="/" element={<Navigate to="/monitoring" replace />} />+ <Route path="/monitoring" element={<MonitoringPage />} /><Route path="/profiles" element={<ProfilesPage />} />- <Route path="/instances" element={<InstancesPage />} /><Route path="/agents" element={<AgentsPage />} /><Route path="/settings" element={<SettingsPage />} /></Routes>diff --git a/dashboard/src/components/molecules/Header.tsx b/dashboard/src/components/molecules/Header.tsxdeleted file mode 100644index e35281c9..00000000--- a/dashboard/src/components/molecules/Header.tsx+++ /dev/null@@ -1,45 +0,0 @@-import { NavLink } from 'react-router-dom'-import { StatusDot } from '../atoms'--const views = [- { path: '/profiles', label: 'Profiles' },- { path: '/instances', label: 'Instances' },- { path: '/agents', label: 'Agents' },- { path: '/settings', label: 'Settings' },-]--const tabBase =- 'rounded px-3 py-1.5 text-sm font-medium transition-all duration-150'-const tabInactive = 'text-text-muted hover:text-text-secondary hover:bg-bg-elevated'-const tabActive = 'text-primary bg-primary/10'--export default function Header() {- return (- <header className="flex items-center justify-between border-b border-border-subtle bg-bg-surface px-4 py-3">- <div className="flex items-center gap-3">- <img- src={`${import.meta.env.BASE_URL}pinchtab-headed-192.png`}- alt="Pinchtab"- className="h-8 w-8"- />- <span className="text-lg font-semibold text-text-primary">Pinchtab</span>- </div>-- <nav className="flex items-center gap-1">- {views.map((v) => (- <NavLink- key={v.path}- to={v.path}- className={({ isActive }) =>- `${tabBase} ${isActive ? tabActive : tabInactive}`- }- >- {v.label}- </NavLink>- ))}- </nav>-- <StatusDot status="online" label="Live" />- </header>- )-}diff --git a/dashboard/src/components/molecules/NavBar.css b/dashboard/src/components/molecules/NavBar.cssnew file mode 100644index 00000000..789b25c5--- /dev/null+++ b/dashboard/src/components/molecules/NavBar.css@@ -0,0 +1,28 @@+/* NavBar: spin animation + active tab underline */++@keyframes navbar-spin {+ from {+ transform: rotate(0deg);+ }+ to {+ transform: rotate(360deg);+ }+}++.navbar-icon-btn.spinning {+ animation: navbar-spin 0.6s ease-in-out;+}++.navbar-tab.active::after {+ content: '';+ position: absolute;+ bottom: 0;+ left: 8px;+ right: 8px;+ height: 2px;+ background: var(--color-primary);+ border-radius: 1px;+ box-shadow:+ 0 0 0 1px color-mix(in srgb, var(--color-primary) 38%, transparent),+ 0 0 12px color-mix(in srgb, var(--color-primary) 18%, transparent);+}diff --git a/dashboard/src/components/molecules/NavBar.tsx b/dashboard/src/components/molecules/NavBar.tsxnew file mode 100644index 00000000..be8a3dcf--- /dev/null+++ b/dashboard/src/components/molecules/NavBar.tsx@@ -0,0 +1,96 @@+import { useCallback, useEffect, useRef, useState } from 'react'+import { NavLink } from 'react-router-dom'+import './NavBar.css'++interface Tab {+ id: string+ path: string+ label: string+}++const tabs: Tab[] = [+ { id: 'monitoring', path: '/monitoring', label: 'Monitoring' },+ { id: 'profiles', path: '/profiles', label: 'Profiles' },+ { id: 'agents', path: '/agents', label: 'Agents' },+ { id: 'settings', path: '/settings', label: 'Settings' },+]++interface NavBarProps {+ onRefresh?: () => void+}++export default function NavBar({ onRefresh }: NavBarProps) {+ const [refreshing, setRefreshing] = useState(false)+ const tabsRef = useRef<HTMLElement>(null)++ const handleRefresh = useCallback(() => {+ if (!onRefresh || refreshing) return+ setRefreshing(true)+ onRefresh()+ setTimeout(() => setRefreshing(false), 800)+ }, [onRefresh, refreshing])++ useEffect(() => {+ const handler = (e: KeyboardEvent) => {+ if (!e.metaKey && !e.ctrlKey) return+ const num = parseInt(e.key)+ if (num >= 1 && num <= tabs.length) {+ e.preventDefault()+ window.location.hash = tabs[num - 1].path+ return+ }+ if (e.key === 'r' && onRefresh) {+ e.preventDefault()+ handleRefresh()+ }+ }+ window.addEventListener('keydown', handler)+ return () => window.removeEventListener('keydown', handler)+ }, [onRefresh, handleRefresh])++ return (+ <header className="sticky top-0 z-50 flex h-[52px] items-center gap-0 border-b border-border-subtle bg-bg-app px-4">+ <div className="flex min-w-40 items-center gap-2.5">+ <img+ src={`${import.meta.env.BASE_URL}pinchtab-headed-192.png`}+ alt="PinchTab"+ className="h-6 w-6"+ />+ <span className="text-sm font-semibold tracking-wide text-text-primary">+ PinchTab+ </span>+ </div>++ <nav className="ml-6 flex items-center gap-0.5" ref={tabsRef}>+ {tabs.map((tab, i) => (+ <NavLink+ key={tab.id}+ to={tab.path}+ className={({ isActive }) =>+ `navbar-tab relative cursor-pointer border-none bg-transparent px-3.5 py-3.5 text-sm font-medium leading-none whitespace-nowrap transition-colors duration-150 hover:text-text-primary focus-visible:rounded focus-visible:shadow-[0_0_0_2px_var(--primary)/25] focus-visible:outline-none ${+ isActive ? 'active text-text-primary' : 'text-text-secondary'+ }`+ }+ title={`${tab.label} (⌘${i + 1})`}+ >+ {tab.label}+ </NavLink>+ ))}+ </nav>++ <div className="ml-auto flex items-center gap-1.5">+ {onRefresh && (+ <button+ className={`navbar-icon-btn flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-transparent bg-transparent text-base text-text-muted transition-all duration-150 hover:border-border-subtle hover:bg-bg-elevated hover:text-text-secondary focus-visible:shadow-[0_0_0_2px_var(--primary)/25] focus-visible:outline-none ${+ refreshing ? 'spinning' : ''+ }`}+ onClick={handleRefresh}+ title="Refresh (⌘R)"+ >+ ↻+ </button>+ )}+ </div>+ </header>+ )+}diff --git a/dashboard/src/components/molecules/index.ts b/dashboard/src/components/molecules/index.tsindex 7361440c..e280953a 100644--- a/dashboard/src/components/molecules/index.ts+++ b/dashboard/src/components/molecules/index.ts@@ -1,4 +1,4 @@-export { default as Header } from './Header'+export { default as NavBar } from './NavBar'export { default as ProfileCard } from './ProfileCard'export { default as InstanceCard } from './InstanceCard'export { default as AgentItem } from './AgentItem'diff --git a/dashboard/src/pages/InstancesPage.tsx b/dashboard/src/pages/MonitoringPage.tsxsimilarity index 99%rename from dashboard/src/pages/InstancesPage.tsxrename to dashboard/src/pages/MonitoringPage.tsxindex 59d4e26c..96dc048a 100644--- a/dashboard/src/pages/InstancesPage.tsx+++ b/dashboard/src/pages/MonitoringPage.tsx@@ -8,7 +8,7 @@ import * as api from '../services/api'const POLL_INTERVAL = 30000 // 30 secondsconst MAX_DATA_POINTS = 60 // 30 minutes of data-export default function InstancesPage() {+export default function MonitoringPage() {const { instances, setInstances, setInstancesLoading } = useAppStore()const [selectedId, setSelectedId] = useState<string | null>(null)const [tabsData, setTabsData] = useState<TabDataPoint[]>([])diff --git a/dashboard/src/pages/index.ts b/dashboard/src/pages/index.tsindex a239df5e..ed74329d 100644--- a/dashboard/src/pages/index.ts+++ b/dashboard/src/pages/index.ts@@ -1,4 +1,4 @@+export { default as MonitoringPage } from './MonitoringPage'export { default as ProfilesPage } from './ProfilesPage'-export { default as InstancesPage } from './InstancesPage'export { default as AgentsPage } from './AgentsPage'export { default as SettingsPage } from './SettingsPage'