From: Felix Date: Wed, 20 Nov 2019 01:06:34 +0000 (+0000) Subject: New buttons added on starter page X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=b5e35e05af82a077db86a6400dad2871e1d95ca3;p=VSoRC%2F.git New buttons added on starter page --- diff --git a/src/routes/index.js b/src/routes/index.js index 45b7350..51f8146 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -71,6 +71,46 @@ router.get('/gettopo', (req, res) => { }); }); +router.get('/net', (req, res) => { + var sys = require('sys') + var exec = require('child_process').exec; + var child; + child = exec("cd /home/pi/scripts && echo net > fifo", function(error, stdout, stderr) { + console.log("pingall"); + res.send(stdout); + }); +}); + +router.get('/nodes', (req, res) => { + var sys = require('sys') + var exec = require('child_process').exec; + var child; + child = exec("cd /home/pi/scripts && echo nodes > fifo", function(error, stdout, stderr) { + console.log("pingall"); + res.send(stdout); + }); +}); + +router.get('/status', (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"); + res.send(stdout); + }); +}); + +router.get('/intfs', (req, res) => { + var sys = require('sys') + var exec = require('child_process').exec; + var child; + child = exec("cd /home/pi/scripts && echo intfs > fifo", function(error, stdout, stderr) { + console.log("pingall"); + res.send(stdout); + }); +}); + router.get('/iperf', (req, res) => { var sys = require('sys') var exec = require('child_process').exec; @@ -80,6 +120,7 @@ router.get('/iperf', (req, res) => { res.send(stdout); }); }); + router.get('/pingall', (req, res) => { var sys = require('sys') var exec = require('child_process').exec; diff --git a/src/views/starter.ejs b/src/views/starter.ejs index 59c535b..0caa1f5 100644 --- a/src/views/starter.ejs +++ b/src/views/starter.ejs @@ -42,9 +42,10 @@ - - - + + + + @@ -203,6 +204,66 @@ console.log("placement"); + } + } + xhr.send(); + } + + function net() { + let xhr = new XMLHttpRequest(); + xhr.open('GET', '/net', 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("net"); + + + } + } + xhr.send(); + } + + function nodes() { + let xhr = new XMLHttpRequest(); + xhr.open('GET', '/nodes', 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("nodes"); + + + } + } + xhr.send(); + } + + function status() { + let xhr = new XMLHttpRequest(); + xhr.open('GET', '/status', 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(); + } + + function intfs() { + let xhr = new XMLHttpRequest(); + xhr.open('GET', '/intfs', 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();