{% extends 'base.html' %}

{% block content %}
    <div class='row'>
        <div class='col-lg-6'>
            <div class="card card-primary card-outline">
                <div class="card-header">
                    <h3 class="card-title">Static Host List</h3>
                </div>

                <div class="card-body">
                <div class="row">
                    <div class="col-lg-12">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th>Hostname</th>
                                <th>IP Address</th>
                                <th></th>
                            </tr>
                            </thead>
                            <tbody>
                            {% if static_host_list %}
                            {% for static_host in static_host_list %}
                                <tr>
                                    <td>{{ static_host.hostname }}</td>
                                    <td>{{ static_host.ip_address }}</td>
                                    <td class="min-width">
                                        <a href="/dns/manage_static_host/?uuid={{ static_host.uuid }}"><i class="fas fa-edit"></i></a>
                                    </td>
                                </tr>
                            {% endfor %}
                            {% else %}
                                <tr>
                                    <td colspan="3"></td>
                                </tr>
                            {% endif %}
                            </tbody>
                        </table>
                    </div>
                </div>
                
                <div class="row">
                    <div class="col-lg-12">
                        <a href="/dns/manage_static_host/" class="btn btn-primary">Add Static Host</a>
                        <a href="/dns/manage_settings/" class="btn btn-primary">DNS Settings</a>
                        <a href="/dns/apply_config/" class="btn btn-primary">Apply Config</a>
                    </div>
                </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

