haproxy-wi/app/templates/metrics.html

78 lines
1.9 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% block content %}
<style>
2018-08-06 13:59:39 +00:00
table, th, tr, td {
border: 1px solid #ddd;
align: center;
text-align: center;
}
th, tr, td {
width: 6%;
2019-10-06 06:31:56 +00:00
min-width: 3%;
2018-08-06 13:59:39 +00:00
padding: 10px;
2019-10-05 20:41:07 +00:00
}
</style>
2019-10-05 21:30:16 +00:00
<link href="/inc/chart.min.css" rel="stylesheet">
2019-10-05 20:41:07 +00:00
<script src="/inc/metrics.js"></script>
2019-10-05 21:30:16 +00:00
<script src="/inc/chart.min.js"></script>
{% if services == '* is not installed' %}
<center>
<br />
<h3>You do not have installed Metrics service
Read <a href="https://haproxy-wi.org/services.py?service=metrics#installation" title="Metrics installation" style="color: #5d9ceb;" target="_blank">hear</a>
how to install Metrics service</h3>
</center>
{% else %}
{% if servers|length == 0 %}
{% include 'include/getstarted.html' %}
{% else %}
<div id="table_metrics"></div>
<div style="padding-left: 25px;float: left;margin-top: 6px;">
<b>Time range:</b>
<select title="Choose time range" id="time-range">
<option value="30">30 minutes</option>
<option value="60">1 hour</option>
<option value="180">3 hours</option>
<option value="360">6 hours</option>
<option value="720">12 hours</option>
</select>
</div>
<div id="refresh" style="text-align: right;margin-top: 20px;margin-right: 10px;" title="Refresh metrics" onclick="showMetrics()">
<span class="service-reload"></span>
</div>
2019-10-05 20:41:07 +00:00
{% for s in servers %}
<div class="chart-container">
<canvas id="{{s.0}}" role="img"></canvas>
</div>
2019-10-05 20:41:07 +00:00
{% endfor %}
2018-08-06 16:18:12 +00:00
<script>
function showMetrics() {
let metrics = new Promise(
(resolve, reject) => {
{% for s in servers %}
getChartData('{{s.0}}')
{% endfor %}
loadMetrics()
});
metrics.then();
}
showMetrics()
$( function() {
$("#time-range").on('selectmenuchange', function () {
removeData()
let metrics = new Promise(
(resolve, reject) => {
{% for s in servers %}
getChartData('{{s.0}}')
{% endfor %}
});
metrics.then();
});
});
</script>
{% endif %}
{% endif %}
{% endblock %}