Files
netdisco/Netdisco/share/views/ajax/device/details.tt
Oliver Gorwits c75167fe27 Modal confirm dialogs for dangerous actions.
Squashed commit of the following:

commit 80513dd206
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Aug 31 08:26:39 2013 +0100

    use blockquote to make dialog more readable

commit bab8e4d00c
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Aug 31 08:16:49 2013 +0100

    add confirm dialog to user delete

commit 46c7d54973
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Aug 31 07:46:52 2013 +0100

    add confirm dialog to pseudo device delete

commit 00f26b92a9
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Aug 31 07:41:41 2013 +0100

    restore aria header ref

commit 1c04d32cd2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Aug 31 07:38:39 2013 +0100

    add confirm dialog to topo link delete

commit 914a03a19c
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Aug 31 07:12:59 2013 +0100

    tidy dialogs

commit e4c3978ba8
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri Aug 30 23:37:55 2013 +0100

    remove attr("data-

commit 626c8c3fdd
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri Aug 30 23:36:47 2013 +0100

    log message for port controls

commit b614669c0c
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri Aug 30 21:23:22 2013 +0100

    swap attr for data

commit 79ce5ec47d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri Aug 30 21:09:41 2013 +0100

    improve delete modal and add log message

commit 601671b383
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue Aug 27 22:46:43 2013 +0100

    modal dialog which calls ajax
2013-08-31 08:29:41 +01:00

138 lines
5.1 KiB
Plaintext

[% SET user_can_port_control = user_has_role('port_control') %]
<table class="table table-condensed table-striped">
</tbody>
<tr>
<td>System Name</td>
<td>[% d.name %]</td>
</tr>
<tr>
<td>Location
[% IF user_can_port_control %]
<i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
[% END %]
</td>
[% IF user_can_port_control %]
<td class="nd_editable-cell" contenteditable="true"
data-field="location" data-for-device="[% d.ip %]">
[% d.location | html_entity %]
</td>
[% ELSE %]
<td>
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
href="[% search_device %]&location=[% d.location | uri %]">[% d.location | html_entity %]</a>
</td>
[% END %]
</tr>
<tr>
<td>Contact
[% IF user_can_port_control %]
<i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
[% END %]
</td>
[% 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 %]
</td>
[% ELSE %]
<td>[% d.contact | html_entity %]</td>
[% END %]
</tr>
<tr>
<td>Vendor / Model</td>
<td>
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
href="[% search_device %]&vendor=[% d.vendor | uri %]">[% d.vendor | html_entity %]</a>
/
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
href="[% search_device %]&model=[% d.model | uri %]">[% d.model | html_entity %]</a>
</td>
</tr>
<tr>
<td>OS / Version</td>
<td>[% d.os | html_entity %] /
<a rel="tooltip" data-placement="top" data-offset="5"
data-title="Find Similar Devices"
href="[% search_device %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver | html_entity %]</a>
</td>
</tr>
<tr>
<td>Serial Number</td>
<td>[% d.serial | html_entity %]</td>
</tr>
<tr>
<td>Description</td>
<td>[% d.description | html_entity | html_line_break %]</td>
</tr>
<tr>
<td>Uptime</td>
<td>[% d.uptime_age | html_entity %]</td>
</tr>
<tr>
<td>Last Discover</td>
<td>[% d.last_discover_stamp | html_entity %]</td>
</tr>
<tr>
<td>Last Arpnip</td>
<td>[% d.last_arpnip_stamp | html_entity %]</td>
</tr>
<tr>
<td>Last Macsuck</td>
<td>[% d.last_macsuck_stamp | html_entity %]</td>
</tr>
<tr>
<td>Hardware Status</td>
<td>Fan: [% d.fan | html_entity %]
<br/>PS1 [[% d.ps1_type | html_entity %]]: [% d.ps1_status | html_entity %]
<br/>PS2 [[% d.ps2_type | html_entity %]]: [% d.ps2_status | html_entity %]</td>
</tr>
<tr>
<td>MAC Address</td>
<td>[% d.mac | html_entity %]</td>
</tr>
<tr>
<td>VTP Domain</td>
<td>[% d.vtp_domain | html_entity %]</td>
</tr>
[% IF user_has_role('admin') %]
<tr data-for-device="[% d.dns || d.ip %]">
<td>Admin Tasks</td>
<td>
<input type="hidden" data-form="discover" value="[% d.ip %]" name="device"/>
<button class="btn btn-info btn-small nd_adminbutton" name="discover">Discover</button>
<input type="hidden" data-form="arpnip" value="[% d.ip %]" name="device"/>
<button class="btn btn-info btn-small nd_adminbutton" name="arpnip">Arpnip</button>
<input type="hidden" data-form="macsuck" value="[% d.ip %]" name="device"/>
<button class="btn btn-info btn-small nd_adminbutton" name="macsuck">Macsuck</button>
<button class="btn btn-danger btn-small pull-right"
data-toggle="modal" data-target="#nd_devdel" type="button">Delete</button>
<div id="nd_devdel" class="nd_modal modal hide fade" tabindex="-1"
role="dialog" aria-labelledby="nd_devdel_label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h3 id="nd_devdel_label">Confirm Delete: [% d.dns || d.ip | html_entity %]</h3>
</div>
<div class="modal-body">
<blockquote>
<ul>
<li><p>This action is immediate and not reversible</p></li>
<li><p>All associated Nodes will be removed from the database</p></li>
</ul>
</blockquote>
<textarea class="input-block-level" rows="2" data-form="delete"
placeholder="Enter a log message" name="log"></textarea>
<input type="hidden" data-form="delete" value="[% d.ip %]" name="device"/>
</div>
<div class="modal-footer">
<button class="btn btn-success" data-dismiss="modal" aria-hidden="true">No !</button>
<button class="btn btn-danger nd_adminbutton" name="delete" data-dismiss="modal">Really Delete</button>
</div>
</div>
</td>
</tr>
[% END %]
</tbody>
</table>