From e61f08c5a9e86d5d313038765e7f261f0bc2258b Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 01:11:13 +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 --- dnsmasq-config-html.lsp | 28 ++++++++++++++-------------- dnsmasq-controller.lua | 9 +++------ dnsmasq-logfile-html.lsp | 1 - dnsmasq-model.lua | 14 +++++++++----- dnsmasq-startstop-html.lsp | 1 - 5 files changed, 26 insertions(+), 27 deletions(-) delete mode 120000 dnsmasq-startstop-html.lsp diff --git a/dnsmasq-config-html.lsp b/dnsmasq-config-html.lsp index a9db81a..bd10b92 100644 --- a/dnsmasq-config-html.lsp +++ b/dnsmasq-config-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then @@ -9,47 +9,47 @@ end %>

Config

<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action - displayformstart(form) + htmlviewfunctions.displayformstart(form) %>

General Parameters

<% - displayformitem(form.value.interface, "interface") - displayformitem(form.value.listen_address, "listen_address") - displayformitem(form.value.domain, "domain") + htmlviewfunctions.displayformitem(form.value.interface, "interface") + htmlviewfunctions.displayformitem(form.value.listen_address, "listen_address") + htmlviewfunctions.displayformitem(form.value.domain, "domain") %>

DNS settings

DNS Parameters

<% - displayformitem(form.value.mx_host, "mx_host") + htmlviewfunctions.displayformitem(form.value.mx_host, "mx_host") %>

DNS filtering

<% - displayformitem(form.value.dns_filtering, "dns_filtering") - displayformitem(form.value.dns_whitelist, "dns_whitelist") - displayformitem(form.value.dns_default_address, "dns_default_address") + htmlviewfunctions.displayformitem(form.value.dns_filtering, "dns_filtering") + htmlviewfunctions.displayformitem(form.value.dns_whitelist, "dns_whitelist") + htmlviewfunctions.displayformitem(form.value.dns_default_address, "dns_default_address") %>

DHCP Parameters

<% - displayformitem(form.value.dhcp_range, "dhcp_range") - displayformitem(form.value.no_dhcp_interface, "no_dhcp_interface") - displayformitem(form.value.dhcp_host, "dhcp_host") - displayformitem(form.value.dhcp_option, "dhcp_option") + htmlviewfunctions.displayformitem(form.value.dhcp_range, "dhcp_range") + htmlviewfunctions.displayformitem(form.value.no_dhcp_interface, "no_dhcp_interface") + htmlviewfunctions.displayformitem(form.value.dhcp_host, "dhcp_host") + htmlviewfunctions.displayformitem(form.value.dhcp_option, "dhcp_option") %>

Save Changes

<% - displayformend(form) + htmlviewfunctions.displayformend(form) %>
diff --git a/dnsmasq-controller.lua b/dnsmasq-controller.lua index 41e3780..5ba412b 100644 --- a/dnsmasq-controller.lua +++ b/dnsmasq-controller.lua @@ -1,8 +1,5 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "status" function status(self) @@ -10,15 +7,15 @@ function status(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 config(self) - return controllerfunctions.handle_form(self, self.model.getconfig, self.model.setconfig, self.clientdata, "Save", "Edit Config", "Configuration Set") + return self.handle_form(self, self.model.getconfig, self.model.setconfig, self.clientdata, "Save", "Edit Config", "Configuration Set") end function expert(self) - return controllerfunctions.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Config File", "Configuration File Set") + return self.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Config File", "Configuration File Set") end function viewleases(self) diff --git a/dnsmasq-logfile-html.lsp b/dnsmasq-logfile-html.lsp index 099d6ae..8c0688c 100644 --- a/dnsmasq-logfile-html.lsp +++ b/dnsmasq-logfile-html.lsp @@ -1,5 +1,4 @@ <% local data, viewlibrary = ... -require("viewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then diff --git a/dnsmasq-model.lua b/dnsmasq-model.lua index b2a6465..d3051cf 100644 --- a/dnsmasq-model.lua +++ b/dnsmasq-model.lua @@ -2,9 +2,9 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") -require("fs") -require("format") -require("validator") +fs = require("acf.fs") +format = require("acf.format") +validator = require("acf.validator") -- Set variables local configfile = "/etc/dnsmasq.conf" @@ -259,8 +259,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/dnsmasq-startstop-html.lsp b/dnsmasq-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/dnsmasq-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp \ No newline at end of file -- cgit v1.2.3