From ac786f45be571556cb986c8c4dac142779ddd7ab Mon Sep 17 00:00:00 2001 From: Tyler Todd Date: Mon, 6 Feb 2023 15:45:13 +0000 Subject: [PATCH] Remove btn-flat to convert to round buttons (first pass) Convert col-xs-* to just col-* as part of bootstrap v3 -> v4 Convert box-* -> card-* as part of bootstrap v3 -> v4 Moved domain actions on main dashboard to a dropdown menu to avoid clutter Added "Log Out" to top header left Hid OTP on admin edit user to only show the disable card & options if the user account has OTP enabled --- package.json | 2 + powerdnsadmin/assets.py | 105 +++-- .../templates/admin_edit_account.html | 199 ++++---- powerdnsadmin/templates/admin_edit_key.html | 10 +- powerdnsadmin/templates/admin_edit_user.html | 228 +++++----- powerdnsadmin/templates/admin_history.html | 132 +++--- .../templates/admin_history_table.html | 150 +++--- .../templates/admin_manage_user.html | 4 +- powerdnsadmin/templates/base.html | 36 +- powerdnsadmin/templates/dashboard.html | 288 ++++++------ powerdnsadmin/templates/dashboard_domain.html | 62 ++- powerdnsadmin/templates/domain.html | 338 +++++++------- powerdnsadmin/templates/domain_add.html | 428 +++++++++--------- powerdnsadmin/templates/domain_changelog.html | 121 ++--- powerdnsadmin/templates/domain_remove.html | 208 +++++---- powerdnsadmin/templates/errors/400.html | 4 +- powerdnsadmin/templates/errors/403.html | 4 +- powerdnsadmin/templates/errors/404.html | 4 +- powerdnsadmin/templates/errors/500.html | 4 +- powerdnsadmin/templates/errors/SAML.html | 5 +- powerdnsadmin/templates/register.html | 18 +- powerdnsadmin/templates/template.html | 16 +- powerdnsadmin/templates/user_profile.html | 48 +- requirements.txt | 2 +- 24 files changed, 1264 insertions(+), 1152 deletions(-) diff --git a/package.json b/package.json index a375986..044e28d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "bootstrap-validator": "^0.11.9", "datatables.net-plugins": "^1.13.1", "icheck": "^1.0.2", + "ionicons": "^6.1.1", "jquery-slimscroll": "^1.3.8", + "jquery-sparkline": "^2.4.0", "jquery-ui-dist": "^1.13.2", "jquery.quicksearch": "^2.4.0", "jtimeout": "^3.2.0", diff --git a/powerdnsadmin/assets.py b/powerdnsadmin/assets.py index 233e23a..ac48610 100644 --- a/powerdnsadmin/assets.py +++ b/powerdnsadmin/assets.py @@ -2,67 +2,64 @@ from flask_assets import Bundle, Environment, Filter class ConcatFilter(Filter): - """ - Filter that merges files, placing a semicolon between them. + """ + Filter that merges files, placing a semicolon between them. - Fixes issues caused by missing semicolons at end of JS assets, for example - with last statement of jquery.pjax.js. - """ - def concat(self, out, hunks, **kw): - out.write(';'.join([h.data() for h, info in hunks])) + Fixes issues caused by missing semicolons at end of JS assets, for example + with last statement of jquery.pjax.js. + """ + def concat(self, out, hunks, **kw): + out.write(';'.join([h.data() for h, info in hunks])) +css_login = Bundle( + 'node_modules/ionicons/dist/collection/components/icon/icon.css', + 'node_modules/icheck/skins/square/blue.css', + 'node_modules/admin-lte/dist/css/adminlte.css', + filters=('cssmin', 'cssrewrite'), + output='generated/login.css') -css_login = Bundle('node_modules/bootstrap/dist/css/bootstrap.css', - 'node_modules/font-awesome/css/font-awesome.css', - 'node_modules/ionicons/dist/css/ionicons.css', - 'node_modules/icheck/skins/square/blue.css', - 'node_modules/admin-lte/dist/css/AdminLTE.css', - filters=('cssmin', 'cssrewrite'), - output='generated/login.css') +js_login = Bundle( + 'node_modules/jquery/dist/jquery.js', + 'node_modules/bootstrap/dist/js/bootstrap.js', + 'node_modules/icheck/icheck.js', + 'custom/js/custom.js', + filters=(ConcatFilter, 'rjsmin'), + output='generated/login.js') -js_login = Bundle('node_modules/jquery/dist/jquery.js', - 'node_modules/bootstrap/dist/js/bootstrap.js', - 'node_modules/icheck/icheck.js', - 'custom/js/custom.js', - filters=(ConcatFilter, 'rjsmin'), - output='generated/login.js') - -js_validation = Bundle('node_modules/bootstrap-validator/dist/validator.js', - output='generated/validation.js') +js_validation = Bundle( + 'node_modules/bootstrap-validator/dist/validator.js', + output='generated/validation.js') css_main = Bundle( - 'node_modules/bootstrap/dist/css/bootstrap.css', - 'node_modules/font-awesome/css/font-awesome.css', - 'node_modules/ionicons/dist/css/ionicons.css', - 'node_modules/datatables.net-bs/css/dataTables.bootstrap.css', - 'node_modules/icheck/skins/square/blue.css', - 'node_modules/multiselect/css/multi-select.css', - 'node_modules/admin-lte/dist/css/AdminLTE.css', - 'node_modules/admin-lte/dist/css/skins/_all-skins.css', - 'custom/css/custom.css', - 'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css', - filters=('cssmin', 'cssrewrite'), - output='generated/main.css') + 'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css', + 'node_modules/icheck/skins/square/blue.css', + 'node_modules/multiselect/css/multi-select.css', + 'node_modules/admin-lte/dist/css/adminlte.css', + 'custom/css/custom.css', + 'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css', + filters=('cssmin', 'cssrewrite'), + output='generated/main.css') -js_main = Bundle('node_modules/jquery/dist/jquery.js', - 'node_modules/jquery-ui-dist/jquery-ui.js', - 'node_modules/bootstrap/dist/js/bootstrap.js', - 'node_modules/datatables.net/js/jquery.dataTables.js', - 'node_modules/datatables.net-bs/js/dataTables.bootstrap.js', - 'node_modules/jquery-sparkline/jquery.sparkline.js', - 'node_modules/jquery-slimscroll/jquery.slimscroll.js', - 'node_modules/icheck/icheck.js', - 'node_modules/fastclick/lib/fastclick.js', - 'node_modules/moment/moment.js', - 'node_modules/admin-lte/dist/js/adminlte.js', - 'node_modules/multiselect/js/jquery.multi-select.js', - 'node_modules/datatables.net-plugins/sorting/natural.js', - 'node_modules/jtimeout/src/jTimeout.js', - 'node_modules/jquery.quicksearch/src/jquery.quicksearch.js', - 'custom/js/custom.js', - 'node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js', - filters=(ConcatFilter, 'rjsmin'), - output='generated/main.js') +js_main = Bundle( + 'node_modules/jquery/dist/jquery.js', + 'node_modules/jquery-ui-dist/jquery-ui.js', + 'node_modules/bootstrap/dist/js/bootstrap.bundle.js', + 'node_modules/datatables.net/js/jquery.dataTables.js', + 'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js', + 'node_modules/jquery-sparkline/jquery.sparkline.js', + 'node_modules/jquery-slimscroll/jquery.slimscroll.js', + 'node_modules/icheck/icheck.js', + 'node_modules/fastclick/lib/fastclick.js', + 'node_modules/moment/moment.js', + 'node_modules/admin-lte/dist/js/adminlte.js', + 'node_modules/multiselect/js/jquery.multi-select.js', + 'node_modules/datatables.net-plugins/sorting/natural.js', + 'node_modules/jtimeout/src/jTimeout.js', + 'node_modules/jquery.quicksearch/src/jquery.quicksearch.js', + 'custom/js/custom.js', + 'node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js', + filters=(ConcatFilter, 'rjsmin'), + output='generated/main.js') assets = Environment() assets.register('js_login', js_login) diff --git a/powerdnsadmin/templates/admin_edit_account.html b/powerdnsadmin/templates/admin_edit_account.html index 08403b9..0fc0b30 100644 --- a/powerdnsadmin/templates/admin_edit_account.html +++ b/powerdnsadmin/templates/admin_edit_account.html @@ -27,110 +27,113 @@ {% block content %}
+
-
-
-
-

{% if create %}Add{% else %}Edit{% endif %} account

+
+
+
+

{% if create %}Add{% else %}Edit{% endif %} account

+
+
+ + +
+ {% if error %} +
+ +

Error!

+ {{ error }}
- - - - - -
- {% if error %} -
- -

Error!

- {{ error }} -
- {{ error }} - {% endif %} -
- - - - {% if invalid_accountname %} - Cannot be blank and must only contain alphanumeric - characters{% if SETTING.get('account_name_extra_chars') %}, dots, hyphens or underscores{% endif %}. - {% elif duplicate_accountname %} - Account name already in use. - {% endif %} -
-
- - - -
-
- - - -
-
- - - -
-
-
-

Access Control

-
-
-

Users on the right have access to manage records in all domains - associated with the account.

-

Click on users to move between columns.

-
- -
-
- - + {{ error }} + {% endif %} +
+ + + + {% if invalid_accountname %} + Cannot be blank and must only contain alphanumeric + characters{% if SETTING.get('account_name_extra_chars') %}, dots, hyphens or underscores{% endif %}. + + {% elif duplicate_accountname %} + Account name already in use. + {% endif %} +
+
+ + + +
+
+ + + +
+
+ + + +
-
-
-
-
-

Help with creating a new account

-
-
-

- An account allows grouping of domains belonging to a particular entity, such as a customer or - department.
- A domain can be assigned to an account upon domain creation or through the domain administration - page. -

-

Fill in all the fields to the in the form to the left.

-

- Name is an account identifier. It will be lowercased and can contain alphanumeric - characters{% if SETTING.get('account_name_extra_chars') %}, dots, hyphens and underscores (no space or other special character is allowed) - {% else %} (no extra character is allowed){% endif %}.
- Description is a user friendly name for this account.
- Contact person is the name of a contact person at the account.
- Mail Address is an e-mail address for the contact person. -

-
+
+

Access Control

+
+

Users on the right have access to manage records in all domains + associated with the account. +

+

Click on users to move between columns.

+
+ +
+
+ +
+
+
+
+
+

Help with creating a new account

+
+
+

+ An account allows grouping of domains belonging to a particular entity, such as a customer or + department. +
+ A domain can be assigned to an account upon domain creation or through the domain administration + page. +

+

Fill in all the fields to the in the form to the left.

+

+ Name is an account identifier. It will be lowercased and can contain alphanumeric + characters{% if SETTING.get('account_name_extra_chars') %}, dots, hyphens and underscores (no space or other special character is allowed) + {% else %} (no extra character is allowed){% endif %}.
+ Description is a user friendly name for this account.
+ Contact person is the name of a contact person at the account.
+ Mail Address is an e-mail address for the contact person. +

+
+
+
+
{% endblock %} {% block extrascripts %} diff --git a/powerdnsadmin/templates/admin_edit_key.html b/powerdnsadmin/templates/admin_edit_key.html index a97afcb..a0e7a88 100644 --- a/powerdnsadmin/templates/admin_edit_key.html +++ b/powerdnsadmin/templates/admin_edit_key.html @@ -31,7 +31,7 @@ {% block content %}
-
+

{% if create %}Add{% else %}Edit{% endif %} Key

@@ -68,7 +68,7 @@

This key will be linked to the accounts on the right,

thus granting access to domains owned by the selected accounts.

Click on accounts to move between the columns.

-
+
{% for domain in domains %} @@ -94,13 +94,13 @@
-
+

Help with {% if create %}creating a new{% else%}updating a{% endif %} key diff --git a/powerdnsadmin/templates/admin_edit_user.html b/powerdnsadmin/templates/admin_edit_user.html index 110321a..b871b31 100644 --- a/powerdnsadmin/templates/admin_edit_user.html +++ b/powerdnsadmin/templates/admin_edit_user.html @@ -1,34 +1,28 @@ {% extends "base.html" %} + {% set active_page = "admin_users" %} -{% block title %}Edit User - {{ SITE_NAME }}{% endblock %} + +{% block title %} + + {% if create %}Add user{% else %}Edit user "{{ user.username }}"{% endif %} - {{ SITE_NAME }} + +{% endblock %} {% block dashboard_stat %} - -
-

- User - {% if create %}New user{% else %}{{ user.username }}{% endif %} -

- -
- -
+

- Dashboard - Control panel + Users + {% if create %}New user{% else %}Edit user {{ user.username }}{% endif %}

@@ -38,109 +32,117 @@ {% block content %}
+
-
-
-
-

{% if create %}Add{% else %}Edit{% endif %} user

+
+
+
+

{% if create %}Add{% else %}Edit{% endif %} user

+
+
+ + +
+ {% if error %} +
+ +

Error!

+ {{ error }}
- - - - - -
- {% if error %} -
- -

Error!

- {{ error }} -
- {{ error }} - {% endif %} -
- - -
-
- - -
-
- - -
- -
- - -
-
- - - {% if blank_password %} - The password cannot be blank. - {% endif %} -
-
- - + {{ error }} + {% endif %} +
+ + + +
+
+ + + +
+
+ + + +
+ +
+ + + +
+
+ + + + {% if blank_password %} + The password cannot be blank. + {% endif %} +
- {% if not create %} -
-
-

Two Factor Authentication

-
-
-

If two factor authentication was configured and is causing problems due to a lost device or - technical issue, it can be disabled here.

-

The user will need to reconfigure two factor authentication, to re-enable it.

-

Beware: This could compromise security!

-
- + + +
+ {% if not create %} + {% if user.otp_secret %} +
+
+

Two Factor Authentication

+
+
+

If two factor authentication is configured for this user and is causing problems due to a lost device or + technical issue, it can be disabled here. +

+

The user will need to reconfigure two factor authentication, to re-enable it.

+

Beware: This could compromise security!

+
+ +
+ {% endif %} + {% endif %} +
+
+
+
+

+ Help with {% if create %}creating a new{% else%}editing a{% endif %} user +

+
+
+

Fill in all the fields to the in the form to the left.

+ {% if create %} +

Newly created users do not have access to any domains. You will need to grant + access to the user once it is created via the domain management buttons on the dashboard. +

+ {% else %} +

Username cannot be changed.

+

Password can be left empty to keep the current password.

{% endif %} +
-
-
-
-

Help with {% if create %}creating a new{% else%}updating a{% endif %} user -

-
-
-

Fill in all the fields to the in the form to the left.

- {% if create %} -

Newly created users do not have access to any domains. You will need to grant - access to the user once it is created via the domain management buttons on the dashboard.

- {% else %} -

Password can be left empty to keep the current password.

-

Username cannot be changed.

- {% endif %} -
-
-
+
+
{% endblock %} + {% block extrascripts %} {% endblock %} {% block modals %} - - {% endblock %} {% block content %}
+
-
+

User Management

@@ -96,6 +97,7 @@
+
{% endblock %} {% block extrascripts %} diff --git a/powerdnsadmin/templates/base.html b/powerdnsadmin/templates/base.html index f3261dd..6c4a81a 100644 --- a/powerdnsadmin/templates/base.html +++ b/powerdnsadmin/templates/base.html @@ -1,5 +1,5 @@ - + {% block head %} @@ -28,7 +28,7 @@ {% endblock %} - + {% set user_image_url = url_for('user.image', username=current_user.username) %}
{% block pageheader %} @@ -41,10 +41,17 @@ + {% if current_user.id is defined %} + + {% endif %}
+

{% endblock %} + {% block extrascripts %} {% endblock %} + {% block modals %} - + + {% endblock %} + +{% block extrascripts %} + +{% endblock %} + +{% block modals %} + + + +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/domain_changelog.html b/powerdnsadmin/templates/domain_changelog.html index a6b530a..27b5bc4 100644 --- a/powerdnsadmin/templates/domain_changelog.html +++ b/powerdnsadmin/templates/domain_changelog.html @@ -2,72 +2,79 @@ {% block title %}{{ domain.name | pretty_domain_name }} - {{ SITE_NAME }}{% endblock %} {% block dashboard_stat %} -
-

- {% if record_name and record_type %} - Record changelog: {{ record_name}}   {{ record_type }} - {% else %} - Domain changelog: {{ domain.name | pretty_domain_name }} - {% endif %} -

- -
+
+
+
+
+

+ {% if record_name and record_type %} + Record changelog: {{ record_name}}   {{ record_type }} + {% else %} + Domain changelog: {{ domain.name | pretty_domain_name }} + {% endif %} +

+
+
+ +
+
+
+
{% endblock %} {% import 'applied_change_macro.html' as applied_change_macro %} {% block content %}
+
-
-
-
- -
-
- - - - - - - - - - {% for applied_change in allHistoryChanges %} - - - - - - - - - - - {% endfor %} - -
Changed onChanged by
- {{ allHistoryChanges[applied_change][0].history_entry.created_on }} - - {{allHistoryChanges[applied_change][0].history_entry.created_by }} -
-
- {% call applied_change_macro.applied_change_template(allHistoryChanges[applied_change]) %} - {% endcall %} -
-
-
-
+
+
+
+ +
+
+ + + + + + + + + {% for applied_change in allHistoryChanges %} + + + + + + + + + + {% endfor %} + +
Changed onChanged by
+ {{ allHistoryChanges[applied_change][0].history_entry.created_on }} + + {{allHistoryChanges[applied_change][0].history_entry.created_by }} +
+
+ {% call applied_change_macro.applied_change_template(allHistoryChanges[applied_change]) %} + {% endcall %} +
+
+
+
+
{% endblock %} diff --git a/powerdnsadmin/templates/domain_remove.html b/powerdnsadmin/templates/domain_remove.html index 6ac5401..5c20f13 100644 --- a/powerdnsadmin/templates/domain_remove.html +++ b/powerdnsadmin/templates/domain_remove.html @@ -1,127 +1,135 @@ {% extends "base.html" %} + {% set active_page = "remove_domain" %} -{% block title %}Remove Domain - {{ SITE_NAME }}{% endblock %} + +{% block title %} + + Remove Domain - {{ SITE_NAME }} + +{% endblock %} {% block dashboard_stat %} - -
-

- Domain - Remove existing -

- -
+
+
+
+
+

+ Domain + Remove +

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

Remove domain

-
- - -
- -
-
- -
- - - -
+
+
+
+

Remove domain

+
+
+ +
+ +
- -
-
-
-
-

Help with removing a new domain

-
-
-
-
Domain name
-
Select domain you wish to remove from DNS.
-
-

Find more details at https://docs.powerdns.com/md/ -

-
+ +
+
+
+
+
+

Help with removing a new domain

+
+
+
+
Domain name
+
Select domain you wish to remove from DNS.
+
+

Find more details at https://docs.powerdns.com/md/

+
+
+
+
{% endblock %} + {% block extrascripts %} {% endblock %} {% block modals %}