add granular view in frontend

This commit is contained in:
saravanan30erd 2020-02-25 20:13:45 +04:00
parent 0bdf6d0f58
commit a0ccc34f2a
2 changed files with 47 additions and 34 deletions

View file

@ -83,8 +83,8 @@ def getMonit():
count = calculate_count(s_checks)
server = dict(name=site, url=s['url'],
result=s_checks, s_rate=count)
print(server)
output.append(server)
#print(output)
print(datetime.datetime.now())
return(output)

View file

@ -13,8 +13,9 @@ $def with (output, now)
errors = 0
color = "green"
$for check in output[server]['result'].keys():
$ isError = output[server]['result'].get(check)
$for _,v in output[server]['result'].items():
$for check in v.keys():
$ isError = v.get(check)
$if isError != 0:
$code:
errors=errors+1
@ -32,11 +33,17 @@ $def with (output, now)
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
</th></tr>
</thead>
$for check in output[server]['result'].keys():
$ isError = output[server]['result'].get(check)
$for env, services in output[server]['result'].items():
<thead class="server-link">
<tr><th colspan="2">
<a href="$output[server]['url']" target="_blank">$env</a>
</th></tr>
</thead>
$for check in services.keys():
$ isError = services.get(check)
$if isError != 0:
<tr>
<td><a href="$output[server]['url']/$check"
<td><a href="$output[server]['url']/$env-$check"
target="_blank">$check</a></td>
<td><a href="$output[server]['url']/$check"
target="_blank"><img src="static/img/error.png"></a></td>
@ -62,8 +69,14 @@ $def with (output, now)
<a href="$output[server]['url']" target="_blank">$output[server]['name']</a>
</th></tr>
</thead>
$for check in output[server]['result'].keys():
$ isError = output[server]['result'].get(check)
$for env, services in output[server]['result'].items():
<thead class="server-link">
<tr><th colspan="2">
<a href="$output[server]['url']" target="_blank">$env</a>
</th></tr>
</thead>
$for check in services.keys():
$ isError = services.get(check)
$if isError != 0:
<tr>
<td><a href="$output[server]['url']/$check"