mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 11:46:49 +00:00
The Users, Groups and Removed VMs pages were bare tables: rows of coloured icon buttons without words, five columns of small checks for a user's role and permissions, dates broken over three lines and a lone "+" for a new entry. The owner chose a directory layout from three rendered options; it follows the host pages' cards: - Each list is a card with its count and search in the header and one list-group item per entry, which stacks on a phone without scrolling. - A user shows their role as a badge (Superuser, Template editor) or "User", Blocked as a red badge, their groups, a granted clone permission and live API tokens, and the last login on one line; role and status are searchable. Edit is the visible action, the menu holds View profile, Block or Unblock and Delete; Block and Delete are disabled on one's own account, which the server refuses anyway. - A group shows its member and permission counts; its name opens it. The page's title said "Users". - A removed VM shows its UUID, the host it left, its owners and when the record was made and expires. - Logs keep their table in a card, the server search in its header, the count of matching rows, Done and Failed as badges, and a message column wide enough to read on a phone. The user form was one long column of horizontal fields. The owner rejected three boxed layouts and chose one led by what the user may do: the Active switch, Template editor and Superuser as two cards, groups as chips, the user's own permissions as switches each saying what it allows, then the name and password and the quota folded into details whose summaries tell their values (-1 as "any"); they open on a new user and on an error inside them. A refused group or permission is said beside its field. The group form follows it: the name, what its members may do, its members as chips. Cancel goes back to the list instead of the browser history.
57 lines
3.1 KiB
HTML
57 lines
3.1 KiB
HTML
{% extends "base.html" %}
|
||
{% load i18n %}
|
||
{% load static %}
|
||
{% load bootstrap_icons %}
|
||
|
||
{% block title %}{% trans "Removed VMs" %}{% endblock %}
|
||
|
||
{% block page_heading %}{% trans "Removed VMs" %}{% endblock page_heading %}
|
||
|
||
{% block content %}
|
||
<p class="text-body-secondary">{% trans "VMs that vanished from their compute. Their owners come back if the same UUID shows up again before the record expires." %}</p>
|
||
{% if not tombstones %}
|
||
<div class="alert alert-info shadow-sm">
|
||
{% bs_icon 'info-circle' %} {% trans "No removed VMs" %}
|
||
</div>
|
||
{% else %}
|
||
<div class="card mb-3">
|
||
<div class="card-header d-flex flex-wrap align-items-center gap-2">
|
||
<span class="me-auto">{% trans "Removed VMs" %} <span class="badge text-bg-light border">{{ tombstones|length }}</span></span>
|
||
<input id="filter" class="form-control form-control-sm w-auto" type="search" placeholder="{% trans "Search" %}" aria-label="{% trans "Search removed VMs" %}">
|
||
</div>
|
||
<div class="list-group list-group-flush searchable">
|
||
{% for tombstone in tombstones %}
|
||
<div class="list-group-item py-3" data-search="{{ tombstone.name }} {{ tombstone.uuid }} {{ tombstone.host }} {{ tombstone.owner_names|join:' ' }}">
|
||
<div class="row g-2 align-items-center">
|
||
<div class="col-12 col-md-4">
|
||
<span class="fw-semibold text-break">{{ tombstone.name }}</span>
|
||
{% if tombstone.is_template %}<span class="badge text-bg-light border">{% trans "Template" %}</span>{% endif %}
|
||
<div class="font-monospace small text-body-secondary text-break mt-1">{{ tombstone.uuid }}</div>
|
||
</div>
|
||
<div class="col-12 col-md-5 small">
|
||
<div>
|
||
{% trans "Left" %} <span class="fw-semibold">{{ tombstone.host }}</span>
|
||
<span class="text-body-secondary">· {% trans "Owners" %}:</span> {{ tombstone.owner_names|join:", "|default:"–" }}
|
||
</div>
|
||
<div class="text-body-secondary mt-1">
|
||
{% trans "Removed" %} <span class="text-nowrap">{{ tombstone.removed|date:"Y-m-d H:i" }}</span>
|
||
· {% trans "expires" %} <span class="text-nowrap">{{ tombstone.expires|date:"Y-m-d H:i" }}</span>
|
||
</div>
|
||
</div>
|
||
<div class="col-12 col-md-3 text-md-end">
|
||
<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:tombstone_delete' tombstone.id %}">{% trans "Delete" %}</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
<div role="status">
|
||
<div id="no-match" class="text-center text-body-secondary py-3" hidden>{% trans "No removed VM matches the search." %}</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% endblock content %}
|
||
|
||
{% block script %}
|
||
{% if tombstones %}<script src="{% static 'js/table_filter.js' %}"></script>{% endif %}
|
||
{% endblock script %}
|