diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 01:28:54 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 01:28:54 +0000 |
commit | 8ba14caa082f7b1195db58f96375f6240630200c (patch) | |
tree | bd1bb150db4fa89235ccf9656b3287134ba0cda0 | |
parent | 5e7a02f85b5ef2a7f9824a4fc68f9e4e91015016 (diff) | |
download | acf-opennhrp-8ba14caa082f7b1195db58f96375f6240630200c.tar.bz2 acf-opennhrp-8ba14caa082f7b1195db58f96375f6240630200c.tar.xz |
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
-rw-r--r-- | opennhrp-controller.lua | 8 | ||||
-rw-r--r-- | opennhrp-editinterface-html.lsp | 4 | ||||
-rw-r--r-- | opennhrp-listinterfaces-html.lsp | 4 | ||||
-rw-r--r-- | opennhrp-model.lua | 10 | ||||
-rw-r--r-- | opennhrp-show-html.lsp | 4 | ||||
l--------- | opennhrp-startstop-html.lsp | 1 |
6 files changed, 16 insertions, 15 deletions
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") %> <script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script> @@ -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) %> <h1><%= html.html_escape(view.label) %></h1> <DL><TABLE> 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 %> <H2><%= html.html_escape(data.label) %></H2> <DL> <% -displayitem(data.value.status) +htmlviewfunctions.displayitem(data.value.status) %> <DT><%= html.html_escape(data.value.peers_list.label) %></DT> <DD> 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 |