Merge pull request #16 from adriaaah/small-beautify

Beautify
This commit is contained in:
adriaaah 2020-01-27 00:22:33 +01:00 committed by GitHub
commit b136bbeb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>