mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/frr: Add area configuration to ospf (#4880)
* net/frr: Add area configuration to ospf * Simplify template and options * Add changelog
This commit is contained in:
+2
-1
@@ -15,7 +15,8 @@ Plugin Changelog
|
||||
1.46
|
||||
|
||||
* Add address family selection to peer groups (opnsense/plugins/pull/4861)
|
||||
* Add OSPF point-to-multipoint options (contributed by Andy Binder)
|
||||
* Add OSPF point-to-multipoint options (contributed by Andy Binder) (opnsense/plugins/pull/4879)
|
||||
* Add OSPF area configuration options (opnsense/plugins/pull/4880)
|
||||
|
||||
1.45
|
||||
|
||||
|
||||
+25
@@ -62,6 +62,31 @@ class OspfsettingsController extends ApiMutableModelControllerBase
|
||||
return $this->setBase('neighbor', 'neighbors.neighbor', $uuid);
|
||||
}
|
||||
|
||||
public function searchAreaAction()
|
||||
{
|
||||
return $this->searchBase('areas.area');
|
||||
}
|
||||
public function getAreaAction($uuid = null)
|
||||
{
|
||||
return $this->getBase('area', 'areas.area', $uuid);
|
||||
}
|
||||
public function addAreaAction()
|
||||
{
|
||||
return $this->addBase('area', 'areas.area');
|
||||
}
|
||||
public function delAreaAction($uuid)
|
||||
{
|
||||
return $this->delBase('areas.area', $uuid);
|
||||
}
|
||||
public function setAreaAction($uuid)
|
||||
{
|
||||
return $this->setBase('area', 'areas.area', $uuid);
|
||||
}
|
||||
public function toggleAreaAction($uuid)
|
||||
{
|
||||
return $this->toggleBase('areas.area', $uuid);
|
||||
}
|
||||
|
||||
public function searchNetworkAction()
|
||||
{
|
||||
return $this->searchBase('networks.network');
|
||||
|
||||
@@ -34,6 +34,9 @@ class OspfController extends \OPNsense\Base\IndexController
|
||||
{
|
||||
$this->view->generalForm = $this->getForm("ospf");
|
||||
|
||||
$this->view->formDialogEditOSPFArea = $this->getForm("dialogEditOSPFArea");
|
||||
$this->view->formGridEditOSPFArea = $this->getFormGrid("dialogEditOSPFArea");
|
||||
|
||||
$this->view->formDialogEditOSPFNeighbor = $this->getForm("dialogEditOSPFNeighbor");
|
||||
$this->view->formGridEditOSPFNeighbor = $this->getFormGrid("dialogEditOSPFNeighbor");
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<form>
|
||||
<field>
|
||||
<id>area.enabled</id>
|
||||
<label>Enabled</label>
|
||||
<type>checkbox</type>
|
||||
<grid_view>
|
||||
<width>6em</width>
|
||||
<type>boolean</type>
|
||||
<formatter>rowtoggle</formatter>
|
||||
</grid_view>
|
||||
</field>
|
||||
<field>
|
||||
<id>area.id</id>
|
||||
<label>Area ID</label>
|
||||
<type>text</type>
|
||||
<help>Enter area ID in dotted (e.g. 0.0.0.1) format.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>area.type</id>
|
||||
<label>Area Type</label>
|
||||
<type>dropdown</type>
|
||||
<help>Select area behavior.</help>
|
||||
</field>
|
||||
</form>
|
||||
@@ -49,6 +49,37 @@
|
||||
<enable>/^(?!0).*$/</enable>
|
||||
</filters>
|
||||
</passiveinterfaces>
|
||||
<areas>
|
||||
<area type="ArrayField">
|
||||
<enabled type="BooleanField">
|
||||
<Default>1</Default>
|
||||
<Required>Y</Required>
|
||||
</enabled>
|
||||
<id type="NetworkField">
|
||||
<Required>Y</Required>
|
||||
<AddressFamily>ipv4</AddressFamily>
|
||||
<NetMaskAllowed>N</NetMaskAllowed>
|
||||
<ValidationMessage>Please enter area ID in dotted (e.g. 0.0.0.1) format.</ValidationMessage>
|
||||
<Constraints>
|
||||
<check001>
|
||||
<type>UniqueConstraint</type>
|
||||
<ValidationMessage>The area ID must be unique.</ValidationMessage>
|
||||
</check001>
|
||||
</Constraints>
|
||||
</id>
|
||||
<type type="OptionField">
|
||||
<Required>Y</Required>
|
||||
<Default>standard</Default>
|
||||
<OptionValues>
|
||||
<standard>standard</standard>
|
||||
<stub>stub</stub>
|
||||
<stub-no-summary value="stub no-summary">stub no-summary</stub-no-summary>
|
||||
<nssa>nssa</nssa>
|
||||
<nssa-no-summary value="nssa no-summary">nssa no-summary</nssa-no-summary>
|
||||
</OptionValues>
|
||||
</type>
|
||||
</area>
|
||||
</areas>
|
||||
<networks>
|
||||
<network type="ArrayField">
|
||||
<enabled type="BooleanField">
|
||||
|
||||
@@ -59,6 +59,14 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
'del':'/api/quagga/ospfsettings/del_neighbor/',
|
||||
'toggle':'/api/quagga/ospfsettings/toggle_neighbor/'
|
||||
});
|
||||
$("#{{formGridEditOSPFArea['table_id']}}").UIBootgrid({
|
||||
'search':'/api/quagga/ospfsettings/search_area',
|
||||
'get':'/api/quagga/ospfsettings/get_area/',
|
||||
'set':'/api/quagga/ospfsettings/set_area/',
|
||||
'add':'/api/quagga/ospfsettings/add_area/',
|
||||
'del':'/api/quagga/ospfsettings/del_area/',
|
||||
'toggle':'/api/quagga/ospfsettings/toggle_area/'
|
||||
});
|
||||
$("#{{formGridEditNetwork['table_id']}}").UIBootgrid({
|
||||
'search':'/api/quagga/ospfsettings/search_network',
|
||||
'get':'/api/quagga/ospfsettings/get_network/',
|
||||
@@ -154,6 +162,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
|
||||
<li class="active"><a data-toggle="tab" href="#general">{{ lang._('General') }}</a></li>
|
||||
<li><a data-toggle="tab" href="#neighbors">{{ lang._('Neighbors') }}</a></li>
|
||||
<li><a data-toggle="tab" href="#areas">{{ lang._('Areas') }}</a></li>
|
||||
<li><a data-toggle="tab" href="#networks">{{ lang._('Networks') }}</a></li>
|
||||
<li><a data-toggle="tab" href="#interfaces">{{ lang._('Interfaces') }}</a></li>
|
||||
<li><a data-toggle="tab" href="#prefixlists">{{ lang._('Prefix Lists') }}</a></li>
|
||||
@@ -169,6 +178,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<div id="neighbors" class="tab-pane fade in">
|
||||
{{ partial('layout_partials/base_bootgrid_table', formGridEditOSPFNeighbor)}}
|
||||
</div>
|
||||
<!-- Tab: Areas -->
|
||||
<div id="areas" class="tab-pane fade in">
|
||||
{{ partial('layout_partials/base_bootgrid_table', formGridEditOSPFArea)}}
|
||||
</div>
|
||||
<!-- Tab: Networks -->
|
||||
<div id="networks" class="tab-pane fade in">
|
||||
{{ partial('layout_partials/base_bootgrid_table', formGridEditNetwork)}}
|
||||
@@ -187,6 +200,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
</div>
|
||||
</div>
|
||||
{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/quagga/service/reconfigure', 'data_service_widget': 'quagga'}) }}
|
||||
{{ partial("layout_partials/base_dialog",['fields':formDialogEditOSPFArea,'id':formGridEditOSPFArea['edit_dialog_id'],'label':lang._('Edit Area')])}}
|
||||
{{ partial("layout_partials/base_dialog",['fields':formDialogEditOSPFNeighbor,'id':formGridEditOSPFNeighbor['edit_dialog_id'],'label':lang._('Edit Neighbor')])}}
|
||||
{{ partial("layout_partials/base_dialog",['fields':formDialogEditNetwork,'id':formGridEditNetwork['edit_dialog_id'],'label':lang._('Edit Network')])}}
|
||||
{{ partial("layout_partials/base_dialog",['fields':formDialogEditInterface,'id':formGridEditInterface['edit_dialog_id'],'label':lang._('Edit Interface')])}}
|
||||
|
||||
@@ -66,6 +66,11 @@ router ospf
|
||||
redistribute {{ redistribution.redistribute }}{% if redistribution.linkedRoutemap %} route-map {{ helpers.getUUID(redistribution.linkedRoutemap).name }}{% endif +%}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for area in helpers.toList('OPNsense.quagga.ospf.areas.area') %}
|
||||
{% if area.enabled == '1' %}
|
||||
area {{ area.id }} {{ area.type }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if helpers.exists('OPNsense.quagga.ospf.neighbors.neighbor') %}
|
||||
{% for neighbor in helpers.toList('OPNsense.quagga.ospf.neighbors.neighbor') %}
|
||||
{% if neighbor.enabled == '1' %}
|
||||
|
||||
Reference in New Issue
Block a user