From: Florian Eckert Date: Thu, 18 Jan 2018 12:42:21 +0000 (+0100) Subject: luci-app-mwan3: refactoring detail status view and controller X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=406564c7db61f5e80bc246554488d7b04566d4cb;p=oweals%2Fluci.git luci-app-mwan3: refactoring detail status view and controller Signed-off-by: Florian Eckert --- diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index e7e8dc93c..69e72b7fd 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -68,16 +68,13 @@ function mwan_Status() end function detailedStatus() - local mArray = {} - - -- detailed mwan status - local detailStatusInfo = ut.trim(sys.exec("/usr/sbin/mwan3 status")) - if detailStatusInfo ~= "" then - mArray.mwandetail = { detailStatusInfo } + local statusInfo = ut.trim(sys.exec("/usr/sbin/mwan3 status")) + luci.http.prepare_content("text/plain") + if statusInfo ~= "" then + luci.http.write(statusInfo) + else + luci.http.write("Unable to get status information") end - - luci.http.prepare_content("application/json") - luci.http.write_json(mArray) end function diagnosticsData(interface, task) diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm index 0ff2824ed..4cb65dd2b 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm @@ -10,33 +10,23 @@ -
+
- <%:MWAN Detailed Status%> -
<%:Loading%><%:Collecting data...%>
+ <%:Collecting data...%> + + <%:Loading%> +
- - <%+footer%>