1
0

Upload files to "dnac_integration"

This commit is contained in:
2024-02-15 17:48:37 +00:00
parent 95bed3a0c0
commit 0b1fe631fc
5 changed files with 88 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import django_tables2 as tables
from django.utils.safestring import mark_safe
from netbox.tables import NetBoxTable
from .models import dnacServer
# Hide password from being viewed
# TODO: add custom view to base64, aes256 encrypt passwords
class MaskedPassword(tables.Column):
def render(self, value):
value = "*****"
return mark_safe(value)
class dnacServerTable(NetBoxTable):
# Define the type of fields to display for a table
hostname = tables.Column(
linkify=True
)
username = tables.Column()
password = MaskedPassword()
version = tables.Column()
verify = tables.BooleanColumn()
status = tables.BooleanColumn()
default_filter_action = tables.BooleanColumn()
# Setup table ordering
class Meta(NetBoxTable.Meta):
model = dnacServer
fields = ('pk', 'id', 'hostname', 'username', 'password', 'version', 'verify', 'status', 'default_filter_action', 'actions')
default_columns = ('hostname', 'version', 'verify', 'status')