summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--provisioning-searchbyextension-html.lsp16
-rw-r--r--provisioning-searchbymac-html.lsp16
-rw-r--r--provisioning-searchdevices-html.lsp6
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
%>