<% local view, viewlibrary, page_info, session = ... 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

<% for i,n in ipairs(display) do %> <% for k,v in ipairs( view.value ) do %> <% for i,n in ipairs(display) do %> <% end %> <% end %>
Action Device ID<%= string.gsub(n, "^.", string.upper) %> <% end %>
<% if viewlibrary.check_permission("deletedevice") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletedevice?device_id="..v.device_id, label="Delete ", class="deletedevice"} %> <% end %> <% if viewlibrary.check_permission("editdevice") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editdevice?device_id="..v.device_id.."&redir="..page_info.orig_action, label="Edit "} %> <% end %> <% if viewlibrary.check_permission("overridedeviceparams") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/overridedeviceparams?device_id="..v.device_id.."&redir="..page_info.orig_action, label="Params "} %> <% elseif viewlibrary.check_permission("editdeviceparams") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editdeviceparams?device_id="..v.device_id.."&redir="..page_info.orig_action, label="Params "} %> <% end %> <% if viewlibrary.check_permission("getdevicevalues") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/getdevicevalues?id=device_id&value="..v.device_id.."&Search=Search&viewtype=templated", label="View "} %> <% end %> <%= html.html_escape(v.device_id) %><%= html.html_escape(v[n]) %>
<% if view.errtxt then %>

<%= html.html_escape(view.errtxt) %>

<% end %> <% if #view.value == 0 then %>

No devices found

<% end %>
<% if page_info.action == "listdevices" and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createdevice") then viewlibrary.dispatch_component("createdevice") end %>