Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
"use client";
import { useEffect, useRef, useState } from "react";
import { Trash2 } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Switch } from "@/components/ui/switch";
import { deleteVariable, listVariables, setVariable } from "../lib/api";
export function WorkflowVariablePanel(){const[rows,setRows]=useState<Awaited<ReturnType<typeof listVariables>>>([]),[key,setKey]=useState(""),[value,setValue]=useState(""),[secret,setSecret]=useState(false),[error,setError]=useState(""),[busy,setBusy]=useState(false);const pending=useRef(false);const load=async()=>setRows(await listVariables());useEffect(()=>{let cancelled=false;void listVariables().then((v)=>{if(!cancelled)setRows(v);}).catch((e)=>{if(!cancelled)setError(e instanceof Error?e.message:"Could not load variables");});return()=>{cancelled=true;};},[]);const save=async()=>{if(pending.current)return;pending.current=true;setBusy(true);setError("");try{let parsed:unknown=value;try{parsed=JSON.parse(value);}catch{}await setVariable(key.toUpperCase(),parsed,secret);setKey("");setValue("");setSecret(false);await load();}catch(e){setError(e instanceof Error?e.message:"Save failed");}finally{pending.current=false;setBusy(false);}};const remove=async(name:string)=>{if(pending.current||!window.confirm(`Delete variable ${name}?`))return;pending.current=true;setBusy(true);setError("");try{await deleteVariable(name);await load();}catch(e){setError(e instanceof Error?e.message:"Delete failed");}finally{pending.current=false;setBusy(false);}};return <ScrollArea className="h-full"><div className="space-y-3 p-3"><div><div className="text-xs font-semibold">Private variables</div><p className="mt-1 text-[10px] text-muted-foreground">Use {`{"$var":"KEY"}`} in node config. Secret values are never returned by the API.</p></div><Input aria-label="Variable key" placeholder="KEY" value={key} onChange={(e)=>setKey(e.target.value.toUpperCase())}/><Input aria-label="Variable value" type={secret?"password":"text"} placeholder="Value or JSON" value={value} onChange={(e)=>setValue(e.target.value)}/><label className="flex items-center justify-between text-xs"><span>Secret</span><Switch checked={secret} onCheckedChange={setSecret}/></label><Button size="sm" disabled={busy||!key||!value} onClick={()=>void save()}>Save variable</Button>{error&&<p className="text-xs text-destructive">{error}</p>}<div className="space-y-1">{rows.map((row)=><div key={row.key} className="flex items-center justify-between rounded border p-2"><div><div className="text-xs font-medium">{row.key}</div><div className="text-[10px] text-muted-foreground">{row.secret?"secret":JSON.stringify(row.value)}</div></div><Button size="icon" variant="ghost" disabled={busy} aria-label={`Delete variable ${row.key}`} title={`Delete variable ${row.key}`} onClick={()=>void remove(row.key)}><Trash2 className="size-3"/></Button></div>)}</div></div></ScrollArea>;}