mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-01-07 10:55:40 +00:00
Merge pull request #38 from ivanfilippov/new_ui
Results of first round of testing
This commit is contained in:
commit
5842617b31
@ -112,4 +112,41 @@ function SelectElement(elementID, valueToSelect)
|
|||||||
{
|
{
|
||||||
var element = document.getElementById(elementID);
|
var element = document.getElementById(elementID);
|
||||||
element.value = valueToSelect;
|
element.value = valueToSelect;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getdnssec(url){
|
||||||
|
|
||||||
|
$.getJSON(url, function(data) {
|
||||||
|
var modal = $("#modal_dnssec_info");
|
||||||
|
|
||||||
|
if (data['status'] == 'error'){
|
||||||
|
modal.find('.modal-body p').text(data['msg']);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dnssec_msg = '';
|
||||||
|
var dnssec = data['dnssec'];
|
||||||
|
for (var i = 0; i < dnssec.length; i++) {
|
||||||
|
if (dnssec[i]['active']){
|
||||||
|
dnssec_msg += '<form>'+
|
||||||
|
'<h3><strong>'+dnssec[i]['keytype']+'</strong></h3>'+
|
||||||
|
'<strong>DNSKEY</strong>'+
|
||||||
|
'<input class="form-control" autocomplete="off" type="text" readonly="true" value="'+dnssec[i]['dnskey']+'">'+
|
||||||
|
'</form>'+
|
||||||
|
'<br/>';
|
||||||
|
if(dnssec[i]['ds']){
|
||||||
|
var dsList = dnssec[i]['ds'];
|
||||||
|
dnssec_msg += '<strong>DS</strong>';
|
||||||
|
for (var j = 0; j < dsList.length; j++){
|
||||||
|
dnssec_msg += '<input class="form-control" autocomplete="off" type="text" readonly="true" value="'+dsList[j]+'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dnssec_msg += '</form>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
modal.find('.modal-body p').replaceWith(dnssec_msg);
|
||||||
|
|
||||||
|
}
|
||||||
|
modal.modal('show');
|
||||||
|
});
|
||||||
}
|
}
|
@ -31,8 +31,8 @@
|
|||||||
<!-- small box -->
|
<!-- small box -->
|
||||||
<div class="small-box bg-aqua">
|
<div class="small-box bg-aqua">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3>{{ domains|length }}</h3>
|
<h3>{{ domain_count }}</h3>
|
||||||
<p>{% if domains|length > 1 %}Domains{% else %}Domain{% endif %}</p>
|
<p>{% if domain_count > 1 %}Domains{% else %}Domain{% endif %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="fa fa-book"></i>
|
<i class="fa fa-book"></i>
|
||||||
@ -152,11 +152,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if domain.dnssec %}
|
{% if domain.dnssec %}
|
||||||
<button type="button" class="btn btn-flat dnssec">
|
<button type="button" class="btn btn-flat dnssec button_dnssec" id="{{ domain.name }}">
|
||||||
<i class="fa fa-lock"></i> Enabled
|
<i class="fa fa-lock"></i> Enabled
|
||||||
</button>
|
</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-flat dnssec">
|
<button type="button" class="btn btn-flat dnssec button_dnssec" id="{{ domain.name }}">
|
||||||
<i class="fa fa-unlock-alt"></i> Disabled
|
<i class="fa fa-unlock-alt"></i> Disabled
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -219,6 +219,10 @@
|
|||||||
modal.find('.modal-body p').text(info);
|
modal.find('.modal-body p').text(info);
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
});
|
});
|
||||||
|
$(document).on("click", ".button_dnssec", function() {
|
||||||
|
var domain = $(this).prop('id');
|
||||||
|
getdnssec('/domain/' + domain + '/dnssec');
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
@ -245,4 +249,27 @@
|
|||||||
<!-- /.modal-dialog -->
|
<!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal -->
|
<!-- /.modal -->
|
||||||
|
<div class="modal fade" id="modal_dnssec_info">
|
||||||
|
<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">DNSSEC</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default pull-right"
|
||||||
|
data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.modal-content -->
|
||||||
|
</div>
|
||||||
|
<!-- /.modal-dialog -->
|
||||||
|
</div>
|
||||||
|
<!-- /.modal -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -217,6 +217,7 @@
|
|||||||
var table = $("#tbl_records").DataTable();
|
var table = $("#tbl_records").DataTable();
|
||||||
saveRow(table, nEditing);
|
saveRow(table, nEditing);
|
||||||
nEditing = null;
|
nEditing = null;
|
||||||
|
nNew = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -136,7 +136,7 @@ def dashboard():
|
|||||||
domains = User(id=current_user.id).get_domain()
|
domains = User(id=current_user.id).get_domain()
|
||||||
|
|
||||||
# stats for dashboard
|
# stats for dashboard
|
||||||
domains = Domain.query.all()
|
domain_count = Domain.query.count()
|
||||||
users = User.query.all()
|
users = User.query.all()
|
||||||
history_number = History.query.count()
|
history_number = History.query.count()
|
||||||
history = History.query.limit(4)
|
history = History.query.limit(4)
|
||||||
@ -146,7 +146,7 @@ def dashboard():
|
|||||||
uptime = filter(lambda uptime: uptime['name'] == 'uptime', statistics)[0]['value']
|
uptime = filter(lambda uptime: uptime['name'] == 'uptime', statistics)[0]['value']
|
||||||
else:
|
else:
|
||||||
uptime = 0
|
uptime = 0
|
||||||
return render_template('dashboard.html', domains=domains, users=users, history_number=history_number, uptime=uptime, histories=history)
|
return render_template('dashboard.html', domains=domains, domain_count=domain_count, users=users, history_number=history_number, uptime=uptime, histories=history)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/domain/<string:domain_name>', methods=['GET', 'POST'])
|
@app.route('/domain/<string:domain_name>', methods=['GET', 'POST'])
|
||||||
|
Loading…
Reference in New Issue
Block a user