/restore/', self.admin_site.admin_view(self.restore), name='extras_configrevision_restore'),
- ]
-
- return urls + super().get_urls()
-
- # Views
-
- def restore(self, request, pk):
- # Get the ConfigRevision being restored
- candidate_config = get_object_or_404(ConfigRevision, pk=pk)
-
- if request.method == 'POST':
- candidate_config.activate()
- self.message_user(request, f"Restored configuration revision #{pk}")
-
- return redirect(reverse('admin:extras_configrevision_changelist'))
-
- # Get the current ConfigRevision
- config_version = get_config().version
- current_config = ConfigRevision.objects.filter(pk=config_version).first()
-
- params = []
- for param in PARAMS:
- params.append((
- param.name,
- current_config.data.get(param.name, None),
- candidate_config.data.get(param.name, None)
- ))
-
- context = self.admin_site.each_context(request)
- context.update({
- 'object': candidate_config,
- 'params': params,
- })
-
- return TemplateResponse(request, 'admin/extras/configrevision/restore.html', context)
diff --git a/netbox/templates/admin/extras/configrevision/restore.html b/netbox/templates/admin/extras/configrevision/restore.html
deleted file mode 100644
index 4a0eb81a6..000000000
--- a/netbox/templates/admin/extras/configrevision/restore.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load static %}
-
-{% block content %}
- Restore configuration #{{ object.pk }} from {{ object.created }}?
-
-
-
-
- Parameter |
- Current Value |
- New Value |
- |
-
-
-
- {% for param, current, new in params %}
-
- {{ param }} |
- {{ current }} |
- {{ new }} |
- {% if current != new %} {% endif %} |
-
- {% endfor %}
-
-
-
-
-{% endblock content %}
-
-