123 lines
4.9 KiB
HTML
123 lines
4.9 KiB
HTML
{% extends "hobo/base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block appbar %}
|
|
<h2>{% trans 'System' %}</h2>
|
|
<span class="actions">
|
|
<a class="extra-actions-menu-opener"></a>
|
|
<ul class="extra-actions-menu">
|
|
<li><a rel="popup" href="{% url 'environment-import' %}">{% trans 'Import' %}</a></li>
|
|
<li><a href="{% url 'environment-export' %}">{% trans 'Export' %}</a></li>
|
|
</ul>
|
|
</span>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
{% if services %}
|
|
<div class="services">
|
|
{% for service in services %}
|
|
<a href="{{ service.base_url }}" class="service-link" data-service-slug="{{ service.slug }}">
|
|
<div class="service" data-service-slug="{{ service.slug }}">
|
|
<h3 class="service-title">{{ service.title }} <span class="service-url">{{ service.base_url }}</span></h3>
|
|
<p class="service-status-items">
|
|
<span class="checking">{% trans "checking..." %}</span>
|
|
<span style="display: none" class="dns">{% trans "DNS" %}</span>
|
|
<span style="display: none" class="certificate">{% trans "Certificate" %}</span>
|
|
<span style="display: none" class="web">{% trans "Web" %}</span>
|
|
<span style="display: none" class="security">{% trans "Security" %}</span>
|
|
</p>
|
|
</div>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="big-msg-info">
|
|
{% blocktrans trimmed %}
|
|
This deployment doesn't have any service deployed yet. Click on the
|
|
"Services" menu entry in the top right of the page to add a first one.
|
|
{% endblocktrans %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<script>
|
|
$(function() {
|
|
$.ajax({
|
|
url: '/api/health/',
|
|
success: function(response, status) {
|
|
$('[data-service-slug]').each(function(idx, service_block) {
|
|
var $service_block = $(service_block);
|
|
var service_slug = $service_block.data('service-slug');
|
|
var service = response.data[service_slug];
|
|
var ok = true;
|
|
if (service.is_resolvable) {
|
|
$service_block.find('.dns').addClass('op-ok');
|
|
} else {
|
|
$service_block.find('.dns').addClass('op-nok');
|
|
ok = false;
|
|
}
|
|
if (service.has_valid_certificate) {
|
|
$service_block.find('.certificate').addClass('op-ok');
|
|
} else {
|
|
$service_block.find('.certificate').addClass('op-nok');
|
|
ok = false;
|
|
}
|
|
if (service.is_running) {
|
|
$service_block.find('.web').addClass('op-ok');
|
|
} else {
|
|
$service_block.find('.web').addClass('op-nok');
|
|
ok = false;
|
|
}
|
|
$service_block.find('.security').addClass('sec-' + service.security_data.level);
|
|
$service_block.find('.security').attr('title', service.security_data.label);
|
|
|
|
var $service_p = $service_block.find('span.checking')
|
|
$service_block.find('span').show();
|
|
$service_p.hide();
|
|
if (ok) {
|
|
$service_block.addClass('op-ok');
|
|
} else {
|
|
$service_block.addClass('op-nok');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
{% endblock %}
|
|
|
|
{% block sidebar %}
|
|
<aside id="sidebar">
|
|
<h3>{% trans "Settings" %}</h3>
|
|
|
|
{% if has_authentic %}
|
|
<a class="button button-paragraph" href="{% url 'profile-home' %}">{% trans 'User Profile' %}</a>
|
|
{% endif %}
|
|
<a class="button button-paragraph" href="{% url 'theme-home' %}">{% trans 'Theme' %}
|
|
{% if not has_global_title %}
|
|
<p class="warning">
|
|
{% trans 'You have not yet defined a name for the platform; the generic title "Compte Citoyen" is used.' %}
|
|
</p>
|
|
{% endif %}
|
|
</a>
|
|
<a class="button button-paragraph" href="{% url 'emails-home' %}">{% trans 'Emails' %}
|
|
{% if not has_default_from_email %}
|
|
<p class="warning">
|
|
{% trans "You have not yet defined an address for emails sent by Publik." %}
|
|
</p>
|
|
{% endif %}
|
|
</a>
|
|
<a class="button button-paragraph" href="{% url 'sms-home' %}">{% trans 'SMS' %}</a>
|
|
{% if has_authentic %}
|
|
<a class="button button-paragraph" href="{% url 'franceconnect-home' %}">FranceConnect</a>
|
|
{% endif %}
|
|
<a class="button button-paragraph" href="{% url 'matomo-home' %}">{% trans 'User tracking' %}</a>
|
|
<a class="button button-paragraph" href="{% url 'seo-home' %}">{% trans 'Indexing' %}</a>
|
|
<a class="button button-paragraph" href="{% url 'environment-home' %}">{% trans 'Services' %}</a>
|
|
<a class="button button-paragraph" href="{% url 'environment-variables' %}">{% trans 'Variables' %}</a>
|
|
<a class="button button-paragraph" href="{% url 'debug-home' %}">{% trans 'Debugging' %}</a>
|
|
{% if show_maintenance_menu %}<a class="button button-paragraph" href="{% url 'maintenance-home' %}">{% trans 'Maintenance' %}</a>{% endif %}
|
|
</aside>
|
|
{% endblock %}
|