From 986cb126468602f41faa8e7d2fee21eee43b0e9c Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Thu, 22 May 2014 19:02:50 +0200 Subject: [PATCH] [luci-app-bmx6]: fix status page --- .../usr/lib/lua/luci/view/bmx6/status_j.htm | 51 +++++-------------- luci-app-bmx6/files/www/cgi-bin/bmx6-info | 9 +++- 2 files changed, 20 insertions(+), 40 deletions(-) diff --git a/luci-app-bmx6/files/usr/lib/lua/luci/view/bmx6/status_j.htm b/luci-app-bmx6/files/usr/lib/lua/luci/view/bmx6/status_j.htm index 0668db7..bf21106 100644 --- a/luci-app-bmx6/files/usr/lib/lua/luci/view/bmx6/status_j.htm +++ b/luci-app-bmx6/files/usr/lib/lua/luci/view/bmx6/status_j.htm @@ -47,39 +47,15 @@ Visit bmx6.net for more info. - - - - - - - -
<%:Version%><%:Compat%><%:Code Version%><%:Global ID%> <%:Primary IP%> <%:Tun6Address%> <%:Tun4Address%><%:Local ID%> <%:Uptime%> <%:Cpu load%> <%:Nodes seen%>

<%:Collecting data...%>
- - -
- - <%:Network devices%> - - - - - - - - - - - - - + +
<%:Name%><%:State%><%:Type%><%:Rate%><%:Local IP%><%:Global IP%><%:Multicast IP%><%:is Primary%>

<%:Collecting data...%>

<%:Collecting data...%>
@@ -87,26 +63,23 @@ Visit bmx6.net for more info. - - diff --git a/luci-app-bmx6/files/www/cgi-bin/bmx6-info b/luci-app-bmx6/files/www/cgi-bin/bmx6-info index 37ff25a..5263081 100644 --- a/luci-app-bmx6/files/www/cgi-bin/bmx6-info +++ b/luci-app-bmx6/files/www/cgi-bin/bmx6-info @@ -76,7 +76,7 @@ print_query() { } # If the query is a file, just printing the file - [ -f "$BMX6_DIR/$QUERY" ] && cat "$BMX6_DIR/$QUERY"; + [ -f "$BMX6_DIR/$1" ] && cat "$BMX6_DIR/$1"; } if [ "${QUERY##*/}" == "all" ]; then @@ -84,6 +84,13 @@ if [ "${QUERY##*/}" == "all" ]; then QALL=1 fi +if [ "$QUERY" == '$info' ]; then + echo '{ "info": [ ' + print_query status + echo -n "," + print_query interfaces + echo "] }" +fi if [ "$QUERY" == '$neighbours' ]; then QALL=1