1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-26 08:05:22 +00:00
webvirtcloud/interfaces/templates/interfaces.html
catborise 073b7b6717
Bootstrap5 (#17)
* Bootstrap5 migration
2021-07-07 14:12:38 +03:00

104 lines
No EOL
4.3 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% block title %}{% trans "Interfaces" %} - {{ compute.name }}{% endblock %}
{% block page_heading %}{{ compute.name }} - {% trans "Interfaces" %}{% endblock page_heading %}
{% block page_heading_extra %}
{% include 'create_iface_block.html' %}
{% endblock page_heading_extra %}
{% block content %}
<div class="row">
<div class="col-lg-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb shadow-sm">
<li class="breadcrumb-item">
<a href="{% url 'overview' compute.id %}"><i class="fa fa-dashboard"></i> {% trans "Overview" %}</a>
</li>
<li class="breadcrumb-item">
<a href="{% url 'instances' compute.id %}"><i class="fa fa-server"></i> {% trans "Instances" %}</a>
</li>
<li class="breadcrumb-item">
<a href="{% url 'storages' compute.id %}"><i class="fa fa-hdd-o"></i> {% trans "Storages" %}</a>
</li>
<li class="breadcrumb-item">
<a href="{% url 'networks' compute.id %}"><i class="fa fa-sitemap"></i> {% trans "Networks" %}</a>
</li>
<li class="breadcrumb-item">
<span class="fw-bold"><i class="fa fa-wifi"></i> {% trans "Interfaces" %}</span>
</li>
<li class="breadcrumb-item">
<a href="{% url 'nwfilters' compute.id %}"><i class="fa fa-filter"></i> {% trans "NWFilters" %}</a>
</li>
<li class="breadcrumb-item">
<a href="{% url 'virtsecrets' compute.id %}"><i class="fa fa-key"></i> {% trans "Secrets" %}</a>
</li>
</ol>
</nav>
</div>
</div>
<div class="row">
{% if not ifaces_all %}
<div class="col-lg-12">
<div class="alert alert-warning shadow-sm">
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning" %}:</strong> {% trans "Hypervisor doesn't have any Interfaces" %}
</div>
</div>
{% else %}
{% for iface in ifaces_all %}
<div class="col-12 col-sm-4">
<div class="mb-3 card {% if iface.state == 1 %}border-success{% else %}border-danger{% endif %} shadow-sm">
<div class="card-header {% if iface.state == 1 %}bg-success{% else %}bg-danger{% endif %}">
<h6 class="my-0 card-title">
<a class="card-link text-light" href="{% url 'interface' compute.id iface.name %}">{{ iface.name }}</a>
</h6>
</div>
<div class="ps-0 pe-0 card-body">
<div class="row">
<div class="col-3 col-sm-4">
<p><strong>{% trans "Type" %}:</strong></p>
<p><strong>{% trans "MAC" %}:</strong></p>
</div>
<div class="col-9 col-sm-8">
<p>{{ iface.type }}</p>
<p>{{ iface.mac }}</p>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>
{% endblock %}
{% block script %}
<script>
$(document).ready(function () {
$('#itype').change(function (eventObject) {
if ($(this).val() == 'bridge') {
$('.bridge_name_form_group').show();
} else {
$('.bridge_name_form_group').hide();
}
}).change();
$('#ipv4').change(function (eventObject) {
if ($(this).val() == 'static') {
$('.static_ipv4_form_group').show();
} else {
$('.static_ipv4_form_group').hide();
}
}).change();
$('#ipv6').change(function (eventObject) {
if ($(this).val() == 'static') {
$('.static_ipv6_form_group').show();
} else {
$('.static_ipv6_form_group').hide();
}
}).change();
});
</script>
{% endblock %}