polish sandbox workflows
This commit is contained in:
+47
-31
@@ -3,7 +3,7 @@
|
||||
interface SidebarProps {
|
||||
sandboxesRunning: number
|
||||
sandboxesTotal: number
|
||||
activeView: 'settings' | 'sandboxes'
|
||||
activeView: 'settings' | 'sandboxes' | 'help' | 'wizards'
|
||||
isCreateMode: boolean
|
||||
isDestroyMode: boolean
|
||||
onSandboxesClick: () => void
|
||||
@@ -11,6 +11,8 @@ interface SidebarProps {
|
||||
onDestroyClick: () => void
|
||||
onTerminalClick: () => void
|
||||
onSettingsClick: () => void
|
||||
onWizardsClick: () => void
|
||||
onHelpClick: () => void
|
||||
onExitMode: () => void
|
||||
onLogout: () => void
|
||||
terminalDisabled?: boolean
|
||||
@@ -27,16 +29,26 @@ export default function Sidebar({
|
||||
onDestroyClick,
|
||||
onTerminalClick,
|
||||
onSettingsClick,
|
||||
onWizardsClick,
|
||||
onHelpClick,
|
||||
onExitMode,
|
||||
onLogout,
|
||||
terminalDisabled = false,
|
||||
}: SidebarProps) {
|
||||
const navItemClass = (active = false, danger = false) => `w-full flex items-center gap-3 px-3 py-2.5 rounded transition-colors ${
|
||||
active
|
||||
? danger
|
||||
? 'bg-[var(--status-stopped)] text-white shadow-[0_10px_28px_rgba(220,38,38,0.18)]'
|
||||
: 'bg-[var(--nvidia-green)] text-black shadow-[0_10px_28px_rgba(118,185,0,0.18)]'
|
||||
: 'hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)] hover:text-[var(--foreground)]'
|
||||
}`
|
||||
|
||||
return (
|
||||
<aside className="fixed left-0 top-0 h-screen w-64 bg-[var(--background-secondary)] border-r border-[var(--border-subtle)] flex flex-col z-20">
|
||||
<div className="p-4 border-b border-[var(--border-subtle)]">
|
||||
<aside className="fixed left-0 top-0 z-20 flex h-screen w-64 flex-col border-r border-[var(--border-subtle)] bg-[var(--background-secondary)]/95 shadow-[12px_0_40px_rgba(0,0,0,0.22)] backdrop-blur lg:w-64 max-lg:bottom-0 max-lg:top-auto max-lg:h-auto max-lg:w-full max-lg:border-r-0 max-lg:border-t max-lg:shadow-[0_-12px_40px_rgba(0,0,0,0.22)]">
|
||||
<div className="p-4 border-b border-[var(--border-subtle)] max-lg:hidden">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-8 h-8 bg-[var(--nvidia-green)] rounded-sm flex items-center justify-center">
|
||||
<svg className="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<div className="w-8 h-8 bg-[var(--nvidia-green)] rounded flex items-center justify-center shadow-[0_0_22px_rgba(118,185,0,0.28)]">
|
||||
<svg className="w-5 h-5 text-black" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M4 7l8-4 8 4v10l-8 4-8-4V7z" />
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M4 7l8 4 8-4M12 11v10" />
|
||||
</svg>
|
||||
@@ -50,14 +62,10 @@ export default function Sidebar({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav className="flex-1 p-2">
|
||||
<nav className="flex-1 p-2 max-lg:grid max-lg:grid-cols-4 max-lg:gap-1 max-lg:overflow-x-auto">
|
||||
<button
|
||||
onClick={onSandboxesClick}
|
||||
className={`w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors ${
|
||||
activeView === 'sandboxes' && !isCreateMode && !isDestroyMode
|
||||
? 'bg-[var(--nvidia-green)] text-white'
|
||||
: 'hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)]'
|
||||
}`}
|
||||
className={navItemClass(activeView === 'sandboxes' && !isCreateMode && !isDestroyMode)}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
|
||||
@@ -67,11 +75,7 @@ export default function Sidebar({
|
||||
|
||||
<button
|
||||
onClick={onCreateClick}
|
||||
className={`mt-1 w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors ${
|
||||
isCreateMode
|
||||
? 'bg-[var(--nvidia-green)] text-white'
|
||||
: 'hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)]'
|
||||
}`}
|
||||
className={`mt-1 max-lg:mt-0 ${navItemClass(isCreateMode)}`}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M12 4v16m8-8H4" />
|
||||
@@ -81,11 +85,7 @@ export default function Sidebar({
|
||||
|
||||
<button
|
||||
onClick={onDestroyClick}
|
||||
className={`mt-1 w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors ${
|
||||
isDestroyMode
|
||||
? 'bg-[var(--status-stopped)] text-white'
|
||||
: 'hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)]'
|
||||
}`}
|
||||
className={`mt-1 max-lg:mt-0 ${navItemClass(isDestroyMode, true)}`}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6M4 7h16" />
|
||||
@@ -96,7 +96,7 @@ export default function Sidebar({
|
||||
<button
|
||||
onClick={onTerminalClick}
|
||||
disabled={terminalDisabled}
|
||||
className="mt-1 w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)] disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
className="mt-1 max-lg:mt-0 w-full flex items-center gap-3 px-3 py-2.5 rounded transition-colors hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)] hover:text-[var(--foreground)] disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M4 17l6-6-6-6m8 14h8" />
|
||||
@@ -107,7 +107,7 @@ export default function Sidebar({
|
||||
{(isCreateMode || isDestroyMode) && (
|
||||
<button
|
||||
onClick={onExitMode}
|
||||
className="mt-1 w-full flex items-center gap-3 px-3 py-2 rounded-sm bg-[var(--background-tertiary)] text-[var(--foreground-dim)] hover:bg-[var(--background-panel)] transition-colors"
|
||||
className="mt-1 w-full flex items-center gap-3 px-3 py-2.5 rounded bg-[var(--background-tertiary)] text-[var(--foreground-dim)] hover:bg-[var(--background-panel)] transition-colors max-lg:col-span-2"
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
|
||||
@@ -118,11 +118,7 @@ export default function Sidebar({
|
||||
|
||||
<button
|
||||
onClick={onSettingsClick}
|
||||
className={`mt-4 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)]'
|
||||
}`}
|
||||
className={`mt-4 max-lg:mt-0 ${navItemClass(activeView === 'settings')}`}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M12 6v6l4 2m5-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
@@ -130,9 +126,29 @@ export default function Sidebar({
|
||||
<span className="text-sm">Inference Endpoints</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={onWizardsClick}
|
||||
className={`mt-1 max-lg:mt-0 ${navItemClass(activeView === 'wizards')}`}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M12 3l2.2 4.8L19 10l-4.8 2.2L12 17l-2.2-4.8L5 10l4.8-2.2L12 3zm6 12l.9 2.1L21 18l-2.1.9L18 21l-.9-2.1L15 18l2.1-.9L18 15z" />
|
||||
</svg>
|
||||
<span className="text-sm">Wizards</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={onHelpClick}
|
||||
className={`mt-1 max-lg:mt-0 ${navItemClass(activeView === 'help')}`}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M9.09 9a3 3 0 115.82 1c-.64.85-1.91 1.26-2.41 2.32V13m-.5 4h.01M12 3a9 9 0 100 18 9 9 0 000-18z" />
|
||||
</svg>
|
||||
<span className="text-sm">Help</span>
|
||||
</button>
|
||||
|
||||
<a
|
||||
href="/setup-account"
|
||||
className="mt-1 w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)]"
|
||||
className="mt-1 max-lg:mt-0 w-full flex items-center gap-3 px-3 py-2.5 rounded transition-colors hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)] hover:text-[var(--foreground)]"
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M12 12a4 4 0 100-8 4 4 0 000 8zm-7 9a7 7 0 0114 0" />
|
||||
@@ -141,10 +157,10 @@ export default function Sidebar({
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<div className="p-2 border-t border-[var(--border-subtle)]">
|
||||
<div className="p-2 border-t border-[var(--border-subtle)] max-lg:hidden">
|
||||
<button
|
||||
onClick={onLogout}
|
||||
className="w-full flex items-center gap-3 px-3 py-2 rounded-sm transition-colors hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)]"
|
||||
className="w-full flex items-center gap-3 px-3 py-2.5 rounded transition-colors hover:bg-[var(--background-tertiary)] text-[var(--foreground-dim)] hover:text-[var(--foreground)]"
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="square" strokeLinejoin="miter" strokeWidth={2} d="M15 12H3m0 0l4-4m-4 4l4 4m5-10h6v12h-6" />
|
||||
|
||||
Reference in New Issue
Block a user