release 2.012000

Squashed commit of the following:

commit 94ed51c799fa605f5debc262dd9ccfd756bc9ee5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 18:34:13 2013 +0100

    ready for 2.012000

commit b26bdbeb5df65011bf79baa7beccefbbfbfe6614
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 18:29:38 2013 +0100

    add note to clarify cron spec

commit 6271f08f2b6c44668ca772a3478fbc42a76d3f01
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 17:34:33 2013 +0100

    update TODO

commit 221b062bb80cd29263d1f2dbf3cf674140cad972
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 17:33:12 2013 +0100

    Manual topology is preserved when re-discovering neighbors

commit 50fd829c9e986afd47640abbeae06b09cd0796ec
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 16:40:09 2013 +0100

    Pseudo device ports being counted properly since Port Utilization report

commit 252f136f6a4226a78c859c68ea0c1245109c71ca
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 16:24:47 2013 +0100

    Fix blur events on editable cells

commit 3136e3b899ce697ed43a1347c61bd11fc4011b77
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 15:58:23 2013 +0100

    move port control features from common device js

commit dba012ea1c169993dd80e9aef0067597def54f79
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 15:41:50 2013 +0100

    Floating table headers not compatible with in-header drop-down menus

commit e728258f74cb1ebddc47acfa1e152ee8ba91f0e8
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 6 15:13:56 2013 +0100

    RW snmp community strings now in the "community" table

commit d01ac4d8060bb6eaa152987a4a1b0c35cd580ade
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 19:04:56 2013 +0100

    fixes to deal with Extensible auth redirects

commit 0529003a4b408a3725ec61d5f18f09fce741c2c2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 18:42:47 2013 +0100

    cute bug icon in the report bug message

commit c7a77f791e6a2130c3a0c776a9de37c89e68bdeb
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 18:28:20 2013 +0100

    shift ports legend over to line up with colums controls

commit 09d94a66916aef1e41835bfab105805184e523a7
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 18:19:18 2013 +0100

    move Auth::Extensible settings into core config

commit 05cba664a50ee2abd062e24270e0fcab442ba8ac
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 18:17:33 2013 +0100

    fix no_port_control setting after authN changes

commit 679f776b821f8cf4299032ab87006807bfeb6c8c
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 18:05:55 2013 +0100

    bit more efficient checking of roles

commit 3535d2a4c8d97582b0297d0ee2c07d2a5e62b713
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 18:00:55 2013 +0100

    set require_login on almost all handlers

commit 32ae6391fef6ebca6973f7227dc1b68d91db6d68
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Aug 5 17:50:38 2013 +0100

    Implement extensible authN and role based access control

commit f06f11628f5cf63e627c01eb9c8ab927a064fecd
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Aug 4 23:28:08 2013 +0100

    Device re-discover/arpnip/macsuck is async with toastr notify

commit aeceb4235fc2e7b51673a4fca37c8e25343ec23d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Aug 4 22:58:27 2013 +0100

    simplify template logic

commit 6b19f47283d6597d46a5af530e5605f8df8e17ec
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Aug 4 22:41:09 2013 +0100

    Always offer to discover device on site homepage

commit a7a01fb794418feb86c2d5bc5214127c85bd14b2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Aug 4 22:26:50 2013 +0100

    use fontawesome icons for legend

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
This commit is contained in:
Oliver Gorwits
2013-08-06 18:35:15 +01:00
parent 86d74b0100
commit 5bddeb5515
61 changed files with 1033 additions and 397 deletions

View File

@@ -30,6 +30,7 @@
href="#[% task.tag %]_pane">[% task.label %]</a></li>
[% IF task.tag == 'jobqueue' %]
<span id="nd_device-name">
<a class="nd_adminbutton" name="delall" href="#"><i class="icon-trash text-error"></i></a>
<a id="nd_countdown-refresh" href="#"><i class="text-success icon-refresh"></i></a>
<a id="nd_countdown-control" href="#">
<i id="nd_countdown-control-icon" class="text-success icon-play"></i></a>

View File

@@ -1,3 +1,4 @@
[% SET user_can_port_control = user_has_role('port_control') %]
<table class="table table-condensed table-striped">
</tbody>
<tr>
@@ -6,11 +7,11 @@
</tr>
<tr>
<td>Location
[% IF vars.user.port_control %]
[% IF user_can_port_control %]
<i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
[% END %]
</td>
[% IF vars.user.port_control %]
[% IF user_can_port_control %]
<td class="nd_editable-cell" contenteditable="true"
data-field="location" data-for-device="[% d.ip %]">
[% d.location | html_entity %]
@@ -24,11 +25,11 @@
</tr>
<tr>
<td>Contact
[% IF vars.user.port_control %]
[% IF user_can_port_control %]
<i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
[% END %]
</td>
[% IF vars.user.port_control %]
[% IF user_can_port_control %]
<td class="nd_editable-cell" contenteditable="true"
data-field="contact" data-for-device="[% d.ip | html_entity %]">
[% d.contact | html_entity %]
@@ -93,22 +94,16 @@
<td>VTP Domain</td>
<td>[% d.vtp_domain | html_entity %]</td>
</tr>
[% IF vars.user.admin %]
<tr>
[% IF user_has_role('admin') %]
<tr data-for-device="[% d.dns || d.ip %]">
<td>Admin Tasks</td>
<td>
<form method="post" class="nd_inline-form" action="[% uri_for('/admin/discover') %]">
<input type="hidden" value="[% d.ip %]" name="device" type="text"/>
<button type="submit" class="btn btn-info btn-small">Discover</button>
</form>
<form method="post" class="nd_inline-form" action="[% uri_for('/admin/arpnip') %]">
<input type="hidden" value="[% d.ip %]" name="device" type="text"/>
<button type="submit" class="btn btn-info btn-small">Arpnip</button>
</form>
<form method="post" class="nd_inline-form" action="[% uri_for('/admin/macsuck') %]">
<input type="hidden" value="[% d.ip %]" name="device" type="text"/>
<button type="submit" class="btn btn-info btn-small">Macsuck</button>
</form>
<input type="hidden" data-form="discover" value="[% d.ip %]" name="device" type="text"/>
<button class="btn btn-info btn-small nd_adminbutton" name="discover" type="submit">Discover</button>
<input type="hidden" data-form="arpnip" value="[% d.ip %]" name="device" type="text"/>
<button class="btn btn-info btn-small nd_adminbutton" name="arpnip" type="submit">Arpnip</button>
<input type="hidden" data-form="macsuck" value="[% d.ip %]" name="device" type="text"/>
<button class="btn btn-info btn-small nd_adminbutton" name="macsuck" type="submit">Macsuck</button>
</td>
</tr>
[% END %]

View File

@@ -1,3 +1,4 @@
[% SET user_can_port_control = user_has_role('port_control') %]
<table class="table table-bordered table-striped nd_floatinghead">
<thead>
<tr>
@@ -7,7 +8,7 @@
[% 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')) %]>
(user_can_port_control AND params.c_admin AND (item.name == 'c_port' OR item.name == 'c_name')) %]>
[% item.label | html_entity %]
</th>
[% END %]
@@ -16,15 +17,17 @@
</tbody>
[% FOREACH row IN results %]
<tr>
<td>
<td class="nd_center-cell">
[% IF row.up_admin == 'down' %]
<span class="label">S</span>
<i class="icon-angle-down"></i>
[% ELSIF row.stp == 'blocking' %]
<span class="label label-info">B</span>
<i class="icon-fullscreen text-info"></i>
[% ELSIF params.free OR row.is_free %]
<span class="label label-success">F</span>
<i class="icon-arrow-down text-success"></i>
[% ELSIF row.up_admin == 'up' AND row.up == 'down' %]
<span class="label label-warning">D</span>
<i class="icon-arrow-down text-error"></i>
[% ELSE %]
<i class="icon-angle-up text-success"></i>
[% END %]
</td>
@@ -40,7 +43,7 @@
[% END %]
[% IF params.c_port %]
[% IF vars.user.port_control AND params.c_admin %]
[% IF user_can_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 %]">
@@ -95,7 +98,7 @@
[% END %]
[% IF params.c_name %]
[% IF vars.user.port_control AND params.c_admin %]
[% IF user_can_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>
@@ -121,7 +124,7 @@
[% END %]
[% IF params.c_vlan %]
[% IF vars.user.port_control AND params.c_admin %]
[% IF user_can_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>
@@ -164,7 +167,7 @@
[% IF params.c_power %]
[% IF row.power %]
[% IF row.power.admin == 'true' %]
[% IF vars.user.port_control AND params.c_admin %]
[% IF user_can_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 %]">
@@ -184,7 +187,7 @@
[% END %]
</span>
[% ELSE %]
[% IF vars.user.port_control AND params.c_admin %]
[% IF user_can_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 %]">
@@ -214,25 +217,25 @@
[% ' 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>
<i class="icon-unlink text-error"></i>&nbsp;
<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)
<i class="icon-unlink text-error"></i>&nbsp; (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> &nbsp;' IF NOT node.active %]
[% '<i class="icon-book"></i>&nbsp; ' 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/>&nbsp; [% '<span class="label label-warning">A</span> &nbsp;' IF NOT ip.active %]
<br/>&nbsp; [% '<i class="icon-book"></i>&nbsp; ' IF NOT ip.active %]
[% SET dns = ip.dns %]
[% IF dns %]
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip | html_entity %])</a>

View File

@@ -24,7 +24,7 @@
[% END %]
<td>IP &rarr; MAC</td>
<td><a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
[% ' <span class="label label-warning">A</span>' IF NOT row.active %]
[% '&nbsp;<i class="icon-book text-warning"></i>&nbsp;' IF NOT row.active %]
[% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %]
</td>
[% IF params.stamps %]
@@ -42,7 +42,7 @@
<td><a class="nd_linkcell"
href="[% device_ports %]&q=[% node.device.dns || node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on">
[% node.switch | html_entity %] - [% node.port | html_entity %]</a>
[% ' <span class="label label-warning">A</span>' IF NOT node.active %]
[% '&nbsp;<i class="icon-book text-warning"></i>&nbsp;' IF NOT node.active %]
[% IF node.device.dns AND node.device_port AND node.device_port.name %]
([% node.device.dns | html_entity %] - [% node.device_port.name | html_entity %])
[% END %]
@@ -61,7 +61,7 @@
[% END %]
<td>MAC &rarr; IP</td>
<td><a href="[% search_node %]&q=[% nodeip.ip | uri %]">[% nodeip.ip | html_entity %]</a>
[% ' <span class="label label-warning">A</span>' IF NOT nodeip.active %]
[% '&nbsp;<i class="icon-book text-warning"></i>&nbsp;' IF NOT nodeip.active %]
[% ' (' _ nodeip.dns.remove(settings.domain_suffix) _ ')' IF nodeip.dns %]
</td>
[% IF params.stamps %]

View File

@@ -37,7 +37,7 @@
[% END %]
<td>MAC &rarr; IP</td>
<td><a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
[% ' <span class="label label-warning">A</span>' IF NOT row.active %]
[% '&nbsp;<i class="icon-book text-warning"></i>&nbsp;' IF NOT row.active %]
[% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %]
</td>
[% IF params.stamps %]
@@ -71,7 +71,7 @@
<td><a class="nd_linkcell"
href="[% device_ports %]&q=[% node.device.dns || node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on">
[% node.switch | html_entity %] - [% node.port | html_entity %]</a>
[% ' <span class="label label-warning">A</span>' IF NOT node.active %]
[% '&nbsp;<i class="icon-book text-warning"></i>&nbsp;' IF NOT node.active %]
[% IF node.device.dns AND node.device_port AND node.device_port.name %]
([% node.device.dns | html_entity %] - [% node.device_port.name | html_entity %])
[% END %]

View File

@@ -1,7 +1,7 @@
<div class="container">
<div class="row nd_hero-row">
<div class="span8 offset2">
[% IF params.failed %]
[% IF params.login_failed %]
<div class="alert alert-error fade in">
<a class="close" data-dismiss="alert">×</a>
Incorrect username or password, please try again.
@@ -22,42 +22,37 @@
[% IF vars.notfound %]
<div class="alert fade in">
<a class="close" data-dismiss="alert">×</a>
Sorry, page not found.
<a href="http://sourceforge.net/p/netdisco/bugs/" target="_blank">Report a Bug?</a>
Sorry, page not found.&nbsp;
<a href="http://sourceforge.net/p/netdisco/bugs/" target="_blank"><i class="icon-bug"></i>&nbsp;Report a Bug?</a>
</div>
[% END %]
<div class="hero-unit">
<h2>Welcome to Netdisco</h2>
<small>Netdisco is an Open Source web-based network management tool.</small>
[% IF NOT session.user %]
[% IF NOT session.logged_in_user %]
<form class="nd_login-form" method="post" action="[% uri_for('/login') %]">
<div class="form-horizontal">
<input placeholder="Username" class="span2" name="username" type="text"/>
<input placeholder="Password" class="span2" name="password" type="password"/>
<button type="submit" class="btn btn-info">Log In</button>
</div>
[% IF vars.requested_path %]
<input type="hidden" name="path" value="[% vars.requested_path | html_entity %]"/>
[% IF vars.return_url %]
<input type="hidden" name="path" value="[% vars.return_url | html_entity %]"/>
[% END %]
</form>
[% ELSE %]
[% IF user_has_role('admin') %]
<form class="nd_login-form" method="post" action="[% uri_for('/admin/discover') %]">
<div class="form-horizontal">
<input placeholder="Device hostname or IP" class="span4" name="device" type="text"/>
<input type="hidden" name="extra" value="with-walk"/>
<button type="submit" class="btn btn-info">Discover</button>
</div>
</form>
[% END %]
<script type="text/javascript"> $('#nq').focus(); // set focus to navbar search </script>
[% END %]
</div>
[% IF vars.nodevices %]
<div class="hero-unit">
<h3>Initial Discovery</h3>
<p>You haven't discovered any devices yet.<p>
<p>Enter a network device name or IP to queue the first discovery:</p>
<form method="post" action="[% uri_for('/admin/discover') %]">
<div class="form-horizontal">
<input placeholder="Device hostname or IP" class="span4" name="device" type="text"/>
<input type="hidden" name="extra" value="with-walk"/>
<button type="submit" class="btn btn-info">Discover</button>
</div>
</form>
</div>
[% END %]
</div>
</div>
</div> <!-- /container -->

View File

@@ -107,7 +107,7 @@
// activity for admin task tables
// dynamically bind to all forms in the table
$(target).on('click', '.nd_adminbutton', function(event) {
$('.content').on('click', '.nd_adminbutton', function(event) {
// stop form from submitting normally
event.preventDefault();
@@ -117,7 +117,7 @@
}
// what purpose - add/update/del
var mode = $(this).attr('name')
var mode = $(this).attr('name');
// submit the query and put results into the tab pane
$.ajax({

View File

@@ -86,58 +86,30 @@
}
});
// toggle visibility of port up/down and edit controls
$('.tab-content').on('mouseenter', '.nd_editable-cell', function() {
$(this).children('.nd_hand-icon').show();
if (! $(this).is(':focus')) {
$(this).children('.nd_edit-icon').show(); // ports
$(this).siblings('td').find('.nd_device-details-edit').show(); // details
}
});
$('.tab-content').on('mouseleave', '.nd_editable-cell', function() {
$(this).children('.nd_hand-icon').hide();
if (! $(this).is(':focus')) {
$(this).children('.nd_edit-icon').hide(); // ports
$(this).siblings('td').find('.nd_device-details-edit').hide(); // details
}
});
$('.tab-content').on('focus', '[contenteditable=true]', function() {
$(this).children('.nd_edit-icon').hide(); // ports
$(this).siblings('td').find('.nd_device-details-edit').hide(); // details
});
// activity for admin tasks in device details
$('#details_pane').on('click', '.nd_adminbutton', function(event) {
// stop form from submitting normally
event.preventDefault();
// activity for port up/down control
$('#ports_pane').on('click', '.icon-hand-up', function() {
port_control(this); // save
});
$('#ports_pane').on('click', '.icon-hand-down', function() {
port_control(this); // save
});
// what purpose - discover/macsuck/arpnip
var mode = $(this).attr('name');
var tr = $(this).closest('tr');
// activity for power enable/disable control
$('#ports_pane').on('click', '.nd_power-icon', function() {
port_control(this); // save
});
// activity for contenteditable control
$('.tab-content').on('keydown', '[contenteditable=true]', function(event) {
var esc = event.which == 27,
nl = event.which == 13;
if (esc) {
if (dirty) { document.execCommand('undo') }
$(this).blur();
dirty = false;
}
else if (nl) {
$(this).blur();
event.preventDefault();
dirty = false;
port_control(this); // save
}
else {
dirty = true;
}
// submit the query
$.ajax({
type: 'POST'
,async: true
,dataType: 'html'
,url: uri_base + '/ajax/control/admin/' + mode
,data: tr.find('input[data-form="' + mode + '"]').serializeArray()
,success: function() {
toastr.info('Queued '+ mode +' for device '+ tr.attr('data-for-device'));
}
// skip any error reporting for now
// TODO: fix sanity_ok in Netdisco Web
,error: function() {
toastr.error('Failed to queue '+ mode +' for device '+ tr.attr('data-for-device'));
}
});
});
});

View File

@@ -25,10 +25,11 @@
<script type="text/javascript">
var uri_base = '[% uri_base %]';
var nd_port_control = '[% NOT settings.no_port_control %]';
</script>
<script type="text/javascript" src="[% uri_base %]/javascripts/netdisco.js"></script>
[% IF vars.user.port_control %]
[% IF user_has_role('port_control') %]
<script type="text/javascript" src="[% uri_base %]/javascripts/netdisco_portcontrol.js"></script>
[% END %]
@@ -54,7 +55,7 @@
<div class="navbar-inner">
<div class="container">
<a class="brand" href="[% uri_for('/') %]">Netdisco</a>
[% IF session.user %]
[% IF session.logged_in_user %]
<ul class="nav">
[% FOREACH ni IN settings._navbar_items %]
<li[% ' class="active"' IF vars.nav == ni.tag %]>
@@ -88,7 +89,7 @@
<i id="navsearchgo" class="icon-search nd_navbar-icon"></i>
</span>
</form>
[% IF vars.user.admin AND settings._admin_tasks.size %]
[% IF user_has_role('admin') %]
<ul class="nav">
<li class="dropdown[% ' active' IF vars.nav == 'admin' %]">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin Tasks <b class="caret"></b></a>
@@ -108,32 +109,34 @@
<button type="submit" class="btn btn-link nd_btn-link">Macsuck All</button>
</form>
</li>
[% '<li class="divider"></li>' IF settings._admin_tasks.keys.size %]
[% FOREACH ai IN settings._admin_tasks.keys.sort %]
<li><a href="[% uri_for('/admin/' _ ai) %]">[% settings._admin_tasks.$ai.label | html_entity %]</a></li>
[% IF settings._admin_tasks.size %]
<li class="divider"></li>
[% FOREACH ai IN settings._admin_tasks.keys.sort %]
<li><a href="[% uri_for('/admin/' _ ai) %]">[% settings._admin_tasks.$ai.label | html_entity %]</a></li>
[% END %]
[% END %]
</ul>
</li> <!-- /dropdown -->
</ul>
[% END %]
<ul class="nav pull-right">
<li class="nd_navbar-text">Logged in as &nbsp;</li>
<li class="nd_navbar-text">Logged in as&nbsp;</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
[% IF vars.user.admin %]
[% IF user_has_role('admin') %]
<i class="icon-user text-error"></i>
[% ELSIF vars.user.port_control %]
[% ELSIF user_has_role('port_control') %]
<i class="icon-user text-warning"></i>
[% ELSE %]
<i class="icon-user"></i>
[% END %]
[% END %]&nbsp;
[% IF NOT settings.no_auth %]
[% session.user | html_entity %] <b class="caret"></b></a>
[% session.logged_in_user | html_entity %] <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="[% uri_for('/logout') %]">Log Out</a></li>
</ul>
[% ELSE %]
[% session.user | html_entity %]</a>
[% session.logged_in_user | html_entity %]</a>
[% END %]
</li> <!-- /dropdown -->
</ul>

View File

@@ -14,32 +14,18 @@
<i class="nd_arrow-up-down-right icon-chevron-up icon-large"></i>
</label></span>
<div id="nd_legend" class="collapse">
<ul class="nd_inputs-list unstyled">
<li>
<span class="label">S</span>&nbsp; Admin Disabled
</li>
<li>
<span class="label label-warning">D</span>&nbsp; Link Down
</li>
<li>
<span class="label label-success">F</span>&nbsp; Port Free (Down)
</li>
<li>
<span class="label label-info">B</span>&nbsp; Blocking
</li>
<li>
<span class="label label-important">N</span>&nbsp; Neighbor Inacessible
</li>
<li>
<span class="label label-warning">A</span>&nbsp; Archived Data
</li>
<li>
<i class="icon-phone"></i>&nbsp; IP Phone
</li>
[% IF vars.user.port_control %]
<li>
<i class="icon-refresh"></i>&nbsp; Click "Update View"
</li>
<ul class="icons-ul"><!-- nd_inputs-list unstyled"> -->
<li><i class="icon-li icon-angle-up text-success"></i>&nbsp; Link Up</li>
<li><i class="icon-li icon-arrow-down text-error"></i>&nbsp; Link Down</li>
<li><i class="icon-li icon-arrow-down text-success"></i>&nbsp; Port Free</li>
<li><i class="icon-li icon-angle-down"></i>&nbsp; Admin Disabled</li>
<li><i class="icon-li icon-fullscreen text-info"></i>&nbsp; Blocking</li>
<li><i class="icon-li icon-unlink text-error"></i>&nbsp; Neighbor Inacessible</li>
<li><i class="icon-li icon-phone"></i>&nbsp; IP Phone</li>
<li><i class="icon-li icon-signal"></i>&nbsp; Wireless Client</li>
<li><i class="icon-li icon-book"></i>&nbsp; Archived Data</li>
[% IF user_has_role('port_control') %]
<li><i class="icon-li icon-refresh"></i>&nbsp; Click "Update View"</li>
[% END %]
</ul>
</div>
@@ -52,7 +38,7 @@
<div id="nd_columns" class="collapse in">
<ul class="nd_inputs-list unstyled">
[% FOREACH item IN vars.port_columns %]
[% NEXT IF item.name == 'c_admin' AND NOT vars.user.port_control %]
[% NEXT IF item.name == 'c_admin' AND NOT user_has_role('port_control') %]
<li>
<label class="checkbox">
<input type="checkbox" id="[% item.name | html_entity %]"

View File

@@ -26,7 +26,7 @@
</label>
<label class="nd_checkboxlabel" for="archived">
<span class="nd_searchcheckbox uneditable-input">
Archived Data <span class="nd_legendlabel label label-warning">A</span></span>
Archived Data &nbsp;<i class="icon-book text-warning"></i></span>
</label>
</div>
<div class="clearfix input-prepend">