summaryrefslogtreecommitdiffstats
path: root/gnats-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gnats-controller.lua')
-rw-r--r--gnats-controller.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/gnats-controller.lua b/gnats-controller.lua
index 25d1ee5..d85445d 100644
--- a/gnats-controller.lua
+++ b/gnats-controller.lua
@@ -232,6 +232,15 @@ function query(self)
value="Submit",
})
+ -- Assume connection is down if you get no reply from it (disable buttons)
+ if not (query['severity']['option']) or (#query['severity']['option'] < 2) then
+ query.advanced_cmd.disabled="yes"
+ query.advanced_cmd.errtxt="Lost connection to the server!"
+ query.pr_cmd.disabled=query.advanced_cmd.disabled
+ query.pr_cmd.errtxt=query.advanced_cmd.errtxt
+
+ end
+
return {
option={ script=self.conf.script,
prefix=self.conf.prefix,
@@ -446,6 +455,13 @@ function report(self)
value="Submit",
type="submit",
})
+ -- Assume connection is down if you get no reply from it (disable buttons)
+ if not (reportform['severity']['option']) or (#reportform['severity']['option'] == 0) then
+ reportform.submit.disabled = "yes"
+ reportform.submit.errtxt = "Lost connection to the server!"
+ end
+
+
if (self.clientdata.submit) then