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