From 8ba14caa082f7b1195db58f96375f6240630200c Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 01:28:54 +0000 Subject: Started work on updating for acf-core-0.15 Removed controllerfunctions library (still needs more work and corresponding work in model) Updated startstop functionality and deleted view Updated for viewfunctions to htmlviewfunctions and modified require statements for acf libraries --- opennhrp-controller.lua | 8 +++----- opennhrp-editinterface-html.lsp | 4 ++-- opennhrp-listinterfaces-html.lsp | 4 ++-- opennhrp-model.lua | 10 +++++++--- opennhrp-show-html.lsp | 4 ++-- opennhrp-startstop-html.lsp | 1 - 6 files changed, 16 insertions(+), 15 deletions(-) delete mode 120000 opennhrp-startstop-html.lsp diff --git a/opennhrp-controller.lua b/opennhrp-controller.lua index 305898b..4468997 100644 --- a/opennhrp-controller.lua +++ b/opennhrp-controller.lua @@ -1,7 +1,5 @@ module(..., package.seeall) -require("controllerfunctions") - default_action = "status" function status(self) @@ -13,7 +11,7 @@ function show(self) end function startstop(self) - return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata) + return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata) end function listinterfaces(self) @@ -21,9 +19,9 @@ function listinterfaces(self) end function editinterface(self) - return controllerfunctions.handle_form(self, function() return self.model.getinterfacedetails(self.clientdata.interface) end, self.model.updateinterfacedetails, self.clientdata, "Save", "Edit Interface Config", "Interface Configuration Set") + return self.handle_form(self, function() return self.model.getinterfacedetails(self.clientdata.interface) end, self.model.updateinterfacedetails, self.clientdata, "Save", "Edit Interface Config", "Interface Configuration Set") end function expert (self) - return controllerfunctions.handle_form(self, function() return self.model:getconfigfile() end, function(value) return self.model:setconfigfile(value) end, self.clientdata, "Save", "Edit Config", "Configuration Set") + return self.handle_form(self, function() return self.model:getconfigfile() end, function(value) return self.model:setconfigfile(value) end, self.clientdata, "Save", "Edit Config", "Configuration Set") end diff --git a/opennhrp-editinterface-html.lsp b/opennhrp-editinterface-html.lsp index 924f6db..b389f9d 100644 --- a/opennhrp-editinterface-html.lsp +++ b/opennhrp-editinterface-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> @@ -23,5 +23,5 @@ require("viewfunctions") <% form.value.interface.readonly = true local option = {"interface", "type", "map"} - displayform(form, option, nil, page_info) + htmlviewfunctions.displayform(form, option, nil, page_info) %> diff --git a/opennhrp-listinterfaces-html.lsp b/opennhrp-listinterfaces-html.lsp index ea899d0..8a38e51 100644 --- a/opennhrp-listinterfaces-html.lsp +++ b/opennhrp-listinterfaces-html.lsp @@ -1,8 +1,8 @@ <% local view, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"editinterface"}, session) %> +<% htmlviewfunctions.displaycommandresults({"editinterface"}, session) %>

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

diff --git a/opennhrp-model.lua b/opennhrp-model.lua index fac0358..b23cb67 100644 --- a/opennhrp-model.lua +++ b/opennhrp-model.lua @@ -2,7 +2,7 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") -require("validator") +validator = require("acf.validator") -- Set variables local configfile = "/etc/opennhrp/opennhrp.conf" @@ -178,8 +178,12 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function startstop_service(action) - return modelfunctions.startstop_service(processname, action) +function get_startstop(clientdata) + return modelfunctions.get_startstop(processname) +end + +function startstop_service(startstop, action) + return modelfunctions.startstop_service(startstop, action) end function getstatus() diff --git a/opennhrp-show-html.lsp b/opennhrp-show-html.lsp index 5725861..9ca12f6 100644 --- a/opennhrp-show-html.lsp +++ b/opennhrp-show-html.lsp @@ -1,5 +1,5 @@ <% local data, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then @@ -9,7 +9,7 @@ end %>

<%= html.html_escape(data.label) %>

<% -displayitem(data.value.status) +htmlviewfunctions.displayitem(data.value.status) %>
<%= html.html_escape(data.value.peers_list.label) %>
diff --git a/opennhrp-startstop-html.lsp b/opennhrp-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/opennhrp-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp \ No newline at end of file -- cgit v1.2.3