From db70e34c9859663488923c9cc196d6d6669b3694 Mon Sep 17 00:00:00 2001 From: Matt Scott Date: Mon, 20 Feb 2023 09:39:13 -0500 Subject: [PATCH] Completed first-found updates for the API keys list view. --- .../templates/admin_manage_keys.html | 271 +++++++++--------- 1 file changed, 137 insertions(+), 134 deletions(-) diff --git a/powerdnsadmin/templates/admin_manage_keys.html b/powerdnsadmin/templates/admin_manage_keys.html index 87a36b0..bc75e1c 100644 --- a/powerdnsadmin/templates/admin_manage_keys.html +++ b/powerdnsadmin/templates/admin_manage_keys.html @@ -1,153 +1,156 @@ {% extends "base.html" %} - {% set active_page = "admin_keys" %} - -{% block title %} - - Key Management - {{ SITE_NAME }} - -{% endblock %} +{% block title %}API Keys - {{ SITE_NAME }}{% endblock %} {% block dashboard_stat %} -
-
-
-
-

- API Keys - Management -

+
+
+
+
+

API Keys

+
+
+ +
+
-
- -
-
-
{% endblock %} {% block content %} -
-
-
-
-

Key Management

- - - -
-
- - - - - - - - - - - - - {% for key in keys %} - - - - - - - - - {% endfor %} - -
IdRoleDescriptionDomainsAccountsActions
{{ key.id }}{{ key.role.name }}{{ key.description }}{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %}, {% endif %}{% endfor %}{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, {% endif %}{% endfor %} - -
-
-
-
-
+
+
+
+
+

API Keys

+ + +
+ +
+ + + + + + + + + + + + + {% for key in keys %} + + + + + + + + + {% endfor %} + +
IdRoleDescriptionDomainsAccountsActions
{{ key.id }}{{ key.role.name }}{{ key.description }}{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %}, + {% endif %}{% endfor %}{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, + {% endif %}{% endfor %} + +
+
+ +
+ +
+ +
{% endblock %} {% block extrascripts %} - + // handle deletion of keys + $(document.body).on('click', '.button_delete', function () { + var modal = $("#modal_delete"); + var key_id = $(this).prop('id'); + var info = "Are you sure you want to delete key #" + key_id + "?"; + modal.find('.modal-body p').text(info); + modal.find('#button_delete_confirm').click(function () { + var postdata = { + 'action': 'delete_key', + 'data': key_id, + '_csrf_token': '{{ csrf_token() }}' + } + applyChanges(postdata, $SCRIPT_ROOT + '/admin/manage-keys', false, true); + modal.modal('hide'); + }) + modal.modal('show'); + }); + {% endblock %} {% block modals %} -