Skip to content

Commit ba8c5c1

Browse files
committed
fix(ui): use shellTool selector
1 parent 9713ac4 commit ba8c5c1

File tree

4 files changed

+35
-20
lines changed

4 files changed

+35
-20
lines changed

web/src/components/memshell/main-config-card.tsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -393,22 +393,31 @@ export default function MainConfigCard({
393393
}}
394394
className="w-full"
395395
>
396-
<div className="relative bg-muted rounded-lg">
397-
<TabsList className="flex flex-wrap gap-1 w-full bg-transparent overflow-x-auto tabs-list">
398-
{shellTools.map((shellTool) => (
399-
<TabsTrigger
400-
key={shellTool}
401-
value={shellTool}
402-
className="flex-1 min-w-24 data-[state=active]:bg-background"
403-
>
404-
<span className="flex items-center gap-2">
405-
{shellToolIcons[shellTool]}
406-
{shellTool}
407-
</span>
408-
</TabsTrigger>
409-
))}
410-
</TabsList>
411-
</div>
396+
<FormField
397+
control={form.control}
398+
name="shellTool"
399+
render={({ field }) => (
400+
<FormItem>
401+
<Select onValueChange={field.onChange} defaultValue={field.value}>
402+
<FormControl>
403+
<SelectTrigger>
404+
<SelectValue />
405+
</SelectTrigger>
406+
</FormControl>
407+
<SelectContent>
408+
{shellTools.map((tool) => (
409+
<SelectItem key={tool} value={tool}>
410+
<span className="flex items-center gap-2">
411+
{shellToolIcons[tool]}
412+
{tool}
413+
</span>
414+
</SelectItem>
415+
))}
416+
</SelectContent>
417+
</Select>
418+
</FormItem>
419+
)}
420+
/>
412421

413422
<GodzillaTabContent form={form} shellTypes={shellTypes} />
414423
<CommandTabContent form={form} shellTypes={shellTypes} />

web/src/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@
160160
body {
161161
@apply bg-background text-foreground;
162162
}
163+
164+
html, body {
165+
overflow: hidden;
166+
height: 100%;
167+
margin: 0;
168+
}
163169
}
164170

165171
.tabs-list {

web/src/pages/memshell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default function MemShellPage() {
129129
onSubmit={form.handleSubmit(onSubmit)}
130130
className="flex flex-col xl:flex-row gap-6"
131131
>
132-
<div className="w-full xl:w-1/2 space-y-4">
132+
<div className="w-full xl:w-1/2 flex flex-col gap-2">
133133
<MainConfigCard
134134
servers={serverConfig}
135135
mainConfig={mainConfig}
@@ -145,7 +145,7 @@ export default function MemShellPage() {
145145
{t("memshell:buttons.generate")}
146146
</Button>
147147
</div>
148-
<div className="w-full xl:w-1/2 space-y-4">
148+
<div className="w-full xl:w-1/2 flex flex-col gap-4">
149149
<ShellResult
150150
packMethod={packMethod}
151151
generateResult={generateResult}

web/src/pages/probeshell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default function ProbeShellGenerator() {
107107
onSubmit={form.handleSubmit(onSubmit)}
108108
className="flex flex-col xl:flex-row gap-6"
109109
>
110-
<div className="w-full xl:w-1/2 space-y-4">
110+
<div className="w-full xl:w-1/2 flex flex-col gap-4">
111111
<MainConfigCard form={form} servers={serverConfig} />
112112
<PackageConfigCard form={form} packerConfig={packerConfig} />
113113
<Button className="w-full" type="submit" disabled={isActionPending}>
@@ -119,7 +119,7 @@ export default function ProbeShellGenerator() {
119119
{t("probeshell:buttons.generate")}
120120
</Button>
121121
</div>
122-
<div className="w-full xl:w-1/2 space-y-4">
122+
<div className="w-full xl:w-1/2 flex flex-col gap-4">
123123
<ShellResult
124124
packMethod={packMethod}
125125
generateResult={generateResult}

0 commit comments

Comments
 (0)