monit-dashboard/templates/index.html

118 lines
4.2 KiB
HTML
Raw Normal View History

2019-12-10 07:12:50 +00:00
$def with (output, now)
2019-08-16 17:07:50 +00:00
<body onload="draw($output[0]['s_rate']);">
2020-01-26 23:21:03 +00:00
$ errors = 0
$ color = "green"
<div>
<div class="download-header">
<button class="download-button" onclick="window.location.href = 'download';">Download Report</button>
</div>
<div style="height: 100%;border-right:2px solid #ccc; padding:5px;overflow-x: hidden; float:left; width:48%">
$for server in range(len(output)):
2020-01-26 22:49:29 +00:00
$code:
errors = 0
color = "green"
2020-02-25 16:13:45 +00:00
$for _,v in output[server]['result'].items():
$for check in v.keys():
$ isError = v.get(check)
$if isError != 0:
$code:
errors=errors+1
2020-01-26 22:49:29 +00:00
$if errors > 0:
$code:
color = "red"
<button class="accordion ${color}" onmouseenter="draw($output[server]['s_rate'])">$output[server]['name']: $errors error(s)</button>
<div class="panel">
2020-01-26 22:49:29 +00:00
<br>
<table width=100%>
<thead class="server-link">
<tr><th colspan="2">
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
</th></tr>
</thead>
2020-02-25 16:13:45 +00:00
$for env, services in output[server]['result'].items():
<thead class="server-link">
<tr><th colspan="2">
<a href="$output[server]['url']" target="_blank">$env</a>
</th></tr>
</thead>
$for check in services.keys():
$ isError = services.get(check)
$if isError != 0:
<tr>
<td><a href="$output[server]['url']/$env-$check"
2020-02-26 06:55:05 +00:00
target="_blank" style="text-decoration:none;">$check</a></td>
<td><img src="static/img/error.png"></td>
2020-02-25 16:13:45 +00:00
</tr>
$else:
<tr>
2020-02-26 06:55:05 +00:00
<td><a href="$output[server]['url']/$env-$check"
target="_blank" style="text-decoration:none;">$check</a></td>
2020-02-25 16:13:45 +00:00
<td><img src="static/img/ok.png"></td>
</tr>
2020-01-26 22:49:29 +00:00
</table>
</div>
$else:
$code:
color = "green"
<button class="accordion ${color}" onmouseenter="draw($output[server]['s_rate'])">$output[server]['name']</button>
<div class="panel">
2020-01-26 22:49:29 +00:00
<br>
<table width=100%>
<thead class="server-link">
<tr><th colspan="2">
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
</th></tr>
</thead>
2020-02-25 16:13:45 +00:00
$for env, services in output[server]['result'].items():
<thead class="server-link">
<tr><th colspan="2">
<a href="$output[server]['url']" target="_blank">$env</a>
</th></tr>
</thead>
$for check in services.keys():
$ isError = services.get(check)
$if isError != 0:
<tr>
2020-02-26 06:55:05 +00:00
<td><a href="$output[server]['url']/$env-$check"
target="_blank" style="text-decoration:none;">$check</a></td>
<td><img src="static/img/error.png"></td>
2020-02-25 16:13:45 +00:00
</tr>
$else:
<tr>
2020-02-26 06:55:05 +00:00
<td><a href="$output[server]['url']/$env-$check"
target="_blank" style="text-decoration:none;">$check</a></td>
2020-02-25 16:13:45 +00:00
<td><img src="static/img/ok.png"></td>
</tr>
2020-01-26 22:49:29 +00:00
</table>
</div>
</div>
2020-01-26 23:21:03 +00:00
<div class="canvas-container">
<div class="canvas-graph">
<div class="canvas-header">
<h2 style="margin: 0">Hosts status</h2>
</div>
<canvas id="canvas" width="400" height="400"></canvas>
</div>
</div>
2019-10-04 09:29:56 +00:00
2020-01-26 23:21:03 +00:00
<div style="height: 10%; float:right">
<br><br><br>
Latest update: $now.day/$now.month/$now.year, $now.hour:$now.minute:$now.second
<br><br>
<a href="/">Home</a> | <a href="/help">Help</a>
</div>
2020-01-26 23:21:03 +00:00
</div>
</body>
2019-08-16 15:29:41 +00:00
<script src="static/monit-dashboard.js" type="text/javascript"></script>