168 lines
7.5 KiB
Django/Jinja
168 lines
7.5 KiB
Django/Jinja
|
|
#macro headerState(state)
|
|
#if state == 'enabled'
|
|
Enabled hosts
|
|
#elif state == 'disabled'
|
|
Disabled hosts
|
|
#else
|
|
Hosts
|
|
#endif
|
|
#endmacro
|
|
|
|
#macro headerReady(ready)
|
|
#if ready == 'ready'
|
|
which are ready
|
|
#elif ready == 'notready'
|
|
which are not ready
|
|
#endif
|
|
#endmacro
|
|
|
|
#macro headerArch(arch)
|
|
#if arch == 'all'
|
|
on all arches
|
|
#else
|
|
on {{ arch }} arch
|
|
#endif
|
|
#endmacro
|
|
|
|
#macro headerChannel(channel)
|
|
#if channel == 'all'
|
|
in all channels
|
|
#else
|
|
in {{ channel }} channel
|
|
#endif
|
|
#endmacro
|
|
|
|
#set _PASSTHROUGH = ['state', 'order', 'ready', 'channel', 'arch']
|
|
|
|
#include "includes/header.html.j2"
|
|
|
|
<h4>{{ headerState(state) }} {{ headerReady(ready) }} {{ headerArch(arch) }} {{ headerChannel(channel) }}</h4>
|
|
<table class="data-list">
|
|
<tr>
|
|
<td colspan="9">
|
|
<table class="nested">
|
|
<tr><td>
|
|
<strong>State</strong>:
|
|
</td><td>
|
|
<select name="state" class="filterlist" onchange="javascript: window.location = 'hosts?state=' + this.value + '{{ util.passthrough_except('state') }}';">
|
|
<option value="enabled" {{ 'selected' if state == 'enabled' else '' }}>enabled</option>
|
|
<option value="disabled" {{ 'selected' if state == 'disabled' else '' }}>disabled</option>
|
|
<option value="all" {{ 'selected' if state == 'all' else '' }}>all</option>
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<strong>Channels</strong>:
|
|
</td><td>
|
|
<select name="channel" class="filterlist" onchange="javascript: window.location = 'hosts?channel=' + this.value + '{{ util.passthrough_except('channel') }}';">
|
|
<option value="all" {{ 'selected' if not channel else '' }}>all</option>
|
|
#for chan in channels
|
|
<option value="{{ chan.name }}" {{ 'selected' if chan.name == channel else '' }}>{{ chan.name }}</option>
|
|
#endfor
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr><td>
|
|
<strong>Ready</strong>:
|
|
</td><td>
|
|
<select name="ready" class="filterlist" onchange="javascript: window.location = 'hosts?ready=' + this.value + '{{ util.passthrough_except('ready') }}';">
|
|
<option value="yes" {{ 'selected' if ready == 'yes' else '' }}>yes</option>
|
|
<option value="no" {{ 'selected' if ready == 'no' else '' }}>no</option>
|
|
<option value="all" {{ 'selected' if ready== 'all' else '' }}>all</option>
|
|
</select>
|
|
</td><td>
|
|
<strong>Arches</strong>:
|
|
</td><td>
|
|
<select name="arch" class="filterlist" onchange="javascript: window.location = 'hosts?arch=' + this.value + '{{ util.passthrough_except('arch') }}';">
|
|
<option value="all" {{ 'selected' if not arch else '' }}>all</option>
|
|
#for arch_item in arches
|
|
<option value="{{ arch_item }}" {{ 'selected' if arch_item == arch else '' }}>{{ arch_item }}</option>
|
|
#endfor
|
|
</select>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paginate" colspan="9">
|
|
#if (hostPages |length) > 1
|
|
<form class="pageJump" action="">
|
|
Page:
|
|
<select onchange="javascript: window.location = 'hosts?start=' + this.value * {{ hostRange }} + '{{ util.passthrough_except() }}';">
|
|
#for pageNum in hostPages
|
|
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
|
#endfor
|
|
</select>
|
|
</form>
|
|
#endif
|
|
#if hostStart > 0
|
|
<a href="hosts?start={{ hostStart - hostRange }}{{ util.passthrough_except() }}"><<<</a>
|
|
#endif
|
|
#if totalHosts != 0
|
|
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
|
#endif
|
|
#if hostStart + hostCount < totalHosts
|
|
<a href="hosts?start={{ hostStart + hostRange }}{{ util.passthrough_except() }}">>>></a>
|
|
#endif
|
|
</td>
|
|
</tr>
|
|
<tr class="list-header">
|
|
<th><a href="hosts?order={{ util.toggleOrder('id') }}{{ util.passthrough_except('order') }}">ID</a> {{ util.sortImage('id') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('name') }}{{ util.passthrough_except('order') }}">Name</a> {{ util.sortImage('name') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('arches') }}{{ util.passthrough_except('order') }}">Arches</a> {{ util.sortImage('arches') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('channels') }}{{ util.passthrough_except('order') }}">Channels</a> {{ util.sortImage('channels') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('enabled') }}{{ util.passthrough_except('order') }}">Enabled?</a> {{ util.sortImage('enabled') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('ready') }}{{ util.passthrough_except('order') }}">Ready?</a> {{ util.sortImage('ready') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('task_load') }}{{ util.passthrough_except('order') }}">Load</a> {{ util.sortImage('task_load') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('capacity') }}{{ util.passthrough_except('order') }}">Cap.</a> {{ util.sortImage('capacity') }}</th>
|
|
<th><a href="hosts?order={{ util.toggleOrder('last_update') }}{{ util.passthrough_except('order') }}">Last Update</a> {{ util.sortImage('last_update') }}</th>
|
|
</tr>
|
|
#if (hosts |length) > 0
|
|
#for host in hosts
|
|
<tr class="{{ util.rowToggle() }}">
|
|
<td>{{ host.id }}</td>
|
|
<td><a href="hostinfo?hostID={{ host.id }}">{{ host.name }}</a></td>
|
|
<td>{{ host.arches }}</td>
|
|
<td>
|
|
#for channame, chan_id, chan_enabled in zip(host.channels, host.channels_id, host.channels_enabled)
|
|
<a href="channelinfo?channelID={{ chan_id }}" class="{{ chan_enabled }}">{{ channame }}</a>
|
|
#endfor
|
|
</td>
|
|
<td class="{{ 'true' if host.enabled else 'false' }}">{{ util.imageTag('yes') if host.enabled else util.imageTag('no') }}</td>
|
|
<td class="{{ 'true' if host.ready else 'false' }}">{{ util.imageTag('yes') if host.ready else util.imageTag('no') }}</td>
|
|
<td>{{ '%.2f' % host.task_load }}</td>
|
|
<td>{{ host.capacity }}</td>
|
|
<td>{{ util.formatTime(host.last_update) }}</td>
|
|
</tr>
|
|
#endfor
|
|
#else
|
|
<tr class="row-odd">
|
|
<td colspan="9">No hosts</td>
|
|
</tr>
|
|
#endif
|
|
<tr>
|
|
<td class="paginate" colspan="9">
|
|
#if (hostPages |length) > 1
|
|
<form class="pageJump" action="">
|
|
Page:
|
|
<select onchange="javascript: window.location = 'hosts?start=' + this.value * {{ hostRange }} + '{{ util.passthrough_except() }}';">
|
|
#for pageNum in hostPages
|
|
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
|
#endfor
|
|
</select>
|
|
</form>
|
|
#endif
|
|
#if hostStart > 0
|
|
<a href="hosts?start={{ hostStart - hostRange }}{{ util.passthrough_except() }}"><<<</a>
|
|
#endif
|
|
#if totalHosts != 0
|
|
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
|
#endif
|
|
#if hostStart + hostCount < totalHosts
|
|
<a href="hosts?start={{ hostStart + hostRange }}{{ util.passthrough_except() }}">>>></a>
|
|
#endif
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
#include "includes/footer.html.j2"
|