fix the canvas func onload issue

This commit is contained in:
saravanan30erd 2019-08-16 19:29:41 +04:00
parent bce596438f
commit ff76401ecd
3 changed files with 6 additions and 10 deletions

View File

@ -25,7 +25,6 @@ output = []
# Functions # Functions
def getMonit(): def getMonit():
output = [] output = []
xmlQuery = "/_status?format=xml" xmlQuery = "/_status?format=xml"
@ -61,7 +60,6 @@ def getMonit():
# Classes # Classes
class monitDashboard(web.application): class monitDashboard(web.application):
def run(self, port=8080, *middleware): def run(self, port=8080, *middleware):

View File

@ -1,11 +1,7 @@
$def with (output, now) $def with (output, now)
$ data = 0.5 $ data = 0.4
<html>
<head>
<script src="static/monit-dashboard.js" type="text/javascript"></script>
</head>
<body onload='draw($data);'> <body onload="draw($data);">
$ errors = 0 $ errors = 0
$ color = "green" $ color = "green"
$for server in range(len(output)): $for server in range(len(output)):
@ -86,5 +82,7 @@ Latest update: $now.day/$now.month/$now.year, $now.hour:$now.minute:$now.second
<br><br> <br><br>
<canvas id="canvas" width="400" height="400"></canvas> <canvas id="canvas" width="400" height="400"></canvas>
</body> </body>
</html>
<script src="static/monit-dashboard.js" type="text/javascript"></script>

View File

@ -15,4 +15,4 @@ $def with (content)
<a href="/">Home</a> | <a href="/help">Help</a> <a href="/">Home</a> | <a href="/help">Help</a>
</body> </body>
</html> </html>