diff options
Diffstat (limited to 'provisioning-listdevices-html.lsp')
-rw-r--r-- | provisioning-listdevices-html.lsp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/provisioning-listdevices-html.lsp b/provisioning-listdevices-html.lsp index c19f281..b203368 100644 --- a/provisioning-listdevices-html.lsp +++ b/provisioning-listdevices-html.lsp @@ -26,18 +26,30 @@ require("viewfunctions") <% displaycommandresults({"deletedevice", "editdevice", "editdeviceparams", "overridedeviceparams"}, session) %> <% displaycommandresults({"createdevice"}, session, true) %> +<% -- Determine all of the groups +local tmp = {} +for k,v in ipairs( view.value ) do + for g,c in pairs(v) do + if not tmp[g] then tmp[g] = true end + end +end +local display = {} +for n in pairs(tmp) do + if n ~= "device_id" then + display[#display+1] = n + end +end +table.sort(display) +%> + <h1>Devices</h1> <DL> <TABLE id="list" class="tablesorter"><THEAD> <TR style="background:#eee;font-weight:bold;"> <TH>Action</TH> <TH>Device ID</TH> - <% if page_info.action ~= "listdevices" then %> - <% if view.value[1] and view.value[1].group and view.value[1].group ~= "" then %> - <TH>Group</TH> - <% end %> - <TH>Param</TH> - <TH>Value</TH> + <% for i,n in ipairs(display) do %> + <TH><%= string.gsub(n, "^.", string.upper) %> <% end %> </TR> </THEAD><TBODY> @@ -60,12 +72,8 @@ require("viewfunctions") <% end %> </TD> <TD><%= html.html_escape(v.device_id) %></TD> - <% if page_info.action ~= "listdevices" then %> - <% if v.group and v.group ~= "" then %> - <TD><%= html.html_escape(v.group) %></TD> - <% end %> - <TD><%= html.html_escape(v.param) %></TD> - <TD><%= html.html_escape(v.value) %></TD> + <% for i,n in ipairs(display) do %> + <TD><%= html.html_escape(v[n]) %></TD> <% end %> </TR> <% end %> |