2020-04-10 10:21:02 -04:00
{% extends 'base.html' %}
2019-08-09 12:33:33 -04:00
{% load helpers %}
{% block content %}
< h1 > {% block title %}Scripts{% endblock %}< / h1 >
< div class = "row" >
2020-07-06 01:58:28 -04:00
< div class = "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 >
< th class = "text-right" > Last Run< / th >
2019-08-09 12:33:33 -04:00
< / tr >
< / thead >
< tbody >
{% for class_name, script in module_scripts.items %}
< tr >
< td >
2019-10-30 09:13:26 -04:00
< 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 >
2019-08-12 13:16:18 -04:00
< td > {{ script.Meta.description }}< / td >
2020-07-06 01:58:28 -04:00
{% if script.result %}
2020-08-10 16:27:24 -04:00
< td class = "text-right" >
< 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 %}
< td class = "text-right text-muted" > Never< / td >
{% endif %}
2019-08-09 12:33:33 -04:00
< / tr >
{% endfor %}
< / tbody >
< / table >
{% endfor %}
{% else %}
< div class = "alert alert-info" >
< p > < strong > No scripts found.< / strong > < / p >
2019-08-21 15:46:06 -04:00
< p > Scripts should be saved to < code > {{ settings.SCRIPTS_ROOT }}< / code > . (This path can be changed by setting < code > SCRIPTS_ROOT< / code > in NetBox's configuration.)< / p >
2019-08-09 12:33:33 -04:00
< / div >
{% endif %}
< / div >
2020-07-06 01:58:28 -04:00
< div class = "col-md-3" >
{% if scripts %}
< div class = "panel panel-default" >
{% for module, module_scripts in scripts.items %}
< div class = "panel-heading" >
< strong > {{ module|bettertitle }}< / strong >
< / div >
< ul class = "list-group" >
{% for class_name, script in module_scripts.items %}
< a href = "#script.{{ class_name }}" class = "list-group-item" >
< i class = "fa fa-list-alt" > < / i > {{ script.name }}
< div class = "pull-right" >
{% include 'extras/inc/job_label.html' with result=script.result %}
< / div >
< / a >
{% endfor %}
< / ul >
{% endfor %}
< / div >
{% endif %}
< / div >
2019-08-09 12:33:33 -04:00
< / div >
{% endblock %}