Update terminal panel

This commit is contained in:
MacRimi
2026-01-31 17:40:08 +01:00
parent 3c3c902087
commit 82cac690fa
4 changed files with 34 additions and 31 deletions

View File

@@ -342,31 +342,9 @@ export function LxcTerminalModal({
{/* Header */} {/* Header */}
<div className="flex items-center justify-between px-4 py-2 bg-zinc-900 border-b border-zinc-800"> <div className="flex items-center justify-between px-4 py-2 bg-zinc-900 border-b border-zinc-800">
<div className="flex items-center gap-3">
<DialogTitle className="text-sm font-medium text-white"> <DialogTitle className="text-sm font-medium text-white">
Terminal: {vmName} (ID: {vmid}) Terminal: {vmName} (ID: {vmid})
</DialogTitle> </DialogTitle>
<div className="flex items-center gap-1.5">
<Activity
className={`h-3.5 w-3.5 ${
connectionStatus === "online"
? "text-green-500"
: connectionStatus === "connecting"
? "text-yellow-500 animate-pulse"
: "text-red-500"
}`}
/>
<span className="text-xs text-zinc-400 capitalize">{connectionStatus}</span>
</div>
</div>
<Button
variant="ghost"
size="sm"
onClick={onClose}
className="h-7 w-7 p-0 text-zinc-400 hover:text-white hover:bg-zinc-800"
>
<X className="h-4 w-4" />
</Button>
</div> </div>
{/* Terminal container */} {/* Terminal container */}
@@ -452,6 +430,30 @@ export function LxcTerminalModal({
</div> </div>
</div> </div>
)} )}
{/* Status bar at bottom */}
<div className="flex items-center justify-between px-4 py-2 bg-zinc-900 border-t border-zinc-800">
<div className="flex items-center gap-3">
<Activity className="h-5 w-5 text-blue-500" />
<div
className={`w-2 h-2 rounded-full ${
connectionStatus === "online"
? "bg-green-500"
: connectionStatus === "connecting"
? "bg-yellow-500 animate-pulse"
: "bg-red-500"
}`}
/>
<span className="text-xs text-zinc-400 capitalize">{connectionStatus}</span>
</div>
<Button
onClick={onClose}
variant="outline"
className="bg-red-600/20 hover:bg-red-600/30 border-red-600/50 text-red-400"
>
Close
</Button>
</div>
</DialogContent> </DialogContent>
</Dialog> </Dialog>
) )

View File

@@ -787,7 +787,7 @@ export function ScriptTerminalModal({
<Button <Button
onClick={handleCloseModal} onClick={handleCloseModal}
variant="outline" variant="outline"
className="bg-red-600 hover:bg-red-700 border-red-500 text-white" className="bg-red-600/20 hover:bg-red-600/30 border-red-600/50 text-red-400"
> >
Close Close
</Button> </Button>

View File

@@ -755,7 +755,7 @@ const handleClose = () => {
variant="outline" variant="outline"
size="sm" size="sm"
disabled={terminals.length >= 4} disabled={terminals.length >= 4}
className="h-8 gap-2 bg-green-600 hover:bg-green-700 border-green-500 text-white disabled:opacity-50" className="h-8 gap-2 bg-green-600/20 hover:bg-green-600/30 border-green-600/50 text-green-400 disabled:opacity-50"
> >
<Plus className="h-4 w-4" /> <Plus className="h-4 w-4" />
<span className="hidden sm:inline">New</span> <span className="hidden sm:inline">New</span>
@@ -765,7 +765,7 @@ const handleClose = () => {
variant="outline" variant="outline"
size="sm" size="sm"
disabled={!activeTerminal?.isConnected} disabled={!activeTerminal?.isConnected}
className="h-8 gap-2 bg-blue-600 hover:bg-blue-700 border-blue-500 text-white disabled:opacity-50" className="h-8 gap-2 bg-blue-600/20 hover:bg-blue-600/30 border-blue-600/50 text-blue-400 disabled:opacity-50"
> >
<Search className="h-4 w-4" /> <Search className="h-4 w-4" />
<span className="hidden sm:inline">Search</span> <span className="hidden sm:inline">Search</span>
@@ -775,7 +775,7 @@ const handleClose = () => {
variant="outline" variant="outline"
size="sm" size="sm"
disabled={!activeTerminal?.isConnected} disabled={!activeTerminal?.isConnected}
className="h-8 gap-2 bg-yellow-600 hover:bg-yellow-700 border-yellow-500 text-white disabled:opacity-50" className="h-8 gap-2 bg-yellow-600/20 hover:bg-yellow-600/30 border-yellow-600/50 text-yellow-400 disabled:opacity-50"
> >
<Trash2 className="h-4 w-4" /> <Trash2 className="h-4 w-4" />
<span className="hidden sm:inline">Clear</span> <span className="hidden sm:inline">Clear</span>
@@ -784,7 +784,7 @@ const handleClose = () => {
onClick={handleClose} onClick={handleClose}
variant="outline" variant="outline"
size="sm" size="sm"
className="h-8 gap-2 bg-red-600 hover:bg-red-700 border-red-500 text-white" className="h-8 gap-2 bg-red-600/20 hover:bg-red-600/30 border-red-600/50 text-red-400"
> >
<X className="h-4 w-4" /> <X className="h-4 w-4" />
<span className="hidden sm:inline">Close</span> <span className="hidden sm:inline">Close</span>

View File

@@ -258,8 +258,9 @@ def lxc_terminal_websocket(ws, vmid):
master_fd, slave_fd = pty.openpty() master_fd, slave_fd = pty.openpty()
# Start pct enter directly to connect to the LXC container # Start pct enter directly to connect to the LXC container
# pct is located in /usr/sbin on Proxmox VE
shell_process = subprocess.Popen( shell_process = subprocess.Popen(
['/usr/bin/pct', 'enter', str(vmid)], ['/usr/sbin/pct', 'enter', str(vmid)],
stdin=slave_fd, stdin=slave_fd,
stdout=slave_fd, stdout=slave_fd,
stderr=slave_fd, stderr=slave_fd,