74 lines
2.8 KiB
HTML
74 lines
2.8 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Kwapi monitoring</title>
|
|
<meta charset="utf-8">
|
|
<link rel="stylesheet" href="{{ url_for('v1.static', filename='design.css') }}"/>
|
|
<link rel="icon" type="image/png" href="{{ url_for('v1.static', filename='favicon.png') }}" />
|
|
<script src="{{ url_for('v1.static', filename='jquery-1.9.1.min.js') }}"></script>
|
|
<script type="text/javascript">
|
|
// <![CDATA[
|
|
function reloadImage(img) {
|
|
var src = img.attr('src');
|
|
param_position = src.indexOf('#a');
|
|
if(param_position != -1) {
|
|
src = src.substring(0, param_position);
|
|
}
|
|
src += '#' + Date.now();
|
|
img.attr('src', src);
|
|
}
|
|
|
|
function reloadAllImages() {
|
|
$('.graph').each(function() {
|
|
reloadImage($(this));
|
|
});
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
setInterval('reloadAllImages()', {{ refresh*1000 }});
|
|
});
|
|
// ]]>
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="header"><h1>Kwapi energy monitoring</h1></div>
|
|
<!-- Horizontal menu bar -->
|
|
<div class="menu">
|
|
<ul>
|
|
{% for label in scales %}
|
|
{% if label == scale %}
|
|
<li><a class="active" href="/last/{{ label }}/">{{ label }}</a></li>
|
|
{% else %}
|
|
<li><a href="/last/{{ label }}/">{{ label }}</a></li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="inner">
|
|
<!-- Scale view (all probes for one scale) -->
|
|
{% if view == 'scale' %}
|
|
{% if probes|count > 0 %}
|
|
<h2>Summary</h2>
|
|
<!-- Display summary graph -->
|
|
<img class="graph" id="summary" src="/graph/{{ scale }}/" alt="Summary graph"/>
|
|
<h2>Details</h2>
|
|
<!-- Display all probe graphs -->
|
|
{% for probe in probes %}
|
|
<a href="/probe/{{ probe }}"><img class="graph" src="/graph/{{ scale }}/{{ probe }}/" alt="Graph {{ probe }}"/></a>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p>No probes found.</p>
|
|
{% endif %}
|
|
|
|
<!-- Probe view (all scales for one probe) -->
|
|
{% elif view == 'probe' %}
|
|
<h2>{{ probe }}</h2>
|
|
{% for scale in scales %}
|
|
<img class="graph" src="/graph/{{ scale }}/{{ probe }}/" alt="Graph {{ probe }}"/>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
</body>
|
|
</html>
|