Initial go at upgrading from Bootstap v3 to v4 and to AdminLTE v3.2.0

This commit is contained in:
Tyler Todd 2023-02-02 21:19:15 +00:00
parent e411bc9f19
commit 7f25e3b555
24 changed files with 1246 additions and 931 deletions

View File

@ -1,15 +1,15 @@
{ {
"dependencies": { "dependencies": {
"admin-lte": "2.4.9", "admin-lte": "3.2.0",
"bootstrap": "^3.4.1", "bootstrap": "4.6.2",
"bootstrap-datepicker": "^1.8.0", "bootstrap-datepicker": "^1.9.0",
"bootstrap-validator": "^0.11.9", "bootstrap-validator": "^0.11.9",
"datatables.net-plugins": "^1.10.19", "datatables.net-plugins": "^1.13.1",
"icheck": "^1.0.2", "icheck": "^1.0.2",
"jquery-slimscroll": "^1.3.8", "jquery-slimscroll": "^1.3.8",
"jquery-ui-dist": "^1.12.1", "jquery-ui-dist": "^1.13.2",
"jquery.quicksearch": "^2.4.0", "jquery.quicksearch": "^2.4.0",
"jtimeout": "^3.1.0", "jtimeout": "^3.2.0",
"multiselect": "^0.9.12" "multiselect": "^0.9.12"
} }
} }

View File

@ -287,4 +287,18 @@ function copy_otp_secret_to_clipboard() {
navigator.clipboard.writeText(copyBox.value); navigator.clipboard.writeText(copyBox.value);
$("#copy_tooltip").css("visibility", "visible"); $("#copy_tooltip").css("visibility", "visible");
setTimeout(function(){ $("#copy_tooltip").css("visibility", "collapse"); }, 2000); setTimeout(function(){ $("#copy_tooltip").css("visibility", "collapse"); }, 2000);
} }
// 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');

View File

@ -4,26 +4,34 @@
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Account <div class="row mb-2">
<small>{% if create %}New account{% else %}{{ account.name }}{% endif %}</small> <div class="col-sm-6">
</h1> <h1 class="m-0 text-dark">
<ol class="breadcrumb"> Account
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li> <small>{% if create %}New account{% else %}{{ account.name }}{% endif %}</small>
<li><a href="{{ url_for('admin.manage_account') }}">Accounts</a></li> </h1>
<li class="active">{% if create %}Add{% else %}Edit{% endif %} account</li> </div>
</ol> <div class="col-sm-6">
</section> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li>
<li class="breadcrumb-item"><a href="{{ url_for('admin.manage_account') }}">Accounts</a></li>
<li class="breadcrumb-item active">{% if create %}Add{% else %}Edit{% endif %} account</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="content"> <section class="content">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="box box-primary"> <div class="card card-primary">
<div class="box-header with-border"> <div class="card-header with-border">
<h3 class="box-title">{% if create %}Add{% else %}Edit{% endif %} account</h3> <h3 class="card-title">{% if create %}Add{% else %}Edit{% endif %} account</h3>
</div> </div>
<!-- /.box-header --> <!-- /.box-header -->
<!-- form start --> <!-- form start -->
@ -31,7 +39,7 @@
action="{% if create %}{{ url_for('admin.edit_account') }}{% else %}{{ url_for('admin.edit_account', account_name=account.name) }}{% endif %}"> action="{% if create %}{{ url_for('admin.edit_account') }}{% else %}{{ url_for('admin.edit_account', account_name=account.name) }}{% endif %}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="create" value="{{ create }}"> <input type="hidden" name="create" value="{{ create }}">
<div class="box-body"> <div class="card-body">
{% if error %} {% if error %}
<div class="alert alert-danger alert-dismissible"> <div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
@ -73,10 +81,10 @@
<span class="fa fa-envelope form-control-feedback"></span> <span class="fa fa-envelope form-control-feedback"></span>
</div> </div>
</div> </div>
<div class="box-header with-border"> <div class="card-header with-border">
<h3 class="box-title">Access Control</h3> <h3 class="card-title">Access Control</h3>
</div> </div>
<div class="box-body"> <div class="card-body">
<p>Users on the right have access to manage records in all domains <p>Users on the right have access to manage records in all domains
associated with the account.</p> associated with the account.</p>
<p>Click on users to move between columns.</p> <p>Click on users to move between columns.</p>
@ -90,7 +98,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="box-footer"> <div class="card-footer">
<button type="submit" <button type="submit"
class="btn btn-flat btn-primary">{% if create %}Create{% else %}Update{% endif %} class="btn btn-flat btn-primary">{% if create %}Create{% else %}Update{% endif %}
Account</button> Account</button>
@ -98,12 +106,12 @@
</form> </form>
</div> </div>
</div> </div>
<div class="col-md-8"> <div class="col-md-6">
<div class="box box-primary"> <div class="card card-primary">
<div class="box-header with-border"> <div class="card-header with-border">
<h3 class="box-title">Help with creating a new account</h3> <h3 class="card-title">Help with creating a new account</h3>
</div> </div>
<div class="box-body"> <div class="card-body">
<p> <p>
An account allows grouping of domains belonging to a particular entity, such as a customer or An account allows grouping of domains belonging to a particular entity, such as a customer or
department.<br /> department.<br />

View File

@ -6,26 +6,35 @@
{% endblock %} {% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Key <div class="row mb-2">
<small>{% if create %}New key{% else %}{{ key.id }}{% endif %}</small> <div class="col-sm-6">
</h1> <h1 class="m-0 text-dark">
<ol class="breadcrumb"> API Keys
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li> <small>{% if create %}Add API Key{% else %}Edit API Key - {{ key.id }}{% endif %}</small>
<li><a href="{{ url_for('admin.manage_keys') }}">Key</a></li> </h1>
<li class="active">{% if create %}Add{% else %}Edit{% endif %} key</li> </div>
</ol> <div class="col-sm-6">
</section> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item"><a href="{{ url_for('admin.manage_keys') }}">API Keys</a></li>
<li class="breadcrumb-item active">{% if create %}Add API Key{% else %}Edit API Key - {% endif %}{{ key.id }}</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="content"> <section class="content">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-6">
<div class="box box-primary"> <div class="card card-primary">
<div class="box-header with-border"> <div class="card-header with-border">
<h3 class="box-title">{% if create %}Add{% else %}Edit{% endif %} key</h3> <h3 class="card-title">{% if create %}Add{% else %}Edit{% endif %} Key</h3>
</div> </div>
<!-- /.box-header --> <!-- /.box-header -->
<!-- form start --> <!-- form start -->
@ -33,7 +42,7 @@
action="{% if create %}{{ url_for('admin.edit_key') }}{% else %}{{ url_for('admin.edit_key', key_id=key.id) }}{% endif %}"> action="{% if create %}{{ url_for('admin.edit_key') }}{% else %}{{ url_for('admin.edit_key', key_id=key.id) }}{% endif %}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="create" value="{{ create }}"> <input type="hidden" name="create" value="{{ create }}">
<div class="box-body"> <div class="card-body">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<label class="control-label" for="role">Role</label> <label class="control-label" for="role">Role</label>
<select class="key_role form-control" id="key_role" name="key_role"> <select class="key_role form-control" id="key_role" name="key_role">
@ -52,10 +61,10 @@
class="glyphicon glyphicon-pencil form-control-feedback"></span> class="glyphicon glyphicon-pencil form-control-feedback"></span>
</div> </div>
</div> </div>
<div class="box-header with-border key-opts"{% if hide_opts %} style="display: none;"{% endif %}> <div class="card-header with-border key-opts"{% if hide_opts %} style="display: none;"{% endif %}>
<h3 class="box-title">Accounts Access Control</h3> <h3 class="card-title">Accounts Access Control</h3>
</div> </div>
<div class="box-body key-opts"{% if hide_opts %} style="display: none;"{% endif %}> <div class="card-body key-opts"{% if hide_opts %} style="display: none;"{% endif %}>
<p>This key will be linked to the accounts on the right,</p> <p>This key will be linked to the accounts on the right,</p>
<p>thus granting access to domains owned by the selected accounts.</p> <p>thus granting access to domains owned by the selected accounts.</p>
<p>Click on accounts to move between the columns.</p> <p>Click on accounts to move between the columns.</p>
@ -68,10 +77,10 @@
</select> </select>
</div> </div>
</div> </div>
<div class="box-header with-border key-opts"{% if hide_opts %} style="display: none;"{% endif %}> <div class="card-header with-border key-opts"{% if hide_opts %} style="display: none;"{% endif %}>
<h3 class="box-title">Domain Access Control</h3> <h3 class="card-title">Domain Access Control</h3>
</div> </div>
<div class="box-body key-opts"{% if hide_opts %} style="display: none;"{% endif %}> <div class="card-body key-opts"{% if hide_opts %} style="display: none;"{% endif %}>
<p>This key will have acess to the domains on the right.</p> <p>This key will have acess to the domains on the right.</p>
<p>Click on domains to move between the columns.</p> <p>Click on domains to move between the columns.</p>
<div class="form-group col-xs-2"> <div class="form-group col-xs-2">
@ -83,7 +92,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="box-footer"> <div class="card-footer">
<button type="submit" <button type="submit"
class="btn btn-flat btn-primary" id="key_submit">{% if create %}Create{% else %}Update{% endif %} class="btn btn-flat btn-primary" id="key_submit">{% if create %}Create{% else %}Update{% endif %}
Key</button> Key</button>
@ -91,13 +100,13 @@
</form> </form>
</div> </div>
</div> </div>
<div class="col-md-8"> <div class="col-md-6">
<div class="box box-primary"> <div class="card card-primary">
<div class="box-header with-border"> <div class="card-header with-border">
<h3 class="box-title">Help with {% if create %}creating a new{% else%}updating a{% endif %} key <h3 class="card-title">Help with {% if create %}creating a new{% else%}updating a{% endif %} key
</h3> </h3>
</div> </div>
<div class="box-body"> <div class="card-body">
<p>Fill in all the fields in the form to the left.</p> <p>Fill in all the fields in the form to the left.</p>
<p><strong>Role</strong> The role of the key.</p> <p><strong>Role</strong> The role of the key.</p>
<p><strong>Description</strong> The key description.</p> <p><strong>Description</strong> The key description.</p>

View File

@ -15,6 +15,25 @@
<li class="active">{% if create %}Add{% else %}Edit{% endif %} user</li> <li class="active">{% if create %}Add{% else %}Edit{% endif %} user</li>
</ol> </ol>
</section> </section>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
Dashboard
<small>Control panel</small>
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Dashboard v1</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -13,6 +13,26 @@
<li class="active">Global Search</li> <li class="active">Global Search</li>
</ol> </ol>
</section> </section>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
Dashboard
<small>Control panel</small>
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Dashboard v1</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% block content %} {% endblock %} {% block content %}
<section class="content"> <section class="content">
<div class="row"> <div class="row">

View File

@ -4,15 +4,26 @@
<title>History - {{ SITE_NAME }}</title> <title>History - {{ SITE_NAME }}</title>
{% endblock %} {% block dashboard_stat %} {% endblock %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header">
<h1> <div class="content-header">
History <small>Recent events</small> <div class="container-fluid">
</h1> <div class="row mb-2">
<ol class="breadcrumb"> <div class="col-sm-6">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li> <h1 class="m-0 text-dark">
<li class="active">History</li> History
</ol> <small>Recent Events</small>
</section> </h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li>
<li class="breadcrumb-item active">History</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% import 'applied_change_macro.html' as applied_change_macro %} {% import 'applied_change_macro.html' as applied_change_macro %}
@ -20,57 +31,57 @@
<section class="content"> <section class="content">
<div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-md-12">
<div class="box"> <div class="card">
<div class="box-header"> <div class="card-header">
<h3 class="box-title">History Management</h3> <h3 class="card-title">History Management</h3>
</div>
<div class="card-body clearfix">
<button type="button" class="btn btn-flat btn-danger pull-right" data-toggle="modal" data-target="#modal_clear_history" {% if current_user.role.name != 'Administrator' %}disabled{% endif %}>
Clear History
<i class="fa fa-trash"></i>
</button>
</div>
<div class="card-body clearfix">
<form id="history-search-form" autocomplete="off">
<div class="nav-tabs-custom" id="tabs">
<ul class="nav nav-tabs" id="nav_nav_tabs" name="nav_nav_tabs">
<li id="activity_tab" class="active"><a href="#tabs-act" data-toggle="tab">Search for All Activity</a></li>
<li id="domain_tab"><a href="#tabs-domain" data-toggle="tab">Search By Domain</a></li>
<li id="account_tab"><a href="#tabs-account" data-toggle="tab">Search By Account</a></li>
{% if current_user.role.name != 'User' %}
<li id="user_auth_tab"><a href="#tabs-auth" data-toggle="tab">Search for User Authentication</a></li>
{% endif %}
</ul>
<div class="tab-content">
<div class="tab-pane" id="tabs-act">
</div>
<div class="tab-pane" id="tabs-domain">
<td>
<label>Domain Name</label>
</td>
<td>
<div class="autocomplete" style="width:250px;">
<input type="text" class="form-control" id="domain_name_filter" name="domain_name_filter" placeholder="Enter * to search for any domain" value="">
</div> </div>
<div class="box-body clearfix"> </td>
<button type="button" class="btn btn-flat btn-danger pull-right" data-toggle="modal" <td>
data-target="#modal_clear_history" <div style="position: relative; top:10px;">
{% if current_user.role.name != 'Administrator' %}disabled{% endif %}> <td>Record Changelog only &nbsp</td>
Clear History&nbsp;<i class="fa fa-trash"></i> <td>
</button> <input type="checkbox" id="domain_changelog_only_checkbox" name="domain_changelog_only_checkbox"
</div> class="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;">
</td>
<div class="box-body clearfix"> </div>
<form id="history-search-form" autocomplete="off"> </td>
<!-- Custom Tabs --> </div>
<div class="nav-tabs-custom" id="tabs"> <div class="tab-pane" id="tabs-account">
<ul class="nav nav-tabs" id="nav_nav_tabs" name="nav_nav_tabs"> <td><label>Account Name</label></td>
<li id="activity_tab" class="active"><a href="#tabs-act" data-toggle="tab">Search for All Activity</a></li> <td>
<li id="domain_tab"><a href="#tabs-domain" data-toggle="tab">Search By Domain</a></li> <div class="autocomplete" style="width:250px;">
<li id="account_tab"><a href="#tabs-account" data-toggle="tab">Search By Account</a></li> <input type="text" class="form-control" id="account_name_filter" name="account_name_filter" placeholder="Enter * to search for any account" value="">
{% if current_user.role.name != 'User' %}
<li id="user_auth_tab"><a href="#tabs-auth" data-toggle="tab">Search for User Authentication</a></li>
{% endif %}
</ul>
<div class="tab-content">
<div class="tab-pane" id="tabs-act">
</div>
<div class="tab-pane" id="tabs-domain">
<td><label>Domain Name</label></td>
<td>
<div class="autocomplete" style="width:250px;">
<input type="text" class="form-control" id="domain_name_filter" name="domain_name_filter" placeholder="Enter * to search for any domain" value="">
</div>
</td>
<td>
<div style="position: relative; top:10px;">
<td>Record Changelog only &nbsp</td>
<td>
<input type="checkbox" id="domain_changelog_only_checkbox" name="domain_changelog_only_checkbox"
class="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;">
</td>
</div>
</td>
</div>
<div class="tab-pane" id="tabs-account">
<td><label>Account Name</label></td>
<td>
<div class="autocomplete" style="width:250px;">
<input type="text" class="form-control" id="account_name_filter" name="account_name_filter" placeholder="Enter * to search for any account" value="">
</div> </div>
</td> </td>
</div> </div>
@ -109,9 +120,7 @@
</td> </td>
</div> </div>
</div> </div>
<!-- End Custom Tabs --> <div class="card-body">
<div class="box-body">
<table id="Filters-Table"> <table id="Filters-Table">
<thead> <thead>
<th>Filters</th> <th>Filters</th>
@ -148,7 +157,6 @@
<button type="submit" id="search-submit" name="search-submit" class="btn btn-flat btn-primary button-filter">Search&nbsp;<i class="fa fa-search"></i></button> <button type="submit" id="search-submit" name="search-submit" class="btn btn-flat btn-primary button-filter">Search&nbsp;<i class="fa fa-search"></i></button>
</td> </td>
<td> <td>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<button id="clear-filters" name="clear-filters" class="btn btn-flat btn-warning button-clearf">Clear Filters&nbsp;<i class="fa fa-trash"></i></button> <button id="clear-filters" name="clear-filters" class="btn btn-flat btn-warning button-clearf">Clear Filters&nbsp;<i class="fa fa-trash"></i></button>
</td> </td>
</tr> </tr>
@ -157,17 +165,8 @@
</div> </div>
</form> </form>
</div> </div>
<div id="table_from_ajax"></div> <div id="table_from_ajax"></div>
<!-- /.box-body -->
</div> </div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section> </section>
{% endblock %} {% endblock %}
{% block extrascripts %} {% block extrascripts %}

View File

@ -3,74 +3,80 @@
{% block title %} {% block title %}
<title>Account Management - {{ SITE_NAME }}</title> <title>Account Management - {{ SITE_NAME }}</title>
{% endblock %} {% block dashboard_stat %} {% endblock %} {% block dashboard_stat %}
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Accounts <small>Manage accounts</small> <div class="row mb-2">
</h1> <div class="col-sm-6">
<ol class="breadcrumb"> <h1 class="m-0 text-dark">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li> Accounts
<li class="active">Accounts</li> <small>Manage</small>
</ol> </h1>
</section> </div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li>
<li class="breadcrumb-item active">Accounts</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% block content %} {% endblock %} {% block content %}
<section class="content"> <section class="content">
<div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12 col-md-12">
<div class="box"> <div class="card card-primary">
<div class="box-header"> <div class="card-header with-border">
<h3 class="box-title">Account Management</h3> <h3 class="card-title">Account Management</h3>
</div> </div>
<div class="box-body"> <div class="card-body">
<a href="{{ url_for('admin.edit_account') }}"> <a href="{{ url_for('admin.edit_account') }}">
<button type="button" class="btn btn-flat btn-primary pull-left button_add_account"> <button type="button" class="btn btn-flat btn-primary pull-left button_add_account">
Add Account&nbsp;<i class="fa fa-plus"></i> Add Account&nbsp;<i class="fa fa-plus"></i>
</button> </button>
</a> </a>
</div> </div>
<div class="box-body"> <div class="card-body">
<table id="tbl_accounts" class="table table-bordered table-striped"> <table id="tbl_accounts" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Description</th> <th>Description</th>
<th>Contact</th> <th>Contact</th>
<th>Mail</th> <th>Mail</th>
<th>Member</th> <th>Member</th>
<th>Domain</th> <th>Domain</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for account in accounts %} {% for account in accounts %}
<tr class="odd gradeX"> <tr class="odd gradeX">
<td>{{ account.name }}</td> <td>{{ account.name }}</td>
<td>{{ account.description }}</td> <td>{{ account.description }}</td>
<td>{{ account.contact }}</td> <td>{{ account.contact }}</td>
<td>{{ account.mail }}</td> <td>{{ account.mail }}</td>
<td>{{ account.user_num }}</td> <td>{{ account.user_num }}</td>
<td>{{ account.domains|length }}</td> <td>{{ account.domains|length }}</td>
<td width="15%"> <td width="15%">
<button type="button" class="btn btn-flat btn-success" <button type="button" class="btn btn-flat btn-success" onclick="window.location.href='{{ url_for('admin.edit_account', account_name=account.name) }}'">
onclick="window.location.href='{{ url_for('admin.edit_account', account_name=account.name) }}'"> Edit&nbsp;<i class="fa fa-cog"></i>
Edit&nbsp;<i class="fa fa-cog"></i> </button>
</button> <button type="button" class="btn btn-flat btn-danger button_delete" id="{{ account.name }}">
<button type="button" class="btn btn-flat btn-danger button_delete" Delete&nbsp;<i class="fa fa-trash"></i>
id="{{ account.name }}"> </button>
Delete&nbsp;<i class="fa fa-trash"></i> </td>
</button> </tr>
</td> {% endfor %}
</tr> </tbody>
{% endfor %} </table>
</tbody> </div>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div> </div>
<!-- /.col --> </div>
</div> </div>
<!-- /.row --> </div>
</section> </section>
{% endblock %} {% endblock %}
{% block extrascripts %} {% block extrascripts %}

View File

@ -3,72 +3,75 @@
{% block title %} {% block title %}
<title>Key Management - {{ SITE_NAME }}</title> <title>Key Management - {{ SITE_NAME }}</title>
{% endblock %} {% block dashboard_stat %} {% endblock %} {% block dashboard_stat %}
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Key <small>Manage API keys</small> <div class="row mb-2">
</h1> <div class="col-sm-6">
<ol class="breadcrumb"> <h1 class="m-0 text-dark">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li> API Keys
<li class="active">Key</li> <small>Management</small>
</ol> </h1>
</section> </div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">API Keys</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% block content %} {% endblock %} {% block content %}
<section class="content"> <section class="content">
<div class="row"> <div class="container-fluid">
<div class="col-xs-12"> <div class="card">
<div class="box"> <div class="card-header with-border">
<div class="box-header"> <h3 class="card-title">Key Management</h3>
<h3 class="box-title">Key Management</h3> </div>
</div> <div class="card-body">
<div class="box-body"> <a href="{{ url_for('admin.edit_key') }}">
<a href="{{ url_for('admin.edit_key') }}"> <button type="button" class="btn btn-primary pull-left button_add_key">
<button type="button" class="btn btn-flat btn-primary pull-left button_add_key"> Add Key&nbsp;<i class="fa fa-plus"></i>
Add Key&nbsp;<i class="fa fa-plus"></i> </button>
</button> </a>
</a> </div>
</div> <div class="card-body">
<div class="box-body"> <table id="tbl_keys" class="table table-bordered table-striped">
<table id="tbl_keys" class="table table-bordered table-striped"> <thead>
<thead> <tr>
<tr> <th>Id</th>
<th>Id</th> <th>Role</th>
<th>Role</th> <th>Description</th>
<th>Description</th> <th>Domains</th>
<th>Domains</th> <th>Accounts</th>
<th>Accounts</th> <th>Action</th>
<th>Action</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> {% for key in keys %}
{% for key in keys %} <tr class="odd gradeX">
<tr class="odd gradeX"> <td>{{ key.id }}</td>
<td>{{ key.id }}</td> <td>{{ key.role.name }}</td>
<td>{{ key.role.name }}</td> <td>{{ key.description }}</td>
<td>{{ key.description }}</td> <td>{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td>
<td>{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td> <td>{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td>
<td>{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td> <td width="15%">
<td width="15%"> <button type="button" class="btn btn-flat btn-success button_edit"
<button type="button" class="btn btn-flat btn-success button_edit" onclick="window.location.href='{{ url_for('admin.edit_key', key_id=key.id) }}'">
onclick="window.location.href='{{ url_for('admin.edit_key', key_id=key.id) }}'"> Edit&nbsp;<i class="fa fa-lock"></i>
Edit&nbsp;<i class="fa fa-lock"></i> </button>
</button> <button type="button" class="btn btn-flat btn-danger button_delete"
<button type="button" class="btn btn-flat btn-danger button_delete" id="{{ key.id }}">
id="{{ key.id }}"> Delete&nbsp;<i class="fa fa-trash"></i>
Delete&nbsp;<i class="fa fa-trash"></i> </button>
</button> </td>
</td> </tr>
</tr> {% endfor %}
{% endfor %} </tbody>
</tbody> </table>
</table> </div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div> </div>
<!-- /.row --> </div>
</section> </section>
{% endblock %} {% endblock %}
{% block extrascripts %} {% block extrascripts %}

View File

@ -3,31 +3,40 @@
{% block title %} {% block title %}
<title>User Management - {{ SITE_NAME }}</title> <title>User Management - {{ SITE_NAME }}</title>
{% endblock %} {% block dashboard_stat %} {% endblock %} {% block dashboard_stat %}
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
User <small>Manage user privileges</small> <div class="row mb-2">
</h1> <div class="col-sm-6">
<ol class="breadcrumb"> <h1 class="m-0 text-dark">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li> User
<li class="active">User</li> <small>Manage user privileges</small>
</ol> </h1>
</section> </div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li>
<li class="breadcrumb-item active">User</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% block content %} {% endblock %} {% block content %}
<section class="content"> <section class="content">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box"> <div class="card">
<div class="box-header"> <div class="card-header with-border">
<h3 class="box-title">User Management</h3> <h3 class="card-title">User Management</h3>
</div> </div>
<div class="box-body"> <div class="card-body">
<a href="{{ url_for('admin.edit_user') }}"> <a href="{{ url_for('admin.edit_user') }}">
<button type="button" class="btn btn-flat btn-primary pull-left button_add_user"> <button type="button" class="btn btn-flat btn-primary pull-left button_add_user">
Add User&nbsp;<i class="fa fa-plus"></i> Add User&nbsp;<i class="fa fa-plus"></i>
</button> </button>
</a> </a>
</div> </div>
<div class="box-body"> <div class="card-body">
<table id="tbl_users" class="table table-bordered table-striped"> <table id="tbl_users" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>

View File

@ -13,6 +13,26 @@
<li class="active">Admin Console</li> <li class="active">Admin Console</li>
</ol> </ol>
</section> </section>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
Dashboard
<small>Control panel</small>
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Dashboard v1</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -4,33 +4,43 @@
<title>Authentication Settings - {{ SITE_NAME }}</title> <title>Authentication Settings - {{ SITE_NAME }}</title>
{% endblock %} {% block dashboard_stat %} {% endblock %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Settings <small>PowerDNS-Admin settings</small> <div class="row mb-2">
</h1> <div class="col-sm-6">
<ol class="breadcrumb"> <h1 class="m-0 text-dark">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li> Settings
<li><a href="#">Setting</a></li> <small>PowerDNS-Admin Settings</small>
<li class="active">Authentication</li> </h1>
</ol> </div>
<script> <div class="col-sm-6">
function ldapSelection() { <ol class="breadcrumb float-sm-right">
if (document.getElementById('ldap').checked) { <li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li>
document.getElementById('ldap_openldap_fields').style.display = 'block'; <li class="breadcrumb-item">Settings</li>
document.getElementById('ldap_openldap_group_filters').style.display = 'block'; <li class="breadcrumb-item active">Authentication</li>
document.getElementById('ldap_ad_fields').style.display = 'none'; </ol>
} else { <script>
document.getElementById('ldap_openldap_fields').style.display = 'none'; function ldapSelection() {
document.getElementById('ldap_openldap_group_filters').style.display = 'none'; if (document.getElementById('ldap').checked) {
document.getElementById('ldap_ad_fields').style.display = 'block'; document.getElementById('ldap_openldap_fields').style.display = 'block';
document.getElementById('ldap_openldap_group_filters').style.display = 'block';
document.getElementById('ldap_ad_fields').style.display = 'none';
} else {
document.getElementById('ldap_openldap_fields').style.display = 'none';
document.getElementById('ldap_openldap_group_filters').style.display = 'none';
document.getElementById('ldap_ad_fields').style.display = 'block';
}
} }
}
window.onload = function() {
ldapSelection();
}
</script>
</div>
</div>
</div>
</div>
window.onload = function() {
ldapSelection();
}
</script>
</section>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="content"> <section class="content">

View File

@ -4,66 +4,73 @@
<title>Basic Settings - {{ SITE_NAME }}</title> <title>Basic Settings - {{ SITE_NAME }}</title>
{% endblock %} {% block dashboard_stat %} {% endblock %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Settings <small>PowerDNS-Admin settings</small> <div class="row mb-2">
</h1> <div class="col-sm-6">
<ol class="breadcrumb"> <h1 class="m-0 text-dark">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li> Settings
<li><a href="#">Setting</a></li> <small>Basic</small>
<li class="active">Basic</li> </h1>
</ol> </div>
</section> <div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">Settings - Basic</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% block content %} {% endblock %} {% block content %}
<section class="content"> <section class="content">
<div class="row"> <div class="container-fluid">
<div class="col-xs-12"> <div class="card">
<div class="box"> <div class="card-header with-border">
<div class="box-header"> <h3 class="card-title">Basic Settings</h3>
<h3 class="box-title">Basic Settings</h3> </div>
</div> <div class="card-body">
<div class="box-body"> <table id="tbl_settings" class="table table-bordered table-striped">
<table id="tbl_settings" class="table table-bordered table-striped"> <thead>
<thead> <tr>
<tr> <th>Name</th>
<th>Name</th> <th>Value</th>
<th>Value</th> <th>Change</th>
<th>Change</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> {% for setting in settings %}
{% for setting in settings %} <tr class="odd">
<tr class="odd "> <td>
<td>{{ setting }}</td> {{ setting }}
{% if SETTING.get(setting) in [True, False] %} </td>
<td>{{ SETTING.get(setting)|display_setting_state }}</td> {% if SETTING.get(setting) in [True, False] %}
<td width="6%"> <td>{{ SETTING.get(setting)|display_setting_state }}</td>
<button type="button" class="btn btn-flat btn-warning setting-toggle-button" <td width="6%">
id="{{ setting }}"> <button type="button" class="btn btn-warning setting-toggle-button" id="{{ setting }}">
Toggle&nbsp;<i class="fa fa-info"></i> Toggle
</button> <i class="fa fa-info"></i>
</td> </button>
{% else %} </td>
<td><input name="value" id="value" value="{{ SETTING.get(setting) }}"></td> {% else %}
<td width="6%"> <td>
<button type="button" class="btn btn-flat btn-warning setting-save-button" <input name="value" id="value" value="{{ SETTING.get(setting) }}">
id="{{ setting }}"> </td>
Save&nbsp;<i class="fa fa-info"></i> <td width="6%">
</button> <button type="button" class="btn btn-warning setting-save-button" id="{{ setting }}">
</td> Save
{% endif %} <i class="fa fa-info"></i>
</tr> </button>
{% endfor %} </td>
</tbody> {% endif %}
</table> </tr>
</div> {% endfor %}
<!-- /.box-body --> </tbody>
</div> </table>
<!-- /.box --> </div>
</div>
<!-- /.col -->
</div> </div>
<!-- /.row --> </div>
</section> </section>
{% endblock %} {% endblock %}
{% block extrascripts %} {% block extrascripts %}

View File

@ -4,7 +4,7 @@
<title>PDNS Settings - {{ SITE_NAME }}</title> <title>PDNS Settings - {{ SITE_NAME }}</title>
{% endblock %} {% block dashboard_stat %} {% endblock %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<h1> <h1>
Settings <small>PowerDNS-Admin settings</small> Settings <small>PowerDNS-Admin settings</small>
</h1> </h1>
@ -13,7 +13,7 @@
<li><a href="#">Setting</a></li> <li><a href="#">Setting</a></li>
<li class="active">PDNS</li> <li class="active">PDNS</li>
</ol> </ol>
</section> </div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="content"> <section class="content">

View File

@ -2,37 +2,85 @@
<html> <html>
<head> <head>
{% block head %} {% block head %}
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}"> <link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}">
{% block title %}<title>{{ SITE_NAME }}</title>{% endblock %} {% block title %}
<link rel="stylesheet" href="{{ url_for('static', filename='assets/css/style.css') }}"> <title>
<!-- Get Google Fonts we like --> {{ SITE_NAME }}
<link rel="stylesheet" href="{{ url_for('static', filename='assets/css/source_sans_pro.css') }}"> </title>
<link rel="stylesheet" href="{{ url_for('static', filename='assets/css/roboto_mono.css') }}"> {% endblock %}
<!-- Tell the browser to be responsive to screen width --> <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/style.css') }}">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <!-- Get Google Fonts we like -->
<!-- Tell Safari to not recognise telephone numbers --> <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/source_sans_pro.css') }}">
<meta name="format-detection" content="telephone=no"> <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/roboto_mono.css') }}">
{% assets "css_main" -%} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Tell Safari to not recognise telephone numbers -->
<meta name="format-detection" content="telephone=no">
{% assets "css_main" -%}
<link rel="stylesheet" href="{{ ASSET_URL }}"> <link rel="stylesheet" href="{{ ASSET_URL }}">
{%- endassets %} {%- endassets %}
{% if SETTING.get('custom_css') %} {% if SETTING.get('custom_css') %}
<link rel="stylesheet" href="/static/custom/{{ SETTING.get('custom_css') }}"> <link rel="stylesheet" href="/static/custom/{{ SETTING.get('custom_css') }}">
{% endif %} {% endif %}
{% endblock %} {% endblock %}
</head> </head>
<body class="hold-transition skin-blue sidebar-mini {% if not SETTING.get('fullscreen_layout') %}layout-boxed{% endif %}"> <body class="hold-transition skin-blue sidebar-mini {% if not SETTING.get('fullscreen_layout') %}layout-boxed{% endif %}">
{% set user_image_url = url_for('user.image', username=current_user.username) %} {% set user_image_url = url_for('user.image', username=current_user.username) %}
<div class="wrapper"> <div class="wrapper">
{% block pageheader %} {% block pageheader %}
<header class="main-header"> <nav class="main-header navbar navbar-expand navbar-dark">
<!-- Header Navbar: style can be found in header.less -->
<!-- Sidebar toggle button-->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#" role="button">
<i class="fas fa-bars"></i>
</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
{% if current_user.id is defined %}
<li class="nav-item dropdown user-menu">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
<img src="{{ user_image_url }}" class="user-image img-circle elevation-2" alt="User Image"/>
<span class="d-none d-md-inline">
{{ current_user.firstname }} {{ current_user.lastname }}
</span>
</a>
<ul class="dropdown-menu">
<li class="user-header">
<img src="{{ user_image_url }}" class="img-circle elevation-2" alt="User Image"/>
<p>
{{ current_user.firstname }} {{ current_user.lastname }}
<small>{{ current_user.role.name }}</small>
</p>
</li>
<li class="user-footer">
<a href="{{ url_for('user.profile') }}" class="btn btn-default">My Profile</a>
<a href="{{ url_for('index.logout') }}" class="btn btn-default float-right">Log out</a>
</li>
</ul>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" data-widget="fullscreen" href="#" role="button">
<i class="fas fa-expand-arrows-alt"></i>
</a>
</li>
</ul>
</nav>
{% endblock %}
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar sidebar-dark-primary">
<!-- Logo --> <!-- Logo -->
<a href="{{ url_for('index.index') }}" class="logo"> <a href="{{ url_for('index.index') }}" class="brand-link">
<!-- mini logo for sidebar mini 50x50 pixels --> <span class="brand-text font-weight-light">
<span class="logo-mini"><b>PD</b>A</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg">
{% if SETTING.get('site_name') %} {% if SETTING.get('site_name') %}
<b>{{ SITE_NAME }}</b> <b>{{ SITE_NAME }}</b>
{% else %} {% else %}
@ -40,128 +88,135 @@
{% endif %} {% endif %}
</span> </span>
</a> </a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div class="navbar-custom-menu">
{% if current_user.id is defined %}
<ul class="nav navbar-nav">
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="{{ user_image_url }}" class="user-image" alt="User Image"/>
<span class="hidden-xs">
{{ current_user.firstname }}
</span>
</a>
<ul class="dropdown-menu">
<li class="user-header">
<img src="{{ user_image_url }}" class="img-circle" alt="User Image"/>
<p>
{{ current_user.firstname }} {{ current_user.lastname }}
<small>{{ current_user.role.name }}</small>
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="{{ url_for('user.profile') }}" class="btn btn-flat btn-primary">My Profile</a>
</div>
<div class="pull-right">
<a href="{{ url_for('index.logout') }}" class="btn btn-flat btn-warning">Log out</a>
</div>
</li>
</ul>
</li>
</ul>
{% endif %}
</div>
</nav>
</header>
{% endblock %}
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less --> <!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar"> <div class="sidebar">
{% if current_user.id is defined %} {% if current_user.id is defined %}
<div class="user-panel"> <div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="pull-left image"> <div class="image">
<img src="{{ user_image_url }}" class="img-circle" alt="User Image"/> <img src="{{ user_image_url }}" class="img-circle elevation-2" alt="User Image">
</div> </div>
<div class="pull-left info"> <div class="info">
<p>{{ current_user.firstname }} {{ current_user.lastname }}</p> <a href="{{ url_for('user.profile') }}" class="d-block">{{ current_user.firstname }} {{ current_user.lastname }}</a>
<a href="#"><i class="fa fa-circle text-success"></i> Logged In</a>
</div> </div>
</div> </div>
<!-- sidebar menu: : style can be found in sidebar.less --> <!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu" data-widget="tree"> <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu">
<li class="header">USER ACTIONS</li> <li class="nav-header">USER ACTIONS</li>
<li class="{{ 'active' if active_page == 'dashboard' else '' }}"> <li class="{{ 'nav-item active' if active_page == 'nav-item dashboard' else 'nav-item' }}">
<a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> <span>Dashboard</span></a> <a href="{{ url_for('dashboard.dashboard') }}" class="nav-link">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>Dashboard</p>
</a>
</li> </li>
{% if SETTING.get('allow_user_create_domain') or current_user.role.name in ['Administrator', 'Operator'] %} {% if SETTING.get('allow_user_create_domain') or current_user.role.name in ['Administrator', 'Operator'] %}
<li class="{{ 'active' if active_page == 'new_domain' else '' }}"> <li class="{{ 'nav-item active' if active_page == 'nav-item new_domain' else 'nav-item' }}">
<a href="{{ url_for('domain.add') }}"><i class="fa fa-plus"></i> <span>New Domain</span></a> <a href="{{ url_for('domain.add') }}" class="nav-link">
<i class="nav-icon fas fa-plus"></i>
<p>New Domain</p>
</a>
</li> </li>
{% endif %} {% endif %}
{% if SETTING.get('allow_user_remove_domain') or current_user.role.name in ['Administrator', 'Operator'] %} {% if SETTING.get('allow_user_remove_domain') or current_user.role.name in ['Administrator', 'Operator'] %}
<li class="{{ 'active' if active_page == 'remove_domain' else '' }}"> <li class="{{ 'nav-item active' if active_page == 'remove_domain' else 'nav-item' }}">
<a href="{{ url_for('domain.remove') }}"><i class="fa fa-trash-o"></i> <span>Remove Domain</span></a> <a href="{{ url_for('domain.remove') }}" class="nav-link">
<i class="nav-icon fas fa-trash-alt"></i>
<p>Remove Domain</p>
</a>
</li> </li>
{% endif %} {% endif %}
{% if current_user.role.name in ['Administrator', 'Operator'] %} {% if current_user.role.name in ['Administrator', 'Operator'] %}
<li class="header">ADMINISTRATION</li> <li class="nav-header">ADMINISTRATION</li>
<li class="{{ 'active' if active_page == 'admin_console' else '' }}"> <li class="{{ 'nav-item active' if active_page == 'admin_console' else 'nav-item' }}">
<a href="{{ url_for('admin.pdns_stats') }}"><i class="fa fa-info-circle"></i> <span>PDNS</span></a> <a href="{{ url_for('admin.pdns_stats') }}" class="nav-link">
</li> <i class="nav-icon fas fa-info-circle"></i>
<li class="{{ 'active' if active_page == 'admin_global_search' else '' }}"> <p>PDNS</p>
<a href="{{ url_for('admin.global_search') }}"><i class="fa fa-search"></i> <span>Global Search</span></a>
</li>
<li class="{{ 'active' if active_page == 'admin_history' else '' }}">
<a href="{{ url_for('admin.history') }}"><i class="fa fa-calendar"></i> <span>History</span></a>
</li>
<li class="{{ 'active' if active_page == 'admin_domain_template' else '' }}">
<a href="{{ url_for('admin.templates') }}"><i class="fa fa-clone"></i> <span>Domain Templates</span></a>
</li>
<li class="{{ 'active' if active_page == 'admin_accounts' else '' }}">
<a href="{{ url_for('admin.manage_account') }}"><i class="fa fa-industry"></i> <span>Accounts</span></a>
</li>
<li class="{{ 'active' if active_page == 'admin_users' else '' }}">
<a href="{{ url_for('admin.manage_user') }}"><i class="fa fa-users"></i> <span>Users</span></a>
</li>
<li class="{{ 'active' if active_page == 'admin_keys' else '' }}">
<a href="{{ url_for('admin.manage_keys') }}"><i class="fa fa-key"></i> <span>API Keys</span></a>
</li>
<li class="{{ 'treeview active' if active_page == 'admin_settings' else 'treeview' }}">
<a href="#">
<i class="fa fa-cog"></i> <span>Settings</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a> </a>
<ul class="treeview-menu" {% if active_page == 'admin_settings' %}style="display: block;"{% endif %}> </li>
<li><a href="{{ url_for('admin.setting_basic') }}"><i class="fa fa-circle-o"></i></i> <span>Basic</span></a></li> <li class="{{ 'nav-item active' if active_page == 'admin_global_search' else 'nav-item' }}">
<li><a href="{{ url_for('admin.setting_records') }}"><i class="fa fa-circle-o"></i> <span>Records</span></a></li> <a href="{{ url_for('admin.global_search') }}" class="nav-link">
<i class="nav-icon fas fa-search"></i>
<p>Global Search</p>
</a>
</li>
<li class="{{ 'nav-item active' if active_page == 'admin_history' else 'nav-item' }}">
<a href="{{ url_for('admin.history') }}" class="nav-link">
<i class="nav-icon fas fa-calendar"></i>
<p>History</p>
</a>
</li>
<li class="{{ 'nav-item active' if active_page == 'admin_domain_template' else 'nav-item' }}">
<a href="{{ url_for('admin.templates') }}" class="nav-link">
<i class="nav-icon fas fa-clone"></i>
<p>Domain Templates</p>
</a>
</li>
<li class="{{ 'nav-item active' if active_page == 'admin_accounts' else 'nav-item' }}">
<a href="{{ url_for('admin.manage_account') }}" class="nav-link">
<i class="nav-icon fas fa-industry"></i>
<p>Accounts</p>
</a>
</li>
<li class="{{ 'nav-item active' if active_page == 'admin_users' else 'nav-item' }}">
<a href="{{ url_for('admin.manage_user') }}" class="nav-link">
<i class="nav-icon fas fa-users"></i>
<p>Users</p>
</a>
</li>
<li class="{{ 'nav-item active' if active_page == 'admin_keys' else 'nav-item' }}">
<a href="{{ url_for('admin.manage_keys') }}" class="nav-link">
<i class="nav-icon fas fa-key"></i>
<p>API Keys</p>
</a>
</li>
<li class="{{ 'nav-item active' if active_page == 'admin_settings' else 'nav-item' }}">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-cog"></i>
<p>
Settings
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview" {% if active_page == 'admin_settings' %}style="display: block;"{% endif %}>
<li class="nav-item">
<a href="{{ url_for('admin.setting_basic') }}" class="nav-link">
<i class="nav-icon fas fa-circle"></i>
<p>Basic</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('admin.setting_records') }}" class="nav-link">
<i class="nav-icon fas fa-circle"></i>
<p>Records</p>
</a>
</li>
{% if current_user.role.name == 'Administrator' %} {% if current_user.role.name == 'Administrator' %}
<li><a href="{{ url_for('admin.setting_pdns') }}"><i class="fa fa-circle-o"></i> <span>PDNS</a></li> <li class="nav-item">
<li><a href="{{ url_for('admin.setting_authentication') }}"><i class="fa fa-circle-o"></i> <span>Authentication</span></a></li> <a href="{{ url_for('admin.setting_pdns') }}" class="nav-link">
<i class="nav-icon fas fa-circle"></i>
<p>PDNS</p>
</a>
</li>
<li class="nav-item">
<a href="{{ url_for('admin.setting_authentication') }}" class="nav-link">
<i class="nav-icon fas fa-circle"></i>
<p>Authentication</p>
</a>
</li>
{% endif %} {% endif %}
</ul> </ul>
</li> </li>
{% elif SETTING.get('allow_user_view_history') %} {% elif SETTING.get('allow_user_view_history') %}
<li class="header">ADMINISTRATION</li> <li class="nav-header">ADMINISTRATION</li>
<li class="{{ 'active' if active_page == 'admin_history' else '' }}"> <li class="{{ 'nav-item active' if active_page == 'admin_history' else 'nav-item' }}">
<a href="{{ url_for('admin.history') }}"><i class="fa fa-calendar"></i> <span>History</span></a> <a href="{{ url_for('admin.history') }}">
<i class="nav-icon fa fa-calendar"></i>
<span>History</span>
</a>
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
{% endif %} {% endif %}
</section> </div>
<!-- /.sidebar --> <!-- /.sidebar -->
</aside> </aside>
@ -169,16 +224,24 @@
<div class="content-wrapper"> <div class="content-wrapper">
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Dashboard <div class="row mb-2">
<small>Control panel</small> <div class="col-sm-6">
</h1> <h1 class="m-0 text-dark">
<ol class="breadcrumb"> Dashboard
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li> <small>Control panel</small>
<li class="active">Dashboard</li> </h1>
</ol> </div>
</section> <div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Home</a></li>
<li class="breadcrumb-item active">Dashboard</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% endblock %} {% endblock %}
@ -382,4 +445,4 @@
{% block modals %} {% block modals %}
{% endblock %} {% endblock %}
</body> </body>
</html> </html>

View File

@ -1,41 +1,52 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<title>PowerDNS-Admin - 400 Error</title>{% endblock %}
{% block title %}
<title>
{{ SITE_NAME }} - 400 Error
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <div class="content-header">
<section class="content-header"> <div class="container-fluid">
<h1> <div class="row mb-2">
400 <div class="col-sm-6">
<small>Error</small> <h1 class="m-0 text-dark">
</h1> 400
<ol class="breadcrumb"> <small>Error</small>
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li> </h1>
<li>400</li> </div>
</ol> <div class="col-sm-6">
</section> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">400 Error</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<!-- Main content --> <section class="content">
<section class="content">
<div class="error-page"> <div class="error-page">
<h2 class="headline text-yellow">400</h2> <h2 class="headline text-yellow">
<div class="error-content"> 400
<h3> </h2>
<i class="fa fa-warning text-yellow"></i> Oops! Bad request <div class="error-content">
</h3> <h3>
<p> <i class="fa fa-warning text-yellow"></i>
{% if msg %} Oops! Bad request
{{ msg }} </h3>
{% else %} <p>
The server refused to process your request and return a 400 error. {% if msg %}
{% endif %} {{ msg }}
<br/>You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>. {% else %}
</p> The server refused to process your request and return a 400 error.
</div> {% endif %}
<!-- /.error-content --> <br/>You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>.
</p>
</div>
</div> </div>
<!-- /.error-page --> </section>
</section> {% endblock %}
<!-- /.content -->
{% endblock %}

View File

@ -1,37 +1,48 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<title>PowerDNS-Admin - 403 Error</title>{% endblock %}
{% block title %}
<title>
{{ SITE_NAME }} - 403 Error
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <div class="content-header">
<section class="content-header"> <div class="container-fluid">
<h1> <div class="row mb-2">
403 <div class="col-sm-6">
<small>Error</small> <h1 class="m-0 text-dark">
</h1> 403
<ol class="breadcrumb"> <small>Error</small>
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li> </h1>
<li>403</li> </div>
</ol> <div class="col-sm-6">
</section> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">403 Error</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<!-- Main content --> <section class="content">
<section class="content">
<div class="error-page"> <div class="error-page">
<h2 class="headline text-yellow">403</h2> <h2 class="headline text-yellow">
<div class="error-content"> 403
<h3> </h2>
<i class="fa fa-warning text-yellow"></i> Oops! Access denied <div class="error-content">
</h3> <h3>
<p> <i class="fa fa-warning text-yellow"></i>
You don't have permission to access this page Oops! Access denied
You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>. </h3>
</p> <p>
</div> You don't have permission to access this page
<!-- /.error-content --> You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>.
</p>
</div>
</div> </div>
<!-- /.error-page --> </section>
</section> {% endblock %}
<!-- /.content -->
{% endblock %}

View File

@ -1,37 +1,48 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<title>PowerDNS-Admin - 404 Error</title>{% endblock %}
{% block title %}
<title>
{{ SITE_NAME }} - 404 Error
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <div class="content-header">
<section class="content-header"> <div class="container-fluid">
<h1> <div class="row mb-2">
404 <div class="col-sm-6">
<small>Error</small> <h1 class="m-0 text-dark">
</h1> 404
<ol class="breadcrumb"> <small>Error</small>
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li> </h1>
<li>404</li> </div>
</ol> <div class="col-sm-6">
</section> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">404 Error</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<!-- Main content --> <section class="content">
<section class="content">
<div class="error-page"> <div class="error-page">
<h2 class="headline text-yellow">404</h2> <h2 class="headline text-yellow">
<div class="error-content"> 404
<h3> </h2>
<i class="fa fa-warning text-yellow"></i> Oops! You're lost <div class="error-content">
</h3> <h3>
<p> <i class="fa fa-warning text-yellow"></i>
The page you requested could not be found. Oops! You're lost
You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>. </h3>
</p> <p>
</div> The page you requested could not be found.
<!-- /.error-content --> You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>.
</p>
</div>
</div> </div>
<!-- /.error-page --> </section>
</section> {% endblock %}
<!-- /.content -->
{% endblock %}

View File

@ -1,37 +1,48 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<title>PowerDNS-Admin - 500 Error</title>{% endblock %}
{% block title %}
<title>
{{ SITE_NAME }} - 500 Error
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <div class="content-header">
<section class="content-header"> <div class="container-fluid">
<h1> <div class="row mb-2">
500 <div class="col-sm-6">
<small>Error</small> <h1 class="m-0 text-dark">
</h1> 500
<ol class="breadcrumb"> <small>Error</small>
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li> </h1>
<li>500</li> </div>
</ol> <div class="col-sm-6">
</section> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">500 Error</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<!-- Main content --> <section class="content">
<section class="content">
<div class="error-page"> <div class="error-page">
<h2 class="headline text-yellow">500</h2> <h2 class="headline text-yellow">
<div class="error-content"> 500
<h3> </h2>
<i class="fa fa-warning text-yellow"></i> Oops! Something went wrong <div class="error-content">
</h3> <h3>
<p> <i class="fa fa-warning text-yellow"></i>
Try again later. Oops! Something went wrong
You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>. </h3>
</p> <p>
</div> Try again later.
<!-- /.error-content --> You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>.
</p>
</div>
</div> </div>
<!-- /.error-page --> </section>
</section> {% endblock %}
<!-- /.content -->
{% endblock %}

View File

@ -1,45 +1,60 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<title>PowerDNS-Admin - SAML Authentication Error</title>{% endblock %}
{% block title %}
<title>
{{ SITE_NAME }} - SAML Authentication Error
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <div class="content-header">
<section class="content-header"> <div class="container-fluid">
<h1> <div class="row mb-2">
SAML <div class="col-sm-6">
<small>Error</small> <h1 class="m-0 text-dark">
</h1> SAML
<ol class="breadcrumb"> <small>Error</small>
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li> </h1>
<li>SAML</li> </div>
</ol> <div class="col-sm-6">
</section> <ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">SAML Authentication Error</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<!-- Main content --> <section class="content">
<section class="content">
<div class="error-page"> <div class="error-page">
<div> <div>
<h1 class="headline text-yellow" style="font-size:46px;">SAML Authentication Error</h1></div><br/><br/> <h1 class="headline text-yellow" style="font-size:46px;">
<div class="error-content"> SAML Authentication Error
<h3> </h1>
<i class="fa fa-warning text-yellow"></i> Oops! Something went wrong </div>
</h3><br> <br/>
<p> <br/>
Login failed.<br> <div class="error-content">
Error(s) when processing SAML Response:<br> <h3>
<ul> <i class="fa fa-warning text-yellow"></i> Oops! Something went wrong
{% for error in errors %} </h3>
<li>{{ error }}</li> <br>
{% endfor %} <p>
</ul> Login failed.
<br>
You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>. Error(s) when processing SAML Response:
</p> <br>
</div> <ul>
<!-- /.error-content --> {% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
You may <a href="{{ url_for('dashboard.dashboard') }}">return to the dashboard</a>.
</p>
</div>
</div> </div>
<!-- /.error-page --> </section>
</section> {% endblock %}
<!-- /.content -->
{% endblock %}

View File

@ -1,166 +1,171 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<head> <meta charset="utf-8">
<meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Log In - {{ SITE_NAME }}</title>
<title>Log In - {{ SITE_NAME }}</title> <link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}">
<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}"> <!-- Tell the browser to be responsive to screen width -->
<!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <META HTTP-EQUIV="REFRESH" CONTENT="{{ 60 * SETTING.get('session_timeout') }}">
<META HTTP-EQUIV="REFRESH" CONTENT="{{ 60 * SETTING.get('session_timeout') }}"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css">
{% assets "css_login" -%} {% assets "css_login" -%}
<link rel="stylesheet" href="{{ ASSET_URL }}"> <link rel="stylesheet" href="{{ ASSET_URL }}">
{%- endassets %} {%- endassets %}
{% if SETTING.get('custom_css') %} {% if SETTING.get('custom_css') %}
<link rel="stylesheet" href="/static/custom/{{ SETTING.get('custom_css') }}"> <link rel="stylesheet" href="/static/custom/{{ SETTING.get('custom_css') }}">
{% endif %} {% endif %}
</head> </head>
<body class="hold-transition login-page">
<body class="hold-transition login-page"> <div class="login-box">
<div class="login-box"> <div class="card card-outline card-primary alert-danger">
<div class="login-logo"> <div class="card-header text-center">
<a href="{{ url_for('index.index') }}"> <a href="{{ url_for('index.index') }}" class="h3">
{% if SETTING.get('site_name') %} {% if SETTING.get('site_name') %}
<b>{{ SITE_NAME }}</b> {{ SITE_NAME }}
{% else %}
<b>PowerDNS</b>-Admin
{% endif %}
</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
{% if error %}
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{ error }}
</div>
{% endif %}
{% if SETTING.get('ldap_enabled') or SETTING.get('local_db_enabled') %}
<form action="" method="post" data-toggle="validator">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<div class="form-group">
<input type="text" class="form-control" placeholder="Username" name="username"
data-error="Please input your username" required {% if username %}value="{{ username }}" {% endif %}>
<span class="help-block with-errors"></span>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" name="password"
data-error="Please input your password" required {% if password %}value="{{ password }}" {% endif %}>
<span class="help-block with-errors"></span>
</div>
{% if SETTING.get('otp_field_enabled') %}
<div class="form-group">
<input type="otptoken" class="form-control" placeholder="OTP Token" name="otptoken" autocomplete="off">
</div>
{% endif %}
{% if SETTING.get('ldap_enabled') and SETTING.get('local_db_enabled') %}
<div class="form-group">
<select class="form-control" name="auth_method">
<option value="LOCAL">LOCAL Authentication</option>
{% if SETTING.get('login_ldap_first') %}
<option value="LDAP" selected="selected">LDAP Authentication</option>
{% else %} {% else %}
<option value="LDAP">LDAP Authentication</option> <b>PowerDNS</b>-Admin
{% endif %} {% endif %}
</select> </a>
</div> </div>
{% elif SETTING.get('ldap_enabled') and not SETTING.get('local_db_enabled') %} <div class="card-body login-card-body">
<div class="form-group"> {% if error %}
<input type="hidden" name="auth_method" value="LDAP"> <div class="alert alert-danger alert-dismissible">
</div> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{% elif SETTING.get('local_db_enabled') and not SETTING.get('ldap_enabled') %} {{ error }}
<div class="form-group">
<input type="hidden" name="auth_method" value="LOCAL">
</div>
{% else %}
<div class="form-group">
<input type="hidden" name="auth_method" value="LOCAL">
</div>
{% endif %}
<div class="row">
<div class="col-xs-8">
<div class="checkbox icheck">
<label>
<input type="checkbox" name="remember"> Remember Me
</label>
</div> </div>
</div> {% endif %}
<!-- /.col --> {% if SETTING.get('ldap_enabled') or SETTING.get('local_db_enabled') %}
<div class="col-xs-4"> <form action="" method="post" data-toggle="validator">
<button type="submit" class="btn btn-flat btn-primary btn-block">Sign In</button> <input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
</div> <div class="form-group">
<!-- /.col --> <input type="text" class="form-control" placeholder="Username" name="username" data-error="Please input your username" required {% if username %}value="{{ username }}" {% endif %}>
<span class="help-block with-errors"></span>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" name="password" data-error="Please input your password" required {% if password %}value="{{ password }}" {% endif %}>
<span class="help-block with-errors"></span>
</div>
{% if SETTING.get('otp_field_enabled') %}
<div class="form-group">
<input type="otptoken" class="form-control" placeholder="OTP Token" name="otptoken" autocomplete="off">
</div>
{% endif %}
{% if SETTING.get('ldap_enabled') and SETTING.get('local_db_enabled') %}
<div class="form-group">
<select class="form-control" name="auth_method">
<option value="LOCAL">
LOCAL Authentication
</option>
{% if SETTING.get('login_ldap_first') %}
<option value="LDAP" selected="selected">
LDAP Authentication
</option>
{% else %}
<option value="LDAP">
LDAP Authentication
</option>
{% endif %}
</select>
</div>
{% elif SETTING.get('ldap_enabled') and not SETTING.get('local_db_enabled') %}
<div class="form-group">
<input type="hidden" name="auth_method" value="LDAP">
</div>
{% elif SETTING.get('local_db_enabled') and not SETTING.get('ldap_enabled') %}
<div class="form-group">
<input type="hidden" name="auth_method" value="LOCAL">
</div>
{% else %}
<div class="form-group">
<input type="hidden" name="auth_method" value="LOCAL">
</div>
{% endif %}
<div class="row">
<div class="col-8">
<div class="icheck-primary">
<input type="checkbox" id="remember">
<label for="remember">
Remember Me
</label>
</div>
</div>
<div class="col-4">
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
</div>
</div>
</form>
{% endif %}
{% if SETTING.get('google_oauth_enabled') or SETTING.get('github_oauth_enabled') or SETTING.get('oidc_oauth_enabled') or SETTING.get('azure_oauth_enabled') %}
<div class="social-auth-links text-center">
{% if SETTING.get('ldap_enabled') or SETTING.get('local_db_enabled') %}
<p>- OR -</p>
{% endif %}
{% if SETTING.get('oidc_oauth_enabled') %}
<a href="{{ url_for('index.oidc_login') }}" class="btn btn-block btn-social btn-openid btn-flat">
<i class="fa fa-openid"></i>
Sign in using OpenID Connect
</a>
{% endif %}
{% if SETTING.get('github_oauth_enabled') %}
<a href="{{ url_for('index.github_login') }}" class="btn btn-block btn-social btn-github btn-flat">
<i class="fa fa-github"></i>
Sign in using Github
</a>
{% endif %}
{% if SETTING.get('google_oauth_enabled') %}
<a href="{{ url_for('index.google_login') }}" class="btn btn-block btn-social btn-google btn-flat">
<i class="fa fa-google"></i>
Sign in using Google
</a>
{% endif %}
{% if SETTING.get('azure_oauth_enabled') %}
<a href="{{ url_for('index.azure_login') }}" class="btn btn-block btn-social btn-microsoft btn-flat">
<i class="fa fa-windows"></i>
Sign in using Microsoft Azure
</a>
{% endif %}
</div>
{% endif %}
{% if saml_enabled %}
<a href="{{ url_for('index.saml_login') }}">
SAML login
</a>
{% endif %}
{% if SETTING.get('signup_enabled') %}
<br>
<a href="{{ url_for('index.register') }}" class="text-center">
Create an account
</a>
{% if SETTING.get('verify_user_email') %}
<br/>
<a href="{{ url_for('index.resend_confirmation_email') }}" class="text-center">
Resend confirmation email
</a>
{% endif %}
{% endif %}
</div> </div>
</form>
{% endif %}
{% if SETTING.get('google_oauth_enabled') or SETTING.get('github_oauth_enabled') or SETTING.get('oidc_oauth_enabled') or SETTING.get('azure_oauth_enabled') %}
<div class="social-auth-links text-center">
{% if SETTING.get('ldap_enabled') or SETTING.get('local_db_enabled') %}
<p>- OR -</p>
{% endif %}
{% if SETTING.get('oidc_oauth_enabled') %}
<a href="{{ url_for('index.oidc_login') }}" class="btn btn-block btn-social btn-openid btn-flat"><i
class="fa fa-openid"></i> Sign in using
OpenID Connect</a>
{% endif %}
{% if SETTING.get('github_oauth_enabled') %}
<a href="{{ url_for('index.github_login') }}" class="btn btn-block btn-social btn-github btn-flat"><i
class="fa fa-github"></i> Sign in using
Github</a>
{% endif %}
{% if SETTING.get('google_oauth_enabled') %}
<a href="{{ url_for('index.google_login') }}" class="btn btn-block btn-social btn-google btn-flat"><i
class="fa fa-google"></i> Sign in using
Google</a>
{% endif %}
{% if SETTING.get('azure_oauth_enabled') %}
<a href="{{ url_for('index.azure_login') }}" class="btn btn-block btn-social btn-microsoft btn-flat"><i
class="fa fa-windows"></i> Sign in using
Microsoft Azure</a>
{% endif %}
</div> </div>
{% endif %} <div class="login-box-footer">
<center>
{% if saml_enabled %} <p>Powered by <a href="https://github.com/PowerDNS-Admin/PowerDNS-Admin">PowerDNS-Admin</a></p>
<a href="{{ url_for('index.saml_login') }}">SAML login</a> </center>
{% endif %} </div>
{% if SETTING.get('signup_enabled') %}
<br>
<a href="{{ url_for('index.register') }}" class="text-center">Create an account </a>
{% if SETTING.get('verify_user_email') %}
<br/>
<a href="{{ url_for('index.resend_confirmation_email') }}" class="text-center">Resend confirmation email</a>
{% endif %}
{% endif %}
</div> </div>
<!-- /.login-box-body --> {% assets "js_login" -%}
<div class="login-box-footer"> <script type="text/javascript" src="{{ ASSET_URL }}"></script>
<center> {%- endassets %}
<p>Powered by <a href="https://github.com/PowerDNS-Admin/PowerDNS-Admin">PowerDNS-Admin</a></p> {% assets "js_validation" -%}
</center> <script type="text/javascript" src="{{ ASSET_URL }}"></script>
</div> {%- endassets %}
</div> <script>
<!-- /.login-box --> $(function () {
$('input').iCheck({
{% assets "js_login" -%} checkboxClass: 'icheckbox_square-blue',
<script type="text/javascript" src="{{ ASSET_URL }}"></script> radioClass: 'iradio_square-blue',
{%- endassets %} increaseArea: '20%' // optional
{% assets "js_validation" -%} });
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{%- endassets %}
<script>
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
}); });
}); </script>
</script> </body>
</body>
</html> </html>

View File

@ -1,111 +1,166 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Register - {{ SITE_NAME }}</title> <title>Register - {{ SITE_NAME }}</title>
<link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}"> <link rel="icon" href="{{ url_for('static', filename='img/favicon.png') }}">
<!-- Tell the browser to be responsive to screen width --> <!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
{% assets "css_login" -%} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css">
<link rel="stylesheet" href="{{ ASSET_URL }}"> {% assets "css_login" -%}
{%- endassets %} <link rel="stylesheet" href="{{ ASSET_URL }}">
</head> {%- endassets %}
</head>
<body class="hold-transition register-page"> <body class="hold-transition register-page">
<div class="register-box"> <div class="register-box">
<div class="register-logo"> <div class="card card-outline card-primary">
<a href="{{ url_for('index.index') }}"><b>PowerDNS</b>-Admin</a> <div class="card-header text-center">
</div> <a href="{{ url_for('index.index') }}" class="h3">
<div class="register-box-body"> {% if SETTING.get('site_name') %}
{% if error %} {{ SITE_NAME }}
<div class="alert alert-danger alert-dismissible"> {% else %}
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <b>PowerDNS</b>-Admin
{{ error }} {% endif %}
</div> </a>
{% endif %}
<p class="login-box-msg">Enter your personal details below</p>
<form action="{{ url_for('index.register') }}" method="post" data-toggle="validator">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="First Name" name="firstname"
data-error="Please input your first name" required>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
<span class="help-block with-errors"></span>
</div> </div>
<div class="form-group has-feedback"> <div class="card-body">
<input type="text" class="form-control" placeholder="Last name" name="lastname" {% if error %}
data-error="Please input your last name" required> <div class="alert alert-danger alert-dismissible">
<span class="glyphicon glyphicon-user form-control-feedback"></span> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<span class="help-block with-errors"></span> {{ error }}
</div> </div>
<div class="form-group has-feedback"> {% endif %}
<input type="email" class="form-control" placeholder="Email" name="email" <p class="login-box-msg">Enter your personal details below</p>
data-error="Please input your valid email address" required> <form action="{{ url_for('index.register') }}" method="post" class="needs-validation" novalidate>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span> <input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<span class="help-block with-errors"></span>
</div> <div class="input-group mb-3">
<p class="login-box-msg">Enter your account details below</p> <input type="text" class="form-control" placeholder="First Name" name="firstname" id="firstname" required>
<div class="form-group has-feedback"> <div class="input-group-append">
<input type="text" class="form-control" placeholder="Username" name="username" <div class="input-group-text">
data-error="Please input your username" required> <span class="fas fa-user"></span>
<span class="glyphicon glyphicon-user form-control-feedback"></span> </div>
<span class="help-block with-errors"></span> </div>
</div> <div class="invalid-feedback">
<div class="form-group has-feedback"> Please input your first name
<input type="password" class="form-control" placeholder="Password" id="password" name="password" </div>
data-error="Please input your password" required> </div>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div> <div class="input-group mb-3">
<div class="form-group has-feedback"> <input type="text" class="form-control" placeholder="Last name" name="lastname" id="lastname" required>
<input type="password" class="form-control" placeholder="Retype password" name="rpassword" <div class="input-group-append">
data-match="#password" data-match-error="Password confirmation does not match" required> <div class="input-group-text">
<span class="glyphicon glyphicon-log-in form-control-feedback"></span> <span class="fas fa-user"></span>
<span class="help-block with-errors"></span> </div>
</div> </div>
{% if captcha_enable %} <div class="invalid-feedback">
<p class="login-box-msg">Please complete the CAPTCHA below</p> Please input your last name
</div>
</div>
<div class="input-group mb-3">
<input type="email" class="form-control" placeholder="Email" name="email" id="email" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div>
</div>
<div class="invalid-feedback">
Please input a valid email address
</div>
</div>
<p class="login-box-msg">Enter your account details below</p>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Username" name="username" id="username" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-user"></span>
</div>
</div>
<div class="invalid-feedback">
Please input desired username
</div>
</div>
<div class="input-group mb-3">
<input type="password" class="form-control" placeholder="Password" id="password" name="password" id="password" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
<div class="invalid-feedback">
Please input desired username
</div>
</div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
{{ captcha() }} <input type="password" class="form-control" placeholder="Retype password" name="rpassword" data-match="#password" data-match-error="Password confirmation does not match" required>
<input type="text" class="form-control" placeholder="CAPTCHA" name="captcha" <span class="fas fa-lock form-control-feedback"></span>
data-error="Please complete the CAPTCHA" required>
<span class="help-block with-errors"></span> <span class="help-block with-errors"></span>
</div> </div>
{% endif %}
<div class="row">
<div class="col-xs-4 pull-left">
<button type="button" class="btn btn-flat btn-block" id="button_back">Back</button>
</div>
<div class="col-xs-4 pull-right">
<button type="submit" class="btn btn-flat btn-primary btn-block">Register</button>
</div>
<!-- /.col -->
</div>
</form>
</div>
<!-- /.form-box -->
<div class="login-box-footer">
<center>
<p>Powered by <a href="https://github.com/PowerDNS-Admin/PowerDNS-Admin">PowerDNS-Admin</a></p>
</center>
</div>
</div>
<!-- /.login-box -->
{% assets "js_login" -%}
<script type="text/javascript" src="{{ ASSET_URL }}"></script> {% if captcha_enable %}
{%- endassets %} <p class="login-box-msg">Please complete the CAPTCHA below</p>
{% assets "js_validation" -%} <div class="form-group has-feedback">
<script type="text/javascript" src="{{ ASSET_URL }}"></script> {{ captcha() }}
{%- endassets %} <input type="text" class="form-control" placeholder="CAPTCHA" name="captcha" data-error="Please complete the CAPTCHA" required>
<script> <span class="help-block with-errors"></span>
$(function () { </div>
$('#button_back').click(function () { {% endif %}
window.location.href = '{{ url_for('index.login') }}'; <div class="row">
}) <div class="col-6">
<button type="button" class="btn btn-block" id="button_back">Back</button>
</div>
<div class="col-4">
<button type="submit" class="btn btn-primary btn-block">Register</button>
</div>
</div>
</form>
</div>
<div class="login--footer">
<center>
<p>Powered by <a href="https://github.com/PowerDNS-Admin/PowerDNS-Admin">PowerDNS-Admin</a></p>
</center>
</div>
</div>
{% assets "js_login" -%}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{%- endassets %}
{% assets "js_validation" -%}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{%- endassets %}
<script>
$(function () {
$('#button_back').click(function () {
window.location.href = '{{ url_for('index.login') }}';
})
});
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
}); });
</script> }, false);
</body> })();
</script>
</body>
</html> </html>

View File

@ -4,16 +4,25 @@
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<h1> <div class="container-fluid">
Template <div class="row mb-2">
<small>Create</small> <div class="col-sm-6">
</h1> <h1 class="m-0 text-dark">
<ol class="breadcrumb"> Template
<li><a href="{{ url_for('admin.templates') }}"><i class="fa fa-dashboard"></i> Templates</a></li> <small>Create</small>
<li class="active">Create</li> </h1>
</ol> </div>
</section> <div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('admin.templates') }}">Templates</a></li>
<li class="breadcrumb-item active">Create</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -1,34 +1,34 @@
Flask==1.1.2 Flask==2.1.3
Flask-Assets==2.0 Flask-Assets==2.0
Flask-Login==0.5.0 Flask-Login==0.6.2
Flask-SQLAlchemy==2.4.4 Flask-SQLAlchemy==2.5.1
Flask-Migrate==2.5.3 Flask-Migrate==2.5.3
SQLAlchemy==1.3.19 SQLAlchemy==1.3.24
mysqlclient==2.0.1 mysqlclient==2.0.1
configobj==5.0.6 configobj==5.0.8
bcrypt>=3.1.7 bcrypt==4.0.1
requests==2.24.0 requests==2.28.2
python-ldap==3.4.2 python-ldap==3.4.3
pyotp==2.4.0 pyotp==2.8.0
qrcode==6.1 qrcode==7.3.1
dnspython>=1.16.0 dnspython>=2.3.0
gunicorn==20.0.4 gunicorn==20.1.0
python3-saml python3-saml
pytz==2020.1 pytz==2022.7.1
cssmin==0.2.0 cssmin==0.2.0
rjsmin==1.2.0 rjsmin==1.2.1
Authlib==0.15 Authlib==1.2.0
Flask-SeaSurf==1.1.1 Flask-SeaSurf==1.1.1
bravado-core==5.17.0 bravado-core==5.17.1
lima==0.5 lima==0.5
pytest==6.1.1 pytest==7.2.1
pytimeparse==1.1.8 pytimeparse==1.1.8
PyYAML==5.4 PyYAML==5.4
Flask-SSLify==0.1.5 Flask-SSLify==0.1.5
Flask-Mail==0.9.1 Flask-Mail==0.9.1
flask-session==0.3.2 flask-session==0.4.0
Jinja2==3.0.3 Jinja2==3.1.2
itsdangerous==2.0.1 itsdangerous==2.1.2
werkzeug==2.0.3 werkzeug==2.1.3
cryptography==36.0.2 cryptography==36.0.2
flask_session_captcha==1.3.0 flask_session_captcha==1.3.0