1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 17:06:09 +00:00
webvirtcloud/nodedevs/templates/nodedevs.html
catborise a2da2ab394 fix(ui): a host's pages on a phone: one row of sections, tables that fit
On a phone the host's section menu wrapped to three lines, each new line
starting with a divider. It is now one row that scrolls sideways, with the
current section in sight (scroll_rows.js, which also takes over the VM page's
tab rows from instance_page.js).

The filter list, a filter's rules and the PCI and USB device tables were wider
than a phone and hid their actions and users off screen; on a phone they now
keep the name, the key column and the actions, as the other lists do.

The overview's live CPU and memory figures, the chart axes and tooltips, and
the VM page's stats now write numbers as the page's language does (a decimal
comma in Turkish), like the cards beside them.

The capacity cards said "0 bytes running"; they now say what they count:
"0 bytes in running VMs".

A pool's type is written as libvirt names it on both the list and its page,
and the device search sits where the interfaces search does.
2026-11-22 14:59:17 +03:00

117 lines
7.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load bootstrap_icons %}
{% block title %}{% trans "Devices" %} - {{ compute.name }}{% endblock %}
{% block page_heading %}{{ compute.name }} - {% trans "Devices" %}{% endblock page_heading %}
{% block content %}
{% include "computes/host_nav.html" with section="nodedevs" %}
{% if devices_read %}
{% if pci_count and not iommu %}
<div class="alert alert-warning shadow-sm">
{% bs_icon 'exclamation-triangle' %}
{% blocktrans %}No IOMMU groups detected: a PCI device cannot be given to a VM. The host needs its IOMMU (Intel VT-d, AMD-Vi) turned on in the firmware and the kernel; on Intel, boot it with intel_iommu=on.{% endblocktrans %}
</div>
{% endif %}
<input id="filter" class="form-control w-auto mb-3" type="search" placeholder="{% trans "Search devices" %}" aria-label="{% trans "Search devices" %}">
{# on a phone each table keeps the device, what the host has on it and who uses it #}
<div class="card mb-3">
<div class="card-header">{% trans "PCI devices" %} <span class="badge text-bg-light border">{{ pci_count }}</span></div>
{% if pci_count %}
<div class="table-responsive position-relative">
<table class="table table-hover align-middle mb-0">
<thead>
<tr>
<th scope="col">{% trans "Address" %}</th>
<th scope="col">{% trans "Device" %}</th>
<th scope="col" class="d-none d-md-table-cell">{% trans "Type" %}</th>
<th scope="col" class="d-none d-md-table-cell">{% trans "Driver" %}</th>
<th scope="col" class="d-none d-md-table-cell">{% trans "Host resources" %}</th>
<th scope="col">{% trans "Used by" %}</th>
</tr>
</thead>
{% for group, devices in groups %}
<tbody class="searchable">
<tr data-group-header class="table-light">
<th colspan="6" scope="rowgroup" class="small">
{% if group is None %}{% trans "Without an IOMMU group" %}{% else %}{% blocktrans %}IOMMU group {{ group }}{% endblocktrans %}{% endif %}
</th>
</tr>
{% for device in devices %}
<tr data-search="{{ device.address }} {{ device.ids }} {{ device.vendor }} {{ device.product }} {{ device.kind }} {{ device.driver }}{% for resource in device.resources %} {{ resource }}{% endfor %}{% for vm in device.vms %} {{ vm.name }}{% endfor %}">
<td class="font-monospace text-nowrap">{{ device.address }}</td>
<td>
<div>{{ device.product }}</div>
<div class="small text-body-secondary">{{ device.vendor }} <span class="font-monospace">{{ device.ids }}</span></div>
{% if device.physfn %}<div class="small text-body-secondary">{% blocktrans with address=device.physfn %}Virtual function of {{ address }}{% endblocktrans %}</div>{% endif %}
{% if device.vfs %}<div class="small text-body-secondary">{% blocktrans count counter=device.vfs %}{{ counter }} virtual function{% plural %}{{ counter }} virtual functions{% endblocktrans %}</div>{% endif %}
{% if device.resources %}<div class="d-md-none mt-1">{% include "nodedev_resources.html" %}</div>{% endif %}
</td>
<td class="text-nowrap d-none d-md-table-cell">{{ device.kind }}</td>
<td class="font-monospace d-none d-md-table-cell">{{ device.driver|default:"–" }}</td>
<td class="d-none d-md-table-cell">{% include "nodedev_resources.html" %}</td>
<td class="text-nowrap">{% include "nodedev_users.html" %}</td>
</tr>
{% endfor %}
</tbody>
{% endfor %}
</table>
</div>
{% else %}
<div class="card-body small text-body-secondary">{% trans "The host reports no PCI devices." %}</div>
{% endif %}
</div>
<div class="card mb-3">
<div class="card-header">{% trans "USB devices" %} <span class="badge text-bg-light border">{{ usb|length }}</span></div>
{% if usb %}
<div class="table-responsive position-relative">
<table class="table table-hover align-middle mb-0">
<thead>
<tr>
<th scope="col">{% trans "Bus / device" %}</th>
<th scope="col">{% trans "Device" %}</th>
<th scope="col" class="d-none d-md-table-cell">{% trans "Type" %}</th>
<th scope="col" class="d-none d-md-table-cell">{% trans "Host resources" %}</th>
<th scope="col">{% trans "Used by" %}</th>
</tr>
</thead>
<tbody class="searchable">
{% for device in usb %}
<tr data-search="{{ device.bus }}/{{ device.device }} {{ device.ids }} {{ device.vendor }} {{ device.product }}{% for kind in device.kinds %} {{ kind }}{% endfor %}{% for resource in device.resources %} {{ resource }}{% endfor %}{% for vm in device.vms %} {{ vm.name }}{% endfor %}{% for vm in device.by_model %} {{ vm }}{% endfor %}">
<td class="font-monospace text-nowrap">{{ device.bus }} / {{ device.device }}</td>
<td>
<div>{{ device.product }}</div>
<div class="small text-body-secondary">{{ device.vendor }} <span class="font-monospace">{{ device.ids }}</span></div>
{% if device.same_model %}<div class="small text-body-secondary">{% trans "One of several of this model: a VM that names the model alone may take any of them." %}</div>{% endif %}
</td>
<td class="d-none d-md-table-cell">{{ device.kinds|join:", "|default:"–" }}</td>
<td class="d-none d-md-table-cell">{% include "nodedev_resources.html" %}</td>
<td>
{% if device.vms or not device.by_model %}{% include "nodedev_users.html" %}{% endif %}
{% if device.by_model %}<div class="small">{% blocktrans with vms=device.by_model|join:", " %}By model: {{ vms }}{% endblocktrans %}</div>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="card-body small text-body-secondary">{% trans "The host reports no USB devices." %}</div>
{% endif %}
</div>
<div role="status">
<div id="no-match" class="text-center text-body-secondary py-3" hidden>{% trans "No device matches the search." %}</div>
</div>
{% endif %}
{% endblock %}
{% block script %}
{% if devices_read %}<script src="{% static 'js/table_filter.js' %}"></script>{% endif %}
{% endblock %}