mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
Convert domain admin page to new template.
This commit is contained in:
parent
79653573ef
commit
be181385d8
@ -1,145 +1,120 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block head %}
|
|
||||||
{{ super() }}
|
|
||||||
|
|
||||||
<!-- BEGIN PAGE LEVEL STYLES -->
|
|
||||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='global/plugins/jquery-multi-select/css/multi-select.css') }}"/>
|
|
||||||
<!-- BEGIN THEME STYLES -->
|
|
||||||
|
|
||||||
<!-- BEGIN THEME STYLES -->
|
|
||||||
<!-- DOC: To use 'rounded corners' style just load 'components-rounded.css' stylesheet instead of 'components.css' in the below style tag -->
|
|
||||||
<link href="{{ url_for('static', filename='global/css/components-md.css') }}" id="style_components" rel="stylesheet" type="text/css"/>
|
|
||||||
<link href="{{ url_for('static', filename='global/css/plugins-md.css') }}" rel="stylesheet" type="text/css"/>
|
|
||||||
<link href="{{ url_for('static', filename='admin/layout2/css/layout.css') }}" rel="stylesheet" type="text/css"/>
|
|
||||||
<link href="{{ url_for('static', filename='admin/layout2/css/themes/grey.css') }}" rel="stylesheet" type="text/css" id="style_color"/>
|
|
||||||
<link href="{{ url_for('static', filename='admin/layout2/css/custom.css') }}" rel="stylesheet" type="text/css"/>
|
|
||||||
<!-- END THEME STYLES -->
|
|
||||||
{% endblock %}
|
|
||||||
{% block title %}<title>DNS Control Panel - Domain Management</title>{% endblock %}
|
{% block title %}<title>DNS Control Panel - Domain Management</title>{% endblock %}
|
||||||
|
|
||||||
{% block dashboard_stat %}
|
{% block dashboard_stat %}
|
||||||
<!-- BEGIN PAGE HEADER-->
|
<section class="content-header">
|
||||||
<h3 class="page-title">
|
<h1>
|
||||||
Admin Console</h3>
|
Manage domain <small>{{ domain.name }}</small>
|
||||||
<div class="page-bar">
|
</h1>
|
||||||
<ul class="page-breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li>
|
<li><a href="{{ url_for('dashboard') }}"><i
|
||||||
<i class="fa fa-home"></i>
|
class="fa fa-dashboard"></i> Home</a></li>
|
||||||
<a href="{{ url_for('dashboard') }}">Home</a>
|
<li class="active">Domain Management</li>
|
||||||
<i class="fa fa-angle-right"></i>
|
</ol>
|
||||||
</li>
|
</section>
|
||||||
<li>
|
|
||||||
<a href="{{ url_for('admin') }}">Admin Console</a>
|
|
||||||
<i class="fa fa-angle-right"></i>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#">Domain Management</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<!-- END PAGE HEADER-->
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="clearfix">
|
<section class="content">
|
||||||
</div>
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
<div class="row">
|
<div class="box">
|
||||||
<div class="col-md-12">
|
<form method="post" action="{{ url_for('domain_management', domain_name=domain.name) }}">
|
||||||
<!-- BEGIN ACCESS CONTROL -->
|
<div class="box-header">
|
||||||
<div class="portlet box red-sunglo">
|
<h3 class="box-title">Domain Access Control</h3>
|
||||||
<div class="portlet-title">
|
</div>
|
||||||
<div class="caption">
|
<div class="box-body">
|
||||||
<i class="fa fa-globe"></i>Domain Access Control
|
<div class="row">
|
||||||
</div>
|
<div class="col-xs-2">
|
||||||
<div class="tools">
|
<p>Users on the right have access to manage the records in
|
||||||
<a href="javascript:;" class="collapse">
|
the {{ domain.name }} domain.</p>
|
||||||
</a>
|
<p>Click on users to move from between columns.</p>
|
||||||
</div>
|
<p>
|
||||||
</div>
|
Users in <font style="color: red;">red</font> are Administrators
|
||||||
<div class="portlet-body">
|
and already have access to <b>ALL</b> domains.
|
||||||
<form method="post" action="{{ url_for('domain_management', domain_name=domain.name) }}" class="form-horizontal form-row-seperated">
|
</p>
|
||||||
<div class="form-body">
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group col-xs-2">
|
||||||
<label class="control-label col-md-3">Move users from left to right to grant them access to the domain <strong>{{ domain.name }}.</strong><br/><br/>
|
<select multiple="multiple" class="form-control" id="domain_multi_user" name="domain_multi_user[]">
|
||||||
Users with <font color="red">red</font> color is in Administrator role, no need to grant permission.
|
{% for user in users %}
|
||||||
</label>
|
<option {% if user.id in
|
||||||
<div class="col-md-9">
|
domain_user_ids %}selected{% endif %} value="{{ user.username }}"
|
||||||
<select multiple="multiple" class="multi-select" id="domain_multi_user" name="domain_multi_user[]">
|
{% if user.role.name== 'Administrator' %}style="color: red"{% endif %}>{{
|
||||||
{% for user in users %}
|
user.username}}</option> {% endfor %}
|
||||||
<option {% if user.id in domain_user_ids %}selected{% endif %} value="{{ user.username }}" {% if user.role.name == 'Administrator' %}style="color:red"{% endif %}>{{ user.username}}
|
</select>
|
||||||
</option>
|
</div>
|
||||||
{% endfor %}
|
</div>
|
||||||
</select>
|
<div class="box-body">
|
||||||
</div>
|
<div class="col-xs-offset-2">
|
||||||
</div>
|
<div class="form-group">
|
||||||
</div>
|
<button type="submit" class="btn btn-primary"><i class="fa fa-check"></i> Save</button>
|
||||||
<div class="form-actions">
|
</div>
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col-md-offset-3 col-md-9">
|
</div>
|
||||||
<button type="submit" class="btn green"><i class="fa fa-check"></i> Save</button>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
<div class="row">
|
||||||
</div>
|
<div class="col-xs-12">
|
||||||
</div>
|
<div class="box">
|
||||||
<!-- END ACCESS CONTROL -->
|
<div class="box-header">
|
||||||
</div>
|
<h3 class="box-title">Domain Deletion</h3>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
<div class="row">
|
<p>This function is used to remove a domain from PowerDNS-Admin <b>AND</b> PowerDNS. All records and user privileges which associated to this domain will also be removed. This change cannot be reverted.</p>
|
||||||
<div class="col-md-12">
|
<button type="button" class="btn btn-flat btn-danger pull-left delete_domain" id="{{ domain.name }}">
|
||||||
<!-- BEGIN DOMAIN DELETION -->
|
<i class="fa fa-trash"></i> DELETE DOMAIN {{ domain.name }}
|
||||||
<div class="portlet box red-sunglo">
|
</button>
|
||||||
<div class="portlet-title">
|
</div>
|
||||||
<div class="caption">
|
</div>
|
||||||
<i class="fa fa-globe"></i>Domain Deletion
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tools">
|
</section>
|
||||||
<a href="javascript:;" class="collapse">
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="portlet-body">
|
|
||||||
<p>This function is used to remove a domain completely from Database and PowerDNS. All records and user privileges which associated to this domain be removed also. Your change <font color="red">cannot be reverted</font>. Please be careful with your action!</p>
|
|
||||||
<div class="form-actions">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-offset-3 col-md-9">
|
|
||||||
<button type="button" class="btn red" id="delete_domain" value="{{ domain.name}}"><i class="fa fa-times"></i> DELETE DOMAIN {{ domain.name }}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- END DOMAIN DELETION -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block extrascripts %}
|
||||||
{% block scripts %}
|
|
||||||
{{ super() }}
|
|
||||||
<!-- BEGIN PAGE LEVEL PLUGINS -->
|
|
||||||
<script type="text/javascript" src="{{ url_for('static', filename='global/plugins/bootstrap-select/bootstrap-select.min.js') }}"></script>
|
|
||||||
<script type="text/javascript" src="{{ url_for('static', filename='global/plugins/select2/select2.min.js') }}"></script>
|
|
||||||
<script type="text/javascript" src="{{ url_for('static', filename='global/plugins/jquery-multi-select/js/jquery.multi-select.js') }}"></script>
|
|
||||||
<script src="{{ url_for('static', filename='global/plugins/bootbox/bootbox.min.js') }}" type="text/javascript"></script>
|
|
||||||
<!-- END PAGE LEVEL PLUGINS -->
|
|
||||||
|
|
||||||
<!-- BEGIN PAGE LEVEL SCRIPTS -->
|
|
||||||
<script src="{{ url_for('static', filename='global/scripts/metronic.js') }}" type="text/javascript"></script>
|
|
||||||
<script src="{{ url_for('static', filename='admin/layout2/scripts/layout.js') }}" type="text/javascript"></script>
|
|
||||||
<script src="{{ url_for('static', filename='admin/pages/scripts/components-dropdowns.js') }}" type="text/javascript"></script>
|
|
||||||
<script src="{{ url_for('static', filename='admin/pages/scripts/my-button-action.js') }}" type="text/javascript"></script>
|
|
||||||
<!-- END PAGE LEVEL SCRIPTS -->
|
|
||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function() {
|
$("#domain_multi_user").multiSelect();
|
||||||
Metronic.init(); // init metronic core componets
|
|
||||||
Layout.init(); // init layout
|
// handle deletion of user
|
||||||
ComponentsDropdowns.init();
|
$('.delete_domain').click(function() {
|
||||||
MyButtonAction.init();
|
var modal = $("#modal_delete_domain");
|
||||||
|
var domain = $(this).prop('id');
|
||||||
|
var info = "Are you sure you want to delete " + domain + "?";
|
||||||
|
modal.find('.modal-body p').text(info);
|
||||||
|
modal.find('#button_delete_confirm').click(function() {
|
||||||
|
$.get('/admin/domain/' + domain + '/delete');
|
||||||
|
modal.modal('hide');
|
||||||
|
window.location.href = '{{ url_for('dashboard') }}';
|
||||||
|
})
|
||||||
|
modal.modal('show');
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<!-- END JAVASCRIPTS -->
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block modals %}
|
||||||
|
<div class="modal fade modal-warning" id="modal_delete_domain">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
|
aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</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-default pull-left"
|
||||||
|
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>
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user