{% extends 'generic/object_edit.html' %} {% load buttons %} {% load custom_links %} {% load form_helpers %} {% load helpers %} {% load perms %} {% load plugins %} {% load tabs %} {% load i18n %} {% load proxbox_tags %} {# Render the SAME object header the detail-style tabs use (generic/object.html), #} {# so switching between the Proxmox Endpoint / Sync Jobs / Settings / SSH / … #} {# tabs keeps identical header chrome — breadcrumb + identifier, object title, #} {# created/updated, Bookmark/Subscribe/Edit/Delete, and the tab strip. Only the #} {# header blocks are overridden; the edit form (block form / content) is left to #} {# object_edit.html, so the save path is unchanged. The view supplies `tab` and #} {# `actions` in the context (ObjectEditView injects neither). #} {% block page-header %}
{# Breadcrumbs #} {# Object identifier #} {% block object_identifier %} {{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }} {% if object.slug %}({{ object.slug }}){% endif %} {% endblock object_identifier %}
{{ block.super }} {% endblock page-header %} {% block title %}{{ object }}{% endblock %} {% block subtitle %}
{% endblock subtitle %} {% block controls %}
{% plugin_buttons object %} {# Add/edit/delete/etc. buttons #} {% block control-buttons %} {# Extra buttons #} {% block extra_controls %}{% endblock %} {# Default buttons #} {% if perms.extras.add_bookmark and object.bookmarks %} {% bookmark_button object %} {% endif %} {% if perms.extras.add_subscription and object.subscriptions %} {% subscribe_button object %} {% endif %} {% action_buttons actions object %} {% endblock control-buttons %}
{# Custom links #}
{% block custom-links %} {% custom_links object %} {% endblock custom-links %}
{% endblock controls %} {# Full object tab strip (primary detail tab + every registered ViewTab), matching #} {# generic/object.html, so the operator can navigate back to the other tabs; the #} {# current tab highlights via context['tab'] (supplied by the view). #} {% block tabs %} {% endblock tabs %} {% block form %} {% for field in form.hidden_fields %} {{ field }} {% endfor %} {# Each configuration section is a selectable tab instead of a stacked card, #} {# so operators can jump straight to a section instead of scrolling. All tab #} {# panes stay in the DOM (Bootstrap only toggles display), so every field #} {# still submits on save regardless of which tab is currently active. #}
{% trans "Connection tunables" %}

{% blocktrans trimmed %} Per-endpoint overrides for the global Proxmox API connection defaults. Leave any field blank to inherit the value from the global plugin settings. {% endblocktrans %}

{% render_field form.timeout %} {% render_field form.max_retries %} {% render_field form.retry_backoff %}
{% trans "Sync mode overrides" %}

{% blocktrans trimmed %} Override whether this endpoint syncs each resource on every run, only bootstraps newly-created records, or skips the resource entirely. Leave blank to inherit the global plugin setting. {% endblocktrans %}

{% for group_label, group_fields in sync_mode_field_groups %}
{{ group_label }}
{% for field_name in group_fields %} {% render_field form|form_field:field_name %} {% endfor %} {% endfor %}
{% trans "Sync overwrite overrides" %}

{% blocktrans trimmed %} Override per-endpoint whether sync overwrites specific fields on existing NetBox objects. Set "Unknown" (the default) to inherit the value from the global Proxbox plugin settings. {% endblocktrans %}

{% for group_label, group_fields in overwrite_field_groups %}
{{ group_label }}
{% for field_name in group_fields %} {% render_field form|form_field:field_name %} {% endfor %} {% endfor %}
{% trans "Tenant assignment overrides" %}

{% blocktrans trimmed %} Override post-sync Tenant assignment behavior for virtual machines from this endpoint. Leave toggle fields blank to inherit the global setting. {% endblocktrans %}

{% render_field form.enable_tenant_name_regex %} {% render_field form.tenant_name_regex_rules %} {% render_field form.enable_tenant_tag_assignment %} {% render_field form.enable_tenant_from_cluster %}
{% if form.changelog_message %}
{% render_field form.changelog_message %}
{% endif %} {% endblock form %} {% block javascript %} {{ block.super }} {# On load we activate the right sub-tab: (1) if the form redisplayed with a #} {# validation error, the errored field may sit on an inactive tab and be #} {# invisible — NetBox's render_field wraps its row in `.has-errors`, so we open #} {# the first tab pane containing one; (2) otherwise, if the URL hash targets a #} {# pane (e.g. `#proxbox-settings-overwrite` from the Overwrite Behavior tab's #} {# Edit button), we open that pane. We click the controlling nav button (which #} {# keeps type="button", so this never resubmits the form) rather than #} {# constructing a Bootstrap Tab instance, because NetBox's bundle registers the #} {# tab data-api but does not expose window.Tab. Runs inside DOMContentLoaded so #} {# data-api registration is guaranteed complete before the click. #} {% endblock javascript %}