Convert admin console (stats and configurations) to new template.

This commit is contained in:
Ivan Filippov 2016-04-23 10:49:35 -06:00
parent 0dc5664f63
commit 2dc7f26b76

View File

@ -1,232 +1,118 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block head %}
{{ super() }}
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='global/plugins/select2/select2.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css') }}"/>
<!-- END PAGE LEVEL PLUGIN 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 - Admin Console</title>{% endblock %} {% block title %}<title>DNS Control Panel - Admin Console</title>{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<!-- BEGIN PAGE HEADER--> <!-- Content Header (Page header) -->
<h3 class="page-title"> <section class="content-header">
Admin Console</h3> <h1>
<div class="page-bar"> History <small>Recent PowerDNS-Admin events</small>
<ul class="page-breadcrumb"> </h1>
<li> <ol class="breadcrumb">
<i class="fa fa-home"></i> <li><a href="{{ url_for('dashboard') }}"><i
<a href="{{ url_for('dashboard') }}">Home</a> class="fa fa-dashboard"></i> Home</a></li>
<i class="fa fa-angle-right"></i> <li class="active">Admin Console</li>
</li> </ol>
<li> </section>
<a href="#">Admin Console</a>
</li>
</ul>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN DASHBOARD STATS -->
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<a class="dashboard-stat dashboard-stat-light blue-soft" href="javascript:;">
<div class="visual">
<i class="fa fa-cloud"></i>
</div>
<div class="details">
<div class="number">
{{ domains|length }}
</div>
<div class="desc">
{% if domains|length > 1 %}Domains{% else %}Domain{% endif %}
</div>
</div>
</a>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<a class="dashboard-stat dashboard-stat-light green-soft" href="javascript:;">
<div class="visual">
<i class="fa fa-user"></i>
</div>
<div class="details">
<div class="number">
{{ users|length }}
</div>
<div class="desc">
{% if users|length > 1 %}Users{% else %}User{% endif %}
</div>
</div>
</a>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<a class="dashboard-stat dashboard-stat-light purple-soft" href="javascript:;">
<div class="visual">
<i class="fa fa-exclamation-triangle"></i>
</div>
<div class="details">
<div class="number">
{{ history_number }}
</div>
<div class="desc">
{% if history_number > 1 %}Histories{% else %}History{% endif %}
</div>
</div>
</a>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<a class="dashboard-stat dashboard-stat-light red-soft" href="javascript:;">
<div class="visual">
<i class="fa fa-star"></i>
</div>
<div class="details">
<div class="number">
{{ uptime|display_second_to_time }}
</div>
<div class="desc">
Uptime
</div>
</div>
</a>
</div>
</div>
<!-- END DASHBOARD STATS -->
{% 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"> <div class="box-header">
<!-- BEGIN SERVER STATISTICS --> <h3 class="box-title">Statistics</h3>
<div class="portlet box grey-cascade"> </div>
<div class="portlet-title"> <div class="box-body">
<div class="caption"> <table id="tbl_statistics" class="table table-bordered table-striped">
<i class="fa fa-sliders"></i>Server Statistics <thead>
</div> <tr>
<div class="tools"> <th width="6%">Docs</th>
<a href="javascript:;" class="reload"> <th>Statistic</th>
</a> <th>Value</th>
<a href="javascript:;" class="collapse"> </tr>
</a> </thead>
</div> <tbody>
</div> {% for statistic in statistics %}
<div class="portlet-body"> <tr class="odd gradeX">
<table class="table table-striped table-bordered table-hover" id="tb_stastic_list"> <td><a
<thead> href="https://google.com/search?q=site:doc.powerdns.com+{{ statistic['name'] }}"
<tr> target="_blank" class="btn btn-xs blue"><i
<th width="6%"> class="fa fa-search"></i></a></td>
Docs <td>{{ statistic['name'] }}</td>
</th> <td>{{ statistic['value'] }}</td>
<th> </tr>
Statistic {% endfor %}
</th> </tbody>
<th> </table>
Value </div>
</th> <!-- /.box-body -->
</tr> </div>
</thead> <!-- /.box -->
<tbody> </div>
{% for statistic in statistics %} <!-- /.col -->
<tr class="odd gradeX"> </div>
<td> <!-- /.row -->
<a href="https://google.com/search?q=site:doc.powerdns.com+{{ statistic['name'] }}" target="_blank" class="btn btn-xs blue"><i class="fa fa-search"></i></a> <div class="row">
</td> <div class="col-xs-12">
<td> <div class="box">
{{ statistic['name'] }} <div class="box-header">
</td> <h3 class="box-title">Configuration</h3>
<td> </div>
{{ statistic['value'] }} <div class="box-body">
</td> <table id="tbl_configuration" class="table table-bordered table-striped">
</tr> <thead>
{% endfor %} <tr>
</tbody> <th width="6%">Docs</th>
</table> <th>Statistic</th>
</div> <th>Value</th>
</div> </tr>
<!-- END SERVER STATISTICS --> </thead>
</div> <tbody>
</div> {% for config in configs %}
<tr class="odd gradeX">
<div class="row"> <td><a
<div class="col-md-12"> href="https://google.com/search?q=site:doc.powerdns.com+{{ config['name'] }}"
<!-- BEGIN SERVER CONFIGURATION TABLE --> target="_blank" class="btn btn-xs blue"><i
<div class="portlet box grey-cascade"> class="fa fa-search"></i></a></td>
<div class="portlet-title"> <td>{{ config['name'] }}</td>
<div class="caption">
<i class="fa fa-gears"></i>Server Configuration
</div>
<div class="tools">
<a href="javascript:;" class="reload">
</a>
<a href="javascript:;" class="collapse">
</a>
</div>
</div>
<div class="portlet-body">
<table class="table table-striped table-bordered table-hover" id="tb_config_list">
<thead>
<tr>
<th width="6%">
Docs
</th>
<th>
Name
</th>
<th>
Value
</th>
</tr>
</thead>
<tbody>
{% for config in configs %}
<tr class="odd gradeX">
<td>
<a href="https://google.com/search?q=site:doc.powerdns.com+{{ config['name'] }}" target="_blank" class="btn btn-xs blue"><i class="fa fa-search"></i></a>
</td>
<td>
{{ config['name'] }}
</td>
<td> <td>
{{ config['value'] }} {{ config['value'] }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> <!-- /.box-body -->
<!-- END SERVER CONFIGURATION TABLE --> </div>
</div> <!-- /.box -->
</div> </div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
{% endblock %} {% endblock %}
{% block extrascripts %}
{% block scripts %}
{{ super() }}
<!-- 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>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- TABLE PLUGINS -->
<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/datatables/media/js/jquery.dataTables.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js') }}"></script>
<script src="{{ url_for('static', filename='admin/pages/scripts/table-managed.js') }}"></script>
<!-- END TABLE PLUGINS -->
<script> <script>
jQuery(document).ready(function() { // set up statistics data table
Metronic.init(); // init metronic core componets $("#tbl_statistics").DataTable({
Layout.init(); // init layout "paging" : true,
TableManaged.init(); "lengthChange" : false,
"searching" : true,
"ordering" : true,
"info" : true,
"autoWidth" : false
});
// set up configuration data table
$("#tbl_configuration").DataTable({
"paging" : true,
"lengthChange" : false,
"searching" : true,
"ordering" : true,
"info" : true,
"autoWidth" : false
}); });
</script> </script>
<!-- END JAVASCRIPTS -->
{% endblock %} {% endblock %}