diff --git a/src/webui.go b/src/webui.go index c338a5b..27223f0 100644 --- a/src/webui.go +++ b/src/webui.go @@ -71,7 +71,6 @@ func startServer() { m := macaron.Classic() m.Use(pongo2.Pongoer()) m.Use(macaron.Static("static")) - // m.Get("/", myHandler) m.Get("/", statusPage) m.Get("/outlets", outletsPage) @@ -87,12 +86,6 @@ func startServer() { m.Get("/json/status", jsonStatus) m.Post("/json/outlet/:id/toggle", jsonOutletToggle) - m.Get("/boards", func(ctx *macaron.Context) { - ctx.HTML(200, "boards") // 200 is the response code. - }) - - logInfo("hostname: " + viper.GetString("system.hostname")) - logInfo("Web interface ready") http.ListenAndServe("0.0.0.0:"+viper.GetString("system.listeningport"), m) } diff --git a/templates/status.html b/templates/status.html index e65b9b5..f47ea92 100644 --- a/templates/status.html +++ b/templates/status.html @@ -72,17 +72,7 @@ $(function () { var btnhtml = `
- - -
`; + `; var table = $('#example2').DataTable({ @@ -98,10 +88,20 @@ 'lengthChange': true, 'searching' : true, 'ordering' : true, - 'info' : true + 'info' : true, + 'rowCallback': function( row, data ) { + if ( data[2] == "true" ) { + $('td:eq(2)', row).html( '' ); + } else { + $('td:eq(2)', row).html( '' ); + } + } }); - // fa-toggle-off + // autoreload every 3 seconds + setInterval( function () { + table.ajax.reload(); + }, 3000 ); $('#example2 tbody').on( 'click', '[script="toggle"]', function (e) { e.preventDefault();