{% extends "../body.html" %}
{% load util %}
{% load static %}
{% block content %}
<script src="{% static 'js/jobs/credentials.js' %}"></script>
<div class="table-responsive aw-data">
    <h2>User Credentials</h2>
    <table class="table table-striped aw-text-responsive" id="aw-api-data1-table">
        <tr>
            <th>Name</th>
            <th>Users</th>
            <th class="aw-responsive-med">Vault</th>
            <th class="aw-responsive-med">Secrets</th>
            <th>Actions</th>
        </tr>
        <tr>
            <td colspan="100%">
                <a href="/ui/jobs/credentials/0?global=false">
                    <button class="btn btn-success aw-btn-action" title="Add User Credentials">
                        {% include "../button/icon/add.html" %}
                    </button>
                </a>
            </td>
        </tr>
        <tr id="aw-api-data-tmpl-row" hidden="hidden">
            <td></td>
            <td></td>
            <td class="aw-responsive-med"></td>
            <td class="aw-responsive-med"></td>
            <td></td>
        </tr>
    </table>
    <div id="aw-api-data1-tmpl-actions" hidden="hidden">
        <a href="/ui/jobs/credentials/${ID}?global=false">
            <button class="btn btn-warning aw-btn-action" title="Edit">
                {% include "../button/icon/edit.html" %}
            </button>
        </a>
        <button class="btn btn-danger aw-btn-action aw-api-click" title="Delete" aw-api-endpoint="credentials" aw-api-item="${ID}?global=false" aw-api-method="delete">
            {% include "../button/icon/delete.html" %}
        </button>
    </div>
    <br>
    <h2>Global Credentials</h2>
    <table class="table table-striped aw-text-responsive" id="aw-api-data2-table">
        <tr>
            <th>Name</th>
            <th>Users</th>
            <th class="aw-responsive-med">Vault</th>
            <th class="aw-responsive-med">Secrets</th>
            <th>Actions</th>
        </tr>
        <tr>
            <td colspan="100%">
                {% include "../button/refresh.html" %}
                <a href="/ui/jobs/credentials/0?global=true">
                    <button class="btn btn-success aw-btn-action" title="Add Global Credentials">
                        {% include "../button/icon/add.html" %}
                    </button>
                </a>
            </td>
        </tr>
    </table>
    <div id="aw-api-data2-tmpl-actions" hidden="hidden">
        <a href="/ui/jobs/credentials/${ID}?global=true">
            <button class="btn btn-warning aw-btn-action" title="Edit">
                {% include "../button/icon/edit.html" %}
            </button>
        </a>
        <button class="btn btn-danger aw-btn-action aw-api-click" title="Delete" aw-api-endpoint="credentials" aw-api-item="${ID}?global=true" aw-api-method="delete">
            {% include "../button/icon/delete.html" %}
        </button>
    </div>
</div>
{% endblock %}