{% extends 'generic/_base.html' %} {% load i18n %} {% comment %} Confirm page for the "Apply design" action: apply.py's plan()/run() pair. GET renders the dry run (this template, driven by `result` = plan()); a successful POST redirects away, a refused one re-renders this same template with the refusal (run() returns the SAME ApplyResult shape) -- see views.DesignApplyView. Context: - object: the Design being applied - result: an apply.ApplyResult -- .problems/.created/.updated/.removed/ .deleted/.reverted (see apply.py's dataclasses) - return_url: where Cancel/Back goes {% endcomment %} {% block title %}{% trans "Apply design" %} {{ object }}{% endblock %} {% block content %}
{% blocktrans trimmed with title=object removal=removal_status_label %} Applying {{ title }} materializes its placements in DCIM: a planned device is created (or updated) for every add/move, and the real device behind every remove is flagged {{ removal }}. The design's own status is not changed here. {% endblocktrans %}
{% if result.problems %}| {% trans "Action" %} | {% trans "Count" %} | {% trans "Detail" %} |
|---|---|---|
| {% trans "Create" %} | {{ result.created|length }} |
{% for entry in result.created %}
{{ entry.name }}
{% if entry.blade %}
→ {{ entry.where }}
{% elif entry.rack %}
→ {{ entry.rack }} U{{ entry.position|floatformat:"-1" }} {{ entry.face }}
{% endif %}
{% if entry.recreated %}
{% trans "recreated" %}
{% endif %}
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Racks" %} | {{ result.resolved_racks|length }} |
{% for entry in result.resolved_racks %}
{{ entry.planned_rack.name }}
({{ entry.planned_rack.location }})
{% if entry.created or not entry.rack %}
→ {% trans "created, status planned" %}
{% else %}
→ {% trans "adopts the existing rack" %} {{ entry.rack }}
{% endif %}
{% endfor %}
|
| {% trans "Power feeds" %} | {{ result.feeds|length }} |
{% for entry in result.feeds %}
{{ entry.planned_feed.name }}
{% trans "on" %} {{ entry.power_panel }}
{% if entry.existing %}
→ {% trans "already exists, reused" %}
{% else %}
→ {% trans "created, status planned; its PDUs cabled to it" %}
{% endif %}
{% endfor %}
|
| {% trans "Update" %} | {{ result.updated|length }} |
{% for entry in result.updated %}
{{ entry.device }}: {{ entry.changes.keys|join:", " }}
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Flag for removal" %} | {{ result.removed|length }} |
{% for entry in result.removed %}
{{ entry.device }}
({% trans "was" %} {{ entry.prior_status }})
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Delete" %} | {{ result.deleted|length }} |
{% for entry in result.deleted %}
{{ entry.device_name }}
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Revert" %} | {{ result.reverted|length }} |
{% for entry in result.reverted %}
{{ entry.device_name }} → {{ entry.prior_status }}
{% empty %}
{% trans "none" %}
{% endfor %}
|