mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 17:06:09 +00:00
- An empty list says so in gray text, as the VM list does, not in a yellow warning or a blue notice (host pools, networks, filters, secrets, interfaces, tags, removed VMs, backups, schedules, targets). - The Jobs and Backups filters show only while there is something to filter. - The Jobs, Backups and Logs filters apply once a choice changes or Enter is pressed (filter_form.js): no Filter or Search button, and Clear the filters only while one is set. - On a phone the Logs table shows the date, user, VM and message, with the result under it, and the Computes table the host and its memory.
71 lines
4.3 KiB
HTML
71 lines
4.3 KiB
HTML
{% extends "base.html" %}
|
||
{% load i18n %}
|
||
{% load bootstrap_icons %}
|
||
|
||
{% block title %}{% trans "Networks" %} - {{ compute.name }}{% endblock %}
|
||
|
||
{% block page_heading %}{{ compute.name }} - {% trans "Networks" %}{% endblock page_heading %}
|
||
|
||
{% block page_heading_extra %}{% include 'create_net_block.html' %}{% endblock page_heading_extra %}
|
||
|
||
{% block content %}
|
||
{% include "computes/host_nav.html" with section="networks" %}
|
||
|
||
{% if networks is None %}{# not read: the error above says why #}{% elif not networks %}
|
||
<p class="text-center text-body-secondary py-4">{% trans "This host has no networks." %}</p>
|
||
{% else %}
|
||
{# a card per network, as the host Overview's Hardware and Software cards #}
|
||
<div class="row row-cols-1 row-cols-md-2 g-3 mb-4">
|
||
{% for net in networks %}
|
||
<div class="col">
|
||
<div class="card h-100">
|
||
<div class="card-header d-flex flex-wrap align-items-center gap-2">
|
||
<a class="fw-semibold me-auto text-break" href="{% url 'network' compute.id net.name %}">{{ net.name }}</a>
|
||
{% if net.status %}
|
||
<span class="badge text-bg-success">{% trans "Active" %}</span>
|
||
{% else %}
|
||
<span class="badge text-bg-secondary">{% trans "Stopped" %}</span>
|
||
{% endif %}
|
||
{% if net.autostart %}<span class="badge text-bg-light border">{% trans "Autostart" %}</span>{% endif %}
|
||
</div>
|
||
<ul class="list-group list-group-flush flex-grow-1">
|
||
<li class="list-group-item py-1 d-flex justify-content-between align-items-baseline gap-3">
|
||
<span class="text-body-secondary">{% trans "Type" %}</span>
|
||
<span class="badge text-bg-light border">{{ net.mode_label }}</span>
|
||
</li>
|
||
<li class="list-group-item py-1 d-flex justify-content-between align-items-baseline gap-3">
|
||
<span class="text-body-secondary">{% trans "Device" %}</span>
|
||
<span class="font-monospace text-break text-end">{{ net.device|default:"–" }}</span>
|
||
</li>
|
||
{% if net.external %}
|
||
<li class="list-group-item py-1 d-flex justify-content-between align-items-baseline gap-3">
|
||
<span class="text-body-secondary">{% trans "Addresses" %}</span>
|
||
<span class="text-body-secondary text-end">{% trans "from the outside network" %}</span>
|
||
</li>
|
||
{% else %}
|
||
{% for ip in net.ips %}
|
||
<li class="list-group-item py-1 d-flex justify-content-between align-items-baseline gap-3">
|
||
<span class="text-body-secondary">{% if ip.family == "ipv6" %}IPv6{% else %}IPv4{% endif %}</span>
|
||
<span class="text-end">
|
||
<span class="font-monospace text-break">{{ ip.subnet|default:ip.address }}</span>
|
||
<span class="d-block small text-body-secondary">
|
||
{% if ip.range %}{% blocktrans with start=ip.range.0 end=ip.range.1 %}DHCP {{ start }} – {{ end }}{% endblocktrans %}
|
||
{% elif ip.dhcp %}{% trans "DHCP: fixed addresses only" %}
|
||
{% else %}{% trans "No DHCP" %}{% endif %}
|
||
</span>
|
||
</span>
|
||
</li>
|
||
{% empty %}
|
||
<li class="list-group-item py-1 d-flex justify-content-between align-items-baseline gap-3">
|
||
<span class="text-body-secondary">{% trans "Addresses" %}</span>
|
||
<span class="text-body-secondary text-end">{% trans "none" %}</span>
|
||
</li>
|
||
{% endfor %}
|
||
{% endif %}
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endif %}
|
||
{% endblock %}
|