Skip to content

Commit

Permalink
vnc ref got
Browse files Browse the repository at this point in the history
  • Loading branch information
ganning127 committed Jun 25, 2024
1 parent c46435c commit 4d3ae60
Show file tree
Hide file tree
Showing 3 changed files with 298 additions and 108 deletions.
2 changes: 0 additions & 2 deletions airavata-local-agent/main/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ ipcMain.on('ci-logon-login', async (event) => {
console.log("Tokens", accessToken, refreshToken);
event.sender.send('ci-logon-success', accessToken, refreshToken);
authWindow.close();
// authWindow.loadURL('https://md.cybershuttle.org/auth/redirect_login/cilogon/');

}
}, 5000);

Expand Down
30 changes: 28 additions & 2 deletions airavata-local-agent/renderer/components/VNCItem.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { VncScreen } from "react-vnc";

export const VNCItem = ({ vncRef, url, username, password, handleOnDisconnect }) => {
console.log("VMD CONNECTING TO", url);
let interval;
console.log("VMD connecting to...", url);
return (
<VncScreen
url={url}
Expand All @@ -18,7 +19,32 @@ export const VNCItem = ({ vncRef, url, username, password, handleOnDisconnect })
}
}}
ref={vncRef}
onDisconnect={handleOnDisconnect}
onDisconnect={() => {
clearInterval(interval);
handleOnDisconnect();
}}
onConnect={(rfb) => {
console.log(rfb);
// rfb._sock._websocket.send(JSON.stringify({
// type: "ping"
// }))

// interval = setInterval(() => {
// rfb._sock._websocket.send(JSON.stringify({
// type: "ping"
// }));
// }, 1000);


// rfb._sock._websocket.onmessage = (e) => {
// console.log("Received message", e.data);
// if (e.data === "ping") {
// rfb._sock._websocket.send(JSON.stringify({
// type: "ping"
// }));
// }
// };
}}
autoConnect={true}
/>
);
Expand Down
Loading

0 comments on commit 4d3ae60

Please sign in to comment.