At 17:00 UTC (19:00 CEST, 13:00 EDT), this Gitlab instance will be upgraded and will be unavailable for a short while.

Commit e61f08c5 authored by Ted Trask's avatar Ted Trask
Browse files

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
parent de41e1d7
<% local form, viewlibrary, page_info, session = ...
require("viewfunctions")
require("htmlviewfunctions")
%>
<% if viewlibrary and viewlibrary.dispatch_component then
......@@ -9,47 +9,47 @@ end %>
<H1>Config</H1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
displayformstart(form)
htmlviewfunctions.displayformstart(form)
%>
</DL>
<H2>General Parameters</H2>
<DL>
<%
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")
%>
</DL>
<H2>DNS settings</H2>
<H3>DNS Parameters</H3>
<DL>
<%
displayformitem(form.value.mx_host, "mx_host")
htmlviewfunctions.displayformitem(form.value.mx_host, "mx_host")
%>
</DL>
<H3>DNS filtering</H3>
<DL>
<%
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")
%>
</DL>
<H2>DHCP Parameters</H2>
<DL>
<%
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")
%>
</DL>
<H2>Save Changes</H2>
<DL>
<%
displayformend(form)
htmlviewfunctions.displayformend(form)
%>
</DL>
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)
......
<% local data, viewlibrary = ...
require("viewfunctions")
%>
<% if viewlibrary and viewlibrary.dispatch_component then
......
......@@ -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()
......
../startstop-html.lsp
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment