Squashed commit of the following: commit 3f1730957b6accbc11737e46c201453d7219d03e Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jul 29 08:01:59 2013 +0100 ready for 2.011000 commit e1873ca58375b458d9543576951f1003e1c28d35 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jul 28 00:02:20 2013 +0100 Find the RW snmp community string correctly now commit 039780bc66ca0d8b19767c38a21aa208feafeaf7 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jul 27 23:07:05 2013 +0100 User Management (for admins only) commit 213352d54ee8e71cbca5ae2c1c75696800c4216b Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jul 27 21:17:57 2013 +0100 Table headers float on the page when scrolling commit 598960e9141b0d9fc4f9a234a7d8fe02a81ba0f9 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jul 27 18:05:00 2013 +0100 Port Utilization report commit d25e41894476c74bee747e38960a277e2f5b2072 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jul 27 15:20:23 2013 +0100 Button to empty the job queue, and improve display when the queue is empty commit 18125d1a758b5707ab4c0ff8b65dfdd90dc32664 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jul 27 14:23:48 2013 +0100 Swap play/pause icons in jobqueue commit 9eead5328a127689701ac28d5bcf1cfa39edaf99 Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jul 25 23:11:17 2013 +0100 Revert "No longer depend on Moo" This reverts commit 0a87ad4b410fa784bfbe823f3e6ede7c979144f3. Conflicts: Netdisco/Changes commit d0c31effa834201f1592c1fc3da9a6a689a3a43c Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jul 25 23:01:32 2013 +0100 REMOTE_USER is an env var, not an HTTP Header commit 0a87ad4b410fa784bfbe823f3e6ede7c979144f3 Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jul 25 22:35:05 2013 +0100 No longer depend on Moo commit 7ccbb04e6f7c1701194d996baa557affcda48103 Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 24 23:44:42 2013 +0100 ready for 2.010004 commit 6314c5a054d56d7829797d37c6627b2cbccde4ab Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 24 23:41:51 2013 +0100 Navbar query box was being cleared sometimes under admin task panels commit 271a5d9db17b288aeff43ee29a6bbf753bf823de Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 24 00:03:05 2013 +0100 update TODO commit 3103f968a9fb128726ed929589137cb6011e2591 Author: Oliver Gorwits <oliver@cpan.org> Date: Tue Jul 23 23:58:19 2013 +0100 ready for 2.010002 commit 0368df1dbdfe6d764eec05f2bf37587fff795995 Author: Oliver Gorwits <oliver@cpan.org> Date: Tue Jul 23 23:17:17 2013 +0100 fix bugs in topo update code commit 43b7203ca3270dc2e02a097472179517087522d2 Author: Oliver Gorwits <oliver@cpan.org> Date: Tue Jul 23 23:12:36 2013 +0100 fix FF bug with forms embedded in tables commit f86c5d7d3d8d293a781c2ec7dc7a18bfb3c8bf78 Author: Oliver Gorwits <oliver@cpan.org> Date: Tue Jul 23 17:15:35 2013 +0100 Nullify unused schema changes commit 649e4c471d524013f87257e11fffa7789dccd01d Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 20 13:48:20 2013 +0100 version bump commit ac6ce399b2bd596444a629f24ddea5eca0fff56a Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 20 13:41:08 2013 +0100 Handle UTF-8 data in the device port remote_id commit c73b86c0204ddd98e9d27437028a7000d70338bf Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 20 13:35:32 2013 +0100 revert bytea conversion on remote_id commit a144f42cf93803882bb8492cd3ce3a8e5679d383 Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 17 23:09:50 2013 +0100 bump version for beta release commit 3b791c93d7d9b7358bf46f31e322a9b807823d9d Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 17 22:57:59 2013 +0100 Pass event param to all js functions which require it commit da38badef893fc1503a797a99c34504db71e7c20 Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 17 22:35:48 2013 +0100 Change data type on device_port remote_id to bytea commit 727237951a5576b476dee127b3cef777afb51df8 Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 17 10:52:28 2013 +0100 fix help message in netdisco-web-fg commit 25bc026dc5e0177cd3aa81c11cdace091eb68f36 Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 17 08:16:56 2013 +0100 bump version for new release commit d4042f6e8db42c7a85df4dcf9690fec72ad2db69 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 18:27:52 2013 +0100 Job Queue page play/pause/refresh controls commit b6c9152516d7800409b7a73c5d0cdce6dd405492 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 17:50:06 2013 +0100 limit size of job queue table commit ac9e5feb8b774071fcf4423dd862dced74dee9e6 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 17:47:55 2013 +0100 update bugs link commit 9c0fb0e9aedc6297f4462c3cf88343f6d0df40b6 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 17:41:29 2013 +0100 update MANIFEST commit 7aaa2fff91ed2b1839bdbb79081d90ad3e144f47 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 17:40:35 2013 +0100 Fix Plack middleware config for Expiry commit 313e2cf014cf0da7cf85074e390ad394b28bf42d Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 17:23:00 2013 +0100 Support for delegated authentication with REMOTE_USER and X-REMOTE_USER commit 85e21f2bf296c4a5ca6b5afb5091694e56e3031f Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 14:24:08 2013 +0100 Add tooltip showing the job queue item logged status message commit 9b14f53ebed51eb46ea278807cfe8a2fbd28743c Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 13:43:26 2013 +0100 Increase default frequency of job queue polling to 2 seconds commit 6ba46818d8ab2100c652c8eb8e98bc6f5a54e273 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 12:57:43 2013 +0100 workaround for https://github.com/PerlDancer/Dancer/issues/935 commit c7a2d8a9d45716959bedbbb8db4cdd82a5950642 Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 16 11:54:18 2013 +0100 Fix hyperlinks when running behind reverse proxy on custom path commit 0620efa404bc25cb0a9ada5aa6f1b092d5c4d482 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jun 15 18:31:19 2013 +0100 update deploy docs commit 857b1c7aa0fe832f8948349eda5211eb38ba3099 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jun 15 18:16:50 2013 +0100 add note about compiler dependency commit 02a2ad6b2c52db9fbc1e24bc8888f658dc7084ad Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jun 15 17:44:29 2013 +0100 sort vlans, macs, ips in device port view commit 097bad77310728a98b261a2cfca4de7ab50be94b Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jun 15 16:32:20 2013 +0100 hint when calling web in fg without starman commit 6425d89ddb2b56129c610482134482d8f9455d40 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jun 15 15:53:26 2013 +0100 macwalk and arpwalk refactored commit d527b9d05addc82fb38c84f6fea1aa5818fc68d5 Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 13 22:27:34 2013 +0100 implement is_macsuckable and is_arpnipable commit 7af10ed313e25f5d99a22b53ba438225c2259069 Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 13 22:17:39 2013 +0100 version bump commit 8ace3bf8fa48cf3e14bdf86fad5a4862aad50a4b Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 13 22:14:05 2013 +0100 tidy up user menu commit e6eef605c248471dbfe7ec62cd04d73d653523ca Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 13 22:02:52 2013 +0100 Add discoverall, macwalk, arpwalk items to the Admin Tasks menu commit 2631fabd1eccd8a3971e4762eebe57f406623bee Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 13 21:21:50 2013 +0100 remove length() which only became sane in 5.12 commit a7b7169070a58685cacde26a3b6d462e74be9928 Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 13 19:07:56 2013 +0100 Use DBIx::Class new collapsed query support when we can commit 77cddab8ba7033ccb1ecae257bafa4eef8f99f47 Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jun 12 17:26:47 2013 +0100 Database config simplified to only four essential settings commit 6ed0802bf2ab0fd898ce6945451b8ca6566ae551 Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jun 12 13:03:20 2013 +0100 Ask to set up guest user for Admin/Port Control rights in deploy script
273 lines
10 KiB
Plaintext
273 lines
10 KiB
Plaintext
<table class="table table-bordered table-striped nd_floatinghead">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
[% FOREACH item IN vars.port_columns %]
|
|
[% NEXT IF item.name == 'c_admin' %]
|
|
[% NEXT IF item.name == 'c_nodes' AND params.c_nodes AND params.c_neighbors %]
|
|
[% NEXT UNLESS params.${item.name} %]
|
|
<th[% ' class="nd_nudge-for-icon"' IF
|
|
(vars.user.port_control AND params.c_admin AND (item.name == 'c_port' OR item.name == 'c_name')) %]>
|
|
[% item.label | html_entity %]
|
|
</th>
|
|
[% END %]
|
|
</tr>
|
|
</thead>
|
|
</tbody>
|
|
[% FOREACH row IN results %]
|
|
<tr>
|
|
<td>
|
|
[% IF row.up_admin == 'down' %]
|
|
<span class="label">S</span>
|
|
[% ELSIF row.stp == 'blocking' %]
|
|
<span class="label label-info">B</span>
|
|
[% ELSIF params.free OR row.is_free %]
|
|
<span class="label label-success">F</span>
|
|
[% ELSIF row.up_admin == 'up' AND row.up == 'down' %]
|
|
<span class="label label-warning">D</span>
|
|
[% END %]
|
|
</td>
|
|
|
|
[% FOREACH config IN settings._extra_device_port_cols %]
|
|
[% NEXT UNLESS config.position == 'left' AND params.${config.name} %]
|
|
<td>
|
|
[% TRY %]
|
|
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
|
[% CATCH %]
|
|
<!-- dummy content required by Template Toolkit TRY -->
|
|
[% END %]
|
|
</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_port %]
|
|
[% IF vars.user.port_control AND params.c_admin %]
|
|
[% IF row.up_admin == 'up' %]
|
|
<td nowrap class="nd_editable-cell" data-action="down"
|
|
data-field="c_port" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
|
<i class="icon-hand-down nd_hand-icon"
|
|
rel="tooltip" data-placement="top" data-offset="3"
|
|
data-animation="" data-title="Click to Disable"></i>
|
|
[% ELSE %]
|
|
<td nowrap class="nd_editable-cell" data-action="up"
|
|
data-field="c_port" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
|
<i class="icon-hand-up nd_hand-icon"
|
|
rel="tooltip" data-placement="top" data-offset="3"
|
|
data-animation="" data-title="Click to Enable"></i>
|
|
[% END %]
|
|
[% ELSE %]
|
|
<td nowrap>
|
|
[% END %]
|
|
<a class="nd_linkcell nd_this-port-only" href="[% uri_for('/device',
|
|
self_options) %]&q=[% params.q | uri %]&f=[% row.port | uri %]">
|
|
[% row.port | html_entity %]
|
|
</a></td>
|
|
[% END %]
|
|
|
|
[% FOREACH config IN settings._extra_device_port_cols %]
|
|
[% NEXT UNLESS config.position == 'mid' AND params.${config.name} %]
|
|
<td>
|
|
[% TRY %]
|
|
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
|
[% CATCH %]
|
|
<!-- dummy content required by Template Toolkit TRY -->
|
|
[% END %]
|
|
</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_descr %]
|
|
<td nowrap>[% row.descr | html_entity %]</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_type %]
|
|
<td>[% row.type | html_entity %]</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_duplex %]
|
|
<td>
|
|
[% IF row.up == 'up' AND row.duplex %]
|
|
[% row.duplex_admin.ucfirst | html_entity %] / [% row.duplex.ucfirst | html_entity %]
|
|
[% END %]
|
|
</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_lastchange %]
|
|
<td>[% row.lastchange_stamp | html_entity %]</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_name %]
|
|
[% IF vars.user.port_control AND params.c_admin %]
|
|
<td nowrap class="nd_editable-cell" contenteditable="true"
|
|
data-field="c_name" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
|
<i class="icon-edit nd_edit-icon"></i>
|
|
[% ELSE %]
|
|
<td nowrap>
|
|
[% END %]
|
|
<div class="nd_editable-cell-content">
|
|
[% row.name | html_entity %]
|
|
</div>
|
|
</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_speed %]
|
|
<td>[% row.speed | html_entity %]</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_mac %]
|
|
<td>[% row.mac | html_entity %]</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_mtu %]
|
|
<td>[% row.mtu | html_entity %]</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_vlan %]
|
|
[% IF vars.user.port_control AND params.c_admin %]
|
|
<td class="nd_editable-cell" contenteditable="true"
|
|
data-field="c_vlan" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
|
<i class="icon-edit nd_edit-icon"></i>
|
|
<div class="nd_editable-cell-content">
|
|
[% IF row.vlan %][% row.vlan | html_entity %][% END %]
|
|
</div>
|
|
</td>
|
|
[% ELSE %]
|
|
<td>
|
|
<a class="nd_linkcell"
|
|
href="[% uri_for('/search') %]?tab=vlan&q=[% row.vlan | uri %]">
|
|
[% row.vlan | html_entity %]</a>
|
|
</td>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF params.c_vmember %]
|
|
<td>
|
|
[% IF row.tagged_vlans_count %]
|
|
[% SET output = '' %]
|
|
[% SET vlanlist = [] %]
|
|
[% FOREACH vlan IN row.tagged_vlans %][% vlanlist.push(vlan.vlan) %][% END %]
|
|
[% FOREACH vlan IN vlanlist.nsort %]
|
|
[% SET output = output _
|
|
'<a href="' _ uri_for('/search') _ '?tab=vlan&q=' _ vlan _ '">' _ vlan _ '</a>' %]
|
|
[% SET output = output _ ', ' IF NOT loop.last %]
|
|
[% END %]
|
|
[% IF row.tagged_vlans_count > 10 %] [%# TODO make this a settable variable %]
|
|
[% SET output = '<div class="nd_vlan-total">(' _ row.tagged_vlans_count
|
|
_ ')</div><span class="nd_linkcell nd_collapse-vlans">
|
|
<div class="nd_arrow-up-down-left icon-chevron-up icon-large"></div>Show VLANs</span>
|
|
<div class="nd_collapsing nd_collapse-pre-hidden">' _ output %]
|
|
[% SET output = output _ '</div>' %]
|
|
[% END %]
|
|
[% output %]
|
|
[% END %]
|
|
</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_power %]
|
|
[% IF row.power %]
|
|
[% IF row.power.admin == 'true' %]
|
|
[% IF vars.user.port_control AND params.c_admin %]
|
|
<td nowrap data-action="false"
|
|
data-field="c_power" data-for-device="[% device.ip | html_entity %]"
|
|
data-for-port="[% row.port | html_entity %]">
|
|
|
|
<i class="icon-off nd_power-icon nd_power-on"
|
|
rel="tooltip" data-placement="top" data-offset="3"
|
|
data-animation="" data-title="Click to Disable"></i>
|
|
[% ELSE %]
|
|
<td nowrap>
|
|
<i class="icon-off nd_power-on"></i>
|
|
[% END %]
|
|
<span>
|
|
[% IF row.power.power > 0 %]
|
|
[% row.power.power | html_entity %] mW
|
|
[% ELSE %]
|
|
([% row.power.status | html_entity %])
|
|
[% END %]
|
|
</span>
|
|
[% ELSE %]
|
|
[% IF vars.user.port_control AND params.c_admin %]
|
|
<td nowrap data-action="true"
|
|
data-field="c_power" data-for-device="[% device.ip | html_entity %]"
|
|
data-for-port="[% row.port | html_entity %]">
|
|
|
|
<i class="icon-off nd_power-icon"
|
|
rel="tooltip" data-placement="top" data-offset="3"
|
|
data-animation="" data-title="Click to Enable"></i>
|
|
[% ELSE %]
|
|
<td>
|
|
<i class="icon-off"></i>
|
|
[% END %]
|
|
[% END %]
|
|
</td>
|
|
[% ELSE %]
|
|
<td></td>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF params.c_nodes OR params.c_neighbors %]
|
|
<td>
|
|
[% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %]
|
|
[% IF row.neighbor %]
|
|
<a href="[% uri_for('/device',
|
|
self_options) %]&q=[% row.neighbor.dns || row.neighbor.ip | uri %]&f=[% row.remote_port | uri %]">
|
|
[% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip | html_entity %]
|
|
([% row.remote_port | html_entity %]
|
|
[% ' id: '_ row.remote_id IF row.remote_id %]
|
|
[% ' type: '_ row.remote_type IF row.remote_type %])</a>
|
|
[% ELSIF row.remote_ip AND row.remote_port %]
|
|
<span class="label label-important">N</span>
|
|
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">
|
|
[% row.remote_ip | html_entity %] (port: [% row.remote_port | html_entity %]
|
|
[% ' id: '_ row.remote_id IF row.remote_id %]
|
|
[% ' type: '_ row.remote_type IF row.remote_type %])</a>
|
|
[% ELSE %]
|
|
<span class="label label-important">N</span> (possible uplink)
|
|
[% END %]
|
|
[% END %]
|
|
[% IF params.c_nodes %]
|
|
[% FOREACH node IN row.$nodes %]
|
|
[% '<br/>' IF (row.remote_ip OR row.is_uplink) OR NOT loop.first %]
|
|
[% '<span class="label label-warning">A</span> ' IF NOT node.active %]
|
|
<a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
|
|
[% node.net_mac.$mac_format_call | html_entity %]</a>
|
|
[% ' (' _ node.time_last_age _ ')' IF params.n_age %]
|
|
[% IF params.n_ip %]
|
|
[% FOREACH ip IN node.ips %]
|
|
<br/> [% '<span class="label label-warning">A</span> ' IF NOT ip.active %]
|
|
[% SET dns = ip.dns %]
|
|
[% IF dns %]
|
|
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip | html_entity %])</a>
|
|
[% ELSE %]
|
|
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% ip.ip | html_entity %]</a>
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_stp %]
|
|
<td>[% row.stp | html_entity %]</td>
|
|
[% END %]
|
|
|
|
[% IF params.c_up %]
|
|
<td>
|
|
[% row.up_admin.ucfirst | html_entity %] / [% row.up.ucfirst | html_entity %]
|
|
</td>
|
|
[% END %]
|
|
|
|
[% FOREACH config IN settings._extra_device_port_cols %]
|
|
[% NEXT UNLESS config.position == 'right' AND params.${config.name} %]
|
|
<td>
|
|
[% TRY %]
|
|
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
|
[% CATCH %]
|
|
<!-- dummy content required by Template Toolkit TRY -->
|
|
[% END %]
|
|
</td>
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|