2020-09-02 22:04:12 +00:00
{% extends "administration/base.html" %}
{% load i18n %}
{% load humanize %}
{% load passbook_utils %}
2020-09-18 22:25:28 +00:00
{% load admin_reflection %}
2020-09-02 22:04:12 +00:00
{% block content %}
< section class = "pf-c-page__main-section pf-m-light" >
< div class = "pf-c-content" >
< h1 >
< i class = "fas fa-map-marker" > < / i >
{% trans 'Outposts' %}
< / h1 >
< p > {% trans "Outposts are deployments of passbook components to support different environments and protocols, like reverse proxies." %}< / p >
< / div >
< / section >
< section class = "pf-c-page__main-section pf-m-no-padding-mobile" >
< div class = "pf-c-card" >
{% if object_list %}
< div class = "pf-c-toolbar" >
< div class = "pf-c-toolbar__content" >
2020-10-03 17:32:01 +00:00
{% include 'partials/toolbar_search.html' %}
2020-09-02 22:04:12 +00:00
< div class = "pf-c-toolbar__bulk-select" >
2020-11-21 15:16:34 +00:00
< pb-modal-button href = "{% url 'passbook_admin:outpost-create' %}" >
< button slot = "trigger" class = "pf-c-button pf-m-primary" >
{% trans 'Create' %}
< / button >
< div slot = "modal" > < / div >
< / pb-modal-button >
< button role = "pb-refresh" class = "pf-c-button pf-m-primary" >
{% trans 'Refresh' %}
< / button >
2020-09-02 22:04:12 +00:00
< / div >
{% include 'partials/pagination.html' %}
< / div >
< / div >
< table class = "pf-c-table pf-m-compact pf-m-grid-xl" role = "grid" >
< thead >
< tr role = "row" >
< th role = "columnheader" scope = "col" > {% trans 'Name' %}< / th >
< th role = "columnheader" scope = "col" > {% trans 'Providers' %}< / th >
< th role = "columnheader" scope = "col" > {% trans 'Health' %}< / th >
2020-09-18 22:54:48 +00:00
< th role = "columnheader" scope = "col" > {% trans 'Version' %}< / th >
2020-09-02 22:04:12 +00:00
< th role = "cell" > < / th >
< / tr >
< / thead >
< tbody role = "rowgroup" >
{% for outpost in object_list %}
< tr role = "row" >
< th role = "columnheader" >
2020-09-18 19:46:14 +00:00
< span > {{ outpost.name }}< / span >
2020-09-02 22:04:12 +00:00
< / th >
< td role = "cell" >
< span >
{{ outpost.providers.all.select_subclasses|join:", " }}
< / span >
< / td >
2020-10-14 08:44:17 +00:00
{% with states=outpost.state %}
2020-10-19 14:34:16 +00:00
{% if states|length > 0 %}
2020-10-14 08:44:17 +00:00
< td role = "cell" >
{% for state in states %}
< div >
{% if state.last_seen %}
< i class = "fas fa-check pf-m-success" > < / i > {{ state.last_seen|naturaltime }}
{% else %}
< i class = "fas fa-times pf-m-danger" > < / i > {% trans 'Unhealthy' %}
{% endif %}
< / div >
{% endfor %}
< / td >
< td role = "cell" >
{% for state in states %}
< div >
{% if not state.version %}
< i class = "fas fa-question-circle" > < / i >
{% elif state.version_outdated %}
< i class = "fas fa-times pf-m-danger" > < / i > {% blocktrans with is=state.version should=state.version_should %}{{ is }}, should be {{ should }}{% endblocktrans %}
{% else %}
< i class = "fas fa-check pf-m-success" > < / i > {{ state.version }}
{% endif %}
< / div >
{% endfor %}
< / td >
{% else %}
< td role = "cell" >
2020-10-07 17:19:25 +00:00
< i class = "fas fa-question-circle" > < / i >
2020-10-14 08:44:17 +00:00
< / td >
< td role = "cell" >
< i class = "fas fa-question-circle" > < / i >
< / td >
{% endif %}
{% endwith %}
2020-09-02 22:04:12 +00:00
< td >
2020-11-21 20:04:42 +00:00
< pb-modal-button href = "{% url 'passbook_admin:outpost-update' pk=outpost.pk %}" >
2020-11-21 15:16:34 +00:00
< button slot = "trigger" class = "pf-c-button pf-m-secondary" >
{% trans 'Edit' %}
< / button >
< div slot = "modal" > < / div >
< / pb-modal-button >
2020-11-21 20:04:42 +00:00
< pb-modal-button href = "{% url 'passbook_admin:outpost-delete' pk=outpost.pk %}" >
2020-11-21 15:16:34 +00:00
< button slot = "trigger" class = "pf-c-button pf-m-danger" >
{% trans 'Delete' %}
< / button >
< div slot = "modal" > < / div >
< / pb-modal-button >
2020-09-18 22:25:28 +00:00
{% get_htmls outpost as htmls %}
{% for html in htmls %}
{{ html|safe }}
{% endfor %}
2020-09-02 22:04:12 +00:00
< / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
2020-10-03 15:50:17 +00:00
< div class = "pf-c-pagination pf-m-bottom" >
2020-09-02 22:04:12 +00:00
{% include 'partials/pagination.html' %}
< / div >
{% else %}
2020-10-03 17:32:01 +00:00
< div class = "pf-c-toolbar" >
< div class = "pf-c-toolbar__content" >
{% include 'partials/toolbar_search.html' %}
< / div >
< / div >
2020-09-02 22:04:12 +00:00
< div class = "pf-c-empty-state" >
< div class = "pf-c-empty-state__content" >
2020-10-03 17:32:01 +00:00
< i class = "fas fa-map-marker pf-c-empty-state__icon" aria-hidden = "true" > < / i >
2020-09-02 22:04:12 +00:00
< h1 class = "pf-c-title pf-m-lg" >
{% trans 'No Outposts.' %}
< / h1 >
< div class = "pf-c-empty-state__body" >
2020-10-03 17:32:01 +00:00
{% if request.GET.search != "" %}
{% trans "Your search query doesn't match any outposts." %}
{% else %}
2020-09-02 22:04:12 +00:00
{% trans 'Currently no outposts exist. Click the button below to create one.' %}
2020-10-03 17:32:01 +00:00
{% endif %}
2020-09-02 22:04:12 +00:00
< / div >
2020-11-21 15:16:34 +00:00
< pb-modal-button href = "{% url 'passbook_admin:outpost-create' %}" >
< button slot = "trigger" class = "pf-c-button pf-m-primary" >
{% trans 'Create' %}
< / button >
< div slot = "modal" > < / div >
< / pb-modal-button >
2020-09-02 22:04:12 +00:00
< / div >
< / div >
{% endif %}
< / div >
< / section >
{% endblock %}