-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+ }
+ }
+ xhr.send();
+ }
+ function placement() {
+ let xhr = new XMLHttpRequest();
+ xhr.open('GET', '/placement', true);
+ xhr.onload = function() {
+ if (xhr.status == 200) { //can use this.status instead
+ //console.log(xhr.responseText);// para ver en la consola
+ vsorcout.value+=xhr.response;
+ console.log("placement");
+
+
+ }
+ }
+ xhr.send();
+ }
+ ///////////////////////////////////////////////////////////////////////CODIGO DE LA terminal
+ // No idea what these are about. Just copied them from the demo code
+ // Terminal.applyAddon(attach);
+ // Terminal.applyAddon(fit);
+ // Terminal.applyAddon(winptyCompat);
+ // The terminal
+
+ // const fitAddon = new FitAddon();
+ // term.loadAddon(fitAddon);
+
+
+ const term = new Terminal();
+ // No idea what this does
+ // term.winptyCompatInit();
+ // This kinda makes sense
+ const container = document.getElementById('terminal');
+ term.open(container);
+ // Open the websocket connection to the backend
+ const protocol = (location.protocol === 'https:') ? 'wss://' : 'ws://';
+ const port = location.port ? `:${location.port}` : '';
+ const socketUrl = `${protocol}${location.hostname}${port}/shell`;
+ const socket = new WebSocket(socketUrl);
+ const attachAddon = new AttachAddon(socket);
+ term.loadAddon(attachAddon);
+ // Attach the socket to the terminal
+ socket.onopen = (ev) => { term.attach(socket); };
+ // Not going to worry about close/error for the websocket
+ //////////////////////////////////////////////////////////////////////FIN DEL CODIGO DE LA TERMINAL
+
+
+
+
+
+
+
+