mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-14 16:16:21 +00:00
Update script-terminal-modal.tsx
This commit is contained in:
@@ -412,6 +412,7 @@ export function ScriptTerminalModal({
|
|||||||
const startHeight = modalHeight
|
const startHeight = modalHeight
|
||||||
|
|
||||||
const handleMove = (moveEvent: MouseEvent | TouchEvent) => {
|
const handleMove = (moveEvent: MouseEvent | TouchEvent) => {
|
||||||
|
moveEvent.preventDefault()
|
||||||
const currentY = moveEvent instanceof MouseEvent ? moveEvent.clientY : moveEvent.touches[0].clientY
|
const currentY = moveEvent instanceof MouseEvent ? moveEvent.clientY : moveEvent.touches[0].clientY
|
||||||
const deltaY = currentY - startY
|
const deltaY = currentY - startY
|
||||||
const newHeight = Math.max(300, Math.min(2400, startHeight + deltaY))
|
const newHeight = Math.max(300, Math.min(2400, startHeight + deltaY))
|
||||||
@@ -420,6 +421,7 @@ export function ScriptTerminalModal({
|
|||||||
|
|
||||||
if (fitAddonRef.current && termRef.current && wsRef.current?.readyState === WebSocket.OPEN) {
|
if (fitAddonRef.current && termRef.current && wsRef.current?.readyState === WebSocket.OPEN) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
if (fitAddonRef.current && termRef.current) {
|
||||||
fitAddonRef.current.fit()
|
fitAddonRef.current.fit()
|
||||||
wsRef.current?.send(
|
wsRef.current?.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -428,6 +430,7 @@ export function ScriptTerminalModal({
|
|||||||
rows: termRef.current.rows,
|
rows: termRef.current.rows,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}, 10)
|
}, 10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -439,6 +442,7 @@ export function ScriptTerminalModal({
|
|||||||
|
|
||||||
if (fitAddonRef.current && termRef.current && wsRef.current?.readyState === WebSocket.OPEN) {
|
if (fitAddonRef.current && termRef.current && wsRef.current?.readyState === WebSocket.OPEN) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
if (fitAddonRef.current && termRef.current) {
|
||||||
fitAddonRef.current.fit()
|
fitAddonRef.current.fit()
|
||||||
wsRef.current?.send(
|
wsRef.current?.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -447,6 +451,7 @@ export function ScriptTerminalModal({
|
|||||||
rows: termRef.current.rows,
|
rows: termRef.current.rows,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}, 50)
|
}, 50)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user