debian-koji/www/kojiweb/templates/clusterhealth.html.j2
2025-05-07 14:07:04 +02:00

83 lines
2.3 KiB
Django/Jinja

#macro printOption(value, label=None)
#if not label
#set label = value
#endif
<option value="{{ value }}"{{ ' selected' if value == arch else '' }}>{{ label }}</option>
#endmacro
#include "header.html.j2"
<style>
span {
display: inline-block;
box-sizing: border-box;
height: 100%;
float: left;
padding: 0px;
text-overflow: ellipsis;
}
.graph {
height: 15px;
}
.free {
background: #00ff00;
text-align: right;
}
.busy {
background: #ff0000;
}
.count {
background: #0000ff;
color: #ffffff;
}
</style>
<h4>Cluster health</h4>
<table class="data-list">
<tr style="text-align: left">
<td colspan="3">
<form action="">
Architecture:
<select onchange="javascript: window.location = 'clusterhealth?arch=' + this.value + '{{ util.passthrough('order') }}';">
{{ printOption('__all__', 'all') }}
#for arch in arches
{{ printOption(arch) }}
#endfor
</select>
</form>
</td>
</tr>
<tr class="list-header">
<th>Channel</th>
<th>Load/Capacity</th>
<th>Builder readiness</th>
</tr>
#for channel in channels
#if channel['enabled_channel']
<tr>
<th>
<a href="channelinfo?channelID={{ channel.id }}">{{ channel.name }}</a>
</th>
<td width="{{ graphWidth }}" class="graph">
#if channel['capacityPerc']
<span style="width: {{ channel.capacityPerc }}%">
<span style="width: {{ channel.perc_load }}%" class="busy" title="Load: {{ channel.load|int }}"></span>
<span style="width: {{ 100 - channel.perc_load }}%" class="free" title="Free capacity: {{ (channel.capacity - channel.load)|int }}">{{ (100 - channel.perc_load)|int }}%&nbsp;</span>
</span>
#endif
</td>
<td width="{{ graphWidth }}" class="graph">
<span style="width: {{ channel.enabledPerc }}%">
<span style="width: {{ 100 - channel.perc_ready }}%" class="busy" title="Busy builders: {{ channel.enabled - channel.ready }}"></span>
<span style="width: {{ channel.perc_ready }}%" class="free" title="Ready builders: {{ channel.ready }}"">{{ channel.ready|int }}&nbsp;</span>
</span>
</td>
</tr>
#endif
#endfor
</table>
#include "footer.html.j2"