mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
Firewall/alias, add reconfigure button + action for https://github.com/opnsense/core/issues/1858
This commit is contained in:
parent
270e6de7ff
commit
ab94750568
@ -30,6 +30,7 @@
|
||||
namespace OPNsense\Firewall\Api;
|
||||
|
||||
use \OPNsense\Base\ApiMutableModelControllerBase;
|
||||
use \OPNsense\Core\Backend;
|
||||
|
||||
/**
|
||||
* @package OPNsense\Firewall
|
||||
@ -170,4 +171,22 @@ class AliasController extends ApiMutableModelControllerBase
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* reconfigure aliases
|
||||
*/
|
||||
public function reconfigureAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$backend = new Backend();
|
||||
$backend->configdRun('template reload OPNsense/Filter');
|
||||
$bckresult = strtolower(
|
||||
trim($backend->configdRun("filter refresh_aliases"))
|
||||
);
|
||||
return array("status" => $bckresult);
|
||||
} else {
|
||||
return array("status" => "failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,6 +191,24 @@
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* reconfigure
|
||||
*/
|
||||
$("#reconfigureAct").click(function(){
|
||||
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
|
||||
ajaxCall("/api/firewall/alias/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 aliases') }}",
|
||||
message: data['status'],
|
||||
draggable: true
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@ -222,6 +240,11 @@
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<hr/>
|
||||
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b> <i id="reconfigureAct_progress" class=""></i></button>
|
||||
<br/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user