diff --git a/Netdisco/lib/Netdisco/Web.pm b/Netdisco/lib/Netdisco/Web.pm index 88353072..08c82c82 100644 --- a/Netdisco/lib/Netdisco/Web.pm +++ b/Netdisco/lib/Netdisco/Web.pm @@ -11,11 +11,6 @@ use Netdisco::Web::AuthN; use Netdisco::Web::Search; use Netdisco::Web::Device; -hook 'before_template' => sub { - my $tokens = shift; - $tokens->{uri_base} = request->base->path; -}; - get '/' => sub { template 'index'; }; diff --git a/Netdisco/views/ajax/device/addresses.tt b/Netdisco/views/ajax/device/addresses.tt index 2a3805ff..1db6fe8f 100644 --- a/Netdisco/views/ajax/device/addresses.tt +++ b/Netdisco/views/ajax/device/addresses.tt @@ -14,10 +14,10 @@ [% row.alias %] [% row.dns.remove(settings.domain_suffix) %] [% row.port %] + href="/device?tab=ports&ip=[% row.ip %]&q=[% row.port %]">[% row.port %] [% row.device_port.name %] [% row.subnet %] + href="/search?tab=node&q=[% row.subnet %]">[% row.subnet %] [% END %] diff --git a/Netdisco/views/ajax/device/details.tt b/Netdisco/views/ajax/device/details.tt index 2ff9becf..417664d3 100644 --- a/Netdisco/views/ajax/device/details.tt +++ b/Netdisco/views/ajax/device/details.tt @@ -8,7 +8,7 @@ Location [% d.location %] + href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&location=[% d.location | uri %]">[% d.location %] @@ -19,10 +19,10 @@ Vendor / Model [% d.vendor %] + href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&vendor=[% d.vendor | uri %]">[% d.vendor %] / [% d.model %] + href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&model=[% d.model | uri %]">[% d.model %] @@ -30,7 +30,7 @@ [% d.os %] / [% d.os_ver %] + href="/search?[% vars.query_defaults.device %]&q=[% d.dns | uri %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver %] diff --git a/Netdisco/views/ajax/device/ports.tt b/Netdisco/views/ajax/device/ports.tt index 02ad669e..74245d11 100644 --- a/Netdisco/views/ajax/device/ports.tt +++ b/Netdisco/views/ajax/device/ports.tt @@ -58,7 +58,7 @@ [% IF params.c_vlan %] [% row.vlan | html_entity %] + href="/search?tab=vlan&q=[% row.vlan | uri %]">[% row.vlan | html_entity %] [% END %] [% IF params.c_vmember %] @@ -69,7 +69,7 @@ [% SET count = 0 %] [% FOREACH vlan IN row.tagged_vlans %] [% SET output = output _ - '' _ vlan.vlan _ '' %] + '' _ vlan.vlan _ '' %] [% SET output = output _ ', ' IF NOT loop.last %] [% SET count = count + 1 %] [% END %] @@ -85,28 +85,28 @@ [% IF row.remote_ip %] [% IF row.neighbor %] - + [% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip %] ([% row.remote_port | html_entity %]) [% ELSE %] n - [% row.remote_ip %] ([% row.remote_port %]) + [% row.remote_ip %] ([% row.remote_port %])
  ([% row.remote_type %]) / ([% row.remote_id %])
[% END %] [% END %] [% FOREACH node IN row.get_nodes(params.n_archived) %] [% '
' IF row.remote_ip OR NOT loop.first %] [% 'a  ' IF NOT node.active %] - [% node.mac %] + [% node.mac %] [% ' (' _ node.time_last _ ')' IF params.n_age %] [% IF params.n_ip %] [% FOREACH ip IN node.ips %]
  [% 'a  ' IF NOT ip.active %] [% SET dns = ip.dns %] [% IF dns %] - [% ip.dns %] ([% ip.ip %]) + [% ip.dns %] ([% ip.ip %]) [% ELSE %] - [% ip.ip %] + [% ip.ip %] [% END %] [% END %] [% END %] diff --git a/Netdisco/views/ajax/search/device.tt b/Netdisco/views/ajax/search/device.tt index 08a17b0e..28b3f3b3 100644 --- a/Netdisco/views/ajax/search/device.tt +++ b/Netdisco/views/ajax/search/device.tt @@ -14,7 +14,7 @@ [% WHILE (row = results.next) %] - [% row.dns.remove(settings.domain_suffix) %] + [% row.dns.remove(settings.domain_suffix) %] [% row.contact %] [% row.location %] [% row.name %] diff --git a/Netdisco/views/ajax/search/node_by_ip.tt b/Netdisco/views/ajax/search/node_by_ip.tt index bbaa4bdc..2f27e542 100644 --- a/Netdisco/views/ajax/search/node_by_ip.tt +++ b/Netdisco/views/ajax/search/node_by_ip.tt @@ -17,12 +17,12 @@ [% WHILE (row = results.next) %] [% row.mac %] + href="/search?[% vars.query_defaults.node %]&q=[% row.mac | uri %]">[% row.mac %] [% IF params.vendor %] [% row.oui.company %] [% END %] IP → MAC - [% row.ip %] + [% row.ip %] [% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %] [% ' a' IF NOT row.active %] @@ -38,7 +38,7 @@   [% END %] Switch Port - [% node.switch %] [ [% node.port %] ] + [% node.switch %] [ [% node.port %] ] [% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %] [% ' a' IF NOT node.active %] @@ -55,7 +55,7 @@   [% END %] MAC → IP - [% nodeip.ip %] + [% nodeip.ip %] [% ' (' _ nodeip.dns.remove(settings.domain_suffix) _ ')' IF nodeip.dns %] [% ' a' IF NOT nodeip.active %] diff --git a/Netdisco/views/ajax/search/node_by_mac.tt b/Netdisco/views/ajax/search/node_by_mac.tt index b41e55df..f9b0d012 100644 --- a/Netdisco/views/ajax/search/node_by_mac.tt +++ b/Netdisco/views/ajax/search/node_by_mac.tt @@ -20,7 +20,7 @@ [% IF first_row %] [% row.mac %] + href="/search?[% vars.query_defaults.node %]&q=[% row.mac | uri %]">[% row.mac %] [% ELSE %]   [% END %] @@ -35,7 +35,7 @@ [% END %] MAC → IP - [% row.ip %] + [% row.ip %] [% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %] [% ' a' IF NOT row.active %] @@ -51,7 +51,7 @@ [% IF first_row %] [% node.mac %] + href="/search?[% vars.query_defaults.node %]&q=[% node.mac | uri %]">[% node.mac %] [% ELSE %]   [% END %] @@ -66,7 +66,7 @@ [% END %] Switch Port - [% node.switch %] [ [% node.port %] ] + [% node.switch %] [ [% node.port %] ] [% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %] [% ' a' IF NOT node.active %] @@ -82,7 +82,7 @@ [% IF first_row %] [% port.mac %] + href="/search?[% vars.query_defaults.node %]&q=[% port.mac | uri %]">[% port.mac %] [% ELSE %]   [% END %] @@ -97,7 +97,7 @@ [% END %] Switch Port - [% port.ip %] [ [% port.port %] ] + [% port.ip %] [ [% port.port %] ] [% ' (' _ port.device.dns.remove(settings.domain_suffix) _ ')' IF port.device.dns %] [% IF params.stamps %] diff --git a/Netdisco/views/ajax/search/port.tt b/Netdisco/views/ajax/search/port.tt index 86dacd16..e8a7f9c8 100644 --- a/Netdisco/views/ajax/search/port.tt +++ b/Netdisco/views/ajax/search/port.tt @@ -11,7 +11,7 @@ [% WHILE (row = results.next) %] [% row.name %] - [% row.ip %] [ [% row.port %] ] + [% row.ip %] [ [% row.port %] ] [% ' (' _ row.device.dns.remove(settings.domain_suffix) _ ')' IF row.device.dns %] [% row.descr %] diff --git a/Netdisco/views/ajax/search/vlan.tt b/Netdisco/views/ajax/search/vlan.tt index c57f1f63..cddf3e76 100644 --- a/Netdisco/views/ajax/search/vlan.tt +++ b/Netdisco/views/ajax/search/vlan.tt @@ -13,17 +13,17 @@ [% WHILE (row = results.next) %] [% row.vlan.vlan %] + href="/device?tab=ports&ip=[% row.ip %]&q=[% row.vlan.vlan %]">[% row.vlan.vlan %] [% row.dns %] + href="/device?tab=ports&ip=[% row.ip %]&q=[% row.vlan.vlan %]">[% row.dns %] [% row.vlan.description %] + href="/device?tab=ports&ip=[% row.ip %]&q=[% row.vlan.vlan %]">[% row.vlan.description %] [% row.model %] + href="/device?tab=ports&ip=[% row.ip %]&q=[% row.vlan.vlan %]">[% row.model %] [% row.os %] + href="/device?tab=ports&ip=[% row.ip %]&q=[% row.vlan.vlan %]">[% row.os %] [% row.vendor %] + href="/device?tab=ports&ip=[% row.ip %]&q=[% row.vlan.vlan %]">[% row.vendor %] [% END %] diff --git a/Netdisco/views/inc/device/addresses.tt b/Netdisco/views/inc/device/addresses.tt index 4dd5238a..6237226e 100644 --- a/Netdisco/views/inc/device/addresses.tt +++ b/Netdisco/views/inc/device/addresses.tt @@ -1,5 +1,5 @@ -
+
diff --git a/Netdisco/views/inc/device/details.tt b/Netdisco/views/inc/device/details.tt index 4dd5238a..6237226e 100644 --- a/Netdisco/views/inc/device/details.tt +++ b/Netdisco/views/inc/device/details.tt @@ -1,5 +1,5 @@ -
+
diff --git a/Netdisco/views/inc/device/modules.tt b/Netdisco/views/inc/device/modules.tt index 4dd5238a..6237226e 100644 --- a/Netdisco/views/inc/device/modules.tt +++ b/Netdisco/views/inc/device/modules.tt @@ -1,5 +1,5 @@ -
+
diff --git a/Netdisco/views/inc/device/ports.tt b/Netdisco/views/inc/device/ports.tt index 534213e6..649e4713 100644 --- a/Netdisco/views/inc/device/ports.tt +++ b/Netdisco/views/inc/device/ports.tt @@ -1,5 +1,5 @@ -
+
diff --git a/Netdisco/views/inc/js/device.js b/Netdisco/views/inc/js/device.js index e1ad0848..4ea9c90a 100644 --- a/Netdisco/views/inc/js/device.js +++ b/Netdisco/views/inc/js/device.js @@ -50,7 +50,7 @@ ); // submit the query and put results into the tab pane - $(target).load( '[% uri_base %]/ajax/content/device/' + tab + '?' + query, + $(target).load( '/ajax/content/device/' + tab + '?' + query, function(response, status, xhr) { if (status !== "success") { $(target).html( @@ -65,7 +65,7 @@ ); } // looks good, update the bookmark for this search - $(mark).attr('href', '[% uri_base %]/device?' + query); + $(mark).attr('href', '/device?' + query); // enable collapser on any large vlan lists $('.nd_collapse_vlans').collapser({ diff --git a/Netdisco/views/inc/js/search.js b/Netdisco/views/inc/js/search.js index e926a2fe..8a274ca7 100644 --- a/Netdisco/views/inc/js/search.js +++ b/Netdisco/views/inc/js/search.js @@ -18,7 +18,7 @@ ); // submit the query and put results into the tab pane - $(target).load( '[% uri_base %]/ajax/content/search/' + tab + '?' + query, + $(target).load( '/ajax/content/search/' + tab + '?' + query, function(response, status, xhr) { if (status !== "success") { $(target).html( @@ -33,7 +33,7 @@ ); } // looks good, update the bookmark for this search - $(mark).attr('href', '[% uri_base %]/search?' + query); + $(mark).attr('href', '/search?' + query); } ); } diff --git a/Netdisco/views/index.tt b/Netdisco/views/index.tt index bbf97ad7..fd8d5a40 100644 --- a/Netdisco/views/index.tt +++ b/Netdisco/views/index.tt @@ -30,7 +30,7 @@

Welcome to Netdisco

Netdisco is an Open Source web-based network management tool. [% IF NOT session.user %] - +
diff --git a/Netdisco/views/layouts/main.tt b/Netdisco/views/layouts/main.tt index adb4d7fa..67d36493 100644 --- a/Netdisco/views/layouts/main.tt +++ b/Netdisco/views/layouts/main.tt @@ -11,12 +11,12 @@ - - - - - - + + + + + + - - + + @@ -41,22 +41,22 @@
- Netdisco + Netdisco [% IF session.user %] - +