1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

77 lines
3.7 KiB
HTML
Raw Normal View History

2021-04-16 14:58:44 -07:00
{% extends 'layout.html' %}
2019-08-09 12:33:33 -04:00
{% load helpers %}
2021-04-16 14:58:44 -07:00
{% block title %}Scripts{% endblock %}
2019-08-09 12:33:33 -04:00
{% block content %}
<div class="row">
2021-04-30 15:55:37 -07:00
<div class="col col-md-9">
2019-08-09 12:33:33 -04:00
{% if scripts %}
{% for module, module_scripts in scripts.items %}
<h3><a name="module.{{ module }}"></a>{{ module|bettertitle }}</h3>
<table class="table table-hover table-headings reports">
<thead>
<tr>
2020-07-06 01:58:28 -04:00
<th>Name</th>
<th>Status</th>
<th>Description</th>
2021-04-16 14:58:44 -07:00
<th class="text-end">Last Run</th>
2019-08-09 12:33:33 -04:00
</tr>
</thead>
<tbody>
{% for class_name, script in module_scripts.items %}
<tr>
<td>
<a href="{% url 'extras:script' module=script.module name=class_name %}" name="script.{{ class_name }}"><strong>{{ script }}</strong></a>
2019-08-09 12:33:33 -04:00
</td>
2020-07-06 01:58:28 -04:00
<td>
{% include 'extras/inc/job_label.html' with result=script.result %}
</td>
<td>{{ script.Meta.description|render_markdown }}</td>
2020-07-06 01:58:28 -04:00
{% if script.result %}
2021-04-16 14:58:44 -07:00
<td class="text-end">
2020-08-10 16:27:24 -04:00
<a href="{% url 'extras:script_result' job_result_pk=script.result.pk %}">{{ script.result.created }}</a>
</td>
2020-07-06 01:58:28 -04:00
{% else %}
2021-04-16 14:58:44 -07:00
<td class="text-end text-muted">Never</td>
2020-07-06 01:58:28 -04:00
{% endif %}
2019-08-09 12:33:33 -04:00
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{% else %}
<div class="alert alert-info">
2021-04-16 14:58:44 -07:00
<h4 class="alert-heading">No Scripts Found</h4>
Scripts should be saved to <code>{{ settings.SCRIPTS_ROOT }}</code>.
<hr/>
This path can be changed by setting <code>SCRIPTS_ROOT</code> in NetBox's configuration.
2019-08-09 12:33:33 -04:00
</div>
{% endif %}
</div>
2021-04-30 15:55:37 -07:00
<div class="col col-md-3">
2020-07-06 01:58:28 -04:00
{% if scripts %}
2021-04-16 14:58:44 -07:00
<div class="card">
<div class="card-body">
{% for module, module_scripts in scripts.items %}
<h5>{{ module|bettertitle }}</h5>
<div class="small mb-2">
<ul class="list-group list-group-flush">
{% for class_name, script in module_scripts.items %}
<a href="#script.{{ class_name }}" class="list-group-item">
<i class="mdi mdi-file-chart-outline"></i> {{ script.name }}
<div class="float-end">
{% include 'extras/inc/job_label.html' with result=script.result %}
</div>
</a>
{% endfor %}
</ul>
2020-07-06 01:58:28 -04:00
</div>
2021-04-16 14:58:44 -07:00
{% endfor %}
</div>
2020-07-06 01:58:28 -04:00
</div>
{% endif %}
</div>
2019-08-09 12:33:33 -04:00
</div>
{% endblock %}