summaryrefslogtreecommitdiffstats
path: root/dhcp-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp-controller.lua')
-rw-r--r--dhcp-controller.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/dhcp-controller.lua b/dhcp-controller.lua
index 8811e86..671e0b3 100644
--- a/dhcp-controller.lua
+++ b/dhcp-controller.lua
@@ -76,6 +76,41 @@ editnet = function ( self )
return ( cfe({ option = option, value = net, error = { value=nil, fields=nil }}) )
end
+createnet = function ( self )
+
+ if not self.clientdata.cmd then
+ list_redir(self)
+ end
+
+ local option = { script = ENV["SCRIPT_NAME"],
+ prefix = self.conf.prefix,
+ controller = self.conf.controller,
+ action = self.conf.action,
+ extra = ""
+ }
+
+ net = { name = { label="Name", value=self.model.nonil(self.clientdata.name), type="message" },
+ defleasetime = { label="Default Lease Time", value=self.model.nonil(self.clientdata.defleasetime), type="text" },
+ maxleasetime = { label="Maximum Lease Time", value=self.model.nonil(self.clientdata.maxleasetime), type="text" },
+ gateway = { label="Gateway", value=self.model.nonil(self.clientdata.gateway), type="text" },
+ domainname = { label="Domainname", value=self.model.nonil(self.clientdata.domainname), type="text" },
+ dnssrv1 = { label="DNS Server 1", value=self.model.nonil(self.clientdata.dnssrv1), type="text" },
+ dnssrv2 = { label="DNS Server 2", value=self.model.nonil(self.clientdata.dnssrv2), type="text" },
+ subnet = { label="Subnet", value=self.model.nonil(self.clientdata.subnet), type="text" },
+ netmask = { label="Netmask", value=self.model.nonil(self.clientdata.netmask), type="text" },
+ leaserangestart = { label="Lease Range Start", value=self.model.nonil(self.clientdata.leaserangestart), type="text" },
+ leaserangeend = { label="Lease Range End", value=self.model.nonil(self.clientdata.leaserangeend), type="text" },
+ wpad = { label="Web Proxy Auto Discovery", value=self.model.nonil(self.clientdata.wpad),
+ type="select", option = { "yes", "no"} }
+ }
+
+ if self.clientdata.cmd == "new" then
+ return ( cfe({ option = option, value = net, error = { value = nil, fields = nil }}) )
+ elseif self.clientdata.cmd == "create" then
+ return ( cfe({ option = option, value = net, error = { value = nil, fields = nil }}) )
+ end
+end
+
home = function ( self )
local srvctrl = ""