add a table which lists all the cron jobs
This commit is contained in:
parent
afb2d0ed95
commit
4a21cc6ad3
|
@ -410,11 +410,13 @@ from .models import (GeneralDevice, Computer, CronJob,
|
|||
def index(request):
|
||||
device_list = GeneralDevice.objects.all()
|
||||
computer_list = Computer.objects.all().order_by('ip')
|
||||
cronjob_list = CronJob.objects.all().order_by('host')
|
||||
|
||||
return render(request,
|
||||
'inventory/index.html',
|
||||
{'device_list': device_list,
|
||||
'computer_list': computer_list})
|
||||
'computer_list': computer_list,
|
||||
'cronjob_list': cronjob_list})
|
||||
|
||||
|
||||
def device_details(request, device_id):
|
||||
|
@ -564,6 +566,29 @@ information.
|
|||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% if cronjob_list %}
|
||||
<h3>Cron Job List</h3>
|
||||
<table cellpadding="10">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Hostname</th>
|
||||
<th>Time</th>
|
||||
<th>Day of Week</th>
|
||||
<th>Day of Month</th>
|
||||
<th>Month</th>
|
||||
</tr>
|
||||
{% for cronjob in cronjob_list %}
|
||||
<tr>
|
||||
<td><a href="{% url 'cronjob' cronjob.id %}">{{ cronjob.name }}</a></td>
|
||||
<td>{{ cronjob.host }}</td>
|
||||
<td>{{ cronjob.time }}</td>
|
||||
<td>{{ cronjob.weekday }}</td>
|
||||
<td>{{ cronjob.day }}</td>
|
||||
<td>{{ cronjob.month }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
#+END_SRC
|
||||
|
||||
|
|
|
@ -21,4 +21,27 @@
|
|||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% if cronjob_list %}
|
||||
<h3>Cron Job List</h3>
|
||||
<table cellpadding="10">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Hostname</th>
|
||||
<th>Time</th>
|
||||
<th>Day of Week</th>
|
||||
<th>Day of Month</th>
|
||||
<th>Month</th>
|
||||
</tr>
|
||||
{% for cronjob in cronjob_list %}
|
||||
<tr>
|
||||
<td><a href="{% url 'cronjob' cronjob.id %}">{{ cronjob.name }}</a></td>
|
||||
<td>{{ cronjob.host }}</td>
|
||||
<td>{{ cronjob.time }}</td>
|
||||
<td>{{ cronjob.weekday }}</td>
|
||||
<td>{{ cronjob.day }}</td>
|
||||
<td>{{ cronjob.month }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -9,11 +9,13 @@ from .models import (GeneralDevice, Computer, CronJob,
|
|||
def index(request):
|
||||
device_list = GeneralDevice.objects.all()
|
||||
computer_list = Computer.objects.all().order_by('ip')
|
||||
cronjob_list = CronJob.objects.all().order_by('host')
|
||||
|
||||
return render(request,
|
||||
'inventory/index.html',
|
||||
{'device_list': device_list,
|
||||
'computer_list': computer_list})
|
||||
'computer_list': computer_list,
|
||||
'cronjob_list': cronjob_list})
|
||||
|
||||
|
||||
def device_details(request, device_id):
|
||||
|
|
Loading…
Reference in New Issue