This commit is contained in:
Adrià 2020-01-27 00:21:03 +01:00
parent b6d9fc1a28
commit e3707750b4
7 changed files with 108 additions and 100 deletions

View file

@ -27,6 +27,7 @@ output = []
# Functions
def calculate_count(data):
count = {}
ls = data.values()
@ -78,6 +79,7 @@ def getMonit():
# Classes
class monitDashboard(web.application):
def run(self, port=8080, *middleware):
func = self.wsgifunc(*middleware)
@ -89,10 +91,12 @@ class index(object):
return render.index(output=getMonit(),
now=datetime.datetime.now())
class help(object):
def GET(self):
return render.help()
class download(object):
def GET(self):
filename = 'health_report.xlsx'
@ -104,6 +108,7 @@ class download(object):
web.header('Cache-Control', 'no-cache')
return open(filename, 'rb').read()
# Main
if __name__ == "__main__":
app = monitDashboard(urls, globals())

View file

@ -1,6 +1,7 @@
import xlsxwriter
import os
def generate_report_excel(output, filename):
if os.path.exists(filename):
os.remove(filename)

View file

@ -84,7 +84,9 @@ $for server in range(len(output)):
<div class="canvas-container">
<div class="canvas-graph">
<div class="canvas-header"><h2 style="margin: 0">Hosts status</h2></div>
<div class="canvas-header">
<h2 style="margin: 0">Hosts status</h2>
</div>
<canvas id="canvas" width="400" height="400"></canvas>
</div>
</div>