fix: cleaner filter layout for the client software overview
The filter card gets a balanced layout: tenant group, tenant, a search field with icon and the buttons in one row, below it the client roles as toggle pills (applied immediately) and the filter hint. The broken checkbox styling is gone. The empty state explains how software lists get into NetBox. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
7d267ec05d
commit
713556a33e
4 files changed
+101
-28
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
from netbox.plugins import PluginConfig, get_plugin_config
|
from netbox.plugins import PluginConfig, get_plugin_config
|
||||||
|
|
||||||
__version__ = "0.29.1"
|
__version__ = "0.29.2"
|
||||||
|
|
||||||
|
|
||||||
class NetBoxUtilitiesConfig(PluginConfig):
|
class NetBoxUtilitiesConfig(PluginConfig):
|
||||||
|
|||||||
@@ -564,6 +564,63 @@ a.nbu-disk-slot[draggable="true"] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Client Software Übersicht */
|
/* Client Software Übersicht */
|
||||||
|
.nbu-sw-filter-footer {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 0.75rem 1.5rem;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding-top: 0.875rem;
|
||||||
|
border-top: 1px solid var(--tblr-border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nbu-sw-roles {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nbu-sw-roles-label {
|
||||||
|
color: var(--tblr-secondary);
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin-right: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nbu-sw-role {
|
||||||
|
border: 1px solid var(--tblr-border-color);
|
||||||
|
background: var(--tblr-bg-surface);
|
||||||
|
color: var(--tblr-body-color);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nbu-sw-role:hover {
|
||||||
|
border-color: var(--tblr-primary);
|
||||||
|
color: var(--tblr-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-check:checked + .nbu-sw-role {
|
||||||
|
background: var(--tblr-primary);
|
||||||
|
border-color: var(--tblr-primary);
|
||||||
|
color: var(--tblr-primary-fg, #fff);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-check:focus-visible + .nbu-sw-role {
|
||||||
|
box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb), 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nbu-sw-filter-hint {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
}
|
||||||
|
|
||||||
.nbu-sw-kpi-label {
|
.nbu-sw-kpi-label {
|
||||||
color: var(--tblr-secondary);
|
color: var(--tblr-secondary);
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
|
|||||||
@@ -32,36 +32,47 @@
|
|||||||
<label class="form-label" for="{{ form.tenant_id.id_for_label }}">Mandant</label>
|
<label class="form-label" for="{{ form.tenant_id.id_for_label }}">Mandant</label>
|
||||||
{{ form.tenant_id }}
|
{{ form.tenant_id }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-6 col-xl-2">
|
<div class="col-12 col-md-8 col-xl-4">
|
||||||
<span class="form-label d-block">Gerätrolle</span>
|
|
||||||
{% for choice in form.role_id %}
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
{{ choice.tag }}
|
|
||||||
<label class="form-check-label" for="{{ choice.id_for_label }}">{{ choice.choice_label }}</label>
|
|
||||||
</div>
|
|
||||||
{% empty %}
|
|
||||||
<div class="text-danger small">Keine Client-Rolle gefunden (<code>software_device_roles</code>)</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-md-6 col-xl-2">
|
|
||||||
<label class="form-label" for="id_q">Software suchen</label>
|
<label class="form-label" for="id_q">Software suchen</label>
|
||||||
<input type="search" name="q" id="id_q" value="{{ form.q.value|default:'' }}" class="form-control"
|
<div class="input-icon">
|
||||||
placeholder="Produkt, Hersteller, Version">
|
<span class="input-icon-addon"><i class="mdi mdi-magnify" aria-hidden="true"></i></span>
|
||||||
|
<input type="search" name="q" id="id_q" value="{{ form.q.value|default:'' }}" class="form-control"
|
||||||
|
placeholder="Produkt, Hersteller oder Version">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-2 d-flex gap-2">
|
<div class="col-12 col-md-4 col-xl-2 d-flex gap-2">
|
||||||
<button type="submit" class="btn btn-primary flex-grow-1"><i class="mdi mdi-filter" aria-hidden="true"></i> Anwenden</button>
|
<button type="submit" class="btn btn-primary flex-grow-1">
|
||||||
<a href="{% url 'plugins:netbox_utilities:software_overview' %}" class="btn btn-outline-secondary" title="Filter zurücksetzen">
|
<i class="mdi mdi-filter" aria-hidden="true"></i> Anwenden
|
||||||
<i class="mdi mdi-backspace" aria-hidden="true"></i>
|
</button>
|
||||||
|
<a href="{% url 'plugins:netbox_utilities:software_overview' %}" class="btn btn-outline-secondary btn-icon"
|
||||||
|
title="Filter zurücksetzen" aria-label="Filter zurücksetzen">
|
||||||
|
<i class="mdi mdi-filter-remove-outline" aria-hidden="true"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-text mt-2">
|
|
||||||
{% if scope_label %}
|
<div class="nbu-sw-filter-footer">
|
||||||
<i class="mdi mdi-filter-check text-primary" aria-hidden="true"></i>
|
<div class="nbu-sw-roles" role="group" aria-label="Gerätrolle">
|
||||||
Es gilt der globale Mandantenfilter <strong>{{ scope_label }}</strong>. Eine eigene Auswahl hier hat Vorrang.
|
<span class="nbu-sw-roles-label">Gerätrolle</span>
|
||||||
{% else %}
|
{% for choice in form.role_id %}
|
||||||
Mandantengruppen schließen alle Untergruppen ein. Ohne Gerätrolle werden alle Geräte berücksichtigt.
|
<input type="checkbox" class="btn-check" name="{{ form.role_id.html_name }}" value="{{ choice.data.value }}"
|
||||||
{% endif %}
|
id="{{ choice.id_for_label }}" autocomplete="off" onchange="this.form.requestSubmit()"
|
||||||
|
{% if choice.data.selected %}checked{% endif %}>
|
||||||
|
<label class="btn btn-sm btn-pill nbu-sw-role" for="{{ choice.id_for_label }}">
|
||||||
|
<i class="mdi mdi-laptop" aria-hidden="true"></i> {{ choice.choice_label }}
|
||||||
|
</label>
|
||||||
|
{% empty %}
|
||||||
|
<span class="text-danger small">Keine Client-Rolle gefunden – <code>software_device_roles</code> prüfen.</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
<div class="nbu-sw-filter-hint">
|
||||||
|
{% if scope_label %}
|
||||||
|
<span class="badge bg-primary-lt"><i class="mdi mdi-filter-check" aria-hidden="true"></i> Globaler Filter: {{ scope_label }}</span>
|
||||||
|
<span class="text-secondary">Eigene Auswahl hat Vorrang.</span>
|
||||||
|
{% else %}
|
||||||
|
<span class="text-secondary">Gruppen schließen Untergruppen ein. Ohne Rollenauswahl: alle Client-Rollen.</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -194,7 +205,12 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<div class="card"><div class="card-body text-center text-muted py-5">
|
<div class="card"><div class="card-body text-center text-muted py-5">
|
||||||
<i class="mdi mdi-package-variant-closed mdi-48px d-block mb-2" aria-hidden="true"></i>
|
<i class="mdi mdi-package-variant-closed mdi-48px d-block mb-2" aria-hidden="true"></i>
|
||||||
Für diese Auswahl ist keine Software erfasst.
|
<div class="fs-3 fw-semibold text-body mb-1">Für diese Auswahl ist keine Software erfasst</div>
|
||||||
|
<div class="mx-auto" style="max-width: 36rem;">
|
||||||
|
Softwarelisten des Windows-Agents und des NetBox Synchronizers werden beim Speichern eines Geräts übernommen.
|
||||||
|
Bereits vorhandene Berichte überträgt einmalig
|
||||||
|
<code>manage.py netbox_utilities_sync_software</code>.
|
||||||
|
</div>
|
||||||
{% if can_add %}<div class="mt-3"><a href="{% url 'plugins:netbox_slm:softwareproductinstallation_add' %}" class="btn btn-primary"><i class="mdi mdi-plus-thick" aria-hidden="true"></i> Installation erfassen</a></div>{% endif %}
|
{% if can_add %}<div class="mt-3"><a href="{% url 'plugins:netbox_slm:softwareproductinstallation_add' %}" class="btn btn-primary"><i class="mdi mdi-plus-thick" aria-hidden="true"></i> Installation erfassen</a></div>{% endif %}
|
||||||
</div></div>
|
</div></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "netbox-utilities"
|
name = "netbox-utilities"
|
||||||
version = "0.29.1"
|
version = "0.29.2"
|
||||||
description = "Navigation, tenant utilities, connection VLANs, partial-width racks, disks, CPU & RAM, switch port export and bulk operations for NetBox 4.6/4.7"
|
description = "Navigation, tenant utilities, connection VLANs, partial-width racks, disks, CPU & RAM, switch port export and bulk operations for NetBox 4.6/4.7"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
Reference in new issue
Block a user