113 lines
3.5 KiB
HTML
113 lines
3.5 KiB
HTML
{% extends "passerelle/manage.html" %}
|
|
{% load i18n passerelle %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
<a href="{{object.get_absolute_url}}">{{ object.title }}</a>
|
|
{% endblock %}
|
|
|
|
{% block appbar %}
|
|
<h2>{{ view.model.get_verbose_name }} - {{ object.title }}
|
|
{% with status=object.get_availability_status %}
|
|
{% if status %}
|
|
{% if status.down %}<span class="down" title="{{status.message}} {% trans 'since:' %} {{status.start_timestamp|date:"SHORT_DATETIME_FORMAT"}} ">{% trans 'Down' %}</span>{% endif %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
</h2>
|
|
<span class="actions">
|
|
{% if object|can_edit:request.user and has_check_status %}
|
|
<a rel="popup" href="{% url 'manage-availability' resource_type=object|resource_type resource_pk=object.id %}">{% trans 'availability check parameters' %}</a>
|
|
{% endif %}
|
|
{% if object|can_edit:request.user %}
|
|
<a rel="popup" href="{% url 'logging-parameters' resource_type=object|resource_type resource_pk=object.id %}">{% trans 'logging parameters' %}</a>
|
|
{% endif %}
|
|
{% if object|can_edit:request.user %}
|
|
<a rel="popup" href="{{ object.get_edit_url }}">{% trans 'edit' %}</a>
|
|
{% endif %}
|
|
{% if object|can_delete:request.user %}
|
|
<a rel="popup" href="{{ object.get_delete_url }}">{% trans 'delete' %}</a>
|
|
{% endif %}
|
|
</span>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<div id="description">
|
|
{% block description %}
|
|
{% if object.description %}{{object.description|linebreaks}}{% endif %}
|
|
|
|
{% for field, value in object.get_description_fields %}
|
|
{% if value or value == False %}
|
|
<p>{{field.verbose_name}}{% trans ":" %}
|
|
{% if value == True %}{% trans "yes" %}
|
|
{% elif value == False %}{% trans "no" %}
|
|
{% else %}{{value}}
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endblock %}
|
|
</div>
|
|
|
|
<div id="endpoints" class="section">
|
|
<h3>{% trans 'Endpoints' %}</h3>
|
|
<div>
|
|
{% if object.api_description %}<p>{{object.api_description}}</p>{% endif %}
|
|
{% block endpoints %}
|
|
<ul>
|
|
{% for endpoint in object.get_endpoints_infos %}
|
|
<li>{% if endpoint.description %}{{endpoint.description}}{% trans ':' %}{% endif %}
|
|
<a href="{{endpoint.example_url}}">{{ site_base_uri }}{{endpoint.example_url_as_html}}</a>
|
|
{% if endpoint.methods|length > 1 %}
|
|
({{endpoint.http_method|upper}})
|
|
{% endif %}
|
|
{% if endpoint.has_params %}
|
|
<ul class="params">
|
|
{% for param in endpoint.get_params %}
|
|
<li>{{param.name}}
|
|
{% if param.optional %}({% trans 'optional' %}{% if param.default_value %},
|
|
{% trans 'default value:' %} {{param.default_value}}{% endif %}){% endif %}
|
|
{% if param.description %}{% trans ':' %} {{param.description}}{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
|
|
{% block extra-sections %}
|
|
{% endblock %}
|
|
|
|
<div id="security" class="section">
|
|
{% if perms.base.view_accessright %}
|
|
<h3>{% trans "Security" %}</h3>
|
|
<div>
|
|
{% block security %}
|
|
{% for permission in object.get_connector_permissions %}
|
|
<p>{{permission.label}}</p>
|
|
{% access_rights_table resource=object permission=permission.key %}
|
|
{% endfor %}
|
|
{% endblock %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if perms.base.view_resourcelog %}
|
|
<div id="logs" class="section">
|
|
<h3>{% trans "Logs" %}
|
|
<a href="{% url 'view-logs-connector' connector=object.get_connector_slug slug=object.slug %}">({% trans "full page & filter" %})</a>
|
|
</h3>
|
|
<div>
|
|
{% block logs %}
|
|
{% resource_logs_table resource=object %}
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|