This commit is contained in:
Adrià 2020-01-26 23:42:32 +01:00
parent fad4a5dcb5
commit 884143cbe9
3 changed files with 146 additions and 144 deletions

View file

@ -97,8 +97,8 @@ div.panel.show {
width: 50%;
display: flex;
justify-content: center;
margin-top:200;
margin-bottom:100;
margin-top: 200;
margin-bottom: 100;
}
.canvas-graph {
@ -108,7 +108,7 @@ div.panel.show {
position: relative;
background-color: white;
margin: 20px 0;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)
}
.canvas-header {

View file

@ -1,14 +1,14 @@
$def with (output, now)
<body onload="draw($output[0]['s_rate']);">
$ errors = 0
$ color = "green"
<div>
<div class="download-header">
$ 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)):
</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)):
$code:
errors = 0
color = "green"
@ -28,18 +28,18 @@ $for server in range(len(output)):
<br>
<table width=100%>
<thead class="server-link">
<tr><th colspan="2">
<tr>
<th colspan="2">
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
</th></tr>
</th>
</tr>
</thead>
$for check in output[server]['result'].keys():
$ isError = output[server]['result'].get(check)
$if isError != 0:
<tr>
<td><a href="$output[server]['url']/$check"
target="_blank">$check</a></td>
<td><a href="$output[server]['url']/$check"
target="_blank"><img src="static/img/error.png"></a></td>
<td><a href="$output[server]['url']/$check" target="_blank">$check</a></td>
<td><a href="$output[server]['url']/$check" target="_blank"><img src="static/img/error.png"></a></td>
</tr>
$else:
<tr>
@ -58,18 +58,18 @@ $for server in range(len(output)):
<br>
<table width=100%>
<thead class="server-link">
<tr><th colspan="2">
<tr>
<th colspan="2">
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
</th></tr>
</th>
</tr>
</thead>
$for check in output[server]['result'].keys():
$ isError = output[server]['result'].get(check)
$if isError != 0:
<tr>
<td><a href="$output[server]['url']/$check"
target="_blank">$check</a></td>
<td><a href="$output[server]['url']/$check"
target="_blank"><img src="static/img/error.png"></a></td>
<td><a href="$output[server]['url']/$check" target="_blank">$check</a></td>
<td><a href="$output[server]['url']/$check" target="_blank"><img src="static/img/error.png"></a></td>
</tr>
$else:
<tr>
@ -79,24 +79,26 @@ $for server in range(len(output)):
</table>
</div>
</div>
</div>
<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>
<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>
<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>
<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>
</div>
</div>
</body>
<script src="static/monit-dashboard.js" type="text/javascript"></script>