if > 100 logs, truncate them and add button to show all logs, and stop auto-refresh too

This commit is contained in:
2021-07-03 12:29:01 +10:00
parent 91322d438c
commit c1177b7c0f

View File

@@ -66,6 +66,14 @@
{% for log in logs %}
<tr><td>{{log.log_date|vicdate}}</td><td>{{log.log|safe}}</td></tr>
{% endfor %}
{% if log_cnt > logs|length %}
<tr>
<td class="align-middle">Remaining logs truncated</td>
<td>
<button type="button" class="btn btn-info my-0 py-1" onClick="document.body.innerHTML+='<form id=_fm method=POST action={{url_for('joblog', id=job.id)}}></form>';document.getElementById('_fm').submit();">Show all logs</button>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
@@ -73,7 +81,7 @@
{% endblock main_content %}
{% block script_content %}
<script>
{% if job.pa_job_state != "Completed" %}
{% if first_logs_only and job.pa_job_state != "Completed" %}
setTimeout(function(){ window.location.reload(1); }, 3000 )
{% endif %}
</script>