feat: flesh out overview and settings views

- wire settings and overview sidebar buttons to real views
- render policy editor for existing sandboxes below telemetry
- add overview summary panel and preset ladder
- reuse preset-driven config panel in global settings view
This commit is contained in:
Mark McKeen
2026-03-29 08:59:06 -06:00
parent 22998e6da7
commit 38b71883ce
3 changed files with 124 additions and 36 deletions
+38 -33
View File
@@ -1,5 +1,6 @@
"use client"
import { useState, useEffect } from 'react'
import ConfigurationPanel from './ConfigurationPanel'
interface Sandbox {
id: string
@@ -165,45 +166,49 @@ export default function SandboxList({
{/* Selected Sandbox Details - Technical Data Panel */}
{!isDestroyMode && selectedSandbox && (
<div className="panel p-6">
<div className="flex items-center justify-between mb-6 pb-4 border-b border-[var(--border-subtle)]">
<h4 className="text-sm font-semibold text-[var(--foreground)] uppercase tracking-wider">
{sandboxes.find(s => s.id === selectedSandbox)?.name} — TELEMETRY
</h4>
<span className="text-[10px] text-[var(--foreground-dim)] font-mono">
LIVE
</span>
</div>
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">CPU</p>
<p className="text-2xl font-mono text-[var(--nvidia-green)] mt-1">
{telemetry.cpu.toFixed(1)}%
</p>
<>
<div className="panel p-6">
<div className="flex items-center justify-between mb-6 pb-4 border-b border-[var(--border-subtle)]">
<h4 className="text-sm font-semibold text-[var(--foreground)] uppercase tracking-wider">
{sandboxes.find(s => s.id === selectedSandbox)?.name} — TELEMETRY
</h4>
<span className="text-[10px] text-[var(--foreground-dim)] font-mono">
LIVE
</span>
</div>
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">MEMORY</p>
<p className="text-2xl font-mono text-[var(--nvidia-green)] mt-1">
{telemetry.memory.toFixed(1)}%
</p>
</div>
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">DISK</p>
<p className="text-2xl font-mono text-[var(--nvidia-green)] mt-1">
{telemetry.disk.toFixed(1)}%
</p>
</div>
{telemetry.gpuTemperature && (
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">GPU TEMP</p>
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">CPU</p>
<p className="text-2xl font-mono text-[var(--nvidia-green)] mt-1">
{telemetry.gpuTemperature.toFixed(1)}°C
{telemetry.cpu.toFixed(1)}%
</p>
</div>
)}
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">MEMORY</p>
<p className="text-2xl font-mono text-[var(--nvidia-green)] mt-1">
{telemetry.memory.toFixed(1)}%
</p>
</div>
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">DISK</p>
<p className="text-2xl font-mono text-[var(--nvidia-green)] mt-1">
{telemetry.disk.toFixed(1)}%
</p>
</div>
{telemetry.gpuTemperature && (
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">GPU TEMP</p>
<p className="text-2xl font-mono text-[var(--nvidia-green)] mt-1">
{telemetry.gpuTemperature.toFixed(1)}°C
</p>
</div>
)}
</div>
</div>
</div>
<ConfigurationPanel sandboxId={selectedSandbox} mode="existing" />
</>
)}
</>
)}
+20 -2
View File
@@ -16,8 +16,11 @@ interface SidebarProps {
onToggleSubmenu: () => void
isCreateMode: boolean
isDestroyMode: boolean
activeView: 'overview' | 'settings' | 'sandboxes'
onCreateClick: () => void
onDestroyClick: () => void
onOverviewClick: () => void
onSettingsClick: () => void
onExitMode: () => void
}
@@ -29,8 +32,11 @@ export default function Sidebar({
onToggleSubmenu,
isCreateMode,
isDestroyMode,
activeView,
onCreateClick,
onDestroyClick,
onOverviewClick,
onSettingsClick,
onExitMode
}: SidebarProps) {
const [sandboxes, setSandboxes] = useState<Sandbox[]>([])
@@ -158,14 +164,26 @@ export default function Sidebar({
</button>
)}
<button className="w-full flex items-center gap-3 px-3 py-2 rounded-sm hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)] transition-colors">
<button
onClick={onSettingsClick}
className={`w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors ${
activeView === 'settings'
? 'bg-[var(--nvidia-green)] text-white'
: 'hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)]'
}`}>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
<span className="text-sm">Settings</span>
</button>
<button className="w-full flex items-center gap-3 px-3 py-2 rounded-sm hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)] transition-colors">
<button
onClick={onOverviewClick}
className={`w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors ${
activeView === 'overview'
? 'bg-[var(--nvidia-green)] text-white'
: 'hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)]'
}`}>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
+66 -1
View File
@@ -11,6 +11,7 @@ export default function Dashboard() {
const [selectedSandbox, setSelectedSandbox] = useState<string | null>(null)
const [isCreateMode, setIsCreateMode] = useState(false)
const [isDestroyMode, setIsDestroyMode] = useState(false)
const [activeView, setActiveView] = useState<'overview' | 'settings' | 'sandboxes'>('sandboxes')
const [deletingSandboxId, setDeletingSandboxId] = useState<string | null>(null)
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false)
@@ -61,17 +62,34 @@ export default function Dashboard() {
}}
isCreateMode={isCreateMode}
isDestroyMode={isDestroyMode}
activeView={activeView}
onCreateClick={() => {
setActiveView('sandboxes')
setIsCreateMode(true)
setIsDestroyMode(false)
setSelectedSandbox(null)
setIsSubmenuOpen(true)
}}
onDestroyClick={() => {
setActiveView('sandboxes')
setIsDestroyMode(true)
setIsCreateMode(false)
setIsSubmenuOpen(true)
}}
onOverviewClick={() => {
setActiveView('overview')
setIsCreateMode(false)
setIsDestroyMode(false)
setSelectedSandbox(null)
setIsSubmenuOpen(false)
}}
onSettingsClick={() => {
setActiveView('settings')
setIsCreateMode(false)
setIsDestroyMode(false)
setSelectedSandbox(null)
setIsSubmenuOpen(false)
}}
onExitMode={() => {
setIsCreateMode(false)
setIsDestroyMode(false)
@@ -83,7 +101,54 @@ export default function Dashboard() {
<main className="ml-64 transition-all duration-300">
<div className={isSubmenuOpen ? 'ml-72' : ''}>
<div className="p-8">
{isCreateMode ? (
{activeView === 'overview' ? (
<div className="space-y-6">
<div className="panel p-8">
<h1 className="text-lg font-semibold text-[var(--nvidia-green)] uppercase tracking-wider mb-4">
OVERVIEW
</h1>
<p className="text-sm text-[var(--foreground-dim)] mb-6">
Operational summary of the current OpenShell environment and preset posture.
</p>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">HOST</p>
<p className="text-lg font-mono text-[var(--nvidia-green)] mt-2">{hostIP}</p>
</div>
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">VIEW</p>
<p className="text-lg font-mono text-[var(--foreground)] mt-2">OVERVIEW</p>
</div>
<div className="metric p-4">
<p className="text-[10px] text-[var(--foreground-dim)] uppercase tracking-wider">STATUS</p>
<p className="text-lg font-mono text-[var(--nvidia-green)] mt-2">ONLINE</p>
</div>
</div>
</div>
<div className="panel p-8">
<h2 className="text-sm font-semibold text-[var(--foreground)] uppercase tracking-wider mb-4">Preset Ladder</h2>
<div className="space-y-3 text-sm text-[var(--foreground-dim)]">
<p><span className="text-[var(--foreground)] font-mono">Lockdown Mode</span> → minimum writable scope</p>
<p><span className="text-[var(--foreground)] font-mono">Enterprise Mode</span> → controlled enterprise defaults</p>
<p><span className="text-[var(--foreground)] font-mono">Medium-Spicy</span> → balanced dev workflow</p>
<p><span className="text-[var(--foreground)] font-mono">Spicy</span> → broad engineering access, dangerous if misused</p>
<p><span className="text-[var(--foreground)] font-mono">Ultra-Lobster</span> → maximum lab convenience, highly permissive</p>
</div>
</div>
</div>
) : activeView === 'settings' ? (
<div className="space-y-6">
<div className="panel p-8">
<h1 className="text-lg font-semibold text-[var(--nvidia-green)] uppercase tracking-wider mb-4">
SETTINGS
</h1>
<p className="text-sm text-[var(--foreground-dim)] mb-6">
Global defaults and preset-driven policy controls for this dashboard instance.
</p>
</div>
<ConfigurationPanel sandboxId="global-settings" mode="create" />
</div>
) : isCreateMode ? (
<div className="space-y-6">
<div className="panel p-8">
<h1 className="text-lg font-semibold text-[var(--nvidia-green)] uppercase tracking-wider mb-4">