divide page to highlight error rate chart
This commit is contained in:
parent
a22071dffe
commit
9fe3733a1a
|
@ -72,6 +72,7 @@ def getMonit():
|
|||
output.append(server)
|
||||
|
||||
print(datetime.datetime.now())
|
||||
output.append({'url': u'https://monit.xxx.xxx', 'result': OrderedDict([(u'staging', 32), (u'monitoring1', 0)]), 's_rate': {'green': 70.0, 'red': 30.0}, 'name': u'MY Environment2'})
|
||||
return(output)
|
||||
|
||||
# Classes
|
||||
|
|
|
@ -3,7 +3,8 @@ $def with (output, now)
|
|||
<body onload="draw($output[0]['s_rate']);">
|
||||
$ errors = 0
|
||||
$ color = "green"
|
||||
|
||||
<div>
|
||||
<div style="height: 50%; overflow-y: scroll;">
|
||||
$for server in range(len(output)):
|
||||
$code:
|
||||
errors = 0
|
||||
|
@ -18,7 +19,7 @@ $for server in range(len(output)):
|
|||
$if errors > 0:
|
||||
$code:
|
||||
color = "red"
|
||||
<button class="accordion ${color}" onmouseenter="draw($output[server]['s_rate'])" >$output[server]['name']: $errors error(s)</button>
|
||||
<button class="accordion ${color}" onmouseenter="draw($output[server]['s_rate'])">$output[server]['name']: $errors error(s)</button>
|
||||
<div class="panel">
|
||||
|
||||
<br>
|
||||
|
@ -48,7 +49,7 @@ $for server in range(len(output)):
|
|||
$else:
|
||||
$code:
|
||||
color = "green"
|
||||
<button class="accordion ${color}">$output[server]['name']</button>
|
||||
<button class="accordion ${color}" onmouseenter="draw($output[server]['s_rate'])">$output[server]['name']</button>
|
||||
<div class="panel">
|
||||
|
||||
<br>
|
||||
|
@ -75,15 +76,17 @@ $for server in range(len(output)):
|
|||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br><br><br>
|
||||
|
||||
<div style="height: 45%; overflow: scroll;">
|
||||
<canvas id="canvas" width="400" height="400"></canvas>
|
||||
<br><br><br>
|
||||
Latest update: $now.day/$now.month/$now.year, $now.hour:$now.minute:$now.second
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
<canvas id="canvas" width="400" height="400"></canvas>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script src="static/monit-dashboard.js" type="text/javascript"></script>
|
||||
|
|
|
@ -8,7 +8,7 @@ $def with (content)
|
|||
<meta http-equiv="refresh" content="300">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body style="height: 100%; overflow: hidden;">
|
||||
|
||||
$:content
|
||||
|
||||
|
|
Loading…
Reference in a new issue