Skip to content

Commit f795cd4

Browse files
terminal ui
1 parent df8ada4 commit f795cd4

3 files changed

Lines changed: 141 additions & 442 deletions

File tree

Lines changed: 14 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use client'
22

3-
import { AppWindow, PanelTopOpen, Sparkles, TerminalSquare } from 'lucide-react'
3+
import { ExternalLink } from 'lucide-react'
44
import { InstanceTerminalWorkspace } from '@/components/instances/instance-terminal-workspace'
5-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
65
import { buttonVariants } from '@/components/ui/button'
76
import type { Instance } from '@/types/instance'
87

@@ -15,102 +14,20 @@ export function InstanceDashboard({ instance }: { instance: Instance }) {
1514
: null
1615

1716
return (
18-
<section className="flex min-h-[calc(100dvh-12rem)] flex-col gap-4">
19-
<div className="relative overflow-hidden rounded-[1.75rem] border border-border/70 bg-card/80 p-5 backdrop-blur">
20-
<div className="absolute inset-x-0 top-0 h-28 bg-[radial-gradient(circle_at_top_left,rgba(16,185,129,0.14),transparent_52%),radial-gradient(circle_at_top_right,rgba(59,130,246,0.12),transparent_45%)]" />
21-
<div className="relative flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
22-
<div className="space-y-3">
23-
<div className="inline-flex items-center gap-2 text-xs font-medium uppercase tracking-[0.2em] text-muted-foreground">
24-
<Sparkles className="h-3.5 w-3.5 text-primary" />
25-
Embedded workspace
26-
</div>
27-
<div className="space-y-1">
28-
<h2 className="text-xl font-semibold tracking-tight">Instance dashboard</h2>
29-
<p className="max-w-2xl text-sm text-muted-foreground">
30-
The terminal workspace is the reliable default here, and the raw Control UI is still one click away when you need it.
31-
</p>
32-
</div>
33-
</div>
34-
35-
{dashboardUrl && (
36-
<a
37-
href={dashboardUrl}
38-
target="_blank"
39-
rel="noopener noreferrer"
40-
className={buttonVariants({ variant: 'outline', size: 'sm' })}
41-
>
42-
<PanelTopOpen className="h-4 w-4" />
43-
Open Control UI
44-
</a>
45-
)}
46-
</div>
47-
</div>
48-
49-
<Tabs defaultValue="terminal" className="gap-4">
50-
<TabsList
51-
variant="line"
52-
className="h-auto w-fit rounded-2xl border border-border/70 bg-card/70 p-1"
17+
<section className="flex flex-col gap-4">
18+
<InstanceTerminalWorkspace instance={instance} />
19+
20+
{dashboardUrl && (
21+
<a
22+
href={dashboardUrl}
23+
target="_blank"
24+
rel="noopener noreferrer"
25+
className={buttonVariants({ variant: 'outline', size: 'sm', className: 'w-fit' })}
5326
>
54-
<TabsTrigger value="terminal" className="px-3 py-2">
55-
<TerminalSquare className="h-4 w-4" />
56-
Terminal workspace
57-
</TabsTrigger>
58-
{dashboardUrl && (
59-
<TabsTrigger value="control" className="px-3 py-2">
60-
<AppWindow className="h-4 w-4" />
61-
Control UI
62-
</TabsTrigger>
63-
)}
64-
</TabsList>
65-
66-
<TabsContent value="terminal">
67-
<InstanceTerminalWorkspace
68-
instance={instance}
69-
showHero={false}
70-
showSummaryCards={false}
71-
/>
72-
</TabsContent>
73-
74-
{dashboardUrl && (
75-
<TabsContent value="control">
76-
<div className="space-y-4">
77-
<div className="flex flex-col gap-3 rounded-2xl border border-border/70 bg-card/70 p-4 backdrop-blur sm:flex-row sm:items-center sm:justify-between">
78-
<div className="space-y-1">
79-
<div className="inline-flex items-center gap-2 text-xs font-medium uppercase tracking-[0.2em] text-muted-foreground">
80-
<AppWindow className="h-3.5 w-3.5 text-primary" />
81-
Raw instance UI
82-
</div>
83-
<div>
84-
<h3 className="text-lg font-semibold tracking-tight">OpenClaw Control UI</h3>
85-
<p className="text-sm text-muted-foreground">
86-
This is the app that runs inside the instance itself. If its frontend assets are missing, the terminal workspace tab remains fully usable.
87-
</p>
88-
</div>
89-
</div>
90-
<a
91-
href={dashboardUrl}
92-
target="_blank"
93-
rel="noopener noreferrer"
94-
className={buttonVariants({ variant: 'outline', size: 'sm' })}
95-
>
96-
<PanelTopOpen className="h-4 w-4" />
97-
Open in new tab
98-
</a>
99-
</div>
100-
101-
<div className="relative flex min-h-0 flex-1 overflow-hidden rounded-[1.5rem] border border-border/80 bg-card shadow-sm">
102-
<div className="pointer-events-none absolute inset-x-0 top-0 z-10 h-16 bg-gradient-to-b from-background/10 to-transparent" />
103-
<iframe
104-
src={dashboardUrl}
105-
className="h-full min-h-[calc(100dvh-20rem)] w-full flex-1 bg-background"
106-
title="OpenClaw Control UI"
107-
allow="clipboard-read; clipboard-write"
108-
/>
109-
</div>
110-
</div>
111-
</TabsContent>
112-
)}
113-
</Tabs>
27+
<ExternalLink className="h-4 w-4" />
28+
Open Control UI
29+
</a>
30+
)}
11431
</section>
11532
)
11633
}

src/components/instances/instance-tabs.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { cn } from '@/lib/utils'
66

77
const tabs = [
88
{ label: 'Overview', href: '' },
9-
{ label: 'Dashboard', href: '/dashboard' },
109
{ label: 'Terminal', href: '/terminal' },
1110
{ label: 'Settings', href: '/settings' },
1211
{ label: 'Usage', href: '/usage' },

0 commit comments

Comments
 (0)