mirror of
https://github.com/lucaspalomodevelop/netbox-acls.git
synced 2026-03-12 23:27:23 +00:00
Add tables
This commit is contained in:
parent
f68d45bd73
commit
8e162ccc17
37
netbox_access_lists/tables.py
Normal file
37
netbox_access_lists/tables.py
Normal file
@ -0,0 +1,37 @@
|
||||
import django_tables2 as tables
|
||||
|
||||
from netbox.tables import NetBoxTable
|
||||
from .models import AccessList, AccessListRule
|
||||
|
||||
|
||||
class AccessListTable(NetBoxTable):
|
||||
name = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
rule_count = tables.Column()
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = AccessList
|
||||
fields = ('pk', 'id', 'name', 'rule_count', 'default_action', 'comments', 'actions')
|
||||
default_columns = ('name', 'rule_count', 'default_action')
|
||||
|
||||
|
||||
class AccessListRuleTable(NetBoxTable):
|
||||
access_list = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
index = tables.Column(
|
||||
linkify=True
|
||||
)
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = AccessListRule
|
||||
fields = (
|
||||
'pk', 'id', 'access_list', 'index', 'source_prefix', 'source_ports', 'destination_prefix',
|
||||
'destination_ports', 'protocol', 'action', 'description', 'actions',
|
||||
)
|
||||
default_columns = (
|
||||
'access_list', 'index', 'source_prefix', 'source_ports', 'destination_prefix',
|
||||
'destination_ports', 'protocol', 'action', 'actions',
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user