From 2e998a74933a039aa12bb9ce70f5a27d07bcc1cf Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 01:20:36 +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 --- qos-config-html.lsp | 4 ++-- qos-controller.lua | 9 +++------ qos-details-html.lsp | 4 ++-- qos-model.lua | 12 ++++++++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/qos-config-html.lsp b/qos-config-html.lsp index 31c965a..02f0d2a 100644 --- a/qos-config-html.lsp +++ b/qos-config-html.lsp @@ -1,10 +1,10 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %>

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

<% local order = {"DEV", "DEV_RATE", "INGRESS_ALG", "IFB_DEV", "INGRESS_RATE", "EGRESS_ALG", "EGRESS_RATE"} form.value.DEV.readonly = true - displayform(form, order, nil, page_info) + htmlviewfunctions.displayform(form, order, nil, page_info) %> diff --git a/qos-controller.lua b/qos-controller.lua index c3358e8..703061a 100644 --- a/qos-controller.lua +++ b/qos-controller.lua @@ -1,8 +1,5 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "status" function status(self) @@ -10,7 +7,7 @@ function status(self) end function startstop(self) - return controllerfunctions.handle_startstop(self, function(action) return self.model.startstop_service(self.clientdata.init, action) end, self.clientdata) + return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata) end function details(self) @@ -22,9 +19,9 @@ function enable(self) end function config(self) - return controllerfunctions.handle_form(self, function() return self.model.get_config(self.clientdata.DEV) end, self.model.update_config, self.clientdata, "Save", "Edit QOS Config", "Configuration Set") + return self.handle_form(self, function() return self.model.get_config(self.clientdata.DEV) end, self.model.update_config, self.clientdata, "Save", "Edit QOS Config", "Configuration Set") end function expert(self) - return controllerfunctions.handle_form(self, function() return self.model.get_filedetails(self.clientdata.interface) end, self.model.update_filedetails, self.clientdata, "Save", "Edit QOS Config", "Configuration Set") + return self.handle_form(self, function() return self.model.get_filedetails(self.clientdata.interface) end, self.model.update_filedetails, self.clientdata, "Save", "Edit QOS Config", "Configuration Set") end diff --git a/qos-details-html.lsp b/qos-details-html.lsp index d5516bc..156fa81 100644 --- a/qos-details-html.lsp +++ b/qos-details-html.lsp @@ -1,8 +1,8 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"enable","config","expert","startstop"}, session) %> +<% htmlviewfunctions.displaycommandresults({"enable","config","expert","startstop"}, session) %> <% viewlibrary.dispatch_component("status") %> diff --git a/qos-model.lua b/qos-model.lua index 81ba993..693ab5e 100644 --- a/qos-model.lua +++ b/qos-model.lua @@ -2,8 +2,8 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") -require("fs") -require("format") +fs = require("acf.fs") +format = require("acf.format") -- Set variables local packagename = "iproute2-qos" @@ -52,8 +52,12 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function startstop_service(processname, 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() -- cgit v1.2.3