mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-09 08:56:23 -04:00
mail/postfix: the usual tweaks
This commit is contained in:
parent
8098fd496b
commit
d5e283e18e
3 changed files with 16 additions and 11 deletions
|
|
@ -58,6 +58,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function startAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun('postfix start');
|
||||
return array("response" => $response);
|
||||
|
|
@ -73,6 +75,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function stopAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("postfix stop");
|
||||
return array("response" => $response);
|
||||
|
|
@ -88,6 +92,8 @@ class ServiceController extends ApiControllerBase
|
|||
public function restartAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("postfix restart");
|
||||
return array("response" => $response);
|
||||
|
|
@ -121,7 +127,6 @@ class ServiceController extends ApiControllerBase
|
|||
$status = "unkown";
|
||||
}
|
||||
|
||||
|
||||
return array("status" => $status);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<OptionValues>
|
||||
<OK>OK</OK>
|
||||
<REJECT>REJECT</REJECT>
|
||||
</OptionValues>
|
||||
</OptionValues>
|
||||
</action>
|
||||
</recipient>
|
||||
</recipients>
|
||||
|
|
|
|||
|
|
@ -34,21 +34,21 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
<div id="general" class="tab-pane fade in active">
|
||||
<div class="content-box" style="padding-bottom: 1.5em;">
|
||||
{{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}}
|
||||
<hr />
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" id="saveAct" type="button"><b>{{ lang._('Save') }}</b><i id="saveAct_progress" class=""></i></button>
|
||||
<hr />
|
||||
<button class="btn btn-primary" id="saveAct" type="button"><b>{{ lang._('Save') }}</b> <i id="saveAct_progress"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="antispam" class="tab-pane fade in">
|
||||
<div class="content-box" style="padding-bottom: 1.5em;">
|
||||
<div class="alert alert-warning" role="alert" id="missing_rspamd" style="display:none;min-height:65px;">
|
||||
<div class="alert alert-warning" role="alert" id="missing_rspamd" style="display:none;min-height:65px;">
|
||||
<div style="margin-top: 8px;">{{ lang._('No Rspamd plugin found, please install and come back.')}}</div>
|
||||
</div>
|
||||
{{ partial("layout_partials/base_form",['fields':antispamForm,'id':'frm_antispam_settings'])}}
|
||||
<hr />
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" id="saveAct2" type="button"><b>{{ lang._('Save') }}</b><i id="saveAct2_progress" class=""></i></button>
|
||||
<hr />
|
||||
<button class="btn btn-primary" id="saveAct2" type="button"><b>{{ lang._('Save') }}</b> <i id="saveAct2_progress"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -68,7 +68,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
// check if Rspamd plugin is installed
|
||||
ajaxCall(url="/api/postfix/service/checkrspamd", sendData={}, callback=function(data,status) {
|
||||
if (data == "0") {
|
||||
if (data == "0") {
|
||||
$('#missing_rspamd').show();
|
||||
}
|
||||
});
|
||||
|
|
@ -76,7 +76,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
// link save button to API set action
|
||||
$("#saveAct").click(function () {
|
||||
saveFormToEndpoint(url="/api/postfix/general/set", formid='frm_general_settings',callback_ok=function () {
|
||||
$("#saveAct_progress").addClass("fa fa-spinner fa-pulse");
|
||||
$("#saveAct_progress").addClass("fa fa-spinner fa-pulse");
|
||||
ajaxCall(url="/api/postfix/service/reconfigure", sendData={}, callback=function (data,status) {
|
||||
ajaxCall(url="/api/postfix/service/status", sendData={}, callback=function (data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
|
|
@ -87,12 +87,12 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
});
|
||||
$("#saveAct2").click(function(){
|
||||
saveFormToEndpoint(url="/api/postfix/antispam/set", formid='frm_antispam_settings',callback_ok=function(){
|
||||
$("#saveAct2_progress").addClass("fa fa-spinner fa-pulse");
|
||||
$("#saveAct2_progress").addClass("fa fa-spinner fa-pulse");
|
||||
ajaxCall(url="/api/postfix/service/reconfigure", sendData={}, callback=function(data,status) {
|
||||
ajaxCall(url="/api/postfix/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
$("#saveAct2_progress").removeClass("fa fa-spinner fa-pulse");
|
||||
$("#saveAct2_progress").removeClass("fa fa-spinner fa-pulse");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue