MVC: simplify captive portal reload, for https://github.com/opnsense/core/issues/3951

This commit is contained in:
Ad Schellevis 2020-02-27 10:33:39 +01:00
parent 385c55f4e5
commit 481018404f

View File

@ -119,22 +119,7 @@ POSSIBILITY OF SUCH DAMAGE.
/**
* Reconfigure
*/
$("#reconfigureAct").click(function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall("/api/captiveportal/service/reconfigure", {}, function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Error reconfiguring captiveportal') }}",
message: data['status'],
draggable: true
});
}
});
});
$("#reconfigureAct").SimpleActionButton();
/*************************************************************************************************************
* File upload action, template dialog
@ -237,7 +222,12 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('After changing settings, please remember to apply them with the button below') }}
</div>
<hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b> <i id="reconfigureAct_progress"></i></button>
<button class="btn btn-primary" id="reconfigureAct"
data-endpoint='/api/captiveportal/service/reconfigure'
data-label="{{ lang._('Apply') }}"
data-error-title="{{ lang._('Error reconfiguring captiveportal') }}"
type="button"
></button>
<br/><br/>
</div>
</div>