firewall: fix a warning and integrate menu nicer #6383

This commit is contained in:
Franco Fichtner 2024-01-11 09:37:51 +01:00
parent 6ab8f8cf2d
commit 0803a233d0
6 changed files with 7 additions and 6 deletions

View File

@ -32,6 +32,7 @@ class FilterController extends \OPNsense\Base\IndexController
public function indexAction()
{
$this->view->pick('OPNsense/Firewall/filter');
$this->view->SavePointBtns = true;
$this->view->ruleController = "filter";
$this->view->gridFields = [
[

View File

@ -33,7 +33,6 @@ class NptController extends \OPNsense\Base\IndexController
{
$this->view->pick('OPNsense/Firewall/filter');
$this->view->ruleController = "npt";
$this->view->hideSavePointBtns = true;
$this->view->gridFields = [
[
'id' => 'enabled', 'formatter' => 'rowtoggle' ,'width' => '6em', 'heading' => gettext('Enabled')

View File

@ -32,6 +32,7 @@ class SourceNatController extends \OPNsense\Base\IndexController
public function indexAction()
{
$this->view->pick('OPNsense/Firewall/filter');
$this->view->SavePointBtns = true;
$this->view->ruleController = "source_nat";
$this->view->gridFields = [
[

View File

@ -1,20 +1,20 @@
<acl>
<page-filter-api>
<name>Firewall: Rules: API</name>
<name>Firewall: Automation: Filter</name>
<patterns>
<pattern>ui/firewall/filter/*</pattern>
<pattern>api/firewall/filter/*</pattern>
</patterns>
</page-filter-api>
<page-filter-snat-api>
<name>Firewall: SourceNat: API</name>
<name>Firewall: Automation: Source NAT</name>
<patterns>
<pattern>ui/firewall/source_nat/*</pattern>
<pattern>api/firewall/source_nat/*</pattern>
</patterns>
</page-filter-snat-api>
<page-firewall-nat-npt>
<name>Firewall: NAT: NPT</name>
<name>Firewall: NAT: NPTv6</name>
<patterns>
<pattern>ui/firewall/npt/*</pattern>
<pattern>api/firewall/npt/*</pattern>

View File

@ -1,6 +1,6 @@
<menu>
<Firewall>
<Automation order="1000" cssClass="fa fa-gear">
<Automation cssClass="fa fa-gear">
<Filter order="50" url="/ui/firewall/filter/">
<FilterRef url="/ui/firewall/filter#*" visibility="hidden"/>
</Filter>

View File

@ -213,7 +213,7 @@
data-error-title="{{ lang._('Filter load error') }}"
type="button"
></button>
{% if not hideSavePointBtns|default(false) %}
{% if SavePointBtns is defined %}
<div class="pull-right">
<button class="btn" id="savepointAct"
data-endpoint='/api/firewall/{{ruleController}}/savepoint'