mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-15 00:26:23 +00:00
Update AppImage
This commit is contained in:
@@ -9,7 +9,8 @@ import { Input } from "@/components/ui/input"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { CheckCircle2, XCircle, Loader2, Activity, GripHorizontal } from "lucide-react"
|
||||
import { TerminalPanel } from "./terminal-panel"
|
||||
import { API_PORT } from "@/lib/api-config"
|
||||
const API_PORT =
|
||||
typeof window !== "undefined" && process.env.NEXT_PUBLIC_API_PORT ? process.env.NEXT_PUBLIC_API_PORT : "8008"
|
||||
import { useIsMobile } from "@/hooks/use-mobile"
|
||||
|
||||
interface WebInteraction {
|
||||
@@ -58,6 +59,28 @@ export function ScriptTerminalModal({
|
||||
const startYRef = useRef(0)
|
||||
const startHeightRef = useRef(80)
|
||||
|
||||
const terminalRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!terminalRef.current) return
|
||||
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
// Notificar a la terminal que necesita redimensionarse
|
||||
const event = new CustomEvent("terminal-resize-needed")
|
||||
window.dispatchEvent(event)
|
||||
})
|
||||
|
||||
resizeObserver.observe(terminalRef.current)
|
||||
|
||||
return () => {
|
||||
resizeObserver.disconnect()
|
||||
}
|
||||
}, [])
|
||||
|
||||
const handleTerminalResize = () => {
|
||||
// Este callback será usado por TerminalPanel para saber cuándo redimensionar
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
setIsComplete(false)
|
||||
@@ -216,7 +239,7 @@ export function ScriptTerminalModal({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 overflow-hidden relative">
|
||||
<div className="flex-1 overflow-hidden relative" ref={terminalRef}>
|
||||
<TerminalPanel
|
||||
websocketUrl={wsUrl}
|
||||
initMessage={{
|
||||
@@ -232,6 +255,7 @@ export function ScriptTerminalModal({
|
||||
}
|
||||
}}
|
||||
isScriptModal={true}
|
||||
onResizeNeeded={handleTerminalResize}
|
||||
/>
|
||||
|
||||
{isWaitingNextInteraction && !currentInteraction && (
|
||||
|
||||
Reference in New Issue
Block a user