pyfedi/app/templates/admin/instances.html

132 lines
8.5 KiB
HTML
Raw Normal View History

2024-09-04 19:45:44 -04:00
{% 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>
2025-01-02 15:36:46 +01:00
<form id="searchInstances" method="get">
<input type="search" name="search" placeholder="{{ _('Search') }}" value="{{ search }}">
<input type="submit" name="submit" value="{{ _('Search') }}">
2024-09-04 19:45:44 -04:00
</form>
2024-09-05 00:00:48 -04:00
Status Filter:
2024-09-24 11:33:49 +12:00
<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> |
2024-12-27 20:20:16 +13:00
<a href="{{ url_for('admin.admin_instances', filter='trusted') }}">{{ _('Trusted') }}</a> |
<a href="{{ url_for('admin.admin_instances', filter='blocked') }}">{{ _('Blocked') }}</a>
2024-09-04 19:45:44 -04:00
<table class="table table-striped">
<tr>
2025-01-02 15:36:46 +01:00
<th>
<button form="searchInstances" name="sort_by" value="domain{{' DESC' if sort_by == 'domain ASC' else ' ASC' }}" class="btn" title="{{ _('Domain') }}">
{{ _('Domain') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'domain DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'domain ASC' }}"></span>
</button>
</th>
<th>
<button form="searchInstances" name="sort_by" value="software{{' DESC' if sort_by == 'software ASC' else ' ASC' }}" class="btn" title="{{ _('Software') }}">
{{ _('Software') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'software DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'software ASC' }}"></span>
</button>
</th>
<th>
<button form="searchInstances" name="sort_by" value="version{{' DESC' if sort_by == 'version ASC' else ' ASC' }}" class="btn" title="{{ _('Version') }}">
{{ _('Version') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'version DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'version ASC' }}"></span>
</button>
</th>
2024-09-24 11:33:49 +12:00
<th title="{{ _('Known Communities') }}">{{ _('Communities') }}</th>
<th title="{{ _('Known Users') }}">{{ _('Users') }}</th>
<th>{{ _('Posts') }}</th>
<th>{{ _('Post Replies') }}</th>
2025-01-02 15:36:46 +01:00
<th>
<button form="searchInstances" name="sort_by" value="vote_weight{{' ASC' if sort_by == 'vote_weight DESC' else ' DESC' }}" class="btn" title="{{ _('Vote Weight') }}">
{{ _('Vote Weight') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'vote_weight ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'vote_weight DESC' }}"></span>
</button>
</th>
<th>
<button form="searchInstances" name="sort_by" value="trusted{{' ASC' if sort_by == 'trusted DESC' else ' DESC' }}" class="btn" title="{{ _('Trusted') }}">
{{ _('Trusted') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'trusted ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'trusted DESC' }}"></span>
</button>
</th>
<th>
<button form="searchInstances" name="sort_by" value="last_seen{{' ASC' if sort_by == 'last_seen DESC' else ' DESC' }}" class="btn" title="{{ _('When an Activity was received from them') }}">
{{ _('Seen') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'last_seen ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'last_seen DESC' }}"></span>
</button>
</th>
<th>
<button form="searchInstances" name="sort_by" value="last_successful_send{{' ASC' if sort_by == 'last_successful_send DESC' else ' DESC' }}" class="btn" title="{{ _('When we successfully sent them an Activity') }}">
{{ _('Sent') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'last_successful_send ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'last_successful_send DESC' }}"></span>
</button>
</th>
<th>
<button form="searchInstances" name="sort_by" value="failures{{' ASC' if sort_by == 'failures DESC' else ' DESC' }}" class="btn" title="{{ _('How many times we failed to send (reset to 0 after every successful send)') }}">
{{ _('Failed') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'failures ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'failures DESC' }}"></span>
</button>
</th>
<th>
<button form="searchInstances" name="sort_by" value="{{'gone_forever ASC, dormant ASC' if sort_by == 'gone_forever DESC, dormant DESC' else 'gone_forever DESC, dormant DESC' }}" class="btn" title="{{ _('Instance Status - Online/Dormant/Gone Forever') }}">
{{ _('Status') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'gone_forever ASC, dormant ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'gone_forever DESC, dormant DESC' }}"></span>
</button>
</th>
2024-09-24 11:33:49 +12:00
<th> </th>
2024-09-04 19:45:44 -04:00
</tr>
{% for instance in instances.items %}
<tr>
2025-01-02 15:36:46 +01:00
<td><span title="{{ _('Domain') }}"><a href="https://{{ instance.domain }}" rel="noopener nofollow noindex noreferrer">{{ instance.domain }}</a></span></td>
<td><span title="{{ _('Software') }}">{{ instance.software }}</span></td>
<td><span title="{{ _('Version') }}">{{ instance.version if instance.version }}</span></td>
<td><span title="{{ _('Known Communities') }}">{{ instance.known_communities_count() }}</span></td>
<td><span title="{{ _('Known Users') }}">{{ instance.known_users_count() }}</span></td>
<td><span title="{{ _('Posts') }}">{{ instance.post_count() }}</span></td>
<td><span title="{{ _('Post Replies') }}">{{ instance.post_replies_count() }}</span></td>
<td><span title="{{ _('Vote Weight') }}">{{ instance.vote_weight }}</span></td>
<td><span title="{{ _('Trusted') }}">{{ _('Yes') if instance.trusted }}</span></td>
2025-01-02 16:39:02 +01:00
<td><span title="{{ _('Last Seen') }}: {{ instance.last_seen }}">{{ arrow.get(instance.last_seen).humanize(locale=locale) if instance.last_seen }}</span></td>
2025-01-02 15:36:46 +01:00
<td><span title="{{ _('Sent') }}">{{ arrow.get(instance.last_successful_send).humanize(locale=locale) if instance.last_successful_send }}</span></td>
<td><span title="{{ _('Failed') }}">{{ instance.failures }}</span></td>
2024-09-04 19:45:44 -04:00
{% if instance.gone_forever %}
2025-01-02 15:36:46 +01:00
<td><span title="{{ _('Status') }}">{{ _('Gone forever') }}</span></td>
2024-09-04 19:45:44 -04:00
{% elif instance.dormant %}
2025-01-02 15:36:46 +01:00
<td><span title="{{ _('Status') }}">{{ _('Dormant') }}</span></td>
2024-09-04 19:45:44 -04:00
{% else %}
2025-01-02 15:36:46 +01:00
<td><span title="{{ _('Status') }}">{{ _('Online') }}</span></td>
2024-09-04 19:45:44 -04:00
{% endif %}
2024-09-24 11:33:49 +12:00
<td><a href="{{ url_for('admin.admin_instance_edit', instance_id=instance.id) }}">{{ _('Edit') }}</a></td>
2024-09-04 19:45:44 -04:00
</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 %}