コード例 #1
0
class ContactTable(BaseTable):
    pk = SelectColumn()
    name = tables.Column(linkify=True)
    phone = tables.Column(linkify=linkify_phone)
    assignment_count = tables.Column(verbose_name="Assignments")
    tags = TagColumn(url_name="messaging:contact_list")
    actions = ButtonsColumn(Contact, buttons=("edit", "delete"))

    class Meta(BaseTable.Meta):
        model = Contact
        fields = (
            "pk",
            "name",
            "title",
            "phone",
            "email",
            "address",
            "comments",
            "assignment_count",
            "tags",
        )
        default_columns = (
            "pk",
            "name",
            "assignment_count",
            "title",
            "phone",
            "email",
            "actions",
        )
コード例 #2
0
class EmailTable(BaseTable):
    pk = SelectColumn()
    name = tables.Column(linkify=True)
    jinja2_trim = BooleanColumn(
        verbose_name="Trim",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    jinja2_lstrip = BooleanColumn(
        verbose_name="Lstrip",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    tags = TagColumn(url_name="peering:configuration_list")
    buttons = ButtonsColumn(Email)

    class Meta(BaseTable.Meta):
        model = Email
        fields = (
            "pk",
            "name",
            "subject",
            "jinja2_trim",
            "jinja2_lstrip",
            "updated",
            "tags",
            "buttons",
        )
        default_columns = ("pk", "name", "updated", "buttons")
コード例 #3
0
class DirectPeeringSessionTable(BaseTable):
    """
    Table for DirectPeeringSession lists
    """

    pk = SelectColumn()
    local_autonomous_system = tables.Column(verbose_name="Local AS", linkify=True)
    autonomous_system = tables.Column(verbose_name="AS", linkify=True)
    ip_address = tables.Column(verbose_name="IP Address", linkify=True)
    bgp_group = tables.Column(
        verbose_name="BGP Group", accessor="bgp_group", linkify=True
    )
    relationship = tables.TemplateColumn(
        verbose_name="Relationship", template_code=BGP_RELATIONSHIP
    )
    enabled = BooleanColumn(
        verbose_name="Status",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    import_routing_policies = RoutingPolicyColumn(verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(verbose_name="Export Policies")
    state = BGPSessionStateColumn(accessor="bgp_state")
    router = tables.Column(verbose_name="Router", accessor="router", linkify=True)
    tags = TagColumn(url_name="peering:directpeeringsession_list")
    actions = ActionsColumn(template_code=DIRECT_PEERING_SESSION_ACTIONS)

    class Meta(BaseTable.Meta):
        model = DirectPeeringSession
        fields = (
            "pk",
            "local_autonomous_system",
            "autonomous_system",
            "ip_address",
            "bgp_group",
            "relationship",
            "enabled",
            "import_routing_policies",
            "export_routing_policies",
            "state",
            "last_established_state",
            "received_prefix_count",
            "advertised_prefix_count",
            "router",
            "tags",
            "actions",
        )
        default_columns = (
            "pk",
            "local_autonomous_system",
            "autonomous_system",
            "ip_address",
            "bgp_group",
            "relationship",
            "enabled",
            "router",
            "actions",
        )
コード例 #4
0
class InternetExchangeTable(BaseTable):
    pk = SelectColumn()
    local_autonomous_system = tables.Column(verbose_name="Local AS",
                                            linkify=True)
    name = tables.Column(linkify=True)
    check_bgp_session_states = BooleanColumn(
        verbose_name="Check Sessions",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    bgp_session_states_update = tables.Column(
        verbose_name="Last Sessions Check")
    import_routing_policies = RoutingPolicyColumn(
        verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(
        verbose_name="Export Policies")
    internetexchangepeeringsession_count = tables.Column(
        verbose_name="Sessions",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    tags = TagColumn(url_name="peering:internetexchange_list")
    buttons = ButtonsColumn(InternetExchange, pk_field="slug")

    class Meta(BaseTable.Meta):
        model = InternetExchange
        fields = (
            "pk",
            "local_autonomous_system",
            "name",
            "slug",
            "import_routing_policies",
            "export_routing_policies",
            "check_bgp_session_states",
            "bgp_session_states_update",
            "internetexchangepeeringsession_count",
            "tags",
            "buttons",
        )
        default_columns = (
            "pk",
            "name",
            "internetexchangepeeringsession_count",
            "buttons",
        )
コード例 #5
0
ファイル: tables.py プロジェクト: traderose/peering-manager
class BGPGroupTable(BaseTable):
    """
    Table for BGPGroup lists
    """

    pk = SelectColumn()
    name = tables.Column(linkify=True)
    check_bgp_session_states = BooleanColumn(
        verbose_name="Poll Session States",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    import_routing_policies = RoutingPolicyColumn(
        verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(
        verbose_name="Export Policies")
    directpeeringsession_count = tables.Column(
        verbose_name="Direct Sessions",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    tags = TagColumn(url_name="peering:bgpgroup_list")
    buttons = ButtonsColumn(BGPGroup, pk_field="slug")

    class Meta(BaseTable.Meta):
        model = BGPGroup
        fields = (
            "pk",
            "name",
            "slug",
            "check_bgp_session_states",
            "import_routing_policies",
            "export_routing_policies",
            "directpeeringsession_count",
            "tags",
            "buttons",
        )
        default_columns = (
            "pk",
            "name",
            "check_bgp_session_states",
            "directpeeringsession_count",
            "buttons",
        )
コード例 #6
0
class EmailTable(BaseTable):
    pk = SelectColumn()
    name = tables.Column(linkify=True)
    tags = TagColumn(url_name="peering:configuration_list")
    buttons = ButtonsColumn(Email)

    class Meta(BaseTable.Meta):
        model = Email
        fields = ("pk", "name", "subject", "updated", "tags", "buttons")
        default_columns = ("pk", "name", "updated", "buttons")
コード例 #7
0
class InternetExchangePeeringSessionTable(BaseTable):
    """
    Table for InternetExchangePeeringSession lists
    """

    pk = SelectColumn()
    autonomous_system = tables.Column(
        verbose_name="AS", accessor="autonomous_system", linkify=True
    )
    internet_exchange = tables.Column(
        verbose_name="IX", accessor="internet_exchange", linkify=True
    )
    ip_address = tables.Column(verbose_name="IP Address", linkify=True)
    is_route_server = BooleanColumn(
        verbose_name="Route Server",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    enabled = BooleanColumn(
        verbose_name="Enabled",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    import_routing_policies = RoutingPolicyColumn(verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(verbose_name="Export Policies")
    state = BGPSessionStateColumn(accessor="bgp_state")
    tags = TagColumn(url_name="peering:internetexchangepeeringsession_list")
    actions = ActionsColumn(template_code=INTERNET_EXCHANGE_PEERING_SESSION_ACTIONS)

    class Meta(BaseTable.Meta):
        model = InternetExchangePeeringSession
        fields = (
            "pk",
            "autonomous_system",
            "internet_exchange",
            "ip_address",
            "is_route_server",
            "enabled",
            "import_routing_policies",
            "export_routing_policies",
            "state",
            "last_established_state",
            "received_prefix_count",
            "advertised_prefix_count",
            "tags",
            "actions",
        )
        default_columns = (
            "pk",
            "autonomous_system",
            "internet_exchange",
            "ip_address",
            "is_route_server",
            "enabled",
            "enabled",
            "actions",
        )
コード例 #8
0
class AutonomousSystemTable(BaseTable):
    """
    Table for AutonomousSystem lists
    """

    pk = SelectColumn()
    asn = tables.Column(verbose_name="ASN")
    name = tables.Column(linkify=True)
    irr_as_set = tables.Column(verbose_name="IRR AS-SET", orderable=False)
    ipv6_max_prefixes = tables.Column(verbose_name="IPv6 Max Prefixes")
    ipv4_max_prefixes = tables.Column(verbose_name="IPv4 Max Prefixes")
    import_routing_policies = RoutingPolicyColumn(verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(verbose_name="Export Policies")
    directpeeringsession_count = tables.Column(
        verbose_name="Direct Sessions",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    internetexchangepeeringsession_count = tables.Column(
        verbose_name="IX Sessions",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    affiliated = BooleanColumn(
        verbose_name="Affiliated",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    tags = TagColumn(url_name="peering:autonomoussystem_list")
    actions = ActionsColumn(template_code=AUTONOMOUS_SYSTEM_ACTIONS)

    class Meta(BaseTable.Meta):
        model = AutonomousSystem
        fields = (
            "pk",
            "asn",
            "name",
            "irr_as_set",
            "ipv6_max_prefixes",
            "ipv4_max_prefixes",
            "import_routing_policies",
            "export_routing_policies",
            "directpeeringsession_count",
            "internetexchangepeeringsession_count",
            "affiliated",
            "tags",
            "actions",
        )
        default_columns = (
            "pk",
            "asn",
            "name",
            "irr_as_set",
            "directpeeringsession_count",
            "internetexchangepeeringsession_count",
            "actions",
        )
コード例 #9
0
class CommunityTable(BaseTable):
    pk = SelectColumn()
    name = tables.Column(linkify=True)
    type = tables.TemplateColumn(template_code=COMMUNITY_TYPE)
    tags = TagColumn(url_name="peering:community_list")
    actions = ButtonsColumn(Community)

    class Meta(BaseTable.Meta):
        model = Community
        fields = ("pk", "name", "slug", "value", "type", "tags", "actions")
        default_columns = ("pk", "name", "value", "type", "actions")
コード例 #10
0
class RoutingPolicyTable(BaseTable):
    pk = SelectColumn()
    name = tables.Column(linkify=True)
    type = tables.TemplateColumn(template_code=ROUTING_POLICY_TYPE)
    tags = TagColumn(url_name="peering:routingpolicy_list")
    buttons = ButtonsColumn(RoutingPolicy)

    class Meta(BaseTable.Meta):
        model = RoutingPolicy
        fields = ("pk", "name", "type", "weight", "address_family", "tags", "buttons")
        default_columns = ("pk", "name", "type", "weight", "address_family", "buttons")
コード例 #11
0
class RouterTable(BaseTable):
    pk = SelectColumn()
    local_autonomous_system = tables.Column(verbose_name="Local AS", linkify=True)
    name = tables.Column(linkify=True)
    platform = tables.Column(linkify=True)
    encrypt_passwords = BooleanColumn(
        verbose_name="Encrypt Password",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    configuration_template = tables.Column(linkify=True, verbose_name="Configuration")
    connection_count = tables.Column(
        verbose_name="Connections",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    directpeeringsession_count = tables.Column(
        verbose_name="Direct Sessions",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    internetexchangepeeringsession_count = tables.Column(
        verbose_name="IX Sessions",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    tags = TagColumn(url_name="peering:router_list")
    buttons = ButtonsColumn(Router)

    class Meta(BaseTable.Meta):
        model = Router
        fields = (
            "pk",
            "local_autonomous_system",
            "name",
            "hostname",
            "platform",
            "encrypt_passwords",
            "configuration_template",
            "connection_count",
            "directpeeringsession_count",
            "internetexchangepeeringsession_count",
            "device_state",
            "tags",
            "buttons",
        )
        default_columns = (
            "pk",
            "name",
            "hostname",
            "platform",
            "encrypt_passwords",
            "configuration_template",
            "connection_count",
            "device_state",
            "buttons",
        )
コード例 #12
0
class InternetExchangeTable(BaseTable):
    """
    Table for InternetExchange lists
    """

    pk = SelectColumn()
    local_autonomous_system = tables.Column(verbose_name="Local AS", linkify=True)
    name = tables.Column(linkify=True)
    ipv6_address = tables.Column(verbose_name="IPv6 Address")
    ipv4_address = tables.Column(verbose_name="IPv4 Address")
    router = tables.Column(verbose_name="Router", accessor="router", linkify=True)
    check_bgp_session_states = BooleanColumn(
        verbose_name="Check Sessions",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    bgp_session_states_update = tables.Column(verbose_name="Last Sessions Check")
    import_routing_policies = RoutingPolicyColumn(verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(verbose_name="Export Policies")
    internetexchangepeeringsession_count = tables.Column(
        verbose_name="Sessions",
        attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}},
    )
    tags = TagColumn(url_name="peering:internetexchange_list")
    actions = ActionsColumn(template_code=INTERNET_EXCHANGE_ACTIONS)

    class Meta(BaseTable.Meta):
        model = InternetExchange
        fields = (
            "pk",
            "local_autonomous_system",
            "name",
            "slug",
            "ipv6_address",
            "ipv4_address",
            "import_routing_policies",
            "export_routing_policies",
            "router",
            "check_bgp_session_states",
            "bgp_session_states_update",
            "internetexchangepeeringsession_count",
            "tags",
            "actions",
        )
        default_columns = (
            "pk",
            "name",
            "ipv6_address",
            "ipv4_address",
            "router",
            "internetexchangepeeringsession_count",
            "actions",
        )
コード例 #13
0
class EmailTable(BaseTable):
    """
    Table for Email lists
    """

    pk = SelectColumn()
    name = tables.Column(linkify=True)
    tags = TagColumn(url_name="peering:configuration_list")
    actions = ActionsColumn(template_code=EMAIL_ACTIONS)

    class Meta(BaseTable.Meta):
        model = Email
        fields = ("pk", "name", "subject", "updated", "tags", "actions")
        default_columns = ("pk", "name", "updated", "actions")
コード例 #14
0
class ConfigurationTable(BaseTable):
    """
    Table for Configuration lists
    """

    pk = SelectColumn()
    name = tables.Column(linkify=True)
    tags = TagColumn(url_name="peering:configuration_list")
    actions = ActionsColumn(template_code=CONFIGURATION_ACTIONS)

    class Meta(BaseTable.Meta):
        model = Configuration
        fields = ("pk", "name", "updated", "tags", "actions")
        default_columns = ("pk", "name", "updated", "actions")
コード例 #15
0
ファイル: tables.py プロジェクト: traderose/peering-manager
class ConfigurationTable(BaseTable):
    """
    Table for Configuration lists
    """

    pk = SelectColumn()
    name = tables.Column(linkify=True)
    tags = TagColumn(url_name="peering:configuration_list")
    buttons = ButtonsColumn(Configuration)

    class Meta(BaseTable.Meta):
        model = Configuration
        fields = ("pk", "name", "updated", "tags", "buttons")
        default_columns = ("pk", "name", "updated", "buttons")
コード例 #16
0
class InternetExchangeTable(BaseTable):
    pk = SelectColumn()
    local_autonomous_system = tables.Column(verbose_name="Local AS",
                                            linkify=True)
    name = tables.Column(linkify=True)
    import_routing_policies = RoutingPolicyColumn(
        verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(
        verbose_name="Export Policies")
    connection_count = tables.Column(
        verbose_name="Connections",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    tags = TagColumn(url_name="peering:internetexchange_list")
    actions = ButtonsColumn(InternetExchange)

    class Meta(BaseTable.Meta):
        model = InternetExchange
        fields = (
            "pk",
            "local_autonomous_system",
            "name",
            "slug",
            "import_routing_policies",
            "export_routing_policies",
            "connection_count",
            "tags",
            "actions",
        )
        default_columns = (
            "pk",
            "name",
            "connection_count",
            "actions",
        )
コード例 #17
0
class EmailTable(BaseTable):
    pk = SelectColumn()
    name = tables.Column(linkify=True)
    jinja2_trim = BooleanColumn(verbose_name="Trim")
    jinja2_lstrip = BooleanColumn(verbose_name="Lstrip")
    tags = TagColumn(url_name="devices:configuration_list")
    actions = ButtonsColumn(Email)

    class Meta(BaseTable.Meta):
        model = Email
        fields = (
            "pk",
            "name",
            "subject",
            "jinja2_trim",
            "jinja2_lstrip",
            "updated",
            "tags",
            "actions",
        )
        default_columns = ("pk", "name", "updated", "actions")
コード例 #18
0
class BGPGroupTable(BaseTable):
    pk = SelectColumn()
    name = tables.Column(linkify=True)
    import_routing_policies = RoutingPolicyColumn(
        verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(
        verbose_name="Export Policies")
    directpeeringsession_count = tables.Column(
        verbose_name="Direct Sessions",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    tags = TagColumn(url_name="peering:bgpgroup_list")
    actions = ButtonsColumn(BGPGroup)

    class Meta(BaseTable.Meta):
        model = BGPGroup
        fields = (
            "pk",
            "name",
            "slug",
            "import_routing_policies",
            "export_routing_policies",
            "directpeeringsession_count",
            "tags",
            "actions",
        )
        default_columns = (
            "pk",
            "name",
            "directpeeringsession_count",
            "actions",
        )
コード例 #19
0
class RouterTable(BaseTable):
    """
    Table for Router lists
    """

    pk = SelectColumn()
    name = tables.Column(linkify=True)
    encrypt_passwords = BooleanColumn(
        verbose_name="Encrypt Password",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    configuration_template = tables.Column(linkify=True,
                                           verbose_name="Configuration")
    directpeeringsession_count = tables.Column(
        verbose_name="Direct Sessions",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    internetexchangepeeringsession_count = tables.Column(
        verbose_name="IX Sessions",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    tags = TagColumn(url_name="peering:router_list")
    actions = ActionsColumn(template_code=ROUTER_ACTIONS)

    class Meta(BaseTable.Meta):
        model = Router
        fields = (
            "pk",
            "name",
            "hostname",
            "platform",
            "encrypt_passwords",
            "configuration_template",
            "last_deployment_id",
            "directpeeringsession_count",
            "internetexchangepeeringsession_count",
            "tags",
            "actions",
        )
        default_columns = (
            "pk",
            "name",
            "hostname",
            "platform",
            "encrypt_passwords",
            "configuration_template",
            "directpeeringsession_count",
            "internetexchangepeeringsession_count",
            "actions",
        )
コード例 #20
0
ファイル: tables.py プロジェクト: traderose/peering-manager
class InternetExchangePeeringSessionTable(BaseTable):
    """
    Table for InternetExchangePeeringSession lists
    """

    append_template = """
    {% load helpers %}
    {% if record.comments %}
    <button type="button" class="btn btn-xs btn-info popover-hover" data-toggle="popover" data-html="true" title="Peering Session Comments" data-content="{{ record.comments | markdown:True }}"><i class="fas fa-comment"></i></button>
    {% endif %}
    {% if record.autonomous_system.comments %}
    <button type="button" class="btn btn-xs btn-info popover-hover" data-toggle="popover" data-html="true" title="Autonomous System Comments" data-content="{{ record.autonomous_system.comments | markdown:True }}"><i class="fas fa-comments"></i></button>
    {% endif %}
    {% if record.internet_exchange.comments %}
    <button type="button" class="btn btn-xs btn-info popover-hover" data-toggle="popover" data-html="true" title="Internet Exchange Comments" data-content="{{ record.internet_exchange.comments | markdown:True }}"><i class="fas fa-comment-dots"></i></button>
    {% endif %}
    """

    pk = SelectColumn()
    autonomous_system = tables.Column(verbose_name="AS",
                                      accessor="autonomous_system",
                                      linkify=True)
    internet_exchange = tables.Column(verbose_name="IX",
                                      accessor="internet_exchange",
                                      linkify=True)
    ip_address = tables.Column(verbose_name="IP Address", linkify=True)
    is_route_server = BooleanColumn(
        verbose_name="Route Server",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    enabled = BooleanColumn(
        verbose_name="Enabled",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    import_routing_policies = RoutingPolicyColumn(
        verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(
        verbose_name="Export Policies")
    state = BGPSessionStateColumn(accessor="bgp_state")
    tags = TagColumn(url_name="peering:internetexchangepeeringsession_list")
    buttons = ButtonsColumn(InternetExchangePeeringSession,
                            append_template=append_template)

    class Meta(BaseTable.Meta):
        model = InternetExchangePeeringSession
        fields = (
            "pk",
            "autonomous_system",
            "internet_exchange",
            "ip_address",
            "is_route_server",
            "enabled",
            "import_routing_policies",
            "export_routing_policies",
            "state",
            "last_established_state",
            "received_prefix_count",
            "advertised_prefix_count",
            "tags",
            "buttons",
        )
        default_columns = (
            "pk",
            "autonomous_system",
            "internet_exchange",
            "ip_address",
            "is_route_server",
            "enabled",
            "enabled",
            "buttons",
        )
コード例 #21
0
ファイル: tables.py プロジェクト: traderose/peering-manager
class DirectPeeringSessionTable(BaseTable):
    """
    Table for DirectPeeringSession lists
    """

    append_template = """
    {% load helpers %}
    {% if record.comments %}
    <button type="button" class="btn btn-xs btn-info popover-hover" data-toggle="popover" data-html="true" title="Peering Session Comments" data-content="{{ record.comments | markdown:True }}"><i class="fas fa-comment"></i></button>
    {% endif %}
    {% if record.autonomous_system.comments %}
    <button type="button" class="btn btn-xs btn-info popover-hover" data-toggle="popover" data-html="true" title="Autonomous System Comments" data-content="{{ record.autonomous_system.comments | markdown:True }}"><i class="fas fa-comments"></i></button>
    {% endif %}
    """

    pk = SelectColumn()
    local_autonomous_system = tables.Column(verbose_name="Local AS",
                                            linkify=True)
    autonomous_system = tables.Column(verbose_name="AS", linkify=True)
    ip_address = tables.Column(verbose_name="IP Address", linkify=True)
    bgp_group = tables.Column(verbose_name="BGP Group",
                              accessor="bgp_group",
                              linkify=True)
    relationship = tables.TemplateColumn(verbose_name="Relationship",
                                         template_code=BGP_RELATIONSHIP)
    enabled = BooleanColumn(
        verbose_name="Status",
        attrs={
            "td": {
                "class": "text-center"
            },
            "th": {
                "class": "text-center"
            }
        },
    )
    import_routing_policies = RoutingPolicyColumn(
        verbose_name="Import Policies")
    export_routing_policies = RoutingPolicyColumn(
        verbose_name="Export Policies")
    state = BGPSessionStateColumn(accessor="bgp_state")
    router = tables.Column(verbose_name="Router",
                           accessor="router",
                           linkify=True)
    tags = TagColumn(url_name="peering:directpeeringsession_list")
    buttons = ButtonsColumn(DirectPeeringSession,
                            append_template=append_template)

    class Meta(BaseTable.Meta):
        model = DirectPeeringSession
        fields = (
            "pk",
            "local_autonomous_system",
            "autonomous_system",
            "ip_address",
            "bgp_group",
            "relationship",
            "enabled",
            "import_routing_policies",
            "export_routing_policies",
            "state",
            "last_established_state",
            "received_prefix_count",
            "advertised_prefix_count",
            "router",
            "tags",
            "buttons",
        )
        default_columns = (
            "pk",
            "local_autonomous_system",
            "autonomous_system",
            "ip_address",
            "bgp_group",
            "relationship",
            "enabled",
            "router",
            "buttons",
        )