organize the code using function
This commit is contained in:
parent
f271a9d711
commit
b9c5991194
|
@ -10,6 +10,11 @@ th {
|
|||
padding: 10px;
|
||||
}
|
||||
|
||||
.th-custom {
|
||||
padding: 10px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
td {
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 15px;
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
$def with (output, now)
|
||||
|
||||
$def row_error(check):
|
||||
<tr>
|
||||
<td><a href="$output[server]['url']/$env-$check"
|
||||
target="_blank" style="text-decoration:none;">$check</a></td>
|
||||
<td><img src="static/img/error.png"></td>
|
||||
</tr>
|
||||
|
||||
$def row_ok(check):
|
||||
<tr>
|
||||
<td><a href="$output[server]['url']/$env-$check"
|
||||
target="_blank" style="text-decoration:none; color:black;">$check</a></td>
|
||||
<td><img src="static/img/ok.png"></td>
|
||||
</tr>
|
||||
|
||||
<body onload="draw($output[0]['s_rate']);">
|
||||
$ errors = 0
|
||||
$ color = "green"
|
||||
|
@ -34,26 +48,40 @@ $def with (output, now)
|
|||
</th></tr>
|
||||
</thead>
|
||||
$for env, services in output[server]['result'].items():
|
||||
$ errors = 0
|
||||
$for check in services.keys():
|
||||
$ isError = services.get(check)
|
||||
$if isError != 0:
|
||||
$ errors=errors+1
|
||||
$if errors > 0:
|
||||
$ color = "red"
|
||||
<thead class="inner-rows">
|
||||
<tr><th colspan="2">
|
||||
<a href="$output[server]['url']" target="_blank">$env</a>
|
||||
<tr><th class="th-custom ${color}" colspan="2">
|
||||
<a style="color: white">$env</a>
|
||||
</th></tr>
|
||||
</thead>
|
||||
<tbody class="toggle-id">
|
||||
$for check in services.keys():
|
||||
$ isError = services.get(check)
|
||||
$if isError != 0:
|
||||
<tr>
|
||||
<td><a href="$output[server]['url']/$env-$check"
|
||||
target="_blank" style="text-decoration:none;">$check</a></td>
|
||||
<td><img src="static/img/error.png"></td>
|
||||
</tr>
|
||||
$:row_error(check)
|
||||
$else:
|
||||
<tr>
|
||||
<td><a href="$output[server]['url']/$env-$check"
|
||||
target="_blank" style="text-decoration:none; color:black;">$check</a></td>
|
||||
<td><img src="static/img/ok.png"></td>
|
||||
</tr>
|
||||
$:row_ok(check)
|
||||
</tbody>
|
||||
$else:
|
||||
$ color = "green"
|
||||
<thead class="inner-rows">
|
||||
<tr><th class="th-custom ${color}" colspan="2">
|
||||
<a style="color: white">$env</a>
|
||||
</th></tr>
|
||||
</thead>
|
||||
<tbody class="toggle-id">
|
||||
$for check in services.keys():
|
||||
$ isError = services.get(check)
|
||||
$if isError != 0:
|
||||
$:row_error(check)
|
||||
$else:
|
||||
$:row_ok(check)
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -79,17 +107,9 @@ $def with (output, now)
|
|||
$for check in services.keys():
|
||||
$ isError = services.get(check)
|
||||
$if isError != 0:
|
||||
<tr>
|
||||
<td><a href="$output[server]['url']/$env-$check"
|
||||
target="_blank" style="text-decoration:none;">$check</a></td>
|
||||
<td><img src="static/img/error.png"></td>
|
||||
</tr>
|
||||
$:row_error(check)
|
||||
$else:
|
||||
<tr>
|
||||
<td><a href="$output[server]['url']/$env-$check"
|
||||
target="_blank" style="text-decoration:none; color:black;">$check</a></td>
|
||||
<td><img src="static/img/ok.png"></td>
|
||||
</tr>
|
||||
$:row_ok(check)
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue