--- /dev/null
+0 info it worked if it ends with ok
+1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
+2 info using npm@1.4.21
+3 info using node@v8.11.1
+4 verbose run-script [ 'prestart', 'start', 'poststart' ]
+5 info prestart web@1.0.0
+6 info start web@1.0.0
+7 verbose unsafe-perm in lifecycle true
+8 info web@1.0.0 Failed to exec start script
+9 error web@1.0.0 start: `node src/index.js`
+9 error Exit status 1
+10 error Failed at the web@1.0.0 start script.
+10 error This is most likely a problem with the web package,
+10 error not with npm itself.
+10 error Tell the author that this fails on your system:
+10 error node src/index.js
+10 error You can get their info via:
+10 error npm owner ls web
+10 error There is likely additional logging output above.
+11 error System Linux 4.19.57-v7+
+12 error command "/usr/bin/node" "/usr/bin/npm" "start"
+13 error cwd /home/pi/VSoRC
+14 error node -v v8.11.1
+15 error npm -v 1.4.21
+16 error code ELIFECYCLE
+17 verbose exit [ 1, true ]
});
});
+router.get('/showtemp', (req, res) => {
+ var sys = require('sys')
+ var exec = require('child_process').exec;
+ var child;
+ child = exec("cd /home/pi/scripts && ./gettemp.sh", function(error, stdout, stderr) {
+ console.log("show temp");
+ res.send(stdout);
+ });
+});
router.get('/gettopo', (req, res) => {
var sys = require('sys')
var exec = require('child_process').exec;
var exec = require('child_process').exec;
var child;
child = exec("cd /home/pi/scripts && echo net > fifo", function(error, stdout, stderr) {
- console.log("pingall");
+ console.log("net");
res.send(stdout);
});
});
var exec = require('child_process').exec;
var child;
child = exec("cd /home/pi/scripts && echo nodes > fifo", function(error, stdout, stderr) {
- console.log("pingall");
+ console.log("nodes");
res.send(stdout);
});
});
-router.get('/status', (req, res) => {
+router.get('/statusnodes', (req, res) => {
var sys = require('sys')
var exec = require('child_process').exec;
var child;
child = exec("cd /home/pi/scripts && echo status > fifo", function(error, stdout, stderr) {
- console.log("pingall");
+ console.log("status");
res.send(stdout);
});
});
var exec = require('child_process').exec;
var child;
child = exec("cd /home/pi/scripts && echo intfs > fifo", function(error, stdout, stderr) {
- console.log("pingall");
+ console.log("interfaces");
res.send(stdout);
});
});
}
xhr.send();
}, 500)
+
</script>
</div>
<div class="wrapper TEMP">
<div class="navbar navbar-dark bg-light"><span>Temperatura de los equipos</span></div>
- <div id="trafico"></div>
+ <div id="temp">
+ <textarea class="text" rows="20" cols="7" id="temperatura" placeholder="Definicion de la red como: h1:s1"></textarea>
+ </div>
+ <script>
+ function showtemp() {
+ let xhr = new XMLHttpRequest();
+ xhr.open('GET', '/showtemp', true);
+ xhr.onload = function() {
+ if (xhr.status == 200) { //can use this.status instead
+ //console.log(xhr.responseText);// para ver en la consola
+ console.log(xhr.response);
+ document.getElementById('temperatura').value = xhr.response;
+ }
+ }
+ xhr.send();
+ //clearInterval(intervalController);
+
+ }
+ setInterval(showtemp,3000);
+ </script>
</div>
</div>
<div class="panel">
<textarea class="text" style="font-size: 12px;" disabled rows="20" cols="7" id="controllerout" placeholder="Salida del controlador"></textarea>
</div>
-
- <div class="terminal"></div>
-
+ <div class="panel">
+ <textarea class="text" style="font-size: 12px;" disabled rows="20" cols="7" id="a" placeholder="Salida del controlador"></textarea>
+ </div>
</div>
<script type="text/javascript">
function status() {
let xhr = new XMLHttpRequest();
- xhr.open('GET', '/status', true);
+ xhr.open('GET', '/statusnodes', true);
xhr.onload = function() {
if (xhr.status == 200) { //can use this.status instead
//console.log(xhr.responseText);// para ver en la consola
}
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
+
</script>
</main>
</body>