mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-29 19:06:37 +00:00
Update terminal-panel.tsx
This commit is contained in:
@@ -656,13 +656,7 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleKeyButton = (key: string, e?: React.MouseEvent | React.TouchEvent) => {
|
const handleKeyButton = (key: string) => {
|
||||||
// Prevenir comportamientos por defecto del navegador
|
|
||||||
if (e) {
|
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
}
|
|
||||||
|
|
||||||
const activeTerminal = terminals.find((t) => t.id === activeTerminalId)
|
const activeTerminal = terminals.find((t) => t.id === activeTerminalId)
|
||||||
if (!activeTerminal || !activeTerminal.ws || activeTerminal.ws.readyState !== WebSocket.OPEN) return
|
if (!activeTerminal || !activeTerminal.ws || activeTerminal.ws.readyState !== WebSocket.OPEN) return
|
||||||
|
|
||||||
@@ -930,11 +924,7 @@ const handleClose = () => {
|
|||||||
{(isMobile || isTablet) && (
|
{(isMobile || isTablet) && (
|
||||||
<div className="flex gap-1.5 justify-center items-center px-1 bg-zinc-900 text-sm rounded-b-md border-t border-zinc-700 py-1.5">
|
<div className="flex gap-1.5 justify-center items-center px-1 bg-zinc-900 text-sm rounded-b-md border-t border-zinc-700 py-1.5">
|
||||||
<Button
|
<Button
|
||||||
onPointerDown={(e) => {
|
onClick={() => sendSequence("\x1b")}
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
sendSequence("\x1b", e)
|
|
||||||
}}
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-2.5 text-xs"
|
className="h-8 px-2.5 text-xs"
|
||||||
@@ -942,11 +932,7 @@ const handleClose = () => {
|
|||||||
ESC
|
ESC
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onPointerDown={(e) => {
|
onClick={() => sendSequence("\t")}
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
sendSequence("\t", e)
|
|
||||||
}}
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-2.5 text-xs"
|
className="h-8 px-2.5 text-xs"
|
||||||
@@ -954,11 +940,7 @@ const handleClose = () => {
|
|||||||
TAB
|
TAB
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onPointerDown={(e) => {
|
onClick={() => handleKeyButton("UP")}
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
handleKeyButton("UP", e)
|
|
||||||
}}
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-3 text-xs"
|
className="h-8 px-3 text-xs"
|
||||||
@@ -966,11 +948,7 @@ const handleClose = () => {
|
|||||||
↑
|
↑
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onPointerDown={(e) => {
|
onClick={() => handleKeyButton("DOWN")}
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
handleKeyButton("DOWN", e)
|
|
||||||
}}
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-3 text-xs"
|
className="h-8 px-3 text-xs"
|
||||||
@@ -978,11 +956,7 @@ const handleClose = () => {
|
|||||||
↓
|
↓
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onPointerDown={(e) => {
|
onClick={() => handleKeyButton("LEFT")}
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
handleKeyButton("LEFT", e)
|
|
||||||
}}
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-3 text-xs"
|
className="h-8 px-3 text-xs"
|
||||||
@@ -990,11 +964,7 @@ const handleClose = () => {
|
|||||||
←
|
←
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onPointerDown={(e) => {
|
onClick={() => handleKeyButton("RIGHT")}
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
handleKeyButton("RIGHT", e)
|
|
||||||
}}
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-3 text-xs"
|
className="h-8 px-3 text-xs"
|
||||||
@@ -1002,11 +972,7 @@ const handleClose = () => {
|
|||||||
→
|
→
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onPointerDown={(e) => {
|
onClick={() => handleKeyButton("ENTER")}
|
||||||
e.preventDefault()
|
|
||||||
e.stopPropagation()
|
|
||||||
handleKeyButton("ENTER", e)
|
|
||||||
}}
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-8 px-2 text-xs bg-blue-600/20 hover:bg-blue-600/30 border-blue-600/50 text-blue-400"
|
className="h-8 px-2 text-xs bg-blue-600/20 hover:bg-blue-600/30 border-blue-600/50 text-blue-400"
|
||||||
|
|||||||
Reference in New Issue
Block a user