Initial commit
This commit is contained in:
commit
4ff9eac274
45 files changed
+2911
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import django_tables2 as tables
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from netbox.tables import NetBoxTable
|
||||
from netbox.tables.columns import (
|
||||
ChoiceFieldColumn,
|
||||
TagColumn,
|
||||
)
|
||||
|
||||
from .models import Service, ServiceTemplate
|
||||
|
||||
|
||||
class ServiceTemplateTable(NetBoxTable):
|
||||
name = tables.Column(linkify=True)
|
||||
status = ChoiceFieldColumn()
|
||||
services_count = tables.Column(
|
||||
verbose_name=_("Services"),
|
||||
accessor="services__count",
|
||||
orderable=False,
|
||||
)
|
||||
tags = TagColumn()
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = ServiceTemplate
|
||||
fields = ("pk", "id", "name", "status", "description", "services_count", "tags")
|
||||
default_columns = ("pk", "name", "status", "description", "services_count")
|
||||
|
||||
|
||||
class ServiceTable(NetBoxTable):
|
||||
name = tables.Column(linkify=True)
|
||||
service_template = tables.Column(linkify=True)
|
||||
tenant = tables.Column(linkify=True)
|
||||
status = ChoiceFieldColumn()
|
||||
tags = TagColumn()
|
||||
|
||||
class Meta(NetBoxTable.Meta):
|
||||
model = Service
|
||||
fields = ("pk", "id", "name", "service_template", "tenant", "status", "description", "tags")
|
||||
default_columns = ("pk", "name", "service_template", "tenant", "status", "description")
|
||||
Reference in new issue
Block a user