<% --[[ Status.htm (Charging_points module) ]]-- local chp = require "luci.model.charging_points" local fs = require "nixio.fs" local utl = require "luci.util" local dsp = require "luci.dispatcher" local mUtl = require "luci.moreUtils" local os = require "os" local path = luci.dispatcher.context.requestpath ------------------------------------------------------------------------------------------------------------------------- local path = dsp.context.requestpath serialnumber = mUtl.get_serialnumber() local method if serialnumber then local maestre = mUtl.identify_pseudo_maestre( path[3] or serialnumber) if maestre == true then method = "powerstack" else method = path[3].."/powerstack" end end local data = utl.ubus(method, "get_status") local translated_data = {} for k , v in pairs (data) do local opts = {} if type(v) == "table" then for z , t in pairs (v) do opts[translate(z)] = translate(tostring(t)) end end if type(v) ~= "table" then translated_data[translate(k)] = v else translated_data[k] = opts end end if luci.http.formvalue("status") == "1" then luci.http.prepare_content("application/json") luci.http.write_json(translated_data) return end %> <%+header%>

<%:Power Modules%><%: - %><%=path[3] or serialnumber%>

<%%>
<%+footer%>