Fix RDP page GraphicsDevice error by updating to use correct WebAssembly API

- Replace undefined GraphicsDevice with newRdpGraphics2D
- Replace undefined RdpClient with WallixModule.RdpClient
- Add proper WebAssembly module loading with WallixModule.ready promise
- Rebuild project to embed updated HTML template
parent d30f31c1
- If you need to rebuild the project, use always ./build.sh --clean && ./build.sh - If you need to rebuild the project, use always ./build.sh --clean && ./build.sh
- if you need to build the debian packages, use ./build.sh --debian - if you need to build the debian packages, use ./build.sh --debian
- if a build give you any warning, fix the warning - if a build give you any warning, fix the warning
- when you finish a todo list and everything is complete, execute a git commit - when you finish a todo list and everything is complete or complete a task, execute a git commit
- when i ask you to update the documentation, update the readme file, the changelog, the todo list checking if we completed anything, the man files. For the documentation always include sections for the config files, examples, verify the command line is updated. - when i ask you to update the documentation, update the readme file, the changelog, the todo list checking if we completed anything, the man files. For the documentation always include sections for the config files, examples, verify the command line is updated.
- If you need to rebuild the project, use always ./build.sh --clean && ./build.sh - If you need to rebuild the project, use always ./build.sh --clean && ./build.sh
- if you need to build the debian packages, use ./build.sh --debian - if you need to build the debian packages, use ./build.sh --debian
- if a build give you any warning, fix the warning - if a build give you any warning, fix the warning
- when you finish a todo list and everything is complete, execute a git commit - when you finish a todo list and everything is complete, execute a git commit
- when i ask you to update the documentation, update the readme file, the changelog, the todo list checking if we completed anything, the man files. For the documentation always include sections for the config files, examples, verify the command line is updated. - when i ask you to update the documentation, update the readme file, the changelog, the todo list checking if we completed anything, the man files. For the documentation always include sections for the config files, examples, verify the command line is updated.
...@@ -2,3 +2,5 @@ ...@@ -2,3 +2,5 @@
- the script embed_assets.sh is launched by the Makefile - the script embed_assets.sh is launched by the Makefile
- the Makefile is generated by the script configure.sh - the Makefile is generated by the script configure.sh
- in wssshd webinterface, the vnc page and the rdp page uses different websocket implementation, looks at the specifics of web.c and vnc.c or rdp.c, the file websocket.c is user ALSO for the websockets in the communication port with wssshc and wsssht, if you modify something for vnc or rdp or anything in the web interface, don't break the implementation for the wssshc-wssshd-wsssht communication channel/protocol - in wssshd webinterface, the vnc page and the rdp page uses different websocket implementation, looks at the specifics of web.c and vnc.c or rdp.c, the file websocket.c is user ALSO for the websockets in the communication port with wssshc and wsssht, if you modify something for vnc or rdp or anything in the web interface, don't break the implementation for the wssshc-wssshd-wsssht communication channel/protocol
- vnc page on wssshd uses the project noVNC
- rdp page on wssshd uses rdp.wasm, project page: https://github.com/sitepi/rdp.wasm
- the html pages and the assets to add in wssshd are generated from the templates directory, using the script embed_assets.sh. - the html pages and the assets to add in wssshd are generated from the templates directory, using the script embed_assets.sh.
- the script embed_assets.sh is launched by the Makefile - the script embed_assets.sh is launched by the Makefile
- the Makefile is generated by the script configure.sh - the Makefile is generated by the script configure.sh
- in wssshd webinterface, the vnc page and the rdp page uses different websocket implementation, looks at the specifics of web.c and vnc.c or rdp.c, the file - in wssshd webinterface, the vnc page and the rdp page uses different websocket implementation, looks at the specifics of web.c and vnc.c or rdp.c, the file websocket.c is user ALSO for the websockets in the communication port with wssshc and wsssht, if you modify something for vnc or rdp or anything in the web interface, don't break the implementation for the wssshc-wssshd-wsssht communication channel/protocol
...@@ -304,26 +304,33 @@ function connect() { ...@@ -304,26 +304,33 @@ function connect() {
socket.binaryType = 'arraybuffer'; socket.binaryType = 'arraybuffer';
socket.onopen = () => { socket.onopen = () => {
const canvas = document.getElementById('canvas'); // Wait for WebAssembly module to be ready
const gd = new GraphicsDevice(canvas); WallixModule.ready.then(() => {
const config = { const canvas = document.getElementById('canvas');
width: 1024, const gd = newRdpGraphics2D(canvas, WallixModule);
height: 768, const config = {
username: '', width: 1024,
password: '', height: 768,
domain: '', username: '',
bpp: 32, password: '',
verbosity: 0 domain: '',
}; bpp: 32,
rdpclient = new RdpClient(gd, config); verbosity: 0
rdpclient.writeFirstPacket(); };
sendData(); rdpclient = new WallixModule.RdpClient(gd, config);
connected = true; rdpclient.writeFirstPacket();
document.getElementById('connectBtn').disabled = true; sendData();
document.getElementById('disconnectBtn').disabled = false; connected = true;
// Hide loading message document.getElementById('connectBtn').disabled = true;
document.getElementById('rdp_loading').style.display = 'none'; document.getElementById('disconnectBtn').disabled = false;
showNotification('RDP session connected', 'success'); // Hide loading message
document.getElementById('rdp_loading').style.display = 'none';
showNotification('RDP session connected', 'success');
}).catch((error) => {
console.error('Failed to initialize WebAssembly module:', error);
showNotification('Failed to initialize RDP client', 'danger');
disconnect();
});
}; };
socket.onmessage = (event) => { socket.onmessage = (event) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment