Remove btn-flat to convert to round buttons (first pass)

Convert col-xs-* to just col-* as part of bootstrap v3 -> v4
Convert box-* -> card-* as part of bootstrap v3 -> v4
Moved domain actions on main dashboard to a dropdown menu to avoid clutter
Added "Log Out" to top header left
Hid OTP on admin edit user to only show the disable card & options if the user account has OTP enabled
This commit is contained in:
Tyler Todd 2023-02-06 15:45:13 +00:00
parent 7f25e3b555
commit ac786f45be
24 changed files with 1264 additions and 1152 deletions

View File

@ -6,7 +6,9 @@
"bootstrap-validator": "^0.11.9",
"datatables.net-plugins": "^1.13.1",
"icheck": "^1.0.2",
"ionicons": "^6.1.1",
"jquery-slimscroll": "^1.3.8",
"jquery-sparkline": "^2.4.0",
"jquery-ui-dist": "^1.13.2",
"jquery.quicksearch": "^2.4.0",
"jtimeout": "^3.2.0",

View File

@ -11,44 +11,41 @@ class ConcatFilter(Filter):
def concat(self, out, hunks, **kw):
out.write(';'.join([h.data() for h, info in hunks]))
css_login = Bundle('node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/font-awesome/css/font-awesome.css',
'node_modules/ionicons/dist/css/ionicons.css',
css_login = Bundle(
'node_modules/ionicons/dist/collection/components/icon/icon.css',
'node_modules/icheck/skins/square/blue.css',
'node_modules/admin-lte/dist/css/AdminLTE.css',
'node_modules/admin-lte/dist/css/adminlte.css',
filters=('cssmin', 'cssrewrite'),
output='generated/login.css')
js_login = Bundle('node_modules/jquery/dist/jquery.js',
js_login = Bundle(
'node_modules/jquery/dist/jquery.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/icheck/icheck.js',
'custom/js/custom.js',
filters=(ConcatFilter, 'rjsmin'),
output='generated/login.js')
js_validation = Bundle('node_modules/bootstrap-validator/dist/validator.js',
js_validation = Bundle(
'node_modules/bootstrap-validator/dist/validator.js',
output='generated/validation.js')
css_main = Bundle(
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/font-awesome/css/font-awesome.css',
'node_modules/ionicons/dist/css/ionicons.css',
'node_modules/datatables.net-bs/css/dataTables.bootstrap.css',
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css',
'node_modules/icheck/skins/square/blue.css',
'node_modules/multiselect/css/multi-select.css',
'node_modules/admin-lte/dist/css/AdminLTE.css',
'node_modules/admin-lte/dist/css/skins/_all-skins.css',
'node_modules/admin-lte/dist/css/adminlte.css',
'custom/css/custom.css',
'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css',
filters=('cssmin', 'cssrewrite'),
output='generated/main.css')
js_main = Bundle('node_modules/jquery/dist/jquery.js',
js_main = Bundle(
'node_modules/jquery/dist/jquery.js',
'node_modules/jquery-ui-dist/jquery-ui.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/bootstrap/dist/js/bootstrap.bundle.js',
'node_modules/datatables.net/js/jquery.dataTables.js',
'node_modules/datatables.net-bs/js/dataTables.bootstrap.js',
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js',
'node_modules/jquery-sparkline/jquery.sparkline.js',
'node_modules/jquery-slimscroll/jquery.slimscroll.js',
'node_modules/icheck/icheck.js',

View File

@ -27,16 +27,14 @@
{% block content %}
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="col-4">
<div class="card card-primary">
<div class="card-header with-border">
<h3 class="card-title">{% if create %}Add{% else %}Edit{% endif %} account</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" method="post"
action="{% if create %}{{ url_for('admin.edit_account') }}{% else %}{{ url_for('admin.edit_account', account_name=account.name) }}{% endif %}">
<form role="form" method="post" 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="create" value="{{ create }}">
<div class="card-body">
@ -48,8 +46,7 @@
</div>
<span class="help-block">{{ error }}</span>
{% endif %}
<div
class="form-group has-feedback {% if invalid_accountname or duplicate_accountname %}has-error{% endif %}">
<div class="form-group has-feedback {% if invalid_accountname or duplicate_accountname %}has-error{% endif %}">
<label class="control-label" for="accountname">Name</label>
<input type="text" class="form-control" placeholder="Account Name (required)"
name="accountname" {% if account %}value="{{ account.name }}" {% endif %}
@ -57,7 +54,8 @@
<span class="fa fa-cog form-control-feedback"></span>
{% if invalid_accountname %}
<span class="help-block">Cannot be blank and must only contain alphanumeric
characters{% if SETTING.get('account_name_extra_chars') %}, dots, hyphens or underscores{% endif %}.</span>
characters{% if SETTING.get('account_name_extra_chars') %}, dots, hyphens or underscores{% endif %}.
</span>
{% elif duplicate_accountname %}
<span class="help-block">Account name already in use.</span>
{% endif %}
@ -86,14 +84,16 @@
</div>
<div class="card-body">
<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>
<div class="form-group col-xs-2">
<div class="form-group col-2">
<select multiple="multiple" class="form-control" id="account_multi_user"
name="account_multi_user">
{% for user in users %}
<option {% if user.id in account_user_ids|default([]) %}selected{% endif %}
value="{{ user.username }}">{{ user.username }}</option>
value="{{ user.username }}">{{ user.username }}
</option>
{% endfor %}
</select>
</div>
@ -101,12 +101,13 @@
<div class="card-footer">
<button type="submit"
class="btn btn-flat btn-primary">{% if create %}Create{% else %}Update{% endif %}
Account</button>
Account
</button>
</div>
</form>
</div>
</div>
<div class="col-md-6">
<div class="col-6">
<div class="card card-primary">
<div class="card-header with-border">
<h3 class="card-title">Help with creating a new account</h3>
@ -114,7 +115,8 @@
<div class="card-body">
<p>
An account allows grouping of domains belonging to a particular entity, such as a customer or
department.<br />
department.
<br />
A domain can be assigned to an account upon domain creation or through the domain administration
page.
</p>
@ -131,6 +133,7 @@
</div>
</div>
</div>
</div>
</section>
{% endblock %}
{% block extrascripts %}

View File

@ -31,7 +31,7 @@
{% block content %}
<section class="content">
<div class="row">
<div class="col-md-6">
<div class="col-4">
<div class="card card-primary">
<div class="card-header with-border">
<h3 class="card-title">{% if create %}Add{% else %}Edit{% endif %} Key</h3>
@ -68,7 +68,7 @@
<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>Click on accounts to move between the columns.</p>
<div class="form-group col-xs-2">
<div class="form-group col-2">
<select multiple="multiple" class="form-control" id="key_multi_account"
name="key_multi_account">
{% for account in accounts %}
@ -83,7 +83,7 @@
<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>Click on domains to move between the columns.</p>
<div class="form-group col-xs-2">
<div class="form-group col-2">
<select multiple="multiple" class="form-control" id="key_multi_domain"
name="key_multi_domain">
{% for domain in domains %}
@ -94,13 +94,13 @@
</div>
<div class="card-footer">
<button type="submit"
class="btn btn-flat btn-primary" id="key_submit">{% if create %}Create{% else %}Update{% endif %}
class="btn btn-flat btn-primary float-right" id="key_submit">{% if create %}Create{% else %}Update{% endif %}
Key</button>
</div>
</form>
</div>
</div>
<div class="col-md-6">
<div class="col-8">
<div class="card card-primary">
<div class="card-header with-border">
<h3 class="card-title">Help with {% if create %}creating a new{% else%}updating a{% endif %} key

View File

@ -1,34 +1,28 @@
{% extends "base.html" %}
{% set active_page = "admin_users" %}
{% block title %}<title>Edit User - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
{% if create %}Add user{% else %}Edit user "{{ user.username }}"{% endif %} - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %}
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
User
<small>{% if create %}New user{% else %}{{ user.username }}{% endif %}</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li>
<li><a href="{{ url_for('admin.manage_user') }}">User</a></li>
<li class="active">{% if create %}Add{% else %}Edit{% endif %} user</li>
</ol>
</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>
Users
<small>{% if create %}New user{% else %}Edit user {{ user.username }}{% endif %}</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>
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item"><a href="{{ url_for('admin.manage_user') }}">Users</a></li>
<li class="breadcrumb-item active">{% if create %}Add user{% else %}Edit user "{{ user.username }}"{% endif %}</li>
</ol>
</div>
</div>
@ -38,19 +32,18 @@
{% block content %}
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{% if create %}Add{% else %}Edit{% endif %} user</h3>
<div class="col-4">
<div class="card card-secondary">
<div class="card-header with-border">
<h3 class="card-title">{% if create %}Add{% else %}Edit{% endif %} user</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" method="post"
action="{% if create %}{{ url_for('admin.edit_user') }}{% else %}{{ url_for('admin.edit_user', user_username=user.username) }}{% endif %}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="create" value="{{ create }}">
<div class="box-body">
<div class="card-body">
{% if error %}
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
@ -62,85 +55,94 @@
<div class="form-group has-feedback">
<label class="control-label" for="firstname">First Name</label>
<input type="text" class="form-control" placeholder="First Name" name="firstname"
{% if user %}value="{{ user.firstname }}" {% endif %}> <span
class="glyphicon glyphicon-user form-control-feedback"></span>
{% if user %}value="{{ user.firstname }}" {% endif %}>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label class="control-label" for="lastname">Last Name</label>
<input type="text" class="form-control" placeholder="Last name" name="lastname"
{% if user %}value="{{ user.lastname }}" {% endif %}> <span
class="glyphicon glyphicon-user form-control-feedback"></span>
{% if user %}value="{{ user.lastname }}" {% endif %}>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label class="control-label" for="email">E-mail address</label>
<input type="email" class="form-control" placeholder="Email" name="email" id="email"
{% if user %}value="{{ user.email }}" {% endif %}> <span
class="glyphicon glyphicon-envelope form-control-feedback"></span>
{% if user %}value="{{ user.email }}" {% endif %}>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<p class="login-box-msg">Enter the account details below</p>
<div class="form-group has-feedback">
<label class="control-label" for="username">Username</label>
<input type="text" class="form-control" placeholder="Username" name="username"
{% if user %}value="{{ user.username }}" {% endif %}
{% if not create %}disabled{% endif %}> <span
class="glyphicon glyphicon-user form-control-feedback"></span>
{% if not create %}disabled{% endif %}>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback {% if blank_password %}has-error{% endif %}">
<label class="control-label" for="username">Password</label>
<input type="password" class="form-control"
placeholder="Password {% if create %}(Required){% else %}(Leave blank to keep unchanged){% endif %}"
name="password"> <span class="glyphicon glyphicon-lock form-control-feedback"></span>
name="password">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
{% if blank_password %}
<span class="help-block">The password cannot be blank.</span>
{% endif %}
</div>
</div>
<div class="box-footer">
<button type="submit"
class="btn btn-flat btn-primary">{% if create %}Create{% else %}Update{% endif %}
User</button>
<div class="card-footer">
<button type="submit" class="btn btn-primary">
{% if create %}Create{% else %}Update{% endif %} User
</button>
</div>
</form>
</div>
{% if not create %}
<div class="box box-secondary">
<div class="box-header with-border">
<h3 class="box-title">Two Factor Authentication</h3>
{% if user.otp_secret %}
<div class="card card-secondary">
<div class="card-header with-border">
<h3 class="card-title">Two Factor Authentication</h3>
</div>
<div class="box-body">
<p>If two factor authentication was configured and is causing problems due to a lost device or
technical issue, it can be disabled here.</p>
<div class="card-body">
<p>If two factor authentication is configured for this user and is causing problems due to a lost device or
technical issue, it can be disabled here.
</p>
<p>The user will need to reconfigure two factor authentication, to re-enable it.</p>
<p><strong>Beware: This could compromise security!</strong></p>
</div>
<div class="box-footer">
<button type="button" class="btn btn-flat btn-warning button_otp_disable" id="{{ user.username }}"
{% if not user.otp_secret %}disabled{% endif %}>Disable Two Factor Authentication</button>
<div class="card-footer">
<button type="button" class="btn btn-warning button_otp_disable" id="{{ user.username }}">
Disable Two Factor Authentication
</button>
</div>
</div>
{% endif %}
{% endif %}
</div>
<div class="col-md-8">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Help with {% if create %}creating a new{% else%}updating a{% endif %} user
<div class="col-8">
<div class="card card-secondary">
<div class="card-header with-border">
<h3 class="card-title">
Help with {% if create %}creating a new{% else%}editing a{% endif %} user
</h3>
</div>
<div class="box-body">
<div class="card-body">
<p>Fill in all the fields to the in the form to the left.</p>
{% if create %}
<p><strong>Newly created users do not have access to any domains.</strong> You will need to grant
access to the user once it is created via the domain management buttons on the dashboard.</p>
access to the user once it is created via the domain management buttons on the dashboard.
</p>
{% else %}
<p><strong>Password</strong> can be left empty to keep the current password.</p>
<p><strong>Username</strong> cannot be changed.</p>
<p><strong>Password</strong> can be left empty to keep the current password.</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}
{% block extrascripts %}
<script>
// handle disabling two factor authentication

View File

@ -34,25 +34,40 @@
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<div class="card card-outline card-secondary">
<div class="card-header with-border">
<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>
{% if current_user.role.name != 'User' %}
<button type="button" class="btn btn-danger float-right" data-toggle="modal" data-target="#modal_clear_history" {% if current_user.role.name != 'Administrator' %}disabled{% endif %}>
<i class="fas fa-trash"></i>
&nbsp;Clear History
</button>
{% endif %}
</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>
<ul class="nav nav-tabs" id="custom-content-below-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" href="#tabs-act" data-toggle="pill" role="tab">
Search for All Activity
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tabs-domain" data-toggle="pill" role="tab">
Search By Domain
</a>
</li>
<li class="nav-item">
<a class="nav-link with-border" href="#tabs-account" data-toggle="pill" role="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>
<li class="nav-item">
<a class="nav-link" href="#tabs-auth" data-toggle="pill" role="tab">
Search for User Authentication
</a>
</li>
{% endif %}
</ul>
<div class="tab-content">
@ -154,15 +169,14 @@ class="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;
<tr><td>&nbsp</td></tr>
<tr>
<td>
<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-primary button-filter"><i class="fa fa-search"></i>&nbsp;Search</button>
</td>
<td>
<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-warning button-clearf"><i class="fa fa-trash"></i>&nbsp;Clear Filters</button>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
<div id="table_from_ajax"></div>
@ -475,44 +489,40 @@ class="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirmation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p>Are you sure you want to remove all history?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-default pull-left" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-flat btn-danger"
onclick="applyChanges({'_csrf_token': '{{ csrf_token() }}'}, $SCRIPT_ROOT + '/admin/history', false, true);">Clear
History</button>
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger float-right" onclick="applyChanges({'_csrf_token': '{{ csrf_token() }}'}, $SCRIPT_ROOT + '/admin/history', false, true);">
Clear History
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- History Details Box -->
<div class="modal fade" id="modal_history_info">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">History Details</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">History Details</h4>
</div>
<div class="modal-body">
<div id="modal-info-content"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-default pull-right" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default float-right" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
{% endblock %}

View File

@ -1,9 +1,9 @@
{% import 'applied_change_macro.html' as applied_change_macro %}
{% if len_histories >= lim %}
<p style="color: rgb(224, 3, 3);"><b>Limit of loaded history records has been reached! Only {{lim}} history records are shown. </b></p>
<p style="color: rgb(224, 3, 3);">
<b>Limit of loaded history records has been reached! Only {{lim}} history records are shown.</b>
</p>
{% endif %}
<div class="box-body"></div>
@ -22,7 +22,6 @@
<td>{{ history.history.created_by }}</td>
<td>{{ history.history.msg }}</td>
<td>{{ history.history.created_on }}</td>
<td width="6%">
<div id="history-info-div-{{ loop.index0 }}" style="display: none;">
{{ history.detailed_msg | safe }}
@ -34,10 +33,12 @@
</div>
{% endif %}
</div>
<button type="button" class="btn btn-flat btn-primary history-info-button"
<button type="button" class="btn btn-primary history-info-button"
{% if history.detailed_msg == "" and history.change_set is none %}
style="visibility: hidden;"
{% endif %} value="{{ loop.index0 }}">Info&nbsp;<i class="fa fa-info"></i>
{% endif %} value="{{ loop.index0 }}">
<i class="fa fa-info"></i>
&nbsp;Info
</button>
</td>
</tr>
@ -49,7 +50,6 @@
<script>
var table;
$(document).ready(function () {
table = $('#tbl_history').DataTable({
"order": [
[2, "desc"]
@ -67,7 +67,6 @@ $(document).ready(function () {
orderCellsTop: true,
fixedHeader: true
});
$(document.body).on('click', '.history-info-button', function () {
var modal = $("#modal_history_info");
var history_id = $(this).val();
@ -75,7 +74,6 @@ $(document).ready(function () {
$('#modal-info-content').html(info);
modal.modal('show');
});
$(document.body).on("click", ".button-filter", function (e) {
e.stopPropagation();
var nextRow = $("#filter-table")
@ -84,7 +82,5 @@ $(document).ready(function () {
else
nextRow.css("visibility", "visible")
});
});
</script>

View File

@ -23,8 +23,9 @@
</div>
{% endblock %} {% block content %}
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="col-sm-12">
<div class="card">
<div class="card-header with-border">
<h3 class="card-title">User Management</h3>
@ -96,6 +97,7 @@
<!-- /.col -->
</div>
<!-- /.row -->
</div>
</section>
{% endblock %}
{% block extrascripts %}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en" class>
<head>
{% block head %}
<meta charset="utf-8">
@ -28,7 +28,7 @@
{% endblock %}
</head>
<body class="hold-transition skin-blue sidebar-mini {% if not SETTING.get('fullscreen_layout') %}layout-boxed{% endif %}">
<body class="hold-transition sidebar-mini text-sm {% if not SETTING.get('fullscreen_layout') %}layout-boxed{% endif %}">
{% set user_image_url = url_for('user.image', username=current_user.username) %}
<div class="wrapper">
{% block pageheader %}
@ -41,10 +41,17 @@
<i class="fas fa-bars"></i>
</a>
</li>
{% if current_user.id is defined %}
<li class="nav-item d-none d-inline-block">
<a class="nav-link" href="{{ url_for('index.logout') }}">
Logout
</a>
</li>
{% endif %}
</ul>
<ul class="navbar-nav ml-auto">
{% if current_user.id is defined %}
<!-- {% 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"/>
@ -53,7 +60,7 @@
</span>
</a>
<ul class="dropdown-menu">
<li class="user-header">
<li class="user-header bg-dark">
<img src="{{ user_image_url }}" class="img-circle elevation-2" alt="User Image"/>
<p>
{{ current_user.firstname }} {{ current_user.lastname }}
@ -61,12 +68,13 @@
</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>
<a href="{{ url_for('user.profile') }}" class="btn btn-primary">My Profile</a>
<a href="{{ url_for('index.logout') }}" class="btn btn-warning 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>
@ -140,7 +148,7 @@
</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>
<i class="nav-icon fas fa-calendar-alt"></i>
<p>History</p>
</a>
</li>
@ -179,26 +187,26 @@
<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>
<i class="nav-icon far 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>
<i class="nav-icon far fa-circle"></i>
<p>Records</p>
</a>
</li>
{% if current_user.role.name == 'Administrator' %}
<li class="nav-item">
<a href="{{ url_for('admin.setting_pdns') }}" class="nav-link">
<i class="nav-icon fas fa-circle"></i>
<i class="nav-icon far 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>
<i class="nav-icon far fa-circle"></i>
<p>Authentication</p>
</a>
</li>
@ -208,9 +216,9 @@
{% elif SETTING.get('allow_user_view_history') %}
<li class="nav-header">ADMINISTRATION</li>
<li class="{{ 'nav-item active' if active_page == 'admin_history' else 'nav-item' }}">
<a href="{{ url_for('admin.history') }}">
<i class="nav-icon fa fa-calendar"></i>
<span>History</span>
<a href="{{ url_for('admin.history') }}" class="nav-link">
<i class="nav-icon fas fa-calendar-alt"></i>
<p>History</p>
</a>
</li>
{% endif %}

View File

@ -1,39 +1,50 @@
{% extends "base.html" %}
{% set active_page = "dashboard" %}
{% block title %}<title>Dashboard - {{ SITE_NAME }}</title>{% endblock %}
{% set active_page = "dashboard" %}
{% block title %}
<title>
Dashboard - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %}
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<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>Info</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Dashboard</li>
</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>
</ol>
</section>
</div>
</div>
</div>
</div>
{% endblock %}
{% import 'applied_change_macro.html' as applied_change_macro %}
{% block content %}
<!-- Main content -->
<section class="content">
<div class="container-fluid">
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %}
<div class="row">
<div class="col-xs-3">
<div class="box">
<div class="box-header">
<h3 class="box-title">Statistics</h3>
<div class="col-3">
<div class="card">
<div class="card-header">
<h3 class="card-title">Statistics</h3>
</div>
<div class="box-body">
<div class="card-body">
<div class="row">
<div class="col-lg-6">
<div class="col-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="small-box bg-info">
<div class="inner">
<h3>{{ domain_count }}</h3>
<p>{% if domain_count > 1 %}Domains{% else %}Domain{% endif %}</p>
@ -44,7 +55,7 @@
</div>
</div>
{% if current_user.role.name in ['Administrator', 'Operator'] %}
<div class="col-lg-6">
<div class="col-6">
<a href="{{ url_for('admin.manage_user') }}">
<div class="small-box bg-green">
<div class="inner">
@ -60,7 +71,7 @@
{% endif %}
</div>
<div class="row">
<div class="col-lg-6">
<div class="col-6">
<a href="{{ url_for('admin.history') }}">
<div class="small-box bg-green">
<div class="inner">
@ -74,7 +85,7 @@
</a>
</div>
{% if current_user.role.name in ['Administrator', 'Operator'] %}
<div class="col-lg-6">
<div class="col-6">
<a href="{{ url_for('admin.pdns_stats') }}">
<div class="small-box bg-green">
<div class="inner">
@ -82,7 +93,7 @@
<p>Uptime</p>
</div>
<div class="icon">
<i class="fa fa-clock-o"></i>
<i class="fa fa-clock"></i>
</div>
</div>
</a>
@ -92,12 +103,12 @@
</div>
</div>
</div>
<div class="col-xs-9">
<div class="box">
<div class="box-header">
<h3 class="box-title">Recent History</h3>
<div class="col-9">
<div class="card">
<div class="card-header">
<h3 class="card-title">Recent History</h3>
</div>
<div class="box-body">
<div class="card-body">
<table id="tbl_history" class="table table-bordered table-striped">
<thead>
<tr>
@ -124,10 +135,11 @@
</div>
{% endif %}
</div>
<button type="button" class="btn btn-flat btn-primary history-info-button"
<button type="button" class="btn btn-sm btn-primary history-info-button"
{% if history.detailed_msg == "" and history.change_set is none %}
style="visibility: hidden;"
{% endif %} value="{{ loop.index0 }}">Info&nbsp;<i class="fa fa-info"></i>
{% endif %} value="{{ loop.index0 }}">
&nbsp;Info
</button>
</td>
</tr>
@ -139,25 +151,37 @@
</div>
</div>
{% endif %}
<!--SYBPATCH START-->
<row>
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_{{custom_boxes.order[0]}}" data-toggle="tab">Hosted Domains <b>{{custom_boxes.boxes[custom_boxes.order[0]][0]}}</b></a></li>
<ul class="nav nav-tabs" id="custom-content-below-tab" role="tablist">
<li class="nav-link">
<a href="#tab_{{custom_boxes.order[0]}}"data-toggle="pill" role="tab">
Hosted Domains <b>{{custom_boxes.boxes[custom_boxes.order[0]][0]}}</b>
</a>
</li>
{% for boxId in custom_boxes.order[1:] %}
<li><a href="#tab_{{boxId}}" data-toggle="tab">Hosted Domains <b>{{custom_boxes.boxes[boxId][0]}}</b></a></li>
<li class="nav-link" >
<a href="#tab_{{boxId}}" data-toggle="pill" role="tab">Hosted Domains <b>{{custom_boxes.boxes[boxId][0]}}</b></a>
</li>
{% endfor %}
</ul>
<div class="tab-content">
{% for boxId in custom_boxes.order %}
<div class="tab-pane" id='tab_{{boxId}}'>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Hosted Domains <b>{{custom_boxes.boxes[boxId][0]}}</b></h3>{% if show_bg_domain_button %}<button type="button" class="btn btn-flat btn-primary refresh-bg-button pull-right"><i class="fa fa-refresh"></i> Sync domains </button>{% endif %}
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Hosted Domains <b>{{custom_boxes.boxes[boxId][0]}}</b></h3>
{% if show_bg_domain_button %}
<button type="button" class="btn btn-primary refresh-bg-button float-right">
<i class="fas fa-sync"></i>
&nbsp;Sync domains
</button>
{% endif %}
</div>
<div class="box-body">
<div class="card-body">
<table id='tbl_domain_list_{{boxId}}' class="table table-bordered table-striped">
<thead>
<tr>
@ -167,7 +191,7 @@
<th>Serial</th>
<th>Master</th>
<th>Account</th>
<th {% if current_user.role.name not in ['Administrator','Operator'] %}width="6%"{% else %}width="25%"{% endif %}>Action</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@ -182,17 +206,18 @@
</div><!-- /.tab-content -->
</div><!-- custom tabs -->
<!--SYBPATCH END-->
</row>
</div>
</section>
<!-- /.content -->
{% endblock %}
{% block extrascripts %}
<script>
//SYBPATCH START//
function setUpDomainList(id ,url){
$(id).DataTable({
"paging" : true,
"lengthChange" : true,
"lengthChange" : false,
language: {
searchPlaceholder: "Use ^ and $ for start and end",
},
@ -230,7 +255,7 @@
"searching" : false,
"ordering" : false,
"info" : false,
"autoWidth" : false,
"autoWidth" : true,
"columnDefs": [
{
"render": function ( data, type, row ) {
@ -351,11 +376,10 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<h4 class="modal-title">DNSSEC</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">DNSSEC</h4>
</div>
<div class="modal-body">
<p></p>

View File

@ -4,9 +4,9 @@
{% macro dnssec(domain) %}
{% if domain.dnssec %}
<td><span style="cursor:pointer" class="label label-success button_dnssec" id="{{ domain.name }}"><i class="fa fa-lock"></i>&nbsp;Enabled</span></td>
<td><span style="cursor:pointer" class="btn btn-lg btn-success button_dnssec" id="{{ domain.name }}"><i class="fa fa-lock"></i>&nbsp;Enabled</span></td>
{% else %}
<td><span style="cursor:pointer" class="label label-primary button_dnssec" id="{{ domain.name }}"><i class="fa fa-unlock-alt"></i>&nbsp;Disabled</span></td>
<td><span style="cursor:pointer" class="btn btn-sm btn-danger button_dnssec" id="{{ domain.name }}"><i class="fa fa-unlock-alt"></i>&nbsp;Disabled</span></td>
{% endif %}
{% endmacro %}
@ -30,30 +30,46 @@
{% macro actions(domain) %}
{% if current_user.role.name in ['Administrator', 'Operator'] %}
<td width="25%">
<button type="button" class="btn btn-flat btn-success button_template" id="{{ domain.name }}">
Template&nbsp;<i class="fa fa-clone"></i>
<td width="6%">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Options
</button>
<button type="button" class="btn btn-flat btn-success" onclick="window.location.href='{{ url_for('domain.domain', domain_name=domain.name) }}'">
Manage&nbsp;<i class="fa fa-cog"></i>
<div class="dropdown-menu" aria-labelledby="dropdownMenu">
<button class="dropdown-item btn-success button_template" id="{{ domain.name }}" type="button">
<i class="fa fa-clone"></i>&nbsp;Template
</button>
<button type="button" class="btn btn-flat btn-danger" onclick="window.location.href='{{ url_for('domain.setting', domain_name=domain.name) }}'">
Admin&nbsp;<i class="fa fa-cog"></i>
<button class="dropdown-item btn-success" type="button" onclick="window.location.href='{{ url_for('domain.domain', domain_name=domain.name) }}'">
<i class="fa fa-cog"></i>&nbsp;Manage
</button>
<button type="button" class="btn btn-flat btn-primary" onclick="window.location.href='{{ url_for('domain.changelog', domain_name=domain.name) }}'">
Changelog&nbsp;<i class="fa fa-history" aria-hidden="true"></i>
<button class="dropdown-item btn-danger" type="button" onclick="window.location.href='{{ url_for('domain.setting', domain_name=domain.name) }}'">
<i class="fa fa-cog"></i>&nbsp;Admin
</button>
<button class="dropdown-item btn-primary" type="button" onclick="window.location.href='{{ url_for('domain.changelog', domain_name=domain.name) }}'">
<i class="fa fa-history" aria-hidden="true"></i>&nbsp;Changelog
</button>
</div>
</div>
</td>
{% else %}
<td width="6%">
<button type="button" class="btn btn-flat btn-success" onclick="window.location.href='{{ url_for('domain.domain', domain_name=domain.name) }}'">
Manage&nbsp;<i class="fa fa-cog"></i>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Options
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu">
<button class="dropdown-item btn-success" type="button" onclick="window.location.href='{{ url_for('domain.domain', domain_name=domain.name) }}'">
<i class="fa fa-cog"></i>&nbsp;Manage
</button>
{% if allow_user_view_history %}
<button type="button" class="btn btn-flat btn-primary" onclick="window.location.href='{{ url_for('domain.changelog', domain_name=domain.name) }}'">
Changelog&nbsp;<i class="fa fa-history" aria-hidden="true"></i>
<button class="dropdown-item btn-primary" type="button" onclick="window.location.href='{{ url_for('domain.changelog', domain_name=domain.name) }}'">
<i class="fa fa-history" aria-hidden="true"></i>&nbsp;Changelog
</button>
{% endif %}
</div>
</div>
</td>
{% endif %}
{% endmacro %}

View File

@ -1,51 +1,67 @@
{% extends "base.html" %}
{% block title %}<title>{{ domain.name | pretty_domain_name }} - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
{{ domain.name | pretty_domain_name }} - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %}
<section class="content-header">
<h1>
Manage domain: <b>{{ domain.name | pretty_domain_name }}</b>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
Domain: <b>{{ domain.name | pretty_domain_name }}</b>
</h1>
<ol class="breadcrumb">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i
class="fa fa-dashboard"></i> Home</a></li>
<li>Domain</li>
<li class="active">{{ domain.name | pretty_domain_name }}</li>
</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">Domain: {{ domain.name | pretty_domain_name }}</li>
</ol>
</section>
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body">
<div class="col-12">
<div class="card">
<div class="card-header">
{% if domain.type != 'Slave' %}
<button type="button" class="btn btn-flat btn-primary pull-left button_add_record" id="{{ domain.name }}">
Add Record&nbsp;<i class="fa fa-plus"></i>
<button type="button" style="position: relative; margin-left: 20px" class="btn btn-primary pull-left button_add_record" id="{{ domain.name }}">
<i class="fas fa-plus"></i>
&nbsp;Add Record
</button>
<button type="button" class="btn btn-flat btn-primary pull-right button_apply_changes" id="{{ domain.name }}" value="{{ domain.serial }}">
Apply Changes&nbsp;<i class="fa fa-floppy-o"></i>
<button type="button" style="position: relative; margin-left: 20px" class="btn btn-primary pull-right button_apply_changes" id="{{ domain.name }}" value="{{ domain.serial }}">
<i class="fas fa-save"></i>
&nbsp;Apply Changes
</button>
{% else %}
<button type="button" class="btn btn-flat btn-primary pull-left button_update_from_master" id="{{ domain.name }}">
Update from Master&nbsp;<i class="fa fa-download"></i>
<button type="button" style="position: relative; margin-left: 20px" class="btn btn-primary pull-left button_update_from_master" id="{{ domain.name }}">
<i class="fas fa-download"></i>
&nbsp;Update from Master
</button>
{% endif %}
{% if current_user.role.name in ['Administrator', 'Operator'] %}
<button type="button" style="position: relative; margin-left: 20px" class="btn btn-flat btn-primary pull-left btn-danger" onclick="window.location.href='{{ url_for('domain.setting', domain_name=domain.name) }}'">
Admin&nbsp;<i class="fa fa-cog"></i>
<button type="button" style="position: relative; margin-left: 20px" class="btn btn-primary pull-left btn-danger" onclick="window.location.href='{{ url_for('domain.setting', domain_name=domain.name) }}'">
<i class="fas fa-cog"></i>
&nbsp;Admin
</button>
{% endif %}
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %}
<button type="button" style="position: relative; margin-left: 20px" class="btn btn-flat btn-primary button_changelog" id="{{ domain.name }}">
Changelog&nbsp;<i class="fa fa-history" aria-hidden="true"></i>
</i>
<button type="button" style="position: relative; margin-left: 20px" class="btn btn-primary button_changelog" id="{{ domain.name }}">
<i class="fas fa-history" aria-hidden="true"></i>
&nbsp;Changelog
</button>
{% endif %}
</div>
<div class="box-body">
<div class="card-body">
<table id="tbl_records" class="table table-bordered table-striped">
<thead>
<tr>
@ -66,49 +82,37 @@
<tbody>
{% for record in records %}
<tr class="odd row_record" id="{{ domain.name }}">
<td>
{{ (record.name,domain.name) | display_record_name | pretty_domain_name }}
</td>
<td>
{{ record.type }}
</td>
<td>
{{ record.status }}
</td>
<td>
{{ record.ttl }}
</td>
<td>
{{ record.data | pretty_domain_name }}
</td>
<td>
{{ record.comment }}
</td>
<td>{{ (record.name,domain.name) | display_record_name | pretty_domain_name }}</td>
<td>{{ record.type }}</td>
<td>{{ record.status }}</td>
<td>{{ record.ttl }}</td>
<td>{{ record.data | pretty_domain_name }}</td>
<td>{{ record.comment }}</td>
{% if domain.type != 'Slave' %}
<td width="6%">
{% if record.is_allowed_edit() %}
<button type="button" class="btn btn-flat btn-warning button_edit">Edit&nbsp;<i class="fa fa-edit"></i></button>
<button type="button" class="btn btn-warning button_edit"><i class="fa fa-edit"></i></button>
{% else %}
<button type="button" class="btn btn-flat btn-warning">&nbsp;&nbsp;<i class="fa fa-exclamation-circle"></i></button>
<button type="button" class="btn btn-warning"><i class="fa fa-exclamation-circle"></i></button>
{% endif %}
</td>
<td width="6%">
{% if record.is_allowed_delete() %}
<button type="button" class="btn btn-flat btn-danger button_delete">Delete&nbsp;<i class="fa fa-trash"></i></button>
<button type="button" class="btn btn-danger button_delete"><i class="fa fa-trash"></i></button>
{% endif %}
</td>
{% else %}
<td width="6%">
<button type="button" class="btn btn-flat btn-warning">&nbsp;&nbsp;<i class="fa fa-exclamation-circle"></i>&nbsp;&nbsp;</button>
<button type="button" class="btn btn-warning"><i class="fa fa-exclamation-circle"></i></button>
</td>
<td width="6%">
<button type="button" class="btn btn-flat btn-warning">&nbsp;&nbsp;<i class="fa fa-exclamation-circle"></i>&nbsp;&nbsp;</button>
<button type="button" class="btn btn-warning"><i class="fa fa-exclamation-circle"></i></button>
</td>
{% endif %}
{% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %}
<td width="6%">
<button type="button" onclick="show_record_changelog('{{record.name}}','{{record.type}}',event)" class="btn btn-flat btn-primary">&nbsp;&nbsp;
<i class="fa fa-history" aria-hidden="true"></i>&nbsp;&nbsp;&nbsp;
<button type="button" onclick="show_record_changelog('{{record.name}}','{{record.type}}',event)" class="btn btn-primary">
<i class="fa fa-history" aria-hidden="true"></i>
</button>
</td>
{% endif %}
@ -119,15 +123,13 @@
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
</section>
{% endblock %}
{% block extrascripts %}
<script>
// superglobals
@ -553,72 +555,64 @@
{% endif %}
</script>
{% endblock %}
{% block modals %}
<div class="modal fade modal-warning" id="modal_delete">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<h4 class="modal-title">Confirmation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-default pull-left" id="button_delete_cancel"
data-dismiss="modal">Close</button>
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">Delete</button>
<button type="button" class="btn btn-primary pull-left" id="button_delete_cancel" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" id="button_delete_confirm">Delete</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<div class="modal fade modal-primary" id="modal_apply_changes">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<h4 class="modal-title">Confirmation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-default pull-left"
data-dismiss="modal">Close</button>
<button type="button" class="btn btn-flat btn-primary" id="button_apply_confirm">Apply</button>
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="button_apply_confirm">Apply</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<div class="modal fade modal-primary" id="modal_custom_record">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<h4 class="modal-title">Custom Record</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Custom Record</h4>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-primary" id="button_save">Save</button>
<button type="button" class="btn btn-primary" id="button_save">Save</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
{% endblock %}

View File

@ -1,44 +1,53 @@
{% extends "base.html" %}
{% set active_page = "new_domain" %}
{% block title %}<title>Add Domain - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
Add Domain - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %}
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
Domain
<small>Create new</small>
<small>New Domain</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li>
<li><a href="{{ url_for('dashboard.dashboard') }}">Domain</a></li>
<li class="active">Add Domain</li>
</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">Domain - New Domain</li>
</ol>
</section>
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Create new domain</h3>
<div class="card card-outline card-secondary">
<div class="card-header with-border">
<h3 class="card-title">Create new domain</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" method="post" action="{{ url_for('domain.add') }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<div class="box-body">
<div class="card-body">
<div class="form-group">
<input type="text" class="form-control" name="domain_name" id="domain_name"
placeholder="Enter a valid domain name (required)">
<input type="text" class="form-control" name="domain_name" id="domain_name" placeholder="Enter a valid domain name (required)">
</div>
{% if domain_override_toggle == True %}
<div class="form-group">
<label>Domain Override Record</label>
<input type="checkbox" id="domain_override" name="domain_override"
class="checkbox">
<input type="checkbox" id="domain_override" name="domain_override" class="checkbox">
</div>
{% endif %}
<select name="accountid" class="form-control" style="width:15em;">
@ -46,7 +55,8 @@
{% for account in accounts %}
<option value="{{ account.id }}">{{ account.name }}</option>
{% endfor %}
</select><br />
</select>
<br />
<div class="form-group">
<label>Type</label>
<div class="radio">
@ -54,13 +64,17 @@
<input type="radio" name="radio_type" id="radio_type_native" value="native" checked>
Native
</label>
&nbsp;&nbsp;&nbsp;
</div>
<div class="radio">
<label>
<input type="radio" name="radio_type" id="radio_type_master" value="master"> Master
<input type="radio" name="radio_type" id="radio_type_master" value="master">
Primary
</label>
&nbsp;&nbsp;&nbsp;
</div>
<div class="radio">
<label>
<input type="radio" name="radio_type" id="radio_type_slave" value="slave">Slave
<input type="radio" name="radio_type" id="radio_type_slave" value="slave">
Secondary
</label>
</div>
</div>
@ -74,22 +88,20 @@
</select>
</div>
<div class="form-group" style="display: none;" id="domain_master_address_div">
<input type="text" class="form-control" name="domain_master_address"
id="domain_master_address"
placeholder="Enter valid master ip addresses (separated by commas)">
<input type="text" class="form-control" name="domain_master_address" id="domain_master_address" placeholder="Enter valid master ip addresses (separated by commas)">
</div>
<div class="form-group">
<label>SOA-EDIT-API</label>
<div class="radio">
<label>
<input type="radio" name="radio_type_soa_edit_api" id="radio_default"
value="DEFAULT" checked> DEFAULT
<input type="radio" name="radio_type_soa_edit_api" id="radio_default" value="DEFAULT" checked>
DEFAULT
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="radio_type_soa_edit_api" id="radio_increase"
value="INCREASE"> INCREASE
<input type="radio" name="radio_type_soa_edit_api" id="radio_increase" value="INCREASE">
INCREASE
</label>
</div>
<div class="radio">
@ -105,42 +117,42 @@
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-flat btn-primary">Submit</button>
<button type="button" class="btn btn-flat btn-default"
onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'">Cancel</button>
<div class="card-footer">
<button type="submit" class="btn btn-primary">
Submit
</button>
<button type="button" class="btn btn-default" onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'">
Cancel
</button>
</div>
</form>
</div>
<!-- /.box -->
</div>
<div class="col-md-8">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Help with creating a new domain</h3>
<div class="card card-outline card-secondary">
<div class="card-header with-border">
<h3 class="card-title">Help with creating a new domain</h3>
</div>
<div class="box-body">
<div class="card-body">
<dl class="dl-horizontal">
<dt>Domain name</dt>
<dd>Enter your domain name in the format of name.tld (eg. powerdns-admin.com). You can also
enter sub-domains to create a sub-root zone (eg. sub.powerdns-admin.com) in case you want to
delegate sub-domain management to specific users.</dd>
delegate sub-domain management to specific users.
</dd>
<dt>Type</dt>
<dd>The type decides how the domain will be replicated across multiple DNS servers.
<ul>
<li>
Native - PowerDNS will not perform any replication. Use this if you only have one
PowerDNS server or you handle replication via your backend.
<b>Native - </b>{{ SITE_NAME }} will not perform any Primary or Secondary zone functions.
</li>
<li>
Master - This PowerDNS server will serve as the master and will send zone transfers
(AXFRs) to other servers configured as slaves.
<b>Primary - </b>{{ SITE_NAME }} will serve as the Primary and will send zone transfers
(AXFRs) to other servers configured as secondaries.
</li>
<li>
Slave - This PowerDNS server will serve as the slave and will request and receive
zone transfers (AXFRs) from other servers configured as masters.
<b>Secondary - </b>{{ SITE_NAME }} will serve as the Secondary and will request and receive
zone transfers (AXFRs) from other servers configured as Primaries.
</li>
</ul>
</dd>
@ -149,30 +161,34 @@
made to the domain.
<ul>
<li>
DEFAULT - Generate a soa serial of YYYYMMDD01. If the current serial is lower than
<b>DEFAULT - </b>Generate a soa serial of YYYYMMDD01. If the current serial is lower than
the generated serial, use the generated serial. If the current serial is higher or
equal to the generated serial, increase the current serial by 1.
</li>
<li>
INCREASE - Increase the current serial by 1.
<b>INCREASE - </b>Increase the current serial by 1.
</li>
<li>
EPOCH - Change the serial to the number of seconds since the EPOCH, aka unixtime.
<b>EPOCH - </b>Change the serial to the number of seconds since the EPOCH, aka unixtime.
</li>
<li>
OFF - Disable automatic updates of the SOA serial.
<b>OFF - </b>Disable automatic updates of the SOA serial.
</li>
</ul>
</dd>
</dl>
<p>Find more details at <a href="https://docs.powerdns.com/md/">https://docs.powerdns.com/md/</a>
<p>
Find more details at <a href="https://docs.powerdns.com/md/">https://docs.powerdns.com/md/</a>
</p>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}
{% block extrascripts %}
<script>
$("input[name=radio_type]").change(function () {
@ -185,6 +201,7 @@
});
</script>
{% endblock %}
{% block modals %}
<script>
{% if domain_override_message %}
@ -196,7 +213,7 @@
});
{% endif %}
</script>
</div>
<div class="modal fade" id="modal_warning">
<div class="modal-dialog">
<div class="modal-content modal-sm">
@ -204,18 +221,19 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close" id="button_close_warn_modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">WARNING</h4>
<h4 class="modal-title">
WARNING
</h4>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-primary center-block" data-dismiss="modal" id="button_confirm_warn_modal">
CLOSE</button>
CLOSE
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
{% endblock %}

View File

@ -2,37 +2,44 @@
{% block title %}<title>{{ domain.name | pretty_domain_name }} - {{ SITE_NAME }}</title>{% endblock %}
{% block dashboard_stat %}
<section class="content-header">
<h1>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
{% if record_name and record_type %}
Record changelog: <b>{{ record_name}} &nbsp {{ record_type }}</b>
{% else %}
Domain changelog: <b>{{ domain.name | pretty_domain_name }}</b>
{% endif %}
</h1>
<ol class="breadcrumb">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li>
<li>Domain</li>
<li class="active">{{ domain.name | pretty_domain_name }}</li>
</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">Changelog: {{ domain.name | pretty_domain_name }}</li>
</ol>
</section>
</div>
</div>
</div>
</div>
{% endblock %}
{% import 'applied_change_macro.html' as applied_change_macro %}
{% block content %}
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body">
<button type="button" class="btn btn-flat btn-primary pull-left button_show_records"
id="{{ domain.name }}">
Manage &nbsp;<i class="fa fa-arrow-left"></i>
<div class="card">
<div class="card-body">
<button type="button" class="btn btn-primary pull-left button_show_records" id="{{ domain.name }}">
<i class="fas fa-arrow-left"></i>
&nbsp;Manage
</button>
</div>
<div class="box-body">
<div class="card-body">
<table id="tbl_changelog" class="table table-bordered table-striped">
<thead>
<tr>
@ -42,7 +49,6 @@
</thead>
<tbody>
{% for applied_change in allHistoryChanges %}
<tr class="odd row_record" id="{{ domain.name }}">
<td id="changed_on" class="changed_on">
{{ allHistoryChanges[applied_change][0].history_entry.created_on }}
@ -68,6 +74,7 @@
</div>
</div>
</div>
</div>
</section>
{% endblock %}

View File

@ -1,72 +1,82 @@
{% extends "base.html" %}
{% set active_page = "remove_domain" %}
{% block title %}<title>Remove Domain - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
Remove Domain - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %}
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
Domain
<small>Remove existing</small>
<small>Remove</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li>
<li><a href="{{ url_for('dashboard.dashboard') }}">Domain</a></li>
<li class="active">Remove Domain</li>
</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">Domain - Remove Domain</li>
</ol>
</section>
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Remove domain</h3>
<div class="card card-outline card-secondary">
<div class="card-header with-border">
<h3 class="card-title">Remove domain</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" method="post" action="{{ url_for('domain.remove') }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<div class="box-body">
<div class="card-body">
<select id=domainid class="form-control" style="width:15em;">
<option value="0">- Select Domain -</option>
{% for domain in domainss %}
<option value="{{ domain.id }}">{{ domain.name }}</option>
{% endfor %}
</select><br />
</select>
<br />
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="button" class="btn btn-flat btn-danger button_delete">Remove</button>
<button type="button" class="btn btn-flat btn-default"
onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'">Cancel</button>
<div class="card-footer">
<button type="button" class="btn btn-default" onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'">
Cancel
</button>
<button type="button" class="btn btn-danger button_delete float-right">Remove</button>
</div>
</form>
</div>
<!-- /.box -->
</div>
<div class="col-md-8">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Help with removing a new domain</h3>
<div class="card card-outline card-secondary">
<div class="card-header with-border">
<h3 class="card-title">Help with removing a new domain</h3>
</div>
<div class="box-body">
<div class="card-body">
<dl class="dl-horizontal">
<dt>Domain name</dt>
<dd>Select domain you wish to remove from DNS.</dd>
</dl>
<p>Find more details at <a href="https://docs.powerdns.com/md/">https://docs.powerdns.com/md/</a>
</p>
<p>Find more details at <a href="https://docs.powerdns.com/md/">https://docs.powerdns.com/md/</a></p>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}
{% block extrascripts %}
<script>
// handle delete button
@ -77,7 +87,6 @@
return;
}
var modal = $("#modal_delete");
var domain = $("#domainid option:selected").text();
var info = "Are you sure you want to delete " + domain + "?";
@ -92,7 +101,6 @@
modal.modal('hide');
})
modal.modal('show');
$("#button_delete_cancel").unbind().one('click', function(e) {
modal.modal('hide');
});
@ -105,23 +113,23 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<h4 class="modal-title">Confirmation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-default pull-left" id="button_delete_cancel"
data-dismiss="modal">Close</button>
<button type="button" class="btn btn-flat btn-danger" id="button_delete_confirm">Delete</button>
<button type="button" class="btn btn-default" id="button_delete_cancel" data-dismiss="modal">
Close
</button>
<button type="button" class="btn btn-danger float-right" id="button_delete_confirm">
Delete
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
{% endblock %}

View File

@ -2,7 +2,7 @@
{% block title %}
<title>
{{ SITE_NAME }} - 400 Error
400 Error - {{ SITE_NAME }}
</title>
{% endblock %}
@ -35,7 +35,7 @@
</h2>
<div class="error-content">
<h3>
<i class="fa fa-warning text-yellow"></i>
<i class="fas fa-exclamation-triangle text-yellow"></i>
Oops! Bad request
</h3>
<p>

View File

@ -2,7 +2,7 @@
{% block title %}
<title>
{{ SITE_NAME }} - 403 Error
403 Error - {{ SITE_NAME }}
</title>
{% endblock %}
@ -35,7 +35,7 @@
</h2>
<div class="error-content">
<h3>
<i class="fa fa-warning text-yellow"></i>
<i class="fas fa-exclamation-triangle text-yellow"></i>
Oops! Access denied
</h3>
<p>

View File

@ -2,7 +2,7 @@
{% block title %}
<title>
{{ SITE_NAME }} - 404 Error
404 Error - {{ SITE_NAME }}
</title>
{% endblock %}
@ -35,7 +35,7 @@
</h2>
<div class="error-content">
<h3>
<i class="fa fa-warning text-yellow"></i>
<i class="fas fa-exclamation-triangle text-yellow"></i>
Oops! You're lost
</h3>
<p>

View File

@ -2,7 +2,7 @@
{% block title %}
<title>
{{ SITE_NAME }} - 500 Error
500 Error - {{ SITE_NAME }}
</title>
{% endblock %}
@ -35,7 +35,7 @@
</h2>
<div class="error-content">
<h3>
<i class="fa fa-warning text-yellow"></i>
<i class="fas fa-exclamation-triangle text-yellow"></i>
Oops! Something went wrong
</h3>
<p>

View File

@ -2,7 +2,7 @@
{% block title %}
<title>
{{ SITE_NAME }} - SAML Authentication Error
SAML Authentication Error - {{ SITE_NAME }}
</title>
{% endblock %}
@ -39,7 +39,8 @@
<br/>
<div class="error-content">
<h3>
<i class="fa fa-warning text-yellow"></i> Oops! Something went wrong
<i class="fas fa-exclamation-triangle text-yellow"></i>
Oops! Something went wrong
</h3>
<br>
<p>

View File

@ -106,15 +106,23 @@
<span class="help-block with-errors"></span>
</div>
{% if captcha_enable %}
<div class="input-group mb-3">
<p class="login-box-msg">Please complete the CAPTCHA below</p>
<div class="form-group has-feedback">
{{ captcha() }}
<input type="text" class="form-control" placeholder="CAPTCHA" name="captcha" data-error="Please complete the CAPTCHA" required>
<span class="help-block with-errors"></span>
<br>
<input type="text" class="form-control" placeholder="CAPTCHA" id="captcha" name="captcha" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
<div class="invalid-feedback">
Please complete the CAPTCHA
</div>
</div>
{% endif %}
<div class="row">
<div class="col-6">
<button type="button" class="btn btn-block" id="button_back">Back</button>

View File

@ -38,19 +38,20 @@
</div>
{% endif %} {% endwith %}
<div class="row">
<div class="container-fluid">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Templates</h3>
<div class="card">
<div class="card-header">
<h3 class="card-title">Templates</h3>
</div>
<div class="box-body">
<div class="card-body">
<a href="{{ url_for('admin.create_template') }}">
<button type="button" class="btn btn-flat btn-primary pull-left">
Create Template&nbsp;<i class="fa fa-plus"></i>
</button>
</a>
</div>
<div class="box-body">
<div class="card-body">
<table id="tbl_template_list" class="table table-bordered table-striped">
<thead>
<tr>
@ -75,11 +76,11 @@
</td>
<td>
<a href="{{ url_for('admin.edit_template', template=template.name) }}">
<button type="button" class="btn btn-flat btn-warning button_edit" id="btn_edit">
<button type="button" class="btn btn-warning button_edit" id="btn_edit">
Edit&nbsp;<i class="fa fa-edit"></i>
</button>
</a>
<button type="button" class="btn btn-flat btn-danger button_delete" id="{{template.name}}">
<button type="button" class="btn btn-danger button_delete" id="{{template.name}}">
Delete&nbsp;<i class="fa fa-trash"></i>
</button>
</td>
@ -94,6 +95,7 @@
</div>
<!-- /.col -->
</div>
</div>
<!-- /.row -->
</section>
<!-- /.content -->

View File

@ -1,28 +1,42 @@
{% extends "base.html" %}
{% block title %}<title>My Profile - {{ SITE_NAME }}</title>{% endblock %}
{% block dashboard_stat %}
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Profile
<small>Edit my profile</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ url_for('dashboard.dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li>
<li class="active">My Profile</li>
</ol>
</section>
{% block title %}
<title>
My Profile - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %}
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
User
<small>My Profile</small>
</h1>
</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">My Profile</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<section class="content">
<div class="row">
<div class="col-lg-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Edit my profile{% if session['authentication_type'] != 'LOCAL' %} [Disabled -
<div class="card card-primary">
<div class="card-header with-border">
<h3 class="card-title">Edit my profile{% if session['authentication_type'] != 'LOCAL' %} [Disabled -
Authenticated externally]{% endif %}</h3>
</div>
<div class="box-body">
<div class="card-body">
<!-- Custom Tabs -->
<div class="nav-tabs-custom" id="tabs">
<ul class="nav nav-tabs">

View File

@ -29,6 +29,6 @@ Flask-Mail==0.9.1
flask-session==0.4.0
Jinja2==3.1.2
itsdangerous==2.1.2
werkzeug==2.1.3
werkzeug==2.1.2
cryptography==36.0.2
flask_session_captcha==1.3.0