From 0501a13026838f688eb8822bf080b0040672190a Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 14 Oct 2011 14:35:27 +0000 Subject: Modify listdevices to also display the class values for each device --- provisioning-listdevices-html.lsp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'provisioning-listdevices-html.lsp') 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) +%> +

Devices

- <% if page_info.action ~= "listdevices" then %> - <% if view.value[1] and view.value[1].group and view.value[1].group ~= "" then %> - - <% end %> - - + <% for i,n in ipairs(display) do %> + @@ -60,12 +72,8 @@ require("viewfunctions") <% end %> - <% if page_info.action ~= "listdevices" then %> - <% if v.group and v.group ~= "" then %> - - <% end %> - - + <% for i,n in ipairs(display) do %> + <% end %> <% end %> -- cgit v1.2.3
Action Device IDGroupParamValue<%= string.gsub(n, "^.", string.upper) %> <% end %>
<%= html.html_escape(v.device_id) %><%= html.html_escape(v.group) %><%= html.html_escape(v.param) %><%= html.html_escape(v.value) %><%= html.html_escape(v[n]) %>