From: Oscar J. Rodriguez B Date: Mon, 4 Nov 2019 15:57:16 +0000 (-0500) Subject: autorefresh in the stats and minor color changes X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=commitdiff_plain;h=62e801ff36b720eeb0851695ed7c6a8f9bfc0fa4 autorefresh in the stats and minor color changes --- diff --git a/1 b/1 deleted file mode 100644 index e69de29..0000000 diff --git a/adminlte b/adminlte deleted file mode 100644 index e69de29..0000000 diff --git a/bootstrapbootswatch b/bootstrapbootswatch deleted file mode 100644 index e69de29..0000000 diff --git a/ejsexpressnode b/ejsexpressnode deleted file mode 100644 index e69de29..0000000 diff --git a/fifo b/fifo deleted file mode 100644 index e69de29..0000000 diff --git a/js/topology/flowtables.js b/js/topology/flowtables.js index af4a22f..99830aa 100644 --- a/js/topology/flowtables.js +++ b/js/topology/flowtables.js @@ -95,12 +95,12 @@ $(function () { loadFlows(); - // function startRefresh() { - // setTimeout(startRefresh,10000); - // loadFlows(); - // } + function startRefresh() { + setTimeout(startRefresh,10000); + loadFlows(); + } - // startRefresh() + startRefresh() // function autoRefreshPage() { // loadFlows(); diff --git a/src/routes/index.js b/src/routes/index.js index d12f534..f8eca17 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -78,7 +78,16 @@ router.get('/listswitch', (req, res) => { child = exec("curl localhost:8080/data?list=switches", function(error, stdout, stderr) { console.log("listswitch"); console.log(stdout); - let value = JSON.parse(stdout) + let value = ''; + try { + value = JSON.parse(stdout) + } + catch(error) { + console.error(error); + console.log("no response from server"); + // expected output: ReferenceError: nonExistentFunction is not defined + // Note - error messages will vary depending on browser + } res.send(value); }); diff --git a/src/views/starter.ejs b/src/views/starter.ejs index 57602b7..01b8327 100644 --- a/src/views/starter.ejs +++ b/src/views/starter.ejs @@ -6,36 +6,33 @@ <%include ../../partials/head%>
<%include ../../partials/header%>
+
@@ -68,63 +71,64 @@ - +