X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=src%2Fviews%2Fstarter.ejs;h=c760c6b89e7dd95f1c7b38baf4087073d4ebcb21;hb=3253f871623a1d1f767923771a593a42b121df0f;hp=5703c0c92ea446729dc050706b4d8fac1929a67a;hpb=0f4e331e6d75c244e978860b62a6e1aed8d446e0;p=VSoRC%2F.git diff --git a/src/views/starter.ejs b/src/views/starter.ejs index 5703c0c..c760c6b 100644 --- a/src/views/starter.ejs +++ b/src/views/starter.ejs @@ -5,95 +5,232 @@ <%include ../../partials/head%> - + + + + + + + + + +
<%include ../../partials/header%> +
+
- - - +
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ -
- + console.log("vsorc stopped"); + } + } + xhr.send(); + clearInterval(intervalVsorc); + vsorcout.value=''; + } + + function getvsorcdata() { + let xhr = new XMLHttpRequest(); + xhr.open('GET', '/getvsorcdata', 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("getting vsorc data"); + + + } + } + xhr.send(); + + vsorcout.scrollTop = vsorcout.scrollHeight; + } + function pingall() { + let xhr = new XMLHttpRequest(); + xhr.open('GET', '/pingall', 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("pingall"); + + + } + } + xhr.send(); + } + + function iperf() { + let xhr = new XMLHttpRequest(); + xhr.open('GET', '/iperf', 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("pingall"); + + + } + } + 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 + +