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,27 +48,41 @@ $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():
|
||||||
<thead class="inner-rows">
|
$ errors = 0
|
||||||
<tr><th colspan="2">
|
|
||||||
<a href="$output[server]['url']" target="_blank">$env</a>
|
|
||||||
</th></tr>
|
|
||||||
</thead>
|
|
||||||
<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>
|
$ errors=errors+1
|
||||||
<td><a href="$output[server]['url']/$env-$check"
|
$if errors > 0:
|
||||||
target="_blank" style="text-decoration:none;">$check</a></td>
|
$ color = "red"
|
||||||
<td><img src="static/img/error.png"></td>
|
<thead class="inner-rows">
|
||||||
</tr>
|
<tr><th class="th-custom ${color}" colspan="2">
|
||||||
$else:
|
<a style="color: white">$env</a>
|
||||||
<tr>
|
</th></tr>
|
||||||
<td><a href="$output[server]['url']/$env-$check"
|
</thead>
|
||||||
target="_blank" style="text-decoration:none; color:black;">$check</a></td>
|
<tbody class="toggle-id">
|
||||||
<td><img src="static/img/ok.png"></td>
|
$for check in services.keys():
|
||||||
</tr>
|
$ isError = services.get(check)
|
||||||
</tbody>
|
$if isError != 0:
|
||||||
|
$:row_error(check)
|
||||||
|
$else:
|
||||||
|
$: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>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
$else:
|
$else:
|
||||||
|
@ -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