Files
Netbox-Utilities/netbox_utilities/templates/netbox_utilities/device_disk_fill.html
T
MrBlakeandClaude Opus 5.5 adbd697c0a feat: add disk management tab for servers, NAS, SAN and MSA devices
Devices whose role is one of disk_device_roles (default Server, NAS, SAN,
MSA) get a "Datenträger" tab with slot layout, disks, RAID groups,
warranty and age warnings, replacement history, CSV import, REST API and
GraphQL.

- First-visit wizard for slot count, rows, first slot number, numbering
  and form factor; layouts can be saved as device type templates and
  applied with one click.
- Slot grid drawn like the device front, coloured by status, with
  warning icons; free slots open a pre-filled disk form.
- Bulk fill of selected slots with shared attributes and one serial per
  line (barcode scanner friendly), with live count and duplicate checks.
- Sizes in vendor notation (960 GB, 4 TB, 1,92 TB, 2 TiB); the tenant is
  always taken from the device and follows tenant changes.
- RAID groups (RAID 0/1/5/6/10/50/60, RAID-Z1/Z2/Z3, JBOD) with hot
  spares, usable capacity, tolerated failures and degraded state.
- "Ersetzen" marks a disk as removed and opens the successor form;
  removed disks stay as per-slot history.
- Warnings for failed disks, expired or expiring warranties and disks
  older than disk_age_warning_years.
- Global disk list with filters, export, global search by serial,
  optional device list column, CSV import, REST API and GraphQL.
- New settings: disks_enabled, disk_device_roles,
  disk_age_warning_years, disk_warranty_warning_days.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:01:56 +02:00

74 lines
3.4 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' %}
{% load static %}
{% block title %}Datenträger bestücken – {{ object }}{% endblock %}
{% block content %}
<form method="post" id="nbu-disk-fill-form">
{% csrf_token %}
<div class="row mb-3">
<div class="col col-xl-10 offset-xl-1">
{% if form.non_field_errors %}<div class="alert alert-danger">{{ form.non_field_errors }}</div>{% endif %}
<div class="card mb-3">
<h2 class="card-header"><i class="mdi mdi-tray-plus me-1" aria-hidden="true"></i>Mehrere Steckplätze von {{ object }} bestücken</h2>
<div class="card-body">
{% if not free_slots %}
<div class="alert alert-warning mb-0">Alle Steckplätze sind bereits bestückt.</div>
{% else %}
<label class="form-label required">Steckplätze</label>
<div class="nbu-disk-fill-slots mb-1">
{% for checkbox in form.slots %}
<label class="btn btn-sm btn-outline-primary nbu-disk-fill-slot">
{{ checkbox.tag }} {{ checkbox.choice_label }}
</label>
{% endfor %}
</div>
{% for error in form.slots.errors %}<div class="text-danger small">{{ error }}</div>{% endfor %}
<div class="form-text mb-3">Alle gewählten Steckplätze erhalten dieselben Angaben, nur die Seriennummern unterscheiden sich.</div>
{% endif %}
</div>
</div>
{% if free_slots %}
<div class="row">
<div class="col-12 col-lg-7">
<div class="card mb-3">
<h2 class="card-header">Gemeinsame Angaben</h2>
<div class="card-body">
<div class="row g-3">
{% for field in form %}
{% if field.name != "slots" and field.name != "serials" %}
<div class="col-12 col-md-6">
<label class="form-label{% if field.field.required %} required{% endif %}" for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% if field.help_text %}<div class="form-text">{{ field.help_text }}</div>{% endif %}
{% for error in field.errors %}<div class="text-danger small">{{ error }}</div>{% endfor %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-5">
<div class="card mb-3">
<h2 class="card-header"><i class="mdi mdi-barcode-scan me-1" aria-hidden="true"></i>Seriennummern</h2>
<div class="card-body">
{{ form.serials }}
<div class="form-text">{{ form.serials.help_text }}</div>
<div class="small mt-2" data-nbu-serial-status></div>
{% for error in form.serials.errors %}<div class="text-danger small">{{ error }}</div>{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}
<div class="text-end">
<a href="{{ return_url }}" class="btn btn-outline-secondary">Abbrechen</a>
{% if free_slots %}<button type="submit" class="btn btn-primary">Datenträger einbauen</button>{% endif %}
</div>
</div>
</div>
</form>
<script src="{% static 'netbox_utilities/disks.js' %}" defer></script>
{% endblock content %}