mirror of
https://github.com/lucaspalomodevelop/netbox-acls.git
synced 2026-03-13 07:29:40 +00:00
Merge branch 'step08-filter-sets' into step09-rest-api
This commit is contained in:
commit
c7dcfbddbd
@ -46,6 +46,9 @@ class AccessList(NetBoxModel):
|
||||
def get_absolute_url(self):
|
||||
return reverse('plugins:netbox_access_lists:accesslist', args=[self.pk])
|
||||
|
||||
def get_default_action_color(self):
|
||||
return ActionChoices.colors.get(self.default_action)
|
||||
|
||||
|
||||
class AccessListRule(NetBoxModel):
|
||||
access_list = models.ForeignKey(
|
||||
@ -101,3 +104,9 @@ class AccessListRule(NetBoxModel):
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('plugins:netbox_access_lists:accesslistrule', args=[self.pk])
|
||||
|
||||
def get_protocol_color(self):
|
||||
return ProtocolChoices.colors.get(self.protocol)
|
||||
|
||||
def get_action_color(self):
|
||||
return ActionChoices.colors.get(self.action)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import django_tables2 as tables
|
||||
|
||||
from netbox.tables import NetBoxTable
|
||||
from netbox.tables import NetBoxTable, ChoiceFieldColumn
|
||||
from .models import AccessList, AccessListRule
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ class AccessListTable(NetBoxTable):
|
||||
name = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
default_action = ChoiceFieldColumn()
|
||||
rule_count = tables.Column()
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
@ -23,6 +24,8 @@ class AccessListRuleTable(NetBoxTable):
|
||||
index = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
protocol = ChoiceFieldColumn()
|
||||
action = ChoiceFieldColumn()
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = AccessListRule
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user