From c61d676dfb435a88b548af2dd72bce3150b03b6e Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sat, 22 Nov 2025 21:26:35 +0100 Subject: [PATCH] Update terminal-panel.tsx --- AppImage/components/terminal-panel.tsx | 666 +++++++++++++------------ 1 file changed, 342 insertions(+), 324 deletions(-) diff --git a/AppImage/components/terminal-panel.tsx b/AppImage/components/terminal-panel.tsx index 8dc8e97..5c7c075 100644 --- a/AppImage/components/terminal-panel.tsx +++ b/AppImage/components/terminal-panel.tsx @@ -318,7 +318,14 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl term.loadAddon(fitAddon) term.open(container) - fitAddon.fit() + + setTimeout(() => { + const xtermViewport = container.querySelector(".xterm-viewport") as HTMLElement + const xtermScreen = container.querySelector(".xterm-screen") as HTMLElement + if (xtermViewport) xtermViewport.style.padding = "0" + if (xtermScreen) xtermScreen.style.padding = "0" + fitAddon.fit() + }, 10) const wsUrl = websocketUrl || getWebSocketUrl() const ws = new WebSocket(wsUrl) @@ -455,349 +462,360 @@ export const TerminalPanel: React.FC = ({ websocketUrl, onCl const activeTerminal = terminals.find((t) => t.id === activeTerminalId) return ( -
-
-
- -
- {terminals.length} / 4 terminals + <> + + +
+
+
+ +
+ {terminals.length} / 4 terminals +
+ +
+ {!isMobile && terminals.length > 1 && ( + <> + + + + + )} + + + + +
-
- {!isMobile && terminals.length > 1 && ( - <> - - - - - )} - - - - -
-
- -
- {isMobile ? ( - - - {terminals.map((terminal) => ( - - {terminal.title} - {terminals.length > 1 && ( - - )} - - ))} - - {terminals.map((terminal) => ( - -
- - ))} - - ) : ( -
- {terminals.map((terminal) => ( -
-
- - {terminals.length > 1 && ( - + )} + + ))} + + {terminals.map((terminal) => ( + +
+ + ))} + + ) : ( +
+ {terminals.map((terminal) => ( +
+
+ - )} + {terminals.length > 1 && ( + + )} +
+
-
-
- ))} + ))} +
+ )} +
+ + {isMobile && ( +
+ {lastKeyPressed && ( + + Sent: {lastKeyPressed} + + )} + + + + + + +
)} -
- {isMobile && ( -
- {lastKeyPressed && ( - - Sent: {lastKeyPressed} - - )} - - - - - - - -
- )} - - - - - Search Commands -
-
-
- - - Search for Linux and Proxmox commands - -
-
- - setSearchQuery(e.target.value)} - className="pl-10 bg-zinc-900 border-zinc-700 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 text-base" - autoCapitalize="none" - autoComplete="off" - autoCorrect="off" - spellCheck={false} - /> -
- - {isSearching && ( -
-
-

Searching cheat.sh...

+ + + + Search Commands +
+
- )} + -
- {searchResults.length > 0 ? ( - <> - {searchResults.map((result, index) => ( + Search for Linux and Proxmox commands + +
+
+ + setSearchQuery(e.target.value)} + className="pl-10 bg-zinc-900 border-zinc-700 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 text-base" + autoCapitalize="none" + autoComplete="off" + autoCorrect="off" + spellCheck={false} + /> +
+ + {isSearching && ( +
+
+

Searching cheat.sh...

+
+ )} + +
+ {searchResults.length > 0 ? ( + <> + {searchResults.map((result, index) => ( +
+ {result.description && ( +

# {result.description}

+ )} +
sendToActiveTerminal(result.command)} + className="flex items-start justify-between gap-2 cursor-pointer group hover:bg-zinc-800/50 rounded p-2 -m-2" + > + {result.command} + +
+
+ ))} + + {/* Powered by cheat.sh */} +
+

+ + Powered by cheat.sh +

+
+ + ) : filteredCommands.length > 0 && !useOnline ? ( + filteredCommands.map((item, index) => (
sendToActiveTerminal(item.cmd)} + className="p-3 rounded-lg border border-zinc-700 bg-zinc-800/50 hover:bg-zinc-800 hover:border-blue-500 cursor-pointer transition-colors" > - {result.description && ( -

# {result.description}

- )} -
sendToActiveTerminal(result.command)} - className="flex items-start justify-between gap-2 cursor-pointer group hover:bg-zinc-800/50 rounded p-2 -m-2" - > - {result.command} - +
+
+ {item.cmd} +

{item.desc}

+
+
- ))} - - {/* Powered by cheat.sh */} -
-

- - Powered by cheat.sh -

-
- - ) : filteredCommands.length > 0 && !useOnline ? ( - filteredCommands.map((item, index) => ( -
sendToActiveTerminal(item.cmd)} - className="p-3 rounded-lg border border-zinc-700 bg-zinc-800/50 hover:bg-zinc-800 hover:border-blue-500 cursor-pointer transition-colors" - > -
-
- {item.cmd} -

{item.desc}

+ )) + ) : !isSearching && !searchQuery && !useOnline ? ( + proxmoxCommands.map((item, index) => ( +
sendToActiveTerminal(item.cmd)} + className="p-3 rounded-lg border border-zinc-700 bg-zinc-800/50 hover:bg-zinc-800 hover:border-blue-500 cursor-pointer transition-colors" + > +
+
+ {item.cmd} +

{item.desc}

+
+
-
-
- )) - ) : !isSearching && !searchQuery && !useOnline ? ( - proxmoxCommands.map((item, index) => ( -
sendToActiveTerminal(item.cmd)} - className="p-3 rounded-lg border border-zinc-700 bg-zinc-800/50 hover:bg-zinc-800 hover:border-blue-500 cursor-pointer transition-colors" - > -
-
- {item.cmd} -

{item.desc}

-
- -
-
- )) - ) : !isSearching ? ( -
- {searchQuery ? ( - <> - -
-

No results found for "{searchQuery}"

-

Try a different command or check your spelling

-
- - ) : ( - <> - -
-

Search for any command

-
-

Try searching for:

-
- {["tar", "grep", "docker ps", "qm list", "systemctl"].map((cmd) => ( - setSearchQuery(cmd)} - className="px-2 py-1 bg-zinc-800 rounded text-blue-400 cursor-pointer hover:bg-zinc-700" - > - {cmd} - - ))} + )) + ) : !isSearching ? ( +
+ {searchQuery ? ( + <> + +
+

No results found for "{searchQuery}"

+

Try a different command or check your spelling

+
+ + ) : ( + <> + +
+

Search for any command

+
+

Try searching for:

+
+ {["tar", "grep", "docker ps", "qm list", "systemctl"].map((cmd) => ( + setSearchQuery(cmd)} + className="px-2 py-1 bg-zinc-800 rounded text-blue-400 cursor-pointer hover:bg-zinc-700" + > + {cmd} + + ))} +
-
- {useOnline && ( -
- - Powered by cheat.sh -
- )} - - )} -
- ) : null} -
- -
-
- - - Tip: Search for any Linux command (tar, grep, docker, etc.) or Proxmox commands (qm, pct, pvesh) - + {useOnline && ( +
+ + Powered by cheat.sh +
+ )} + + )} +
+ ) : null} +
+ +
+
+ + + Tip: Search for any Linux command (tar, grep, docker, etc.) or Proxmox commands (qm, pct, pvesh) + +
+ {useOnline && searchResults.length > 0 && Powered by cheat.sh}
- {useOnline && searchResults.length > 0 && Powered by cheat.sh}
-
- -
-
+ +
+
+ ) }