skip login in dev env, set ports tab on device links
This commit is contained in:
@@ -13,9 +13,13 @@ use List::MoreUtils ();
|
|||||||
|
|
||||||
hook 'before' => sub {
|
hook 'before' => sub {
|
||||||
if (! session('user') && request->path !~ m{^/login}) {
|
if (! session('user') && request->path !~ m{^/login}) {
|
||||||
session(user => 'oliver'); # XXX
|
if (setting('environment') eq 'development') {
|
||||||
#var(requested_path => request->path);
|
session(user => 'developer');
|
||||||
#request->path_info('/');
|
}
|
||||||
|
else {
|
||||||
|
var(requested_path => request->path);
|
||||||
|
request->path_info('/');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# make hash lookups of query lists
|
# make hash lookups of query lists
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
[% END %]
|
[% END %]
|
||||||
<td>Switch Port</td>
|
<td>Switch Port</td>
|
||||||
<td><a href="/device?ip=[% node.switch | url %]&port=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
|
<td><a href="/device?tab=ports&ip=[% node.switch | url %]&port=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
|
||||||
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
|
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
|
||||||
[% ' <span class="label warning">a</span>' IF NOT node.active %]
|
[% ' <span class="label warning">a</span>' IF NOT node.active %]
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
[% END %]
|
[% END %]
|
||||||
<td>Switch Port</td>
|
<td>Switch Port</td>
|
||||||
<td><a href="/device?ip=[% node.switch | url %]&port=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
|
<td><a href="/device?tab=ports&ip=[% node.switch | url %]&port=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
|
||||||
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
|
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
|
||||||
[% ' <span class="label warning">a</span>' IF NOT node.active %]
|
[% ' <span class="label warning">a</span>' IF NOT node.active %]
|
||||||
</td>
|
</td>
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
[% END %]
|
[% END %]
|
||||||
<td>Switch Port</td>
|
<td>Switch Port</td>
|
||||||
<td><a href="/device?ip=[% port.ip | url %]&port=[% port.port | url %]">[% port.ip %] [ [% port.port %] ]</a>
|
<td><a href="/device?tab=ports&ip=[% port.ip | url %]&port=[% port.port | url %]">[% port.ip %] [ [% port.port %] ]</a>
|
||||||
[% ' (' _ port.device.dns.remove(settings.domain_suffix) _ ')' IF port.device.dns %]
|
[% ' (' _ port.device.dns.remove(settings.domain_suffix) _ ')' IF port.device.dns %]
|
||||||
</td>
|
</td>
|
||||||
[% IF params.stamps %]
|
[% IF params.stamps %]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
[% WHILE (row = results.next) %]
|
[% WHILE (row = results.next) %]
|
||||||
<tr>
|
<tr>
|
||||||
<td>[% row.name %]</td>
|
<td>[% row.name %]</td>
|
||||||
<td><a href="/device?ip=[% row.ip %]&port=[% row.port %]">[% row.ip %] [ [% row.port %] ]</a>
|
<td><a href="/device?tab=ports&ip=[% row.ip %]&port=[% row.port %]">[% row.ip %] [ [% row.port %] ]</a>
|
||||||
[% ' (' _ row.device.dns.remove(settings.domain_suffix) _ ')' IF row.device.dns %]
|
[% ' (' _ row.device.dns.remove(settings.domain_suffix) _ ')' IF row.device.dns %]
|
||||||
</td>
|
</td>
|
||||||
<td>[% row.descr %]</td>
|
<td>[% row.descr %]</td>
|
||||||
|
|||||||
@@ -13,17 +13,17 @@
|
|||||||
[% WHILE (row = results.next) %]
|
[% WHILE (row = results.next) %]
|
||||||
<tr>
|
<tr>
|
||||||
<td><a class="nd_linkcell nd_stealthlink"
|
<td><a class="nd_linkcell nd_stealthlink"
|
||||||
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vlan.vlan %]</a></td>
|
href="/device?tab=ports&ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vlan.vlan %]</a></td>
|
||||||
<td><a class="nd_linkcell"
|
<td><a class="nd_linkcell"
|
||||||
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.dns %]</a></td>
|
href="/device?tab=ports&ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.dns %]</a></td>
|
||||||
<td><a class="nd_linkcell nd_stealthlink"
|
<td><a class="nd_linkcell nd_stealthlink"
|
||||||
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vlan.description %]</a></td>
|
href="/device?tab=ports&ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vlan.description %]</a></td>
|
||||||
<td><a class="nd_linkcell nd_stealthlink"
|
<td><a class="nd_linkcell nd_stealthlink"
|
||||||
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.model %]</a></td>
|
href="/device?tab=ports&ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.model %]</a></td>
|
||||||
<td><a class="nd_linkcell nd_stealthlink"
|
<td><a class="nd_linkcell nd_stealthlink"
|
||||||
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.os %]</a></td>
|
href="/device?tab=ports&ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.os %]</a></td>
|
||||||
<td><a class="nd_linkcell nd_stealthlink"
|
<td><a class="nd_linkcell nd_stealthlink"
|
||||||
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vendor %]</a></td>
|
href="/device?tab=ports&ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vendor %]</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
[% END %]
|
[% END %]
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="/search">
|
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="/device">
|
||||||
<input name="ip" value="[% d.ip %]" type="hidden"/>
|
<input name="ip" value="[% d.ip %]" type="hidden"/>
|
||||||
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
||||||
<div class="nd_search clearfix">
|
<div class="nd_search clearfix">
|
||||||
|
|||||||
Reference in New Issue
Block a user