diff options
-rw-r--r-- | shorewall-config-html.lsp | 33 | ||||
-rw-r--r-- | shorewall-controller.lua | 11 |
2 files changed, 17 insertions, 27 deletions
diff --git a/shorewall-config-html.lsp b/shorewall-config-html.lsp index 3f8eb8d..0a54950 100644 --- a/shorewall-config-html.lsp +++ b/shorewall-config-html.lsp @@ -100,34 +100,15 @@ displayinfo(myform,tags) </form> - +<form name="cmd" action="<?= form.option.link ?>/<?= form.option.action ?>" method="POST"> +<H1>MANAGEMENT</H1> +<dl> <? -local cmdform = form.management -local tags = { "restart" } -if (cmdform) and (cmdform[tags[1]]) then +local tags = { "check_cmd",} +displayinfo(myform,tags) ?> - <form name="management" action="" method="POST"> - <H1>MANAGEMENT</H1> - <dl> - <dt><?= cmdform[tags[1]]["label"] ?></dt> - <dd> - <? for k,v in pairs(tags) do ?> - <? if (cmdform[v]) then ?> - <? io.write(html.form[cmdform[v].type](cmdform[v])) ?> - <? end ?> - <? end ?> - </dd> - - <? if (form.cmdmanagement) and (#form.cmdmanagement.descr > 0) then ?> - <dt>Previous action result</dt> - <dd><pre><?= form.cmdmanagement.descr ?></pre></dd> - <? end ?> - </dl> - </form> - -<? end ?> - -<? --]] ?> +</dl> +</form> <? --[[ DEBUG INFORMATION diff --git a/shorewall-controller.lua b/shorewall-controller.lua index dd64ae2..f515719 100644 --- a/shorewall-controller.lua +++ b/shorewall-controller.lua @@ -589,6 +589,15 @@ function config(self) }) config.rules_cmd.descr="Mark a item in above list before pressing [" .. config.rules_cmd.value .. "]" + -- Add button + config.check_cmd = cfe ({ + name="check_cmd", + label="Check if config works", + descr="Attention! This check could take a long time depending on your configuration.", + value="Check", + type="submit", + }) + -- Management buttons -- Display management buttons local management = displaycmdmanagement(disablestart,disablestop,disablerestart) @@ -653,7 +662,7 @@ function config(self) option={ script=ENV["SCRIPT_NAME"], prefix=self.conf.prefix, controller = self.conf.controller, - action = "expert", + action = "check", link = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller, }, clientdata=clientdata, savesuccess=savesuccess, |