diff options
author | Ted Trask <ttrask01@yahoo.com> | 2011-10-14 14:35:27 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-10-14 14:35:27 +0000 |
commit | 0501a13026838f688eb8822bf080b0040672190a (patch) | |
tree | 63ffdc84867d74efc6eebe96a902a95ab384e43e /provisioning-listdevices-html.lsp | |
parent | 102f3e62cedd0ff6cc6f556c3e506951ccb25c1a (diff) | |
download | acf-provisioning-0501a13026838f688eb8822bf080b0040672190a.tar.bz2 acf-provisioning-0501a13026838f688eb8822bf080b0040672190a.tar.xz |
Modify listdevices to also display the class values for each device
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 %> |