pyfedi/app/templates/admin/instances.html
2024-12-27 20:20:16 +13:00

85 lines
4.2 KiB
HTML

{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
{% extends 'themes/' + theme() + '/base.html' %}
{% else %}
{% extends "base.html" %}
{% endif %}
{% from 'bootstrap/form.html' import render_form %}
{% set active_child = 'admin_instances' %}
{% block app_content %}
<div class="row">
<div class="col">
<h1>{{ title }}</h1>
<form method="get">
<input type="search" name="search"> <input type="submit" name="submit" value="Search">
</form>
Status Filter:
<a href="{{ url_for('admin.admin_instances', filter='online') }}">{{ _('Online') }}</a> |
<a href="{{ url_for('admin.admin_instances', filter='dormant') }}">{{ _('Dormant') }}</a> |
<a href="{{ url_for('admin.admin_instances', filter='gone_forever') }}">{{ _('Gone forever') }}</a> |
<a href="{{ url_for('admin.admin_instances', filter='trusted') }}">{{ _('Trusted') }}</a> |
<a href="{{ url_for('admin.admin_instances', filter='blocked') }}">{{ _('Blocked') }}</a>
<table class="table table-striped">
<tr>
<th>{{ _('Domain') }}</th>
<th>{{ _('Software') }}</th>
<th>{{ _('Version') }}</th>
<th title="{{ _('Known Communities') }}">{{ _('Communities') }}</th>
<th title="{{ _('Known Users') }}">{{ _('Users') }}</th>
<th>{{ _('Posts') }}</th>
<th>{{ _('Post Replies') }}</th>
<th>{{ _('Vote Weight') }}</th>
<th>{{ _('Trusted') }}</th>
<th title="{{ _('When an Activity was received from them') }}">{{ _('Seen') }}</th>
<th title="{{ _('When we successfully sent them an Activity') }}">{{ _('Sent') }}</th>
<th title="{{ _('How many times we failed to send (reset to 0 after every successful send)') }}">{{ _('Failed') }}</th>
<th title="{{ _('Instance Status - Online/Dormant/Gone Forever') }}">{{ _('Status') }}</th>
<th> </th>
</tr>
{% for instance in instances.items %}
<tr>
<td><a href="https://{{ instance.domain }}" rel="noopener nofollow noindex noreferrer">{{ instance.domain }}</a></td>
<td>{{ instance.software }}</td>
<td>{{ instance.version if instance.version }}</td>
<td>{{ instance.known_communities_count() }}</td>
<td>{{ instance.known_users_count() }}</td>
<td>{{ instance.post_count() }}</td>
<td>{{ instance.post_replies_count() }}</td>
<td>{{ instance.vote_weight }}</td>
<td>{{ _('Yes') if instance.trusted }}</td>
<td>{{ arrow.get(instance.last_seen).humanize(locale=locale) if instance.last_seen }}</td>
<td>{{ arrow.get(instance.last_successful_send).humanize(locale=locale) if instance.last_successful_send }}</td>
<td>{{ instance.failures }}</td>
{% if instance.gone_forever %}
<td>{{ _('Gone forever') }}</td>
{% elif instance.dormant %}
<td>{{ _('Dormant') }}</td>
{% else %}
<td>{{ _('Online') }}</td>
{% endif %}
<td><a href="{{ url_for('admin.admin_instance_edit', instance_id=instance.id) }}">{{ _('Edit') }}</a></td>
</tr>
{% endfor %}
</table>
<nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
</a>
{% endif %}
{% if next_url %}
<a href="{{ next_url }}" class="btn btn-primary">
{{ _('Next page') }} <span aria-hidden="true">&rarr;</span>
</a>
{% endif %}
</nav>
</div>
</div>
<hr />
<div class="row">
<div class="col">
{% include 'admin/_nav.html' %}
</div>
</div>
<hr />
{% endblock %}