haproxy-wi/app/templates/ajax/provisioning/providers.html

45 lines
1.9 KiB
HTML
Raw Normal View History

{% from 'include/provisioning/variables.html' import get_nice_name %}
{% for p in providers %}
<tr id="provider-{{p.id}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newprovider{% endif %}">
<td class="padding10 first-collumn"><span id="provider-name-{{p.id}}">{{p.name}}</span></td>
<td style="width: 10%">
<span id="provider-type-{{p.id}}">
{% set id = "provider-type-nice-" + id|string() %}
{{ get_nice_name(id, p.type, p.type, 'provider', params) }}
{% if p.type == 'do' %}
{% set onclickEditAction = 'editDoProvider' %}
{% elif p.type == 'aws' %}
{% set onclickEditAction = 'editAwsProvider' %}
{% elif p.type == 'gcore' %}
{% set onclickEditAction = 'editGcoreProvider' %}
{% endif %}
</span>
</td>
{% if role == 1 %}
<td style="width: 10%">
{% for g in groups %}
{% if adding %}
{% if user_group|int() == g.group_id|int() %}
<span id="provider-group-{{p.id}}">{{ g.name }}</span>
{% endif %}
{% else %}
{% if p.group|int() == g.group_id|int() %}
<span id="provider-group-{{p.id}}">{{ g.name }}</span>
{% endif %}
{% endif %}
{% endfor %}
</td>
{% else %}
<span id="provider-group-{{p.id}}" style="display: none;">user_group</span>
{% endif %}
<td id="provider-created-date-{{p.id}}" style="width: 15%">{{p.create_date}}</td>
<td id="provider-edited-date-{{p.id}}" style="width: 100%">{{p.edit_date}}</td>
<td>
<a class="edit" onclick="{{onclickEditAction}}({{p.id}})" title="Edit provider {{p.name}}" style="cursor: pointer;"></a>
</td>
<td>
<a class="delete" onclick="confirmDeleteProvider({{p.id}})" title="Delete provider {{p.name}}" style="cursor: pointer;"></a>
</td>
</tr>
{% endfor %}