From: Felix Date: Wed, 23 Oct 2019 00:02:26 +0000 (+0100) Subject: Primeros pasos en la pagina de estadisticas, para esto en index.js cree una nueva... X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=commitdiff_plain;h=34baebb7bfe5bf15bc1decbbbc3e47a42a279919 Primeros pasos en la pagina de estadisticas, para esto en index.js cree una nueva ruta llamada listswitch --- diff --git a/img/switch.svg b/img/switch.svg old mode 100755 new mode 100644 index 128a126..5c5cf6b Binary files a/img/switch.svg and b/img/switch.svg differ diff --git a/js/topology/common.js b/js/topology/common.js index b892a99..305294b 100644 --- a/js/topology/common.js +++ b/js/topology/common.js @@ -564,7 +564,7 @@ function hc(myString) { // Get information from datapaths function getSwitchData(request, f, g) { - $.get("/data", "list=switches") + $.get("/listswitch") .done(function (switches) { if ($.isEmptyObject(switches)) { var msg = "No switches found!"; diff --git a/src/routes/index.js b/src/routes/index.js index a9299a9..cbb21a3 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -71,6 +71,18 @@ router.get('/gettopo', (req, res) => { }); }); +router.get('/listswitch', (req, res) => { + var sys = require('sys') + var exec = require('child_process').exec; + var child; + child = exec("curl localhost:8080/data?list=switches", function(error, stdout, stderr) { + console.log("listswitch"); + console.log(stdout); + res.send(stdout); + }); +}); + + router.get('/startcontroller', (req, res) => { var sys = require('sys') var exec = require('child_process').exec;