diff --git a/netbox/extras/migrations/0099_eventrule.py b/netbox/extras/migrations/0099_eventrule.py index 3f0694b71..9312a29f3 100644 --- a/netbox/extras/migrations/0099_eventrule.py +++ b/netbox/extras/migrations/0099_eventrule.py @@ -1,7 +1,9 @@ # Generated by Django 4.2.5 on 2023-10-31 14:37 +from django.contrib.contenttypes.models import ContentType from django.db import migrations, models import django.db.models.deletion +from extras.choices import * import extras.utils import taggit.managers import utilities.json diff --git a/netbox/extras/tables/tables.py b/netbox/extras/tables/tables.py index 4d7eefe15..659d237e1 100644 --- a/netbox/extras/tables/tables.py +++ b/netbox/extras/tables/tables.py @@ -270,31 +270,10 @@ class BookmarkTable(NetBoxTable): class WebhookTable(NetBoxTable): - name = tables.Column( - verbose_name=_('Name'), + id = tables.Column( + verbose_name=_('ID'), linkify=True ) - content_types = columns.ContentTypesColumn( - verbose_name=_('Content Types'), - ) - enabled = columns.BooleanColumn( - verbose_name=_('Enabled'), - ) - type_create = columns.BooleanColumn( - verbose_name=_('Create') - ) - type_update = columns.BooleanColumn( - verbose_name=_('Update') - ) - type_delete = columns.BooleanColumn( - verbose_name=_('Delete') - ) - type_job_start = columns.BooleanColumn( - verbose_name=_('Job Start') - ) - type_job_end = columns.BooleanColumn( - verbose_name=_('Job End') - ) ssl_validation = columns.BooleanColumn( verbose_name=_('SSL Validation') ) @@ -305,13 +284,11 @@ class WebhookTable(NetBoxTable): class Meta(NetBoxTable.Meta): model = Webhook fields = ( - 'pk', 'id', 'name', 'content_types', 'enabled', 'type_create', 'type_update', 'type_delete', - 'type_job_start', 'type_job_end', 'http_method', 'payload_url', 'secret', 'ssl_validation', 'ca_file_path', + 'pk', 'id', 'http_method', 'payload_url', 'secret', 'ssl_validation', 'ca_file_path', 'tags', 'created', 'last_updated', ) default_columns = ( - 'pk', 'name', 'content_types', 'enabled', 'type_create', 'type_update', 'type_delete', 'type_job_start', - 'type_job_end', 'http_method', 'payload_url', + 'pk', 'id', 'http_method', 'payload_url', ) diff --git a/netbox/templates/extras/eventrule.html b/netbox/templates/extras/eventrule.html new file mode 100644 index 000000000..375c30dbc --- /dev/null +++ b/netbox/templates/extras/eventrule.html @@ -0,0 +1,94 @@ +{% extends 'generic/object.html' %} +{% load helpers %} +{% load plugins %} +{% load i18n %} + +{% block content %} +
+
+
+
+ {% trans "Webhook" %} +
+
+ + + + + + + + + +
{% trans "Name" %}{{ object.name }}
{% trans "Enabled" %}{% checkmark object.enabled %}
+
+
+
+
+ {% trans "Events" %} +
+
+ + + + + + + + + + + + + + + + + + + + + +
{% trans "Create" %}{% checkmark object.type_create %}
{% trans "Update" %}{% checkmark object.type_update %}
{% trans "Delete" %}{% checkmark object.type_delete %}
{% trans "Job start" %}{% checkmark object.type_job_start %}
{% trans "Job end" %}{% checkmark object.type_job_end %}
+
+
+ {% plugin_left_page object %} +
+
+
+
+ {% trans "Assigned Models" %} +
+
+ + {% for ct in object.content_types.all %} + + + + {% endfor %} +
{{ ct }}
+
+
+
+
+ {% trans "Conditions" %} +
+
+ {% if object.conditions %} +
{{ object.conditions|json }}
+ {% else %} +

{% trans "None" %}

+ {% endif %} +
+
+ {% include 'inc/panels/custom_fields.html' %} + {% include 'inc/panels/tags.html' %} + {% plugin_right_page object %} +
+
+
+
+ {% plugin_full_width_page object %} +
+
+{% endblock %} diff --git a/netbox/templates/extras/webhook.html b/netbox/templates/extras/webhook.html index 5137b0103..83db1a0f6 100644 --- a/netbox/templates/extras/webhook.html +++ b/netbox/templates/extras/webhook.html @@ -6,52 +6,6 @@ {% block content %}
-
-
- {% trans "Webhook" %} -
-
- - - - - - - - - -
{% trans "Name" %}{{ object.name }}
{% trans "Enabled" %}{% checkmark object.enabled %}
-
-
-
-
- {% trans "Events" %} -
-
- - - - - - - - - - - - - - - - - - - - - -
{% trans "Create" %}{% checkmark object.type_create %}
{% trans "Update" %}{% checkmark object.type_update %}
{% trans "Delete" %}{% checkmark object.type_delete %}
{% trans "Job start" %}{% checkmark object.type_job_start %}
{% trans "Job end" %}{% checkmark object.type_job_end %}
-
-
{% trans "HTTP Request" %} @@ -97,32 +51,6 @@ {% plugin_left_page object %}
-
-
- {% trans "Assigned Models" %} -
-
- - {% for ct in object.content_types.all %} - - - - {% endfor %} -
{{ ct }}
-
-
-
-
- {% trans "Conditions" %} -
-
- {% if object.conditions %} -
{{ object.conditions|json }}
- {% else %} -

{% trans "None" %}

- {% endif %} -
-
{% trans "Additional Headers" %}