diff --git a/AppImage/components/terminal-panel.tsx b/AppImage/components/terminal-panel.tsx index 369d608..2c32bca 100644 --- a/AppImage/components/terminal-panel.tsx +++ b/AppImage/components/terminal-panel.tsx @@ -134,7 +134,7 @@ const proxmoxCommands = [ export const TerminalPanel: React.FC = ({ websocketUrl, onClose }) => { const [terminals, setTerminals] = useState([]) const [activeTerminalId, setActiveTerminalId] = useState("") - const [layout, setLayout] = useState<"single" | "grid">("single") + const [layout, setLayout] = useState<"single" | "vertical" | "horizontal" | "grid">("single") const [isMobile, setIsMobile] = useState(false) const [terminalHeight, setTerminalHeight] = useState(500) // altura por defecto en px const [isResizing, setIsResizing] = useState(false) @@ -538,7 +538,8 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl const getLayoutClass = () => { const count = terminals.length if (isMobile || count === 1) return "grid grid-cols-1" - if (layout === "single") return "grid grid-cols-1" + if (layout === "vertical" || count === 2) return "grid grid-cols-2" + if (layout === "horizontal") return "grid grid-rows-2" if (layout === "grid" || count >= 3) return "grid grid-cols-2 grid-rows-2" return "grid grid-cols-1" } @@ -561,20 +562,26 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl {!isMobile && terminals.length > 1 && ( <> + @@ -622,7 +629,10 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl -
+
{isMobile ? ( @@ -648,6 +658,7 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl
(containerRefs.current[terminal.id] = el)} className="w-full h-full bg-black overflow-hidden" + style={{ height: "calc(100vh - 24rem)" }} /> ))} @@ -655,38 +666,41 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl ) : (
{terminals.map((terminal) => ( -
-
- {terminal.title} +
+
-
-
(containerRefs.current[terminal.id] = el)} - className="flex-1 w-full bg-black overflow-hidden" - /> - {!isMobile && layout === "single" && ( -
setActiveTerminalId(terminal.id)} + className={`text-xs font-medium ${ + activeTerminalId === terminal.id ? "text-blue-400" : "text-zinc-500" }`} - title="Arrastra para redimensionar" > - -
- )} + {terminal.title} + + {terminals.length > 1 && ( + + )} +
+
(containerRefs.current[terminal.id] = el)} className="w-full h-full bg-black pt-7" />
))}
)}
+ {!isMobile && ( +
+ +
+ )} + {isMobile && (
{lastKeyPressed && (