New way to show/hide toolkits

This commit is contained in:
naibo
2024-12-31 02:52:48 +08:00
parent 33dda444d7
commit 2feede55db
6 changed files with 97 additions and 31 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -114,6 +114,7 @@ let handle_pairs = {};
let socket_window = null;
let socket_start = null;
let socket_flowchart = null;
let socket_popup = null;
let invoke_window = null;
// var ffi = require('ffi-napi');
@@ -1124,6 +1125,20 @@ async function beginInvoke(msg, ws) {
} catch {
console.log("Cannot get Cookies");
}
} else if (msg.type == 30) {
send_message_to_browser(
JSON.stringify({
type: "showAllToolboxes"
})
);
console.log("Show all toolboxes");
} else if (msg.type == 31) {
send_message_to_browser(
JSON.stringify({
type: "hideAllToolboxes"
})
);
console.log("Hide all toolboxes");
}
}
@@ -1267,6 +1282,9 @@ wss.on("connection", function (ws) {
// console.log("socket_flowchart closed");
// });
console.log("set socket_flowchart at time: ", new Date());
} else if (msg.message.id == 3) {
socket_popup = ws;
console.log("set socket_popup at time: ", new Date());
} else {
//其他的ID是用来标识不同的浏览器标签页的
// await new Promise(resolve => setTimeout(resolve, 200));