Commit 7a58a33c authored by Ted Trask's avatar Ted Trask

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 50ed5582
<% local form, viewlibrary, page_info, session = ...
require("viewfunctions")
require("htmlviewfunctions")
%>
<% if viewlibrary and viewlibrary.dispatch_component then
......@@ -9,5 +9,5 @@ end %>
<H1>Config</H1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
displayform(form)
htmlviewfunctions.displayform(form)
%>
module(..., package.seeall)
-- Load libraries
require("controllerfunctions")
default_action = "status"
function status(self)
......@@ -10,19 +7,19 @@ 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 editips(self)
return controllerfunctions.handle_form(self, self.model.getIPs, self.model.setIPs, self.clientdata, "Save", "Edit IP List", "IP List Set")
return self.handle_form(self, self.model.getIPs, self.model.setIPs, self.clientdata, "Save", "Edit IP List", "IP List Set")
end
function listdomains(self)
......@@ -30,11 +27,11 @@ function listdomains(self)
end
function createdomain(self)
return controllerfunctions.handle_form(self, self.model.getNewDomain, self.model.setNewDomain, self.clientdata, "Create", "Create New Domain", "New Domain Created")
return self.handle_form(self, self.model.getNewDomain, self.model.setNewDomain, self.clientdata, "Create", "Create New Domain", "New Domain Created")
end
function editdomain(self)
return controllerfunctions.handle_form(self, function(form) return self.model.getDomain(self.clientdata.domain) end,
return self.handle_form(self, function(form) return self.model.getDomain(self.clientdata.domain) end,
self.model.setDomain, self.clientdata, "Save", "Edit Domain Entry", "Domain Saved")
end
......
<% local form, viewlibrary, page_info = ...
require("viewfunctions")
require("htmlviewfunctions")
%>
<H1><%= html.html_escape(form.label) %></H1>
......@@ -7,5 +7,5 @@ require("viewfunctions")
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
form.value.domain.readonly = true
local order = { "domain", "iplist" }
displayform(form, order)
htmlviewfunctions.displayform(form, order)
%>
<% local data, viewlibrary, page_info, session = ...
require("viewfunctions")
require("htmlviewfunctions")
%>
<% displaycommandresults({"editdomain", "deletedomain"}, session) %>
<% displaycommandresults({"createdomain"}, session, true) %>
<% htmlviewfunctions.displaycommandresults({"editdomain", "deletedomain"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createdomain"}, session, true) %>
<h1>Configuration</h1>
<h2>Edit/View DNS server entries</h2>
......
module(..., package.seeall)
-- Load libraries
require("modelfunctions")
require("fs")
require("format")
require("posix")
require("validator")
require("modelfunctions")
fs = require("acf.fs")
format = require("acf.format")
validator = require("acf.validator")
-- Set variables
local configfile = "/etc/conf.d/dnscache"
......@@ -59,8 +59,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