add a template for computer details

This commit is contained in:
Andreas Zweili 2017-12-25 13:38:31 +01:00
parent 9fc5279193
commit 9cc24b3f81
2 changed files with 62 additions and 0 deletions

View File

@ -534,3 +534,41 @@ information.
{% endif %}
{% endblock %}
#+END_SRC
** computer_details.html
The computer details show all the known information about the selected computer.
#+BEGIN_SRC html :tangle ../inventory/templates/inventory/computer_details.html
{% extends "inventory/base.html" %}
{% block section_title %}{{ computer.name }}{% endblock %}
{% block content %}
<h3>Description</h3>
<p>{{ computer.description }}</p>
<p><b>Hostname:</b> {{ computer.hostname }}</p>
<p><b>OS:</b> {{ computer.os }}</p>
<p><b>CPU:</b> {{ cpu.cpu }}</p>
<p><b>RAM Modules: </b>{{ram.amount}}x {{ ram.ram }}</p>
<p><b>IP:</b> {{ computer.ip }}</p>
<p><b>Disks:</b> {{ disks.disk }}</p>
<p><b>Host:</b> {{ computer.host }}</p>
#+END_SRC
The list of cron jobs running on the computer get's only displayed if
there are any cron jobs.
#+BEGIN_SRC html :tangle ../inventory/templates/inventory/computer_details.html
{% if cronjob_list %}
<p><b>Cron Jobs:</b></p>
<p>
<ul>
{% for cronjob in cronjob_list %}
<li><a href="{% url 'cronjob' cronjob.id %}">{{ cronjob.name }}
{{ cronjob.time }} {{ cronjob.weekday }} {{ cronjob.month }}</a></li>
{% endfor %}
</ul>
</p>
{% endif %}
{% endblock %}
#+END_SRC

View File

@ -0,0 +1,24 @@
{% extends "inventory/base.html" %}
{% block section_title %}{{ computer.name }}{% endblock %}
{% block content %}
<h3>Description</h3>
<p>{{ computer.description }}</p>
<p><b>Hostname:</b> {{ computer.hostname }}</p>
<p><b>OS:</b> {{ computer.os }}</p>
<p><b>CPU:</b> {{ cpu.cpu }}</p>
<p><b>RAM Modules: </b>{{ram.amount}}x {{ ram.ram }}</p>
<p><b>IP:</b> {{ computer.ip }}</p>
<p><b>Disks:</b> {{ disks.disk }}</p>
<p><b>Host:</b> {{ computer.host }}</p>
{% if cronjob_list %}
<p><b>Cron Jobs:</b></p>
<p>
<ul>
{% for cronjob in cronjob_list %}
<li><a href="{% url 'cronjob' cronjob.id %}">{{ cronjob.name }}
{{ cronjob.time }} {{ cronjob.weekday }} {{ cronjob.month }}</a></li>
{% endfor %}
</ul>
</p>
{% endif %}
{% endblock %}