diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-07-06 11:26:00 -0400 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-07-06 11:26:00 -0400 |
commit | ea9e6f6f8b85126abf87dc7d7101b3d6c90d61c8 (patch) | |
tree | fa49ec53eef44d52f70b38fb434debd88b0cc45b | |
parent | 7eda47ba7e6f00fa24d3da99bb6b82c116d03fbf (diff) | |
download | acf-provisioning-ea9e6f6f8b85126abf87dc7d7101b3d6c90d61c8.tar.bz2 acf-provisioning-ea9e6f6f8b85126abf87dc7d7101b3d6c90d61c8.tar.xz |
Make searchbyextension and searchbymac use searchdevices view rather than listdevices view
searchdevices view is still broken, since listdevices view changed
-rw-r--r-- | provisioning-searchbyextension-html.lsp | 16 | ||||
-rw-r--r-- | provisioning-searchbymac-html.lsp | 16 | ||||
-rw-r--r-- | provisioning-searchdevices-html.lsp | 6 |
3 files changed, 20 insertions, 18 deletions
diff --git a/provisioning-searchbyextension-html.lsp b/provisioning-searchbyextension-html.lsp index 2365df6..d7217b7 100644 --- a/provisioning-searchbyextension-html.lsp +++ b/provisioning-searchbyextension-html.lsp @@ -25,20 +25,20 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"deletedevice", "editdevice", "editdeviceparams", "overridedeviceparams"}, session) %> <% +local id = cfe({type="hidden", value=".extension"}) +local comparison = cfe({type="hidden", value="~"}) +local value = cfe({label="Extension"}) +local form = cfe({type="form", label="Search by Extension", value={id=id, comparison=comparison, value=value}, action="searchdevices", option="Search"}) + if session.searchdevicesresult then local data = session.searchdevicesresult session.searchdevicesresult = nil if data.value and data.value.result then - local func = haserl.loadfile(page_info.viewfile:gsub("searchbyextension", "listdevices")) - func(data.value.result, viewlibrary, page_info, session) + form.value.result = data.value.result end end -%> -<% -local id = cfe({type="hidden", value=".extension"}) -local comparison = cfe({type="hidden", value="~"}) -local value = cfe({label="Extension"}) -htmlviewfunctions.displayitem(cfe({type="form", label="Search by Extension", value={id=id, comparison=comparison, value=value}, action="searchdevices", option="Search"}), page_info) +local func = haserl.loadfile(page_info.viewfile:gsub("searchbyextension", "searchdevices")) +func(form, viewlibrary, page_info, session) %> diff --git a/provisioning-searchbymac-html.lsp b/provisioning-searchbymac-html.lsp index c0c6dc4..eba96f8 100644 --- a/provisioning-searchbymac-html.lsp +++ b/provisioning-searchbymac-html.lsp @@ -24,20 +24,20 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"deletedevice", "editdevice", "editdeviceparams", "overridedeviceparams"}, session) %> <% +local id = cfe({type="hidden", value="device.mac"}) +local comparison = cfe({type="hidden", value="~"}) +local value = cfe({label="MAC Address"}) +local form = cfe({type="form", label="Search by MAC Address", value={id=id, comparison=comparison, value=value}, action="searchdevices", option="Search"}) + if session.searchdevicesresult then local data = session.searchdevicesresult session.searchdevicesresult = nil if data.value and data.value.result then - local func = haserl.loadfile(page_info.viewfile:gsub("searchbymac", "listdevices")) - func(data.value.result, viewlibrary, page_info, session) + form.value.result = data.value.result end end -%> -<% -local id = cfe({type="hidden", value="device.mac"}) -local comparison = cfe({type="hidden", value="~"}) -local value = cfe({label="MAC Address"}) -htmlviewfunctions.displayitem(cfe({type="form", label="Search by MAC Address", value={id=id, comparison=comparison, value=value}, action="searchdevices", option="Search"}), page_info) +local func = haserl.loadfile(page_info.viewfile:gsub("searchbymac", "searchdevices")) +func(form, viewlibrary, page_info, session) %> diff --git a/provisioning-searchdevices-html.lsp b/provisioning-searchdevices-html.lsp index 0cdae00..d2f086d 100644 --- a/provisioning-searchdevices-html.lsp +++ b/provisioning-searchdevices-html.lsp @@ -38,8 +38,10 @@ if form.value.values then form.value.values = nil -- And here we display the list of devices in the result elseif form.value.result then - local func = haserl.loadfile(page_info.viewfile:gsub(page_info.action, "listdevices")) - func(form.value.result, viewlibrary, page_info, session) + + print("There are "..#form.value.result.value.." devices in the result") +-- local func = haserl.loadfile(page_info.viewfile:gsub(page_info.action, "listdevices")) +-- func(form, viewlibrary, page_info, session) end %> |