1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #2643: Add description field to console/power components and device bays

This commit is contained in:
Jeremy Stretch
2019-02-20 14:34:05 -05:00
parent 0a06d92c2e
commit bb6fb81fc0
12 changed files with 181 additions and 54 deletions

View File

@@ -445,6 +445,7 @@
{% endif %}
<th>Name</th>
<th>Status</th>
<th>Description</th>
<th colspan="2">Installed Device</th>
<th></th>
</tr>
@@ -570,6 +571,7 @@
<th class="pk"><input type="checkbox" class="toggle" title="Toggle all" /></th>
{% endif %}
<th>Name</th>
<th>Description</th>
<th>Cable</th>
<th colspan="2">Connection</th>
<th></th>
@@ -625,6 +627,7 @@
<th class="pk"><input type="checkbox" class="toggle" title="Toggle all" /></th>
{% endif %}
<th>Name</th>
<th>Description</th>
<th>Cable</th>
<th colspan="2">Connection</th>
<th></th>

View File

@@ -5,6 +5,11 @@
<i class="fa fa-fw fa-keyboard-o"></i> {{ cp }}
</td>
{# Description #}
<td>
{{ cp.description }}
</td>
{# Cable #}
<td>
{% if cp.cable %}

View File

@@ -1,3 +1,5 @@
{% load helpers %}
<tr class="consoleserverport{% if csp.cable.status %} success{% elif csp.cable %} info{% endif %}">
{# Checkbox #}
@@ -12,12 +14,17 @@
<i class="fa fa-fw fa-keyboard-o"></i> {{ csp }}
</td>
{# Description #}
<td>
{{ csp.description|placeholder }}
</td>
{# Cable #}
<td>
{% if csp.cable %}
<a href="{{ csp.cable.get_absolute_url }}">{{ csp.cable }}</a>
{% else %}
&mdash;
<span class="text-muted">&mdash;</span>
{% endif %}
</td>

View File

@@ -1,16 +1,35 @@
{% load helpers %}
<tr class="devicebay">
{% if perms.dcim.change_devicebay or perms.dcim.delete_devicebay %}
<td class="pk">
<input name="pk" type="checkbox" value="{{ devicebay.pk }}" />
</td>
{% endif %}
{# Name #}
<td>
<i class="fa fa-fw fa-{% if devicebay.installed_device %}dot-circle-o{% else %}circle-o{% endif %}"></i> {{ devicebay.name }}
</td>
{# Status #}
<td>
{% if devicebay.installed_device %}
<span class="label label-{{ devicebay.installed_device.get_status_class }}">
{{ devicebay.installed_device.get_status_display }}
</span>
{% else %}
<span class="label label-default">Vacant</span>
{% endif %}
</td>
{# Description #}
<td>
{{ devicebay.description|placeholder }}
</td>
{# Installed device #}
{% if devicebay.installed_device %}
<td>
<span class="label label-{{ devicebay.installed_device.get_status_class }}">{{ devicebay.installed_device.get_status_display }}</span>
</td>
<td>
<a href="{% url 'dcim:device' pk=devicebay.installed_device.pk %}">{{ devicebay.installed_device }}</a>
</td>
@@ -18,11 +37,10 @@
<span>{{ devicebay.installed_device.device_type.display_name }}</span>
</td>
{% else %}
<td></td>
<td colspan="2">
<span class="text-muted">Vacant</span>
</td>
<td colspan="2"></td>
{% endif %}
{# Actions #}
<td class="text-right">
{% if perms.dcim.change_devicebay %}
{% if devicebay.installed_device %}

View File

@@ -1,3 +1,5 @@
{% load helpers %}
<tr class="poweroutlet{% if po.cable.status %} success{% elif po.cable %} info{% endif %}">
{# Checkbox #}
@@ -12,12 +14,17 @@
<i class="fa fa-fw fa-bolt"></i> {{ po }}
</td>
{# Description #}
<td>
{{ po.description|placeholder }}
</td>
{# Cable #}
<td>
{% if po.cable %}
<a href="{{ po.cable.get_absolute_url }}">{{ po.cable }}</a>
{% else %}
&mdash;
<span class="text-muted">&mdash;</span>
{% endif %}
</td>

View File

@@ -5,6 +5,11 @@
<i class="fa fa-fw fa-bolt"></i> {{ pp }}
</td>
{# Description #}
<td>
{{ pp.description }}
</td>
{# Cable #}
<td>
{% if pp.cable %}