mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
- Introduces the Script model to represent individual Python classes within a ScriptModule file - Automatically migrates jobs & event rules --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
60 lines
2.0 KiB
HTML
60 lines
2.0 KiB
HTML
{% extends 'generic/_base.html' %}
|
|
{% load helpers %}
|
|
{% load buttons %}
|
|
{% load perms %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{{ script }}{% endblock %}
|
|
|
|
{% block subtitle %}
|
|
{{ script.Meta.description|markdown }}
|
|
{% endblock %}
|
|
|
|
{% block page-header %}
|
|
<div class="container-xl mt-2">
|
|
<nav class="breadcrumb-container" aria-label="breadcrumb">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}">{% trans "Scripts" %}</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}#module.{{ script.module }}">{{ script.module|bettertitle }}</a></li>
|
|
<li class="breadcrumb-item"><a href="{{ script.get_absolute_url }}">{{ script }}</a></li>
|
|
<li class="breadcrumb-item">{{ job.created|annotated_date }}</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
{% endblock page-header %}
|
|
|
|
{% block controls %}
|
|
{% if request.user|can_delete:job %}
|
|
{% delete_button job %}
|
|
{% endif %}
|
|
{% endblock controls %}
|
|
|
|
{% block tabs %}
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
<li class="nav-item" role="presentation">
|
|
<a href="#log" role="tab" data-bs-toggle="tab" class="nav-link active">{% trans "Log" %}</a>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<a href="#source" role="tab" data-bs-toggle="tab" class="nav-link">{% trans "Source" %}</a>
|
|
</li>
|
|
</ul>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div role="tabpanel" class="tab-pane active" id="log">
|
|
<div class="row">
|
|
<div class="col col-md-12"{% if not job.completed %} hx-get="{% url 'extras:script_result' job_pk=job.pk %}" hx-trigger="load delay:0.5s, every 5s"{% endif %}>
|
|
{% include 'extras/htmx/script_result.html' %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div role="tabpanel" class="tab-pane" id="source">
|
|
<p><code>{{ script.filename }}</code></p>
|
|
<pre class="block">{{ script.source }}</pre>
|
|
</div>
|
|
{% endblock content %}
|
|
|
|
{% block modals %}
|
|
{% include 'inc/htmx_modal.html' %}
|
|
{% endblock modals %}
|