get chart values dynamically

This commit is contained in:
saravanan30erd 2019-08-21 17:51:02 +04:00
parent cb00899ec8
commit a22071dffe

View file

@ -3,6 +3,7 @@ $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"
$for server in range(len(output)): $for server in range(len(output)):
$code: $code:
errors = 0 errors = 0
@ -17,7 +18,7 @@ $for server in range(len(output)):
$if errors > 0: $if errors > 0:
$code: $code:
color = "red" color = "red"
<button class="accordion ${color}">$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>
@ -82,6 +83,7 @@ Latest update: $now.day/$now.month/$now.year, $now.hour:$now.minute:$now.second
<canvas id="canvas" width="400" height="400"></canvas> <canvas id="canvas" width="400" height="400"></canvas>
</body> </body>
<script src="static/monit-dashboard.js" type="text/javascript"></script> <script src="static/monit-dashboard.js" type="text/javascript"></script>