2022-01-13 10:32:42 -05:00
{% extends 'generic/object_edit.html' %}
{% load form_helpers %}
2023-07-29 03:30:25 +07:00
{% load i18n %}
2022-01-13 10:32:42 -05:00
{% block form %}
< div class = "field-group my-5" >
< div class = "row mb-2" >
2023-07-29 03:30:25 +07:00
< h5 class = "offset-sm-3" > {% trans "Service" %}< / h5 >
2022-01-13 10:32:42 -05:00
< / div >
{# Device/VM selection #}
< div class = "row mb-2" >
< div class = "offset-sm-3" >
< ul class = "nav nav-pills" role = "tablist" >
< li role = "presentation" class = "nav-item" >
< button role = "tab" type = "button" id = "device_tab" data-bs-toggle = "tab" aria-controls = "device" data-bs-target = "#device" class = "nav-link {% if not form.initial.virtual_machine %}active{% endif %}" >
2023-07-29 03:30:25 +07:00
{% trans "Device" %}
2022-01-13 10:32:42 -05:00
< / button >
< / li >
< li role = "presentation" class = "nav-item" >
< button role = "tab" type = "button" id = "vm_tab" data-bs-toggle = "tab" aria-controls = "vm" data-bs-target = "#vm" class = "nav-link {% if form.initial.virtual_machine %}active{% endif %}" >
2023-07-29 03:30:25 +07:00
{% trans "Virtual Machine" %}
2022-01-13 10:32:42 -05:00
< / button >
< / li >
< / ul >
< / div >
< / div >
< div class = "tab-content p-0 border-0" >
< div class = "tab-pane {% if not form.initial.virtual_machine %}active{% endif %}" id = "device" role = "tabpanel" aria-labeled-by = "device_tab" >
{% render_field form.device %}
< / div >
< div class = "tab-pane {% if form.initial.virtual_machine %}active{% endif %}" id = "vm" role = "tabpanel" aria-labeled-by = "vm_tab" >
{% render_field form.virtual_machine %}
< / div >
< / div >
{# Template or custom #}
< div class = "row mb-2" >
< div class = "offset-sm-3" >
< ul class = "nav nav-pills" role = "tablist" >
< li role = "presentation" class = "nav-item" >
< button role = "tab" type = "button" id = "template_tab" data-bs-toggle = "tab" data-bs-target = "#template" class = "nav-link active" >
2023-07-29 03:30:25 +07:00
{% trans "From Template" %}
2022-01-13 10:32:42 -05:00
< / button >
< / li >
< li role = "presentation" class = "nav-item" >
< button role = "tab" type = "button" id = "custom_tab" data-bs-toggle = "tab" data-bs-target = "#custom" class = "nav-link" >
2023-07-29 03:30:25 +07:00
{% trans "Custom" %}
2022-01-13 10:32:42 -05:00
< / button >
< / li >
< / ul >
< / div >
< / div >
< div class = "tab-content p-0 border-0" >
< div class = "tab-pane active" id = "template" role = "tabpanel" aria-labeled-by = "template_tab" >
{% render_field form.service_template %}
< / div >
< div class = "tab-pane" id = "custom" role = "tabpanel" aria-labeled-by = "custom_tab" >
{% render_field form.name %}
{% render_field form.protocol %}
{% render_field form.ports %}
< / div >
< / div >
{% render_field form.ipaddresses %}
{% render_field form.description %}
{% render_field form.tags %}
< / div >
2022-11-04 08:28:09 -04:00
< div class = "field-group my-5" >
{% render_field form.comments %}
< / div >
2022-01-13 10:32:42 -05:00
{% if form.custom_fields %}
< div class = "row mb-2" >
2023-07-29 03:30:25 +07:00
< h5 class = "offset-sm-3" > {% trans "Custom Fields" %}< / h5 >
2022-01-13 10:32:42 -05:00
< / div >
{% render_custom_fields form %}
{% endif %}
{% endblock %}