pull/161/head
Pavel Loginov 2019-10-06 09:31:56 +03:00
parent 4a1a4008b5
commit dd310f0404
5 changed files with 22 additions and 17 deletions

View File

@ -453,7 +453,10 @@ if form.getvalue('new_metrics'):
sess_rate = '' sess_rate = ''
for i in metric: for i in metric:
labels += str(i[5].split(' ')[1])+',' label = str(i[5])
label = label.split(' ')[1]
label = label.split(':')
labels += label[0]+':'+label[1]+','
curr_con += str(i[1])+',' curr_con += str(i[1])+','
curr_ssl_con += str(i[2])+',' curr_ssl_con += str(i[2])+','
sess_rate += str(i[3])+',' sess_rate += str(i[3])+','

View File

@ -1,6 +1,6 @@
<table> <table style="min-width: 40%;">
<tr class="overviewHead"> <tr class="overviewHead">
<th colspan=13>Metrics</th> <th colspan=13 style="background-color: #d1ecf1">Metrics</th>
</tr> </tr>
<tr> <tr>
<th class="padding10 first-collumn overviewTr" rowspan=2>Server</th> <th class="padding10 first-collumn overviewTr" rowspan=2>Server</th>

View File

@ -1,10 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<style> <style>
iframe {
border: none;
padding: 10px;
}
table, th, tr, td { table, th, tr, td {
border: 1px solid #ddd; border: 1px solid #ddd;
align: center; align: center;
@ -12,6 +8,7 @@ table, th, tr, td {
} }
th, tr, td { th, tr, td {
width: 6%; width: 6%;
min-width: 3%;
padding: 10px; padding: 10px;
} }
</style> </style>
@ -20,16 +17,19 @@ th, tr, td {
<script src="/inc/chart.min.js"></script> <script src="/inc/chart.min.js"></script>
<div id="table_metrics"></div> <div id="table_metrics"></div>
{% for s in servers %} {% for s in servers %}
<div class="chart-container" style=""> <div class="chart-container">
<canvas id="{{s.0}}" role="img"></canvas> <canvas id="{{s.0}}" role="img"></canvas>
</div> </div>
<script>
getChartData('{{s.0}}')
</script>
{% endfor %} {% endfor %}
<div id="metrics_iframe"></div> <div id="metrics_iframe"></div>
<script> <script>
function showMetrics() {
{% for s in servers %}
getChartData('{{s.0}}')
{% endfor %}
}
showMetrics()
loadMetrics() loadMetrics()
</script> </script>
{% endblock %} {% endblock %}

View File

@ -30,15 +30,18 @@
<script src="/inc/chart.min.js"></script> <script src="/inc/chart.min.js"></script>
{% for s in servers %} {% for s in servers %}
<div class="chart-container" style=""> <div class="chart-container">
<canvas id="{{s.0}}" role="img"></canvas> <canvas id="{{s.0}}" role="img"></canvas>
</div> </div>
<script>
getWafChartData('{{s.0}}')
</script>
{% endfor %} {% endfor %}
<script> <script>
showOverviewWaf() function showWafMetrics() {
{% for s in servers %}
getWafChartData('{{s.0}}')
{% endfor %}
}
showWafMetrics()
showOverviewWaf()
</script> </script>
{% endblock %} {% endblock %}

View File

@ -6,7 +6,6 @@ requests_toolbelt==0.8.0
pyTelegramBotAPI==3.6.3 pyTelegramBotAPI==3.6.3
dump==0.0.4 dump==0.0.4
networkx==2.1 networkx==2.1
numpy==1.14.0
matplotlib==2.1.2 matplotlib==2.1.2
future==0.13.1 future==0.13.1
mysql-connector-python==8.0.11 mysql-connector-python==8.0.11