Skip to content

Commit

Permalink
firewall/filter: Implement grid and apply button partials, change seq…
Browse files Browse the repository at this point in the history
…uence to auto number field and require uniqueness, split view from filter.volt to filter_rule.volt to test things without causing regressions in other controllers using the same view, construct form with almost same layout as old firewall form hiding most options under advanced that are not needed for creating basic rules, for #8367
  • Loading branch information
Monviech committed Feb 21, 2025
1 parent 3caf9e1 commit 2c5150f
Show file tree
Hide file tree
Showing 6 changed files with 413 additions and 36 deletions.
1 change: 1 addition & 0 deletions plist
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@
/usr/local/opnsense/mvc/app/views/OPNsense/Firewall/alias_util.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Firewall/category.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Firewall/filter_rule.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Firewall/group.volt
/usr/local/opnsense/mvc/app/views/OPNsense/IDS/index.volt
/usr/local/opnsense/mvc/app/views/OPNsense/IDS/policy.volt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (C) 2020 Deciso B.V.
* Copyright (C) 2020-2025 Deciso B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -37,7 +37,7 @@ public function searchRuleAction()
$filter_funct = function ($record) use ($category) {
return empty($category) || array_intersect(explode(',', $record->categories), $category);
};
return $this->searchBase("rules.rule", ['enabled', 'sequence', 'action', 'description'], "sequence", $filter_funct);
return $this->searchBase("rules.rule", null, "sequence", $filter_funct);
}

public function setRuleAction($uuid)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright (C) 2020 Deciso B.V.
* Copyright (C) 2020-2025 Deciso B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -31,20 +31,8 @@ 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 = [
[
'id' => 'enabled', 'formatter' => 'rowtoggle' ,'width' => '6em', 'heading' => gettext('Enabled')
],
[
'id' => 'sequence','width' => '9em', 'heading' => gettext('Sequence')
],
[
'id' => 'description', 'heading' => gettext('Description')
]
];
$this->view->pick('OPNsense/Firewall/filter_rule');
$this->view->formDialogFilterRule = $this->getForm("dialogFilterRule");
$this->view->formGridFilterRule = $this->getFormGrid('dialogFilterRule');
}
}
Loading

0 comments on commit 2c5150f

Please sign in to comment.