make app portable through uri_base

This commit is contained in:
Oliver Gorwits
2012-01-15 23:09:43 +00:00
parent e2e032de18
commit c555fc9330
18 changed files with 59 additions and 54 deletions

View File

@@ -14,10 +14,10 @@
<td>[% row.alias %]</a>
<td>[% row.dns.remove(settings.domain_suffix) %]</a>
<td class="center_cell"><a class="nd_linkcell"
href="/device?tab=ports&ip=[% row.ip %]&q=[% row.port %]">[% row.port %]</a></td>
href="[% uri_base %]/device?tab=ports&ip=[% row.ip %]&q=[% row.port %]">[% row.port %]</a></td>
<td>[% row.device_port.name %]</td>
<td><a class="nd_linkcell"
href="/search?tab=node&q=[% row.subnet %]">[% row.subnet %]</a></td>
href="[% uri_base %]/search?tab=node&q=[% row.subnet %]">[% row.subnet %]</a></td>
</tr>
[% END %]
</tbody>

View File

@@ -8,7 +8,7 @@
<td>Location</td>
<td>
<a rel="twipsy" data-placement="above" data-offset="5" title="Find Similar Devices"
href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&location=[% d.location | uri %]">[% d.location %]</a>
href="[% uri_base %]/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&location=[% d.location | uri %]">[% d.location %]</a>
</td>
</tr>
<tr>
@@ -19,10 +19,10 @@
<td>Vendor / Model</td>
<td>
<a rel="twipsy" data-placement="above" data-offset="5" title="Find Similar Devices"
href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&vendor=[% d.vendor | uri %]">[% d.vendor %]</a>
href="[% uri_base %]/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&vendor=[% d.vendor | uri %]">[% d.vendor %]</a>
/
<a rel="twipsy" data-placement="above" data-offset="5" title="Find Similar Devices"
href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&model=[% d.model | uri %]">[% d.model %]</a>
href="[% uri_base %]/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&model=[% d.model | uri %]">[% d.model %]</a>
</td>
</tr>
<tr>
@@ -30,7 +30,7 @@
<td>[% d.os %] /
<a rel="twipsy" data-placement="above" data-offset="5"
title="Find Similar Devices"
href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver %]</a>
href="[% uri_base %]/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver %]</a>
</td>
</tr>
<tr>

View File

@@ -58,7 +58,7 @@
[% IF params.c_vlan %]
<td class="center_cell">
<a class="nd_linkcell"
href="/search?tab=vlan&q=[% row.vlan | uri %]">[% row.vlan | html_entity %]</a>
href="[% uri_base %]/search?tab=vlan&q=[% row.vlan | uri %]">[% row.vlan | html_entity %]</a>
</td>
[% END %]
[% IF params.c_vmember %]
@@ -69,7 +69,7 @@
[% SET count = 0 %]
[% FOREACH vlan IN row.tagged_vlans %]
[% SET output = output _
'<a href="/search?tab=vlan&q=' _ vlan.vlan _ '">' _ vlan.vlan _ '</a>' %]
'<a href="[% uri_base %]/search?tab=vlan&q=' _ vlan.vlan _ '">' _ vlan.vlan _ '</a>' %]
[% SET output = output _ ', ' IF NOT loop.last %]
[% SET count = count + 1 %]
[% END %]
@@ -85,28 +85,28 @@
<td>
[% IF row.remote_ip %]
[% IF row.neighbor %]
<a href="/device?tab=ports&ip=[% row.neighbor.ip | uri %]&q=[% row.remote_port | uri %]">
<a href="[% uri_base %]/device?tab=ports&ip=[% row.neighbor.ip | uri %]&q=[% row.remote_port | uri %]">
[% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip %]
([% row.remote_port | html_entity %])</a>
[% ELSE %]
<span class="label important">n</span>
<a href="/search?tab=node&q=[% row.remote_ip | uri %]">[% row.remote_ip %] ([% row.remote_port %])
<a href="[% uri_base %]/search?tab=node&q=[% row.remote_ip | uri %]">[% row.remote_ip %] ([% row.remote_port %])
<br/>&nbsp; ([% row.remote_type %]) / ([% row.remote_id %])</a>
[% END %]
[% END %]
[% FOREACH node IN row.get_nodes(params.n_archived) %]
[% '<br/>' IF row.remote_ip OR NOT loop.first %]
[% '<span class="label warning">a</span> &nbsp;' IF NOT node.active %]
<a href="/search?tab=node&q=[% node.mac | uri %]">[% node.mac %]</a>
<a href="[% uri_base %]/search?tab=node&q=[% node.mac | uri %]">[% node.mac %]</a>
[% ' (' _ node.time_last _ ')' IF params.n_age %]
[% IF params.n_ip %]
[% FOREACH ip IN node.ips %]
<br/>&nbsp; [% '<span class="label warning">a</span> &nbsp;' IF NOT ip.active %]
[% SET dns = ip.dns %]
[% IF dns %]
<a href="/search?tab=node&q=[% ip.ip | uri %]">[% ip.dns %] ([% ip.ip %])</a>
<a href="[% uri_base %]/search?tab=node&q=[% ip.ip | uri %]">[% ip.dns %] ([% ip.ip %])</a>
[% ELSE %]
<a href="/search?tab=node&q=[% ip.ip | uri %]">[% ip.ip %]</a>
<a href="[% uri_base %]/search?tab=node&q=[% ip.ip | uri %]">[% ip.ip %]</a>
[% END %]
[% END %]
[% END %]