mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-25 08:56:21 +00:00
Update script-terminal-modal.tsx
This commit is contained in:
@@ -138,6 +138,11 @@ const initMessage = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ws.onmessage = (event) => {
|
ws.onmessage = (event) => {
|
||||||
|
// Filter out pong responses from heartbeat
|
||||||
|
if (event.data === '{"type": "pong"}' || event.data === '{"type":"pong"}') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const msg = JSON.parse(event.data)
|
const msg = JSON.parse(event.data)
|
||||||
if (msg.type === "web_interaction" && msg.interaction) {
|
if (msg.type === "web_interaction" && msg.interaction) {
|
||||||
@@ -282,14 +287,11 @@ const initMessage = {
|
|||||||
}
|
}
|
||||||
}, 30000)
|
}, 30000)
|
||||||
|
|
||||||
// Small delay to ensure paramsRef is updated with latest props
|
const initMessage = {
|
||||||
setTimeout(() => {
|
script_path: scriptPath,
|
||||||
const initMessage = {
|
params: paramsRef.current,
|
||||||
script_path: scriptPath,
|
}
|
||||||
params: paramsRef.current,
|
ws.send(JSON.stringify(initMessage))
|
||||||
}
|
|
||||||
ws.send(JSON.stringify(initMessage))
|
|
||||||
}, 50)
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (fitAddonRef.current && termRef.current && ws.readyState === WebSocket.OPEN) {
|
if (fitAddonRef.current && termRef.current && ws.readyState === WebSocket.OPEN) {
|
||||||
@@ -307,6 +309,11 @@ const initMessage = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ws.onmessage = (event) => {
|
ws.onmessage = (event) => {
|
||||||
|
// Filter out pong responses from heartbeat - don't display in terminal
|
||||||
|
if (event.data === '{"type": "pong"}' || event.data === '{"type":"pong"}') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const msg = JSON.parse(event.data)
|
const msg = JSON.parse(event.data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user