{% extends 'base.html' %}
{% load helpers %}

{% block header %}
    <div class="row noprint">
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li><a href="{% url 'virtualization:virtualmachine_list' %}">Virtual Machines</a></li>
                <li><a href="{{ vminterface.virtual_machine.get_absolute_url }}">{{ vminterface.virtual_machine }}</a></li>
                <li>{{ vminterface }}</li>
            </ol>
        </div>
    </div>
    <div class="pull-right noprint">
        {% if perms.virtualization.change_vminterface %}
            <a href="{% url 'virtualization:vminterface_edit' pk=vminterface.pk %}" class="btn btn-warning">
                <span class="fa fa-pencil" aria-hidden="true"></span> Edit
            </a>
        {% endif %}
        {% if perms.virtualization.delete_vminterface %}
            <a href="{% url 'virtualization:vminterface_delete' pk=vminterface.pk %}" class="btn btn-danger">
                <span class="fa fa-trash" aria-hidden="true"></span> Delete
            </a>
        {% endif %}
    </div>
    <h1>{% block title %}{{ vminterface.virtual_machine }} / {{ vminterface.name }}{% endblock %}</h1>
    <ul class="nav nav-tabs">
        <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
            <a href="{{ vminterface.get_absolute_url }}">Interface</a>
        </li>
        {% if perms.extras.view_objectchange %}
            <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
                <a href="{% url 'virtualization:vminterface_changelog' pk=vminterface.pk %}">Change Log</a>
            </li>
        {% endif %}
    </ul>
{% endblock %}

{% block content %}
<div class="row">
	<div class="col-md-6">
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Interface</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <td>Virtual Machine</td>
                    <td>
                        <a href="{{ vminterface.virtual_machine.get_absolute_url }}">{{ vminterface.virtual_machine }}</a>
                    </td>
                </tr>
                <tr>
                    <td>Name</td>
                    <td>{{ vminterface.name }}</td>
                </tr>
                <tr>
                    <td>Enabled</td>
                    <td>
                        {% if vminterface.enabled %}
                            <span class="text-success"><i class="fa fa-check"></i></span>
                        {% else %}
                            <span class="text-danger"><i class="fa fa-close"></i></span>
                        {% endif %}
                    </td>
                </tr>
                <tr>
                    <td>Description</td>
                    <td>{{ vminterface.description|placeholder }} </td>
                </tr>
                <tr>
                    <td>MTU</td>
                    <td>{{ vminterface.mtu|placeholder }}</td>
                </tr>
                <tr>
                    <td>MAC Address</td>
                    <td><span class="text-monospace">{{ vminterface.mac_address|placeholder }}</span></td>
                </tr>
                <tr>
                    <td>802.1Q Mode</td>
                    <td>{{ vminterface.get_mode_display }}</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="col-md-6">
        {% include 'extras/inc/tags_panel.html' with tags=vminterface.tags.all %}
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        {% include 'panel_table.html' with table=ipaddress_table heading="IP Addresses" %}
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        {% include 'panel_table.html' with table=vlan_table heading="VLANs" %}
    </div>
</div>
{% endblock %}
