From 97d978c267f2819714cf2df4999dba56bdde31d5 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Tue, 16 Jul 2024 11:32:14 +0100 Subject: fix(gui): terminal resize overflow (#2285) --- ui/src/components/runbooks/editor/Editor.tsx | 2 +- .../runbooks/editor/blocks/RunBlock/index.tsx | 41 +++++++++++----------- .../runbooks/editor/blocks/RunBlock/terminal.tsx | 7 ++-- 3 files changed, 26 insertions(+), 24 deletions(-) (limited to 'ui/src/components') diff --git a/ui/src/components/runbooks/editor/Editor.tsx b/ui/src/components/runbooks/editor/Editor.tsx index 8ed52660..b70436de 100644 --- a/ui/src/components/runbooks/editor/Editor.tsx +++ b/ui/src/components/runbooks/editor/Editor.tsx @@ -124,7 +124,7 @@ export default function Editor() { // Renders the editor instance. return ( -
+
-
- -
+ + {isRunning ? : } + + +
+
{ setValue(val); @@ -99,7 +100,7 @@ const RunBlock = ({ basicSetup={false} />
diff --git a/ui/src/components/runbooks/editor/blocks/RunBlock/terminal.tsx b/ui/src/components/runbooks/editor/blocks/RunBlock/terminal.tsx index e5ca0fca..fa203fc9 100644 --- a/ui/src/components/runbooks/editor/blocks/RunBlock/terminal.tsx +++ b/ui/src/components/runbooks/editor/blocks/RunBlock/terminal.tsx @@ -55,6 +55,7 @@ const TerminalComponent = ({ pty }: any) => { terminal.loadAddon(fitAddon); terminal.onResize(onResize(pty)); + fitAddon.fit(); const windowResize = () => { fitAddon.fit(); }; @@ -67,8 +68,6 @@ const TerminalComponent = ({ pty }: any) => { window.addEventListener("resize", windowResize); - fitAddon.fit(); - // Customize further as needed return () => { terminal.dispose(); @@ -76,7 +75,9 @@ const TerminalComponent = ({ pty }: any) => { }; }, [pty]); - return
; + return ( +
+ ); }; export default TerminalComponent; -- cgit v1.3.1