summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-05-06 14:42:01 +0000
committerMika Havela <mika.havela@gmail.com>2008-05-06 14:42:01 +0000
commit064e8596773fef919fdd159788d1b69fd9df13e2 (patch)
tree815b16e2f79211438568c8d2ce75f5c4ce1d82fa
parent8fe21698be1d61a66614019df3900d24715f63dd (diff)
downloadacf-squid-064e8596773fef919fdd159788d1b69fd9df13e2.tar.bz2
acf-squid-064e8596773fef919fdd159788d1b69fd9df13e2.tar.xz
Fixed a bug when start/stop/restart the process. Buttons now enable/disable the right way.
git-svn-id: svn://svn.alpinelinux.org/acf/squid/trunk@1106 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--squid-advanced-html.lsp2
-rw-r--r--squid-authentication-html.lsp2
-rw-r--r--squid-basic-html.lsp2
-rw-r--r--squid-controller.lua50
-rw-r--r--squid-model.lua2
5 files changed, 29 insertions, 29 deletions
diff --git a/squid-advanced-html.lsp b/squid-advanced-html.lsp
index 0121991..2a62e88 100644
--- a/squid-advanced-html.lsp
+++ b/squid-advanced-html.lsp
@@ -7,7 +7,7 @@ require("viewfunctions")
local srv1fill = ""
local srv2fill = "disabled"
- if service.status == "running" then
+ if form.info.status.value == "Enabled" then
srv1fill = "disabled"
srv2fill = ""
end
diff --git a/squid-authentication-html.lsp b/squid-authentication-html.lsp
index 3835be6..621d4c9 100644
--- a/squid-authentication-html.lsp
+++ b/squid-authentication-html.lsp
@@ -8,7 +8,7 @@ require("viewfunctions")
local srv1fill = ""
local srv2fill = "disabled"
- if form.info.status.value == "running" then
+ if form.info.status.value == "Enabled" then
srv1fill = "disabled"
srv2fill = ""
end
diff --git a/squid-basic-html.lsp b/squid-basic-html.lsp
index 8d1cd43..e084ddb 100644
--- a/squid-basic-html.lsp
+++ b/squid-basic-html.lsp
@@ -8,7 +8,7 @@ require("viewfunctions")
local srv1fill = ""
local srv2fill = "disabled"
- if form.info.status.value == "running" then
+ if form.info.status.value == "Enabled" then
srv1fill = "disabled"
srv2fill = ""
end
diff --git a/squid-controller.lua b/squid-controller.lua
index 7014935..b1f5cd1 100644
--- a/squid-controller.lua
+++ b/squid-controller.lua
@@ -22,6 +22,14 @@ end
basic = function( self )
+ local service = {}
+ if self.clientdata.srvcmd then
+ local srvcmd = self.clientdata.srvcmd
+ if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then
+ service.srvcmdresult, service.message = self.model.service_control( srvcmd )
+ end
+ end
+
local info = {
status=self.model.get_status(),
version = self.model.get_squid_version(),
@@ -40,14 +48,6 @@ basic = function( self )
redirect(self, "dep")
end
- local service = {}
- if self.clientdata.srvcmd then
- local srvcmd = self.clientdata.srvcmd
- if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then
- service.srvcmdresult, service.message = self.model.service_control( srvcmd )
- end
- end
-
if self.clientdata.cmd then
local cmd = self.clientdata.cmd
if cmd == "save" then
@@ -75,6 +75,14 @@ end
authentication = function( self )
+ local service = {}
+ if self.clientdata.srvcmd then
+ local srvcmd = self.clientdata.srvcmd
+ if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then
+ service.srvcmdresult, service.message = self.model.service_control( srvcmd )
+ end
+ end
+
local info = {
status=self.model.get_status(),
version = self.model.get_squid_version(),
@@ -88,14 +96,6 @@ authentication = function( self )
action = self.conf.action,
extra = ""
}
-
- local service = {}
- if self.clientdata.srvcmd then
- local srvcmd = self.clientdata.srvcmd
- if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then
- service.srvcmdresult, service.message = self.model.service_control( srvcmd )
- end
- end
if self.clientdata.inout then
local newauth = ""
@@ -121,11 +121,19 @@ authentication = function( self )
service.status = self.model.get_status()
service.config, service.error = self.model.get_basic_config()
- return ( cfe ({ option = option, service = service, info = info }) )
+ return ( cfe ({ option = option, service = service, info = info, mdebug=self.clientdata }) )
end
advanced = function( self )
+ local service = {}
+ if self.clientdata.srvcmd then
+ local srvcmd = self.clientdata.srvcmd
+ if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then
+ service.srvcmdresult, service.message = self.model.service_control( srvcmd )
+ end
+ end
+
local info = {
status=self.model.get_status(),
version = self.model.get_squid_version(),
@@ -140,14 +148,6 @@ advanced = function( self )
extra = ""
}
- local service = {}
- if self.clientdata.srvcmd then
- local srvcmd = self.clientdata.srvcmd
- if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then
- service.srvcmdresult, 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_adv_config( self.clientdata.config )
diff --git a/squid-model.lua b/squid-model.lua
index f23f026..8e20e34 100644
--- a/squid-model.lua
+++ b/squid-model.lua
@@ -57,7 +57,7 @@ end
---
get_status = function()
- local t = procps.pidof(procname)
+ local t = procps.pidof(processname)
local stats
if (t) and (#t > 0) then
stats = "Enabled"