haproxy-wi/app/templates/metrics.html

58 lines
1.4 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>
<h4 style="font-size: 25px">Welcome and let's get started!</h4>
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 it
</center>
{% else %}
{% if servers|length == 0 %}
{% include 'include/getstarted.html' %}
{% else %}
<div id="table_metrics"></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>
<div id="sortable">
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 %}
</div>
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()
</script>
{% endif %}
{% endif %}
{% endblock %}