From 6c38a0c60eaed72bee275bfe23d0783d8b6add4f Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 01:53:16 +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 --- bgp-controller.lua | 7 ++----- bgp-details-html.lsp | 1 - bgp-model.lua | 10 +++++++--- bgp-startstop-html.lsp | 1 - bgp-welcome-html.lsp | 1 - ospf-controller.lua | 7 ++----- ospf-details-html.lsp | 1 - ospf-model.lua | 10 +++++++--- ospf-startstop-html.lsp | 1 - ospf-welcome-html.lsp | 1 - zebra-controller.lua | 7 ++----- zebra-details-html.lsp | 1 - zebra-model.lua | 10 +++++++--- zebra-startstop-html.lsp | 1 - zebra-welcome-html.lsp | 1 - 15 files changed, 27 insertions(+), 33 deletions(-) delete mode 120000 bgp-startstop-html.lsp delete mode 120000 ospf-startstop-html.lsp delete mode 120000 zebra-startstop-html.lsp diff --git a/bgp-controller.lua b/bgp-controller.lua index dfe27e2..15d7658 100644 --- a/bgp-controller.lua +++ b/bgp-controller.lua @@ -1,8 +1,5 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "status" function status(self) @@ -14,10 +11,10 @@ function details(self) end function expert(self) - return controllerfunctions.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit BGP Config", "BGP Configuration Saved") + return self.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit BGP Config", "BGP Configuration Saved") 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 diff --git a/bgp-details-html.lsp b/bgp-details-html.lsp index 8f3283b..d8e1e0f 100644 --- a/bgp-details-html.lsp +++ b/bgp-details-html.lsp @@ -1,5 +1,4 @@ <% local data = ... -require("viewfunctions") %>

BGP routes

diff --git a/bgp-model.lua b/bgp-model.lua index db6fb2c..53ba356 100644 --- a/bgp-model.lua +++ b/bgp-model.lua @@ -2,7 +2,7 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") -require("format") +format = require("acf.format") -- Set variables local path="PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " @@ -72,8 +72,12 @@ function setconfigfile(filedetails) return modelfunctions.setfiledetails(filedetails, {configfile}) end -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 getdetails() diff --git a/bgp-startstop-html.lsp b/bgp-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/bgp-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp \ No newline at end of file diff --git a/bgp-welcome-html.lsp b/bgp-welcome-html.lsp index 251c503..baf324a 100644 --- a/bgp-welcome-html.lsp +++ b/bgp-welcome-html.lsp @@ -1,5 +1,4 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("status") then diff --git a/ospf-controller.lua b/ospf-controller.lua index 23b8fe3..9cabb3b 100644 --- a/ospf-controller.lua +++ b/ospf-controller.lua @@ -1,8 +1,5 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "status" function status(self) @@ -14,10 +11,10 @@ function details(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 expert(self) - return controllerfunctions.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit OSPF Config", "OSPF Configuration Saved") + return self.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit OSPF Config", "OSPF Configuration Saved") end diff --git a/ospf-details-html.lsp b/ospf-details-html.lsp index 4458c03..5e31849 100644 --- a/ospf-details-html.lsp +++ b/ospf-details-html.lsp @@ -1,5 +1,4 @@ <% local data = ... -require("viewfunctions") %>

OSPF routes

diff --git a/ospf-model.lua b/ospf-model.lua index 67ff868..55154f3 100644 --- a/ospf-model.lua +++ b/ospf-model.lua @@ -2,7 +2,7 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") -require("format") +format = require("acf.format") -- Set variables local path="PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " @@ -57,8 +57,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/ospf-startstop-html.lsp b/ospf-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/ospf-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp \ No newline at end of file diff --git a/ospf-welcome-html.lsp b/ospf-welcome-html.lsp index 251c503..baf324a 100644 --- a/ospf-welcome-html.lsp +++ b/ospf-welcome-html.lsp @@ -1,5 +1,4 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("status") then diff --git a/zebra-controller.lua b/zebra-controller.lua index 6e6f7b3..9d723c7 100644 --- a/zebra-controller.lua +++ b/zebra-controller.lua @@ -1,8 +1,5 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "status" function status(self) @@ -14,10 +11,10 @@ function details(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 expert(self) - return controllerfunctions.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Zebra Config", "Zebra Configuration Saved") + return self.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Zebra Config", "Zebra Configuration Saved") end diff --git a/zebra-details-html.lsp b/zebra-details-html.lsp index 94b5655..84feb45 100644 --- a/zebra-details-html.lsp +++ b/zebra-details-html.lsp @@ -1,5 +1,4 @@ <% local data = ... -require("viewfunctions") %>

Zebra routes

diff --git a/zebra-model.lua b/zebra-model.lua index de0edd4..f09b1a2 100644 --- a/zebra-model.lua +++ b/zebra-model.lua @@ -2,7 +2,7 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") -require("format") +format = require("acf.format") -- Set variables local path="PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " @@ -60,8 +60,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/zebra-startstop-html.lsp b/zebra-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/zebra-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp \ No newline at end of file diff --git a/zebra-welcome-html.lsp b/zebra-welcome-html.lsp index 251c503..baf324a 100644 --- a/zebra-welcome-html.lsp +++ b/zebra-welcome-html.lsp @@ -1,5 +1,4 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("status") then -- cgit v1.2.3