divide page to highlight error rate chart

This commit is contained in:
saravanan30erd 2019-08-22 12:52:18 +04:00
parent a22071dffe
commit 9fe3733a1a
4 changed files with 14 additions and 10 deletions

View file

@ -72,6 +72,7 @@ def getMonit():
output.append(server) output.append(server)
print(datetime.datetime.now()) 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) return(output)
# Classes # Classes

View file

@ -3,7 +3,8 @@ $def with (output, now)
<body onload="draw($output[0]['s_rate']);"> <body onload="draw($output[0]['s_rate']);">
$ errors = 0 $ errors = 0
$ color = "green" $ color = "green"
<div>
<div style="height: 50%; overflow-y: scroll;">
$for server in range(len(output)): $for server in range(len(output)):
$code: $code:
errors = 0 errors = 0
@ -18,7 +19,7 @@ $for server in range(len(output)):
$if errors > 0: $if errors > 0:
$code: $code:
color = "red" 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"> <div class="panel">
<br> <br>
@ -48,7 +49,7 @@ $for server in range(len(output)):
$else: $else:
$code: $code:
color = "green" 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"> <div class="panel">
<br> <br>
@ -75,15 +76,17 @@ $for server in range(len(output)):
</table> </table>
</div> </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 Latest update: $now.day/$now.month/$now.year, $now.hour:$now.minute:$now.second
<br><br> <br><br>
</div>
<canvas id="canvas" width="400" height="400"></canvas> </div>
</body> </body>
<script src="static/monit-dashboard.js" type="text/javascript"></script> <script src="static/monit-dashboard.js" type="text/javascript"></script>

View file

@ -8,7 +8,7 @@ $def with (content)
<meta http-equiv="refresh" content="300"> <meta http-equiv="refresh" content="300">
</head> </head>
<body> <body style="height: 100%; overflow: hidden;">
$:content $:content