Files
Netbox-Utilities/netbox_utilities/templates/netbox_utilities/device_disk_setup.html
T
MrBlakeandClaude Opus 5.5 d45afa5e54 feat: several slot areas per device, e.g. front bays and a PCIe card
Disks that are not in the front bays, such as NVMe SSDs on a PCIe card or
M.2 SSDs on a boot card, can now be documented in their own slot area.

- A device can have several areas, each with name, order, slot count,
  rows, first slot, numbering and form factor; the tab shows one grid per
  area with its own fill, select and edit actions.
- Add area, edit area and delete empty areas on the Disks tab.
- Slot numbers are unique per area; drag and drop also moves or swaps
  disks between areas.
- Device type templates store all areas; Apply template creates the
  missing ones.
- Disks get a bay field in forms, CSV import (bay column, optional when
  the device has one area), REST API, GraphQL, filters and tables.
- Migration 0010 turns every existing layout into the area "Front" and
  assigns the existing disks to it.
- The grouped disk overview shows the area in its own column and centres
  the slot number.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 14:46:48 +02:00

49 lines
2.2 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/layout.html' %}
{% block title %}{% if bay %}Bereich {{ bay.name }}{% else %}Neuer Bereich{% endif %} – {{ object }}{% endblock %}
{% block content %}
<div class="row mb-3">
<div class="col col-lg-8 col-xl-6 offset-lg-2 offset-xl-3">
<div class="card">
<h2 class="card-header">
<i class="mdi mdi-view-grid-outline me-1" aria-hidden="true"></i>
{% if bay %}Bereich {{ bay.name }} von {{ object }}{% else %}Neuer Steckplatz-Bereich für {{ object }}{% endif %}
</h2>
<div class="card-body">
{% if bay %}
<div class="alert alert-info">
Bestückte Steckplätze bleiben erhalten. Ein Bereich kann nur verkleinert werden, wenn die wegfallenden Steckplätze leer sind.
</div>
{% else %}
<p class="text-muted">
Ein Bereich ist eine Gruppe von Steckplätzen mit eigener Nummerierung, z. B. die Frontschächte,
ein hinterer Laufwerkskäfig oder eine PCIe-Karte mit zwei NVMe-SSDs.
</p>
{% endif %}
<form method="post">
{% csrf_token %}
{% if bay %}<input type="hidden" name="bay" value="{{ bay.pk }}">{% endif %}
{% include 'netbox_utilities/inc/disk_layout_fields.html' %}
<datalist id="nbu-disk-bay-names">
{% for name in bay_names %}<option value="{{ name }}">{% endfor %}
</datalist>
<div class="d-flex flex-wrap gap-2">
{% if can_delete %}
<button type="submit" name="delete" value="1" formnovalidate class="btn btn-outline-danger me-auto"
onclick="return confirm('Bereich {{ bay.name|escapejs }} löschen?');">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Bereich löschen
</button>
{% else %}
<span class="me-auto"></span>
{% endif %}
<a href="{% url 'dcim:device_disks' pk=object.pk %}" class="btn btn-outline-secondary">Abbrechen</a>
<button type="submit" class="btn btn-primary">Speichern</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock content %}