From eb70f6a066cbcc8604ab5a7e2f1e64a72af95480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kate=C5=99ina=20Churanov=C3=A1?= Date: Sat, 11 Dec 2021 15:49:05 +0100 Subject: [PATCH 01/20] fix: making the key name in the config database unique --- ...add_unique_index_to_settings_table_keys.py | 24 +++++++++++++++++++ powerdnsadmin/models/setting.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py diff --git a/migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py b/migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py new file mode 100644 index 0000000..48cfbe9 --- /dev/null +++ b/migrations/versions/b24bf17725d2_add_unique_index_to_settings_table_keys.py @@ -0,0 +1,24 @@ +"""Add unique index to settings table keys + +Revision ID: b24bf17725d2 +Revises: 0967658d9c0d +Create Date: 2021-12-12 20:29:17.103441 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'b24bf17725d2' +down_revision = '0967658d9c0d' +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_index(op.f('ix_setting_name'), 'setting', ['name'], unique=True) + + +def downgrade(): + op.drop_index(op.f('ix_setting_name'), table_name='setting') diff --git a/powerdnsadmin/models/setting.py b/powerdnsadmin/models/setting.py index a46cfb6..4b9bcc5 100644 --- a/powerdnsadmin/models/setting.py +++ b/powerdnsadmin/models/setting.py @@ -11,7 +11,7 @@ from .base import db class Setting(db.Model): id = db.Column(db.Integer, primary_key=True) - name = db.Column(db.String(64)) + name = db.Column(db.String(64), unique=True, index=True) value = db.Column(db.Text()) defaults = { From e411bc9f1949cd2d42ae13e9c2e9dd5a1d6f34f0 Mon Sep 17 00:00:00 2001 From: Tyler Todd Date: Mon, 30 Jan 2023 22:46:59 +0000 Subject: [PATCH 02/20] Enable CAPTCHA --- configs/development.py | 11 +++++++++++ powerdnsadmin/routes/__init__.py | 3 ++- powerdnsadmin/routes/base.py | 2 ++ powerdnsadmin/routes/index.py | 17 +++++++++++------ powerdnsadmin/templates/register.html | 9 +++++++++ requirements.txt | 1 + 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/configs/development.py b/configs/development.py index d4bd24f..b848d0c 100644 --- a/configs/development.py +++ b/configs/development.py @@ -15,6 +15,17 @@ SQLA_DB_HOST = '127.0.0.1' SQLA_DB_NAME = 'pda' SQLALCHEMY_TRACK_MODIFICATIONS = True +#CAPTCHA Config +CAPTCHA_ENABLE = True +CAPTCHA_LENGTH = 6 +CAPTCHA_WIDTH = 160 +CAPTCHA_HEIGHT = 60 +CAPTCHA_SESSION_KEY = 'captcha_image' + +#Server side sessions tracking +#Set to TRUE for CAPTCHA, or enable another stateful session tracking system +FILESYSTEM_SESSIONS_ENABLED = True + ### DATABASE - MySQL #SQLALCHEMY_DATABASE_URI = 'mysql://{}:{}@{}/{}'.format( # urllib.parse.quote_plus(SQLA_DB_USER), diff --git a/powerdnsadmin/routes/__init__.py b/powerdnsadmin/routes/__init__.py index 7d8aa9a..598b17a 100644 --- a/powerdnsadmin/routes/__init__.py +++ b/powerdnsadmin/routes/__init__.py @@ -1,5 +1,5 @@ from .base import ( - csrf, login_manager, handle_bad_request, handle_unauthorized_access, + captcha, csrf, login_manager, handle_bad_request, handle_unauthorized_access, handle_access_forbidden, handle_page_not_found, handle_internal_server_error ) @@ -14,6 +14,7 @@ from .api import api_bp, apilist_bp def init_app(app): login_manager.init_app(app) csrf.init_app(app) + captcha.init_app(app) app.register_blueprint(index_bp) app.register_blueprint(user_bp) diff --git a/powerdnsadmin/routes/base.py b/powerdnsadmin/routes/base.py index 16ed00a..7af342c 100644 --- a/powerdnsadmin/routes/base.py +++ b/powerdnsadmin/routes/base.py @@ -3,10 +3,12 @@ import base64 from flask import render_template, url_for, redirect, session, request, current_app from flask_login import LoginManager from flask_seasurf import SeaSurf +from flask_session_captcha import FlaskSessionCaptcha from ..models.user import User +captcha = FlaskSessionCaptcha() csrf = SeaSurf() login_manager = LoginManager() diff --git a/powerdnsadmin/routes/index.py b/powerdnsadmin/routes/index.py index e6e8343..98664d6 100644 --- a/powerdnsadmin/routes/index.py +++ b/powerdnsadmin/routes/index.py @@ -10,7 +10,7 @@ from yaml import Loader, load from flask import Blueprint, render_template, make_response, url_for, current_app, g, session, request, redirect, abort from flask_login import login_user, logout_user, login_required, current_user -from .base import csrf, login_manager +from .base import captcha, csrf, login_manager from ..lib import utils from ..decorators import dyndns_login_required from ..models.base import db @@ -651,9 +651,10 @@ def logout(): @index_bp.route('/register', methods=['GET', 'POST']) def register(): + CAPTCHA_ENABLE = current_app.config.get('CAPTCHA_ENABLE') if Setting().get('signup_enabled'): if request.method == 'GET': - return render_template('register.html') + return render_template('register.html', captcha_enable=CAPTCHA_ENABLE) elif request.method == 'POST': username = request.form.get('username', '').strip() password = request.form.get('password', '') @@ -664,12 +665,16 @@ def register(): if not username or not password or not email: return render_template( - 'register.html', error='Please input required information') + 'register.html', error='Please input required information', captcha_enable=CAPTCHA_ENABLE) if password != rpassword: return render_template( 'register.html', - error="Password confirmation does not match") + error="Password confirmation does not match", captcha_enable=CAPTCHA_ENABLE) + + if not captcha.validate(): + return render_template( + 'register.html', error='Invalid CAPTCHA answer', captcha_enable=CAPTCHA_ENABLE) user = User(username=username, plain_text_password=password, @@ -690,9 +695,9 @@ def register(): return redirect(url_for('index.login')) else: return render_template('register.html', - error=result['msg']) + error=result['msg'], captcha_enable=CAPTCHA_ENABLE) except Exception as e: - return render_template('register.html', error=e) + return render_template('register.html', error=e, captcha_enable=CAPTCHA_ENABLE) else: return render_template('errors/404.html'), 404 diff --git a/powerdnsadmin/templates/register.html b/powerdnsadmin/templates/register.html index 9a25fbb..197b18d 100644 --- a/powerdnsadmin/templates/register.html +++ b/powerdnsadmin/templates/register.html @@ -64,6 +64,15 @@ + {% if captcha_enable %} + +
+ {{ captcha() }} + + +
+ {% endif %}
diff --git a/requirements.txt b/requirements.txt index 1fc2864..051d560 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,3 +31,4 @@ Jinja2==3.0.3 itsdangerous==2.0.1 werkzeug==2.0.3 cryptography==36.0.2 +flask_session_captcha==1.3.0 \ No newline at end of file From 7f25e3b555064087a91ac0e7625993c54150669d Mon Sep 17 00:00:00 2001 From: Tyler Todd Date: Thu, 2 Feb 2023 21:19:15 +0000 Subject: [PATCH 03/20] Initial go at upgrading from Bootstap v3 to v4 and to AdminLTE v3.2.0 --- package.json | 12 +- powerdnsadmin/static/custom/js/custom.js | 16 +- .../templates/admin_edit_account.html | 56 +-- powerdnsadmin/templates/admin_edit_key.html | 67 ++-- powerdnsadmin/templates/admin_edit_user.html | 19 + .../templates/admin_global_search.html | 20 ++ powerdnsadmin/templates/admin_history.html | 141 ++++---- .../templates/admin_manage_account.html | 132 +++---- .../templates/admin_manage_keys.html | 129 +++---- .../templates/admin_manage_user.html | 37 +- powerdnsadmin/templates/admin_pdns_stats.html | 20 ++ .../admin_setting_authentication.html | 60 ++-- .../templates/admin_setting_basic.html | 121 ++++--- .../templates/admin_setting_pdns.html | 4 +- powerdnsadmin/templates/base.html | 331 +++++++++++------- powerdnsadmin/templates/errors/400.html | 77 ++-- powerdnsadmin/templates/errors/403.html | 69 ++-- powerdnsadmin/templates/errors/404.html | 69 ++-- powerdnsadmin/templates/errors/500.html | 69 ++-- powerdnsadmin/templates/errors/SAML.html | 89 +++-- powerdnsadmin/templates/login.html | 315 +++++++++-------- powerdnsadmin/templates/register.html | 253 +++++++------ powerdnsadmin/templates/template_add.html | 29 +- requirements.txt | 42 +-- 24 files changed, 1246 insertions(+), 931 deletions(-) diff --git a/package.json b/package.json index 76982c8..a375986 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "dependencies": { - "admin-lte": "2.4.9", - "bootstrap": "^3.4.1", - "bootstrap-datepicker": "^1.8.0", + "admin-lte": "3.2.0", + "bootstrap": "4.6.2", + "bootstrap-datepicker": "^1.9.0", "bootstrap-validator": "^0.11.9", - "datatables.net-plugins": "^1.10.19", + "datatables.net-plugins": "^1.13.1", "icheck": "^1.0.2", "jquery-slimscroll": "^1.3.8", - "jquery-ui-dist": "^1.12.1", + "jquery-ui-dist": "^1.13.2", "jquery.quicksearch": "^2.4.0", - "jtimeout": "^3.1.0", + "jtimeout": "^3.2.0", "multiselect": "^0.9.12" } } diff --git a/powerdnsadmin/static/custom/js/custom.js b/powerdnsadmin/static/custom/js/custom.js index e4b72b1..0f096bf 100644 --- a/powerdnsadmin/static/custom/js/custom.js +++ b/powerdnsadmin/static/custom/js/custom.js @@ -287,4 +287,18 @@ function copy_otp_secret_to_clipboard() { navigator.clipboard.writeText(copyBox.value); $("#copy_tooltip").css("visibility", "visible"); setTimeout(function(){ $("#copy_tooltip").css("visibility", "collapse"); }, 2000); - } \ No newline at end of file + } + +// Side menu nav bar active selection +/** add active class and stay opened when selected */ +var url = window.location; + +// for sidebar menu entirely but not cover treeview +$('ul.nav-sidebar a').filter(function() { + return this.href == url; +}).addClass('active'); + +// for treeview +$('ul.nav-treeview a').filter(function() { + return this.href == url; +}).parentsUntil(".nav-sidebar > .nav-treeview").addClass('menu-open').prev('a').addClass('active'); diff --git a/powerdnsadmin/templates/admin_edit_account.html b/powerdnsadmin/templates/admin_edit_account.html index 1946bc9..08403b9 100644 --- a/powerdnsadmin/templates/admin_edit_account.html +++ b/powerdnsadmin/templates/admin_edit_account.html @@ -4,26 +4,34 @@ {% block dashboard_stat %} -
-

- Account - {% if create %}New account{% else %}{{ account.name }}{% endif %} -

- -
+
+
+
+
+

+ Account + {% if create %}New account{% else %}{{ account.name }}{% endif %} +

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

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

+
+
+

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

@@ -31,7 +39,7 @@ action="{% if create %}{{ url_for('admin.edit_account') }}{% else %}{{ url_for('admin.edit_account', account_name=account.name) }}{% endif %}"> -
+
{% if error %}
@@ -73,10 +81,10 @@
-
-

Access Control

+
+

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.

@@ -90,7 +98,7 @@
- -
-
-
-

Help with creating a new account

+
+
+
+

Help with creating a new account

-
+

An account allows grouping of domains belonging to a particular entity, such as a customer or department.
diff --git a/powerdnsadmin/templates/admin_edit_key.html b/powerdnsadmin/templates/admin_edit_key.html index 6a94340..a97afcb 100644 --- a/powerdnsadmin/templates/admin_edit_key.html +++ b/powerdnsadmin/templates/admin_edit_key.html @@ -6,26 +6,35 @@ {% endblock %} {% block dashboard_stat %} -

-

- Key - {% if create %}New key{% else %}{{ key.id }}{% endif %} -

- -
+
+
+
+
+

+ API Keys + {% if create %}Add API Key{% else %}Edit API Key - {{ key.id }}{% endif %} +

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

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

+
+
+
+
+

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

@@ -33,7 +42,7 @@ action="{% if create %}{{ url_for('admin.edit_key') }}{% else %}{{ url_for('admin.edit_key', key_id=key.id) }}{% endif %}"> -
+
-
+ +
+
+
+
+

+ Dashboard + Control panel +

+
+
+ +
+
+
+
{% endblock %} {% block content %} diff --git a/powerdnsadmin/templates/admin_global_search.html b/powerdnsadmin/templates/admin_global_search.html index 2e38bf1..815230c 100644 --- a/powerdnsadmin/templates/admin_global_search.html +++ b/powerdnsadmin/templates/admin_global_search.html @@ -13,6 +13,26 @@
  • Global Search
  • + +
    +
    +
    +
    +

    + Dashboard + Control panel +

    +
    +
    + +
    +
    +
    +
    + {% endblock %} {% block content %}
    diff --git a/powerdnsadmin/templates/admin_history.html b/powerdnsadmin/templates/admin_history.html index aa16c4a..23b45b9 100644 --- a/powerdnsadmin/templates/admin_history.html +++ b/powerdnsadmin/templates/admin_history.html @@ -4,15 +4,26 @@ History - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - History Recent events -

    - -
    + +
    +
    +
    +
    +

    + History + Recent Events +

    +
    +
    + +
    +
    +
    +
    + {% endblock %} {% block content %} {% import 'applied_change_macro.html' as applied_change_macro %} @@ -20,57 +31,57 @@
    +
    -
    -
    -
    -

    History Management

    +
    +
    +
    +

    History Management

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block extrascripts %} diff --git a/powerdnsadmin/templates/admin_manage_keys.html b/powerdnsadmin/templates/admin_manage_keys.html index dadc2a0..9f2c682 100644 --- a/powerdnsadmin/templates/admin_manage_keys.html +++ b/powerdnsadmin/templates/admin_manage_keys.html @@ -3,72 +3,75 @@ {% block title %} Key Management - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - Key Manage API keys -

    - -
    +
    +
    +
    +
    +

    + API Keys + Management +

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

    Key Management

    -
    - -
    - - - - - - - - - - - - - {% for key in keys %} - - - - - - - - - {% endfor %} - -
    IdRoleDescriptionDomainsAccountsAction
    {{ 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 %} - - -
    -
    - -
    - -
    - +
    +
    +
    +

    Key Management

    +
    + +
    + + + + + + + + + + + + + {% for key in keys %} + + + + + + + + + {% endfor %} + +
    IdRoleDescriptionDomainsAccountsAction
    {{ 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 %} diff --git a/powerdnsadmin/templates/admin_manage_user.html b/powerdnsadmin/templates/admin_manage_user.html index d6a7204..f1b6022 100644 --- a/powerdnsadmin/templates/admin_manage_user.html +++ b/powerdnsadmin/templates/admin_manage_user.html @@ -3,31 +3,40 @@ {% block title %} User Management - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - User Manage user privileges -

    - -
    +
    +
    +
    +
    +

    + User + Manage user privileges +

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

    User Management

    +
    +
    +

    User Management

    -
    + -
    +
    diff --git a/powerdnsadmin/templates/admin_pdns_stats.html b/powerdnsadmin/templates/admin_pdns_stats.html index cd5a000..84a1ec6 100644 --- a/powerdnsadmin/templates/admin_pdns_stats.html +++ b/powerdnsadmin/templates/admin_pdns_stats.html @@ -13,6 +13,26 @@
  • Admin Console
  • + +
    +
    +
    +
    +

    + Dashboard + Control panel +

    +
    +
    + +
    +
    +
    +
    + {% endblock %} {% block content %} diff --git a/powerdnsadmin/templates/admin_setting_authentication.html b/powerdnsadmin/templates/admin_setting_authentication.html index 5d0fd10..0509cbb 100644 --- a/powerdnsadmin/templates/admin_setting_authentication.html +++ b/powerdnsadmin/templates/admin_setting_authentication.html @@ -4,33 +4,43 @@ Authentication Settings - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - Settings PowerDNS-Admin settings -

    - - + + + + - window.onload = function() { - ldapSelection(); - } - -
    {% endblock %} {% block content %}
    diff --git a/powerdnsadmin/templates/admin_setting_basic.html b/powerdnsadmin/templates/admin_setting_basic.html index d3d0905..3df8fc0 100644 --- a/powerdnsadmin/templates/admin_setting_basic.html +++ b/powerdnsadmin/templates/admin_setting_basic.html @@ -4,66 +4,73 @@ Basic Settings - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    -

    - Settings PowerDNS-Admin settings -

    - -
    +
    +
    +
    +
    +

    + Settings + Basic +

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

    Basic Settings

    -
    -
    -
    - - - - - - - - - {% for setting in settings %} - - - {% if SETTING.get(setting) in [True, False] %} - - - {% else %} - - - {% endif %} - - {% endfor %} - -
    NameValueChange
    {{ setting }}{{ SETTING.get(setting)|display_setting_state }} - - - -
    -
    - -
    - -
    - +
    +
    +
    +

    Basic Settings

    +
    +
    + + + + + + + + + + {% for setting in settings %} + + + {% if SETTING.get(setting) in [True, False] %} + + + {% else %} + + + {% endif %} + + {% endfor %} + +
    NameValueChange
    + {{ setting }} + {{ SETTING.get(setting)|display_setting_state }} + + + + + +
    +
    - +
    {% endblock %} {% block extrascripts %} diff --git a/powerdnsadmin/templates/admin_setting_pdns.html b/powerdnsadmin/templates/admin_setting_pdns.html index 84f86a9..08b42f1 100644 --- a/powerdnsadmin/templates/admin_setting_pdns.html +++ b/powerdnsadmin/templates/admin_setting_pdns.html @@ -4,7 +4,7 @@ PDNS Settings - {{ SITE_NAME }} {% endblock %} {% block dashboard_stat %} -
    +

    Settings PowerDNS-Admin settings

    @@ -13,7 +13,7 @@
  • Setting
  • PDNS
  • -
    +
    {% endblock %} {% block content %}
    diff --git a/powerdnsadmin/templates/base.html b/powerdnsadmin/templates/base.html index 35bfc51..f3261dd 100644 --- a/powerdnsadmin/templates/base.html +++ b/powerdnsadmin/templates/base.html @@ -2,37 +2,85 @@ {% block head %} - - - - {% block title %}{{ SITE_NAME }}{% endblock %} - - - - - - - - - {% assets "css_main" -%} + + + + {% block title %} + + {{ SITE_NAME }} + + {% endblock %} + + + + + + + + + + {% assets "css_main" -%} - {%- endassets %} -{% if SETTING.get('custom_css') %} - -{% endif %} + {%- endassets %} + {% if SETTING.get('custom_css') %} + + {% endif %} {% endblock %} + -{% set user_image_url = url_for('user.image', username=current_user.username) %} -
    + {% set user_image_url = url_for('user.image', username=current_user.username) %} +
    {% block pageheader %} -
    + + + {% endblock %} + +
    - {% endblock %} - -
    @@ -169,16 +224,24 @@
    {% block dashboard_stat %} -
    -

    - Dashboard - Control panel -

    - -
    +
    +
    +
    +
    +

    + Dashboard + Control panel +

    +
    +
    + +
    +
    +
    +
    {% endblock %} {% block content %} {% endblock %} @@ -382,4 +445,4 @@ {% block modals %} {% endblock %} - + \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/400.html b/powerdnsadmin/templates/errors/400.html index ec53684..b2ca864 100644 --- a/powerdnsadmin/templates/errors/400.html +++ b/powerdnsadmin/templates/errors/400.html @@ -1,41 +1,52 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 400 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 400 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 400 - Error -

    - -
    +
    +
    +
    +
    +

    + 400 + Error +

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

    400

    -
    -

    - Oops! Bad request -

    -

    - {% if msg %} - {{ msg }} - {% else %} - The server refused to process your request and return a 400 error. - {% endif %} -
    You may return to the dashboard. -

    -
    - +

    + 400 +

    +
    +

    + + Oops! Bad request +

    +

    + {% if msg %} + {{ msg }} + {% else %} + The server refused to process your request and return a 400 error. + {% endif %} +
    You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/403.html b/powerdnsadmin/templates/errors/403.html index ffe96bf..f629eb8 100644 --- a/powerdnsadmin/templates/errors/403.html +++ b/powerdnsadmin/templates/errors/403.html @@ -1,37 +1,48 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 403 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 403 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 403 - Error -

    - -
    +
    +
    +
    +
    +

    + 403 + Error +

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

    403

    -
    -

    - Oops! Access denied -

    -

    - You don't have permission to access this page - You may return to the dashboard. -

    -
    - +

    + 403 +

    +
    +

    + + Oops! Access denied +

    +

    + You don't have permission to access this page + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/404.html b/powerdnsadmin/templates/errors/404.html index a93c731..858731f 100644 --- a/powerdnsadmin/templates/errors/404.html +++ b/powerdnsadmin/templates/errors/404.html @@ -1,37 +1,48 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 404 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 404 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 404 - Error -

    - -
    +
    +
    +
    +
    +

    + 404 + Error +

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

    404

    -
    -

    - Oops! You're lost -

    -

    - The page you requested could not be found. - You may return to the dashboard. -

    -
    - +

    + 404 +

    +
    +

    + + Oops! You're lost +

    +

    + The page you requested could not be found. + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/500.html b/powerdnsadmin/templates/errors/500.html index d223b0b..51142f0 100644 --- a/powerdnsadmin/templates/errors/500.html +++ b/powerdnsadmin/templates/errors/500.html @@ -1,37 +1,48 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - 500 Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - 500 Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - 500 - Error -

    - -
    +
    +
    +
    +
    +

    + 500 + Error +

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

    500

    -
    -

    - Oops! Something went wrong -

    -

    - Try again later. - You may return to the dashboard. -

    -
    - +

    + 500 +

    +
    +

    + + Oops! Something went wrong +

    +

    + Try again later. + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/errors/SAML.html b/powerdnsadmin/templates/errors/SAML.html index 2cfacbd..c779022 100644 --- a/powerdnsadmin/templates/errors/SAML.html +++ b/powerdnsadmin/templates/errors/SAML.html @@ -1,45 +1,60 @@ {% extends "base.html" %} -{% block title %}PowerDNS-Admin - SAML Authentication Error{% endblock %} + +{% block title %} + + {{ SITE_NAME }} - SAML Authentication Error + +{% endblock %} {% block dashboard_stat %} - -
    -

    - SAML - Error -

    - -
    +
    +
    +
    +
    +

    + SAML + Error +

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

    SAML Authentication Error



    -
    -

    - Oops! Something went wrong -


    -

    - Login failed.
    - Error(s) when processing SAML Response:
    -

      - {% for error in errors %} -
    • {{ error }}
    • - {% endfor %} -
    - - You may return to the dashboard. -

    -
    - +
    +

    + SAML Authentication Error +

    +
    +
    +
    +
    +

    + Oops! Something went wrong +

    +
    +

    + Login failed. +
    + Error(s) when processing SAML Response: +
    +

      + {% for error in errors %} +
    • {{ error }}
    • + {% endfor %} +
    + You may return to the dashboard. +

    +
    - -
    - -{% endblock %} +
    +{% endblock %} \ No newline at end of file diff --git a/powerdnsadmin/templates/login.html b/powerdnsadmin/templates/login.html index 805422b..02f3e41 100644 --- a/powerdnsadmin/templates/login.html +++ b/powerdnsadmin/templates/login.html @@ -1,166 +1,171 @@ - - - - - Log In - {{ SITE_NAME }} - - - - - {% assets "css_login" -%} - - {%- endassets %} -{% if SETTING.get('custom_css') %} - -{% endif %} - - - -
    + {% 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 %}
    {% endblock %} + +{% block content %} +
    +
    +
    +
    +
    +
    +

    User Management

    +
    + +
    + + + + + + + + + + + + + + {% for user in users %} + + + + + + + + + + {% endfor %} + +
    UsernameFirst NameLast NameEmailRolePrivilegesAction
    {{ user.username }}{{ user.firstname }}{{ user.lastname }}{{ user.email }} + + + + + + +
    +
    +
    +
    +
    +
    +
    +{% endblock %} + {% block extrascripts %} - + {% endblock %} + {% block modals %} -