merge branch og-portcontrol

This commit is contained in:
Oliver Gorwits
2012-11-24 23:29:00 +00:00
parent 3724e3ed37
commit 083f3a51ed
31 changed files with 1368 additions and 377 deletions

View File

@@ -6,14 +6,36 @@
</tr>
<tr>
<td>Location</td>
[% IF vars.user.port_control %]
<td class="nd_editable_cell" contenteditable="true"
data-field="location" data-for-device="[% d.ip %]">
<i class="icon-edit nd_edit_icon nd_device_details_edit"></i>
[% d.location %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="left" data-offset="3"
data-animation="" title="Click to Apply"></i>
</td>
[% ELSE %]
<td>
<a rel="tooltip" data-placement="top" data-offset="5" title="Find Similar Devices"
href="[% vars.search_device %]&location=[% d.location | uri %]">[% d.location %]</a>
</td>
[% END %]
</tr>
<tr>
<td>Contact</td>
[% IF vars.user.port_control %]
<td class="nd_editable_cell" contenteditable="true"
data-field="contact" data-for-device="[% d.ip %]">
<i class="icon-edit nd_edit_icon nd_device_details_edit"></i>
[% d.contact %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="left" data-offset="3"
data-animation="" title="Click to Apply"></i>
</td>
[% ELSE %]
<td>[% d.contact %]</td>
[% END %]
</tr>
<tr>
<td>Vendor / Model</td>

View File

@@ -3,6 +3,7 @@
<tr>
<th></th>
[% FOREACH item IN vars.port_columns %]
[% NEXT IF item.name == 'c_admin' %]
[% NEXT UNLESS params.${item.name} %]
<th[% ' class="center_cell"' IF NOT loop.first %]>[% item.label %]</th>
[% END %]
@@ -22,18 +23,39 @@
<span class="label label-warning">D</span>
[% END %]
</td>
[% IF params.c_port %]
<td><a class="nd_linkcell nd_this_port_only" href="[% uri_for('/device',
vars.self_options) %]&q=[% params.q | uri %]&f=[% row.port | uri %]">
[% IF vars.user.port_control AND params.c_admin %]
[% IF row.up_admin == 'up' %]
<td class="nd_editable_cell" data-action="down"
data-field="c_port" data-for-device="[% device %]" 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="" title="Click to Disable"></i>
[% ELSE %]
<td class="nd_editable_cell" data-action="up"
data-field="c_port" data-for-device="[% device %]" 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="" title="Click to Enable"></i>
[% END %]
[% ELSE %]
<td>
[% END %]
<a class="nd_linkcell nd_this_port_only" href="[% uri_for('/device',
vars.self_options) %]&q=[% params.q | uri %]&f=[% row.port | uri %]">
[% row.port | html_entity %]
</a></td>
[% END %]
[% IF params.c_descr %]
<td class="center_cell">[% row.descr | html_entity %]</td>
[% END %]
[% IF params.c_type %]
<td class="center_cell">[% row.type | html_entity %]</td>
[% END %]
[% IF params.c_duplex %]
<td class="center_cell">
[% IF row.up == 'up' AND row.duplex %]
@@ -41,27 +63,63 @@
[% END %]
</td>
[% END %]
[% IF params.c_lastchange %]
<td class="center_cell">[% row.lastchange_stamp | html_entity %]</td>
[% END %]
[% IF params.c_name %]
<td class="center_cell">[% row.name | html_entity %]</td>
[% IF vars.user.port_control AND params.c_admin %]
<td class="center_cell nd_editable_cell" contenteditable="true"
data-field="c_name" data-for-device="[% device %]" data-for-port="[% row.port | html_entity %]">
<i class="icon-edit nd_edit_icon"></i>
[% ELSE %]
<td class="center_cell">
[% END %]
<div class="nd_editable_cell_content">
[% row.name | html_entity %]
[% IF vars.user.port_control AND params.c_admin %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="top" data-offset="3"
data-animation="" title="Click to Apply"></i>
[% END %]
</div>
</td>
[% END %]
[% IF params.c_speed %]
<td class="center_cell">[% row.speed | html_entity %]</td>
[% END %]
[% IF params.c_mac %]
<td class="center_cell">[% row.mac | html_entity %]</td>
[% END %]
[% IF params.c_mtu %]
<td class="center_cell">[% row.mtu | html_entity %]</td>
[% END %]
[% IF params.c_vlan %]
[% IF vars.user.port_control AND params.c_admin %]
<td class="center_cell nd_editable_cell" contenteditable="true"
data-field="c_vlan" data-for-device="[% device %]" 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 %][% ELSE %]&nbsp;[% END %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="top" data-offset="3"
data-animation="" title="Click to Apply"></i>
</div>
</td>
[% ELSE %]
<td class="center_cell">
<a class="nd_linkcell"
href="[% uri_for('/search') %]?tab=vlan&q=[% row.vlan | uri %]">[% row.vlan | html_entity %]</a>
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 %]
@@ -73,14 +131,17 @@
[% END %]
[% IF row.tagged_vlans_count > 10 %] [%# FIXME make this a settable variable %]
[% SET output = '<div class="vlan_total">(' _ row.tagged_vlans_count
_ ')</div><a href="#" class="nd_linkcell nd_collapse_vlans"><div class="cell-arrow-up"></div>'
_ 'Show VLANs</a><div class="nd_collapsing nd_collapse_pre_hidden">' _ output %]
_ ')</div><span class="nd_linkcell nd_collapse_vlans">
<i class="cell-arrow-up-down icon-chevron-up icon-large">
</i>Show VLANs</span>
<div class="nd_collapsing nd_collapse_pre_hidden">' _ output %]
[% SET output = output _ '</div>' %]
[% END %]
[% output %]
[% END %]
</td>
[% END %]
[% IF params.c_connected %]
<td>
[% IF row.remote_ip %]
@@ -115,9 +176,11 @@
[% END %]
</td>
[% END %]
[% IF params.c_stp %]
<td class="center_cell">[% row.stp | html_entity %]</td>
[% END %]
[% IF params.c_up %]
<td class="center_cell">
[% row.up_admin | html_entity %] / [% row.up | html_entity %]

View File

@@ -38,7 +38,7 @@
<td>&nbsp;</td>
[% END %]
<td>Switch Port</td>
<td><a href="[% vars.device_ports %]&q=[% node.switch | url %]&f=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
<td><a href="[% vars.device_ports %]&q=[% node.switch | url %]&f=[% node.port | url %]&c_connected=on">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
[% ' <span class="label label-warning">A</span>' IF NOT node.active %]
</td>

View File

@@ -66,7 +66,7 @@
</td>
[% END %]
<td>Switch Port</td>
<td><a href="[% vars.device_ports %]&q=[% node.switch | url %]&f=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
<td><a href="[% vars.device_ports %]&q=[% node.switch | url %]&f=[% node.port | url %]&c_connected=on">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
[% ' <span class="label label-warning">A</span>' IF NOT node.active %]
</td>
@@ -97,7 +97,7 @@
</td>
[% END %]
<td>Switch Port</td>
<td><a href="[% vars.device_ports %]&q=[% port.ip | url %]&f=[% port.port | url %]">[% port.ip %] [ [% port.port %] ]</a>
<td><a href="[% vars.device_ports %]&q=[% port.ip | url %]&f=[% port.port | url %]&c_connected=on">[% port.ip %] [ [% port.port %] ]</a>
[% ' (' _ port.device.dns.remove(settings.domain_suffix) _ ')' IF port.device.dns %]
</td>
[% IF params.stamps %]