mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	* Reference database object by GFK when running scripts & reports via UI * Reference database object by GFK when running scripts & reports via API * Remove old enqueue_job() method * Enable filtering jobs by object * Introduce ObjectJobsView * Add tabbed views for report & script jobs * Add object_id to JobSerializer * Move generic relation to JobsMixin * Clean up old naming
		
			
				
	
	
		
			64 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% extends 'base/layout.html' %}
 | 
						|
{% load helpers %}
 | 
						|
{% load buttons %}
 | 
						|
{% load perms %}
 | 
						|
 | 
						|
{% block title %}{{ script }}{% endblock %}
 | 
						|
 | 
						|
{% block subtitle %}
 | 
						|
  {{ script.Meta.description|markdown }}
 | 
						|
{% endblock %}
 | 
						|
 | 
						|
{% block header %}
 | 
						|
  <div class="row noprint">
 | 
						|
    <div class="col col-md-12">
 | 
						|
      <nav class="breadcrumb-container px-3" aria-label="breadcrumb">
 | 
						|
        <ol class="breadcrumb">
 | 
						|
          <li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}">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="{% url 'extras:script' module=script.module name=script.class_name %}">{{ script }}</a></li>
 | 
						|
          <li class="breadcrumb-item">{{ job.created|annotated_date }}</li>
 | 
						|
        </ol>
 | 
						|
      </nav>
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
  {{ block.super }}
 | 
						|
{% endblock header %}
 | 
						|
 | 
						|
{% block controls %}
 | 
						|
  <div class="controls">
 | 
						|
    <div class="control-group">
 | 
						|
      {% if request.user|can_delete:job %}
 | 
						|
        {% delete_button job %}
 | 
						|
      {% endif %}
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
{% endblock controls %}
 | 
						|
 | 
						|
{% block content-wrapper %}
 | 
						|
  <ul class="nav nav-tabs px-3" role="tablist">
 | 
						|
    <li class="nav-item" role="presentation">
 | 
						|
      <a href="#log" role="tab" data-bs-toggle="tab" class="nav-link active">Log</a>
 | 
						|
    </li>
 | 
						|
    <li class="nav-item" role="presentation">
 | 
						|
      <a href="#source" role="tab" data-bs-toggle="tab" class="nav-link">Source</a>
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
  <div class="tab-content mb-3">
 | 
						|
    <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="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>
 | 
						|
  </div>
 | 
						|
{% endblock content-wrapper %}
 | 
						|
 | 
						|
{% block modals %}
 | 
						|
  {% include 'inc/htmx_modal.html' %}
 | 
						|
{% endblock modals %} |