|
|
@@ -37,43 +37,49 @@
|
|
|
</h5>
|
|
|
<div class="card-body">
|
|
|
{% include 'inc/sync_warning.html' with object=module %}
|
|
|
- <table class="table table-hover table-headings reports">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th width="250">Name</th>
|
|
|
- <th>Description</th>
|
|
|
- <th>Last Run</th>
|
|
|
- <th class="text-end">Status</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- {% with jobs=module.get_latest_jobs %}
|
|
|
- {% for script_name, script_class in module.scripts.items %}
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <a href="{% url 'extras:script' module=module.python_name name=script_name %}" name="script.{{ script_name }}">{{ script_class.name }}</a>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- {{ script_class.Meta.description|markdown|placeholder }}
|
|
|
- </td>
|
|
|
- {% with last_result=jobs|get_key:script_class.name %}
|
|
|
- {% if last_result %}
|
|
|
- <td>
|
|
|
- <a href="{% url 'extras:script_result' job_pk=last_result.pk %}">{{ last_result.created|annotated_date }}</a>
|
|
|
- </td>
|
|
|
- <td class="text-end">
|
|
|
- {% badge last_result.get_status_display last_result.get_status_color %}
|
|
|
- </td>
|
|
|
- {% else %}
|
|
|
- <td class="text-muted">Never</td>
|
|
|
- <td class="text-end">{{ ''|placeholder }}</td>
|
|
|
- {% endif %}
|
|
|
- {% endwith %}
|
|
|
- </tr>
|
|
|
- {% endfor %}
|
|
|
- {% endwith %}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ {% if not module.scripts %}
|
|
|
+ <div class="alert alert-warning d-flex align-items-center" role="alert">
|
|
|
+ <i class="mdi mdi-alert"></i> Script file at: {{module.full_path}} could not be loaded.
|
|
|
+ </div>
|
|
|
+ {% else %}
|
|
|
+ <table class="table table-hover table-headings reports">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th width="250">Name</th>
|
|
|
+ <th>Description</th>
|
|
|
+ <th>Last Run</th>
|
|
|
+ <th class="text-end">Status</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ {% with jobs=module.get_latest_jobs %}
|
|
|
+ {% for script_name, script_class in module.scripts.items %}
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <a href="{% url 'extras:script' module=module.python_name name=script_name %}" name="script.{{ script_name }}">{{ script_class.name }}</a>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{ script_class.Meta.description|markdown|placeholder }}
|
|
|
+ </td>
|
|
|
+ {% with last_result=jobs|get_key:script_class.name %}
|
|
|
+ {% if last_result %}
|
|
|
+ <td>
|
|
|
+ <a href="{% url 'extras:script_result' job_pk=last_result.pk %}">{{ last_result.created|annotated_date }}</a>
|
|
|
+ </td>
|
|
|
+ <td class="text-end">
|
|
|
+ {% badge last_result.get_status_display last_result.get_status_color %}
|
|
|
+ </td>
|
|
|
+ {% else %}
|
|
|
+ <td class="text-muted">Never</td>
|
|
|
+ <td class="text-end">{{ ''|placeholder }}</td>
|
|
|
+ {% endif %}
|
|
|
+ {% endwith %}
|
|
|
+ </tr>
|
|
|
+ {% endfor %}
|
|
|
+ {% endwith %}
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ {% endif %}
|
|
|
</div>
|
|
|
</div>
|
|
|
{% empty %}
|