diff --git a/netbox/extras/urls.py b/netbox/extras/urls.py index 55d1d9e06..479a4bc07 100644 --- a/netbox/extras/urls.py +++ b/netbox/extras/urls.py @@ -117,7 +117,7 @@ urlpatterns = [ path('render/markdown/', views.RenderMarkdownView.as_view(), name="render_markdown"), # Config Revision - path('config-revision/', views.ConfigRevisionListView.as_view(), name='configrevision'), + path('config-revision/', views.ConfigRevisionListView.as_view(), name='configrevision_list'), path('config-revision/add/', views.ConfigRevisionEditView.as_view(), name='configrevision_add'), path('config-revision/delete/', views.ConfigRevisionBulkDeleteView.as_view(), name='configrevision_bulk_delete'), path('config-revision//restore', views.ConfigRevisionRestoreView.as_view(), name='configrevision_restore'), diff --git a/netbox/extras/views.py b/netbox/extras/views.py index dfc5427aa..5dea9d189 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -1257,6 +1257,6 @@ class ConfigRevisionRestoreView(ContentTypePermissionRequiredMixin, View): candidate_config = get_object_or_404(ConfigRevision, pk=pk) candidate_config.activate() - self.message_user(request, f"Restored configuration revision #{pk}") + messages.success(request, f"Restored configuration revision #{pk}") - return redirect(reverse('admin:extras_configrevision_changelist')) + return redirect(reverse('extras:configrevision')) diff --git a/netbox/netbox/navigation/menu.py b/netbox/netbox/navigation/menu.py index 9220a8c9f..18815fd24 100644 --- a/netbox/netbox/navigation/menu.py +++ b/netbox/netbox/navigation/menu.py @@ -352,7 +352,7 @@ ADMIN_MENU = Menu( label=_('Configuration'), items=( MenuItem( - link='extras:configrevision', + link='extras:configrevision_list', link_text=_('Config Revisions'), permissions=['extras.config_revision'] ), diff --git a/netbox/templates/extras/configrevision_restore.html b/netbox/templates/extras/configrevision_restore.html index 5f287e859..ac22f8cbd 100644 --- a/netbox/templates/extras/configrevision_restore.html +++ b/netbox/templates/extras/configrevision_restore.html @@ -4,10 +4,12 @@ {% load perms %} {% load static %} -{% block title %}{{ script }}{% endblock %} +{% block title %}Restore: {{ object }}{% endblock %} {% block subtitle %} - {{ script.Meta.description|markdown }} +
+ Created {{ object.created|annotated_date }} +
{% endblock %} {% block header %} @@ -15,7 +17,8 @@
@@ -33,42 +36,52 @@ {% endblock controls %} -{% block content %} +{% block tabs %} -
-
-
+{% endblock %} -

Restore configuration #{{ object.pk }} from {{ object.created }}?

- - - - - - - - +{% block content %} +
+
+
ParameterCurrent ValueNew Value
+ + + + + + + + + + {% for param, current, new in params %} + + + + + - - - {% for param, current, new in params %} - - - - - - - {% endfor %} - -
ParameterCurrent ValueNew Value
{{ param }}{{ current }}{{ new }}{% if current != new %}*{% endif %}
{{ param }}{{ current }}{{ new }}{% if current != new %}*{% endif %}
- -
+ {% endfor %} + +
+ +
+ {% csrf_token %} +
+
+
+ + Cancel +
+
+
+
+ {% endblock content %} {% block modals %}