mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-14 01:20:27 +00:00
256 lines
9.3 KiB
HTML
256 lines
9.3 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}<title>DNS Control Panel - HOME</title>{% endblock %}
|
|
|
|
{% block dashboard_stat %}
|
|
<!-- Content Header (Page header) -->
|
|
<section class="content-header">
|
|
<h1>
|
|
Dashboard
|
|
<small>Info</small>
|
|
</h1>
|
|
<ol class="breadcrumb">
|
|
<li><a href="{{ url_for('dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li>
|
|
<li class="active">Dashboard</li>
|
|
</ol>
|
|
</section>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<!-- Main content -->
|
|
<section class="content">
|
|
{% if current_user.role.name == 'Administrator' %}
|
|
<div class="row">
|
|
<div class="col-xs-3">
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<h3 class="box-title">Statistics</h3>
|
|
</div>
|
|
<div class="box-body">
|
|
<div class="row">
|
|
<div class="col-lg-6">
|
|
<!-- small box -->
|
|
<div class="small-box bg-aqua">
|
|
<div class="inner">
|
|
<h3>{{ domain_count }}</h3>
|
|
<p>{% if domain_count > 1 %}Domains{% else %}Domain{% endif %}</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="fa fa-book"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<a href="{{ url_for('admin_manageuser') }}">
|
|
<div class="small-box bg-green">
|
|
<div class="inner">
|
|
<h3>{{ users|length }}</h3>
|
|
<p>{% if users|length > 1 %}Users{% else %}User{% endif %}</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="fa fa-users"></i>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-lg-6">
|
|
<a href="{{ url_for('admin_history') }}">
|
|
<div class="small-box bg-green">
|
|
<div class="inner">
|
|
<h3>{{ history_number }}</h3>
|
|
<p>{% if history_number > 1 %}Histories{% else %}History{% endif %}</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="fa fa-calendar"></i>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<a href="{{ url_for('admin') }}">
|
|
<div class="small-box bg-green">
|
|
<div class="inner">
|
|
<h3><span style="font-size: 18px">{{ uptime|display_second_to_time }}</span></h3>
|
|
<p>Uptime</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="fa fa-clock-o"></i>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-9">
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<h3 class="box-title">Recent History</h3>
|
|
</div>
|
|
<div class="box-body">
|
|
<table id="tbl_history" class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Changed By</th>
|
|
<th>Content</th>
|
|
<th>Time</th>
|
|
<th>Detail</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for history in histories %}
|
|
<tr class="odd">
|
|
<td>{{ history.created_by }}</td>
|
|
<td>{{ history.msg }}</td>
|
|
<td>{{ history.created_on }}</td>
|
|
<td width="6%">
|
|
<button type="button" class="btn btn-flat btn-primary history-info-button" value='{{ history.detail|replace("[]","None") }}'>
|
|
Info <i class="fa fa-info"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<h3 class="box-title">Hosted Domains</h3>
|
|
</div>
|
|
<!-- /.box-header -->
|
|
<!--
|
|
{% if current_user.role.name == 'Administrator' %}
|
|
<div class="box-body">
|
|
<button type="button" class="btn btn-flat btn-primary" onclick="window.location.href='{{ url_for('domain_add') }}'">
|
|
New Domain <i class="fa fa-plus"></i>
|
|
</button>
|
|
</div>
|
|
{% endif %}
|
|
-->
|
|
<div class="box-body">
|
|
<table id="tbl_domain_list" class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>DNSSEC</th>
|
|
<th>Type</th>
|
|
<th>Serial</th>
|
|
<th>Master</th>
|
|
<th {% if current_user.role.name !='Administrator' %}width="6%"{% else %}width="20%"{% endif %}>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<!-- Content loaded via AJAX. -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- /.box-body -->
|
|
</div>
|
|
<!-- /.box -->
|
|
</div>
|
|
<!-- /.col -->
|
|
</div>
|
|
<!-- /.row -->
|
|
</section>
|
|
<!-- /.content -->
|
|
{% endblock %}
|
|
{% block extrascripts %}
|
|
<script>
|
|
// set up history data table
|
|
$("#tbl_history").DataTable({
|
|
"paging" : false,
|
|
"lengthChange" : false,
|
|
"searching" : false,
|
|
"ordering" : false,
|
|
"info" : false,
|
|
"autoWidth" : false
|
|
});
|
|
// set up domain list
|
|
$("#tbl_domain_list").DataTable({
|
|
"paging" : true,
|
|
"lengthChange" : true,
|
|
"searching" : true,
|
|
"ordering" : true,
|
|
"processing" : true,
|
|
"serverSide" : true,
|
|
"ajax" : "{{ url_for('dashboard_domains') }}",
|
|
"info" : false,
|
|
"autoWidth" : false,
|
|
{% if default_domain_table_size_setting in ['10','25','50','100'] %}
|
|
"lengthMenu": [ [10, 25, 50, 100, -1],
|
|
[10, 25, 50, 100, "All"]],
|
|
{% else %}
|
|
"lengthMenu": [ [10, 25, 50, 100, {{ default_domain_table_size_setting }}, -1],
|
|
[10, 25, 50, 100, {{ default_domain_table_size_setting }}, "All"]],
|
|
{% endif %}
|
|
"pageLength": {{ default_domain_table_size_setting }}
|
|
});
|
|
$(document.body).on('click', '.history-info-button', function() {
|
|
var modal = $("#modal_history_info");
|
|
var info = $(this).val();
|
|
$('#modal-code-content').html(json_library.prettyPrint(info));
|
|
modal.modal('show');
|
|
});
|
|
$(document.body).on("click", ".button_dnssec", function() {
|
|
var domain = $(this).prop('id');
|
|
getdnssec($SCRIPT_ROOT + '/domain/' + domain + '/dnssec');
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
{% block modals %}
|
|
<div class="modal fade" id="modal_history_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">History Details</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<pre><code id="modal-code-content"></code></pre>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-flat btn-default pull-right"
|
|
data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
</div>
|
|
<!-- /.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-flat btn-default pull-right"
|
|
data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
</div>
|
|
<!-- /.modal -->
|
|
{% endblock %}
|