diff options
author | Andreas Brodmann <andreas.brodmann@gmail.com> | 2007-11-20 20:26:03 +0000 |
---|---|---|
committer | Andreas Brodmann <andreas.brodmann@gmail.com> | 2007-11-20 20:26:03 +0000 |
commit | a6854b1bc082f83a96c10a2d3adbf0b8fe01231a (patch) | |
tree | c77400047e916291b313227faeab577607225517 /squid-controller.lua | |
parent | b2a4c830601186377d8999bac02ea465fd704e66 (diff) | |
download | acf-squid-a6854b1bc082f83a96c10a2d3adbf0b8fe01231a.tar.bz2 acf-squid-a6854b1bc082f83a96c10a2d3adbf0b8fe01231a.tar.xz |
/acf/squid: added advanced configuration page
git-svn-id: svn://svn.alpinelinux.org/acf/squid/trunk@351 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'squid-controller.lua')
-rw-r--r-- | squid-controller.lua | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/squid-controller.lua b/squid-controller.lua index 46da101..3e8522f 100644 --- a/squid-controller.lua +++ b/squid-controller.lua @@ -51,3 +51,32 @@ basic = function( self ) return ( cfe ({ option = option, service = service }) ) end +advanced = function( self ) + + local option = { script = ENV["SCRIPT_NAME"], + prefix = self.conf.prefix, + controller = self.conf.controller, + action = self.conf.action, + extra = "" + } + + local service = { message="", status="", config="" } + if self.clientdata.srvcmd then + local srvcmd = self.clientdata.srvcmd + if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then + service.message = self.model.service_control( srvcmd ) + end + end + + if self.clientdata.cmd then + if self.clientdata.cmd == "save" then + service.message = self.model.update_config( self.clientdata.config ) + end + end + + service.status = self.model.get_status() + service.config = self.model.get_config() + + return ( cfe ({ option = option, service = service }) ) +end + |