{% extends "base.html" %}
{% load i18n %}
{% load bootstrap_icons %}
{% block title %}{% trans "Interface" %} - {{ iface }}{% endblock %}
{% block page_heading %}{{ compute.name }} - {% trans "Interface" %}: {{ iface }}{% endblock page_heading %}
{% block page_heading_extra %}
{% if changeable and info %}
{# the interface's own actions where the host's libvirt can change interfaces: start or stop, and delete a stopped one #}
{% endif %}
{% endblock page_heading_extra %}
{% block content %}
{% include "computes/host_nav.html" with section="interfaces" detail=True %}
{% if changeable is False %}{% include 'interfaces_unchangeable.html' %}{% endif %}
{% if info %}
{% trans "Interface" %}
{% trans "Type" %}{{ info.type|capfirst }}
{% trans "State" %}
{# libvirt's own state where it manages the interface; the link as the kernel reports it everywhere #}
{% if changeable %}{% if state %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %}{% endif %}
{% include "link_badge.html" with link=info.link %}
{% if info.start_mode %}
{% trans "Starts" %}{% if info.start_mode == "onboot" %}{% trans "On boot" %}{% elif info.start_mode == "hotplug" %}{% trans "When plugged in" %}{% else %}{% trans "Only by hand" %}{% endif %}
{% endif %}
{% trans "MAC" %}{{ info.mac|default:"–" }}
{% if info.mtu %}
{% trans "MTU" %}{{ info.mtu }}
{% endif %}
{% if info.speed %}
{% trans "Speed" %}{{ info.speed }} Mb/s
{% endif %}
{% if info.stp %}
{% trans "Spanning tree" %}
{# not its delay: netcf tells it in seconds, the udev backend in hundredths #}
{% if info.stp == "on" %}{% trans "On" %}{% else %}{% trans "Off" %}{% endif %}