feat: rack photo appendix and virtualization cluster section
Rack image attachments can be picked with thumbnails in the export form and are placed in an appendix, linked from below each rack elevation (Word: internal hyperlinks to bookmarks). New section lists clusters with hosts and summed VM resources, counting only VMs inside the export scope. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
74dfa0ec61
commit
c888a65180
12 files changed
+314
-16
No files matched your search
@@ -66,6 +66,7 @@ class ExportForm(forms.Form):
|
||||
)
|
||||
rack_devices = forms.BooleanField(required=False, initial=True, label="Geräteliste je Rack")
|
||||
rack_pagebreak = forms.BooleanField(required=False, initial=True, label="Seitenumbruch nach jedem Rack")
|
||||
rack_photos = forms.MultipleChoiceField(choices=(), required=False, widget=forms.CheckboxSelectMultiple, label="Rack-Fotos")
|
||||
|
||||
topo_details = forms.MultipleChoiceField(
|
||||
choices=(("model", "Modell"), ("primary_ip", "Management-IP"), ("ports", "Ports an Verbindungen")),
|
||||
@@ -108,6 +109,12 @@ class ExportForm(forms.Form):
|
||||
elif isinstance(field.widget, forms.TextInput):
|
||||
field.widget.attrs["class"] = "form-control"
|
||||
self.fields["branding"].choices = [(k, b["name"]) for k, b in get_brandings().items()]
|
||||
self.photo_groups = []
|
||||
if scope is not None:
|
||||
from .rack_photos import grouped
|
||||
|
||||
self.photo_groups = grouped(scope)
|
||||
self.fields["rack_photos"].choices = [(str(a.pk), a.name) for _r, atts in self.photo_groups for a in atts]
|
||||
if scope is not None:
|
||||
role_ids = scope.devices().values("role")
|
||||
roles = DeviceRole.objects.filter(pk__in=role_ids).order_by("name")
|
||||
|
||||
Reference in new issue
Block a user