Port Log now viewable via an icon by device port name

This commit is contained in:
Oliver Gorwits
2013-12-29 21:28:48 +00:00
parent 7749082dfd
commit a2cc3f989e
11 changed files with 114 additions and 4 deletions

View File

@@ -13,8 +13,8 @@
<form id="[% task.tag %]_form" class="nd_sidebar-form form-stacked"
method="get" action="[% uri_for('/admin') %]">
[% TRY %]
[% INCLUDE "sidebar/admintask/${task.tag}.tt" %]
<script type="text/javascript">has_sidebar["[% task.tag %]"] = 1;</script>
[% INCLUDE "sidebar/admintask/${task.tag}.tt" %]
[% CATCH %]
<script type="text/javascript">has_sidebar["[% task.tag %]"] = 0;</script>
[% END %]
@@ -40,6 +40,12 @@
<span id="nd_device-name">
<a class="nd_adminbutton" name="delall" href="#"><i class="icon-trash text-error"></i></a>
</span>
[% ELSIF task.tag == 'portlog' %]
<span id="nd_device-name">
<a href="[% device_ports %]&q=[% params.q | uri %]&c_admin=on">[% params.q %]</a>
-
<a href="[% device_ports %]&q=[% params.q | uri %]&f=[% params.f | uri %]&c_admin=on">[% params.f %]</a>
</span>
[% ELSIF task.provides_csv %]
<span id="nd_device-name">
<a id="nd_csv-download" href="#" download="netdisco.csv">

View File

@@ -1,5 +1,5 @@
[% IF results.count == 0 %]
<div class="span2 alert alert-info">The aren't enough jobs to report.</div>
<div class="span3 alert alert-info">The aren't enough jobs to report.</div>
[% ELSE %]
<table class="table table-bordered table-condensed table-hover nd_floatinghead">
<thead>

View File

@@ -0,0 +1,29 @@
[% IF results.count == 0 %]
<div class="span2 alert alert-info">This port's log is empty.</div>
[% ELSE %]
<table class="table table-bordered table-condensed table-hover nd_floatinghead">
<thead>
<tr>
<th class="nd_center-cell">Creation</th>
<th class="nd_center-cell">User</th>
<th class="nd_center-cell">User IP</th>
<th class="nd_center-cell">Action</th>
<th class="nd_center-cell">Reason</th>
<th class="nd_center-cell">Log</th>
</tr>
</thead>
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td class="nd_center-cell">[% row.creation | html_entity %]</td>
<td class="nd_center-cell">[% row.username | html_entity %]</td>
<td class="nd_center-cell">[% row.userip | html_entity %]</td>
<td class="nd_center-cell">[% row.action | html_entity %]</td>
<td class="nd_center-cell">[% settings.port_control_reasons.item(row.reason) || row.reason | html_entity %]</td>
<td class="nd_center-cell">[% row.log || '-' | html_entity %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]

View File

@@ -57,6 +57,12 @@
rel="tooltip" data-placement="top" data-offset="3"
data-animation="" data-title="Click to Enable"></i>
[% END %]
<a class="nd_log-icon"
href="[% uri_for('/admin/portlog') %]?q=[% device.dns || device.ip | uri %]&f=[% row.port | uri %]">
<i class="icon-file-text-alt"
rel="tooltip" data-placement="top" data-offset="3"
data-animation="" data-title="View Port Log"></i>
</a>
[% ELSE %]
<td nowrap>
[% END %]

View File

@@ -105,6 +105,7 @@
[% IF settings._admin_tasks.size %]
<li class="divider"></li>
[% FOREACH ai IN settings._admin_tasks.keys.sort %]
[% NEXT IF settings._admin_tasks.$ai.hidden %]
<li><a href="[% uri_for('/admin/' _ ai) %]">[% settings._admin_tasks.$ai.label | html_entity %]</a></li>
[% END %]
[% END %]

View File

@@ -0,0 +1,5 @@
<input name="q" value="[% params.q | html_entity %]" type="hidden"/>
<input name="f" value="[% params.f | html_entity %]" type="hidden"/>
<script type="text/javascript">has_sidebar["portlog"] = 0;</script>