[913a75]: Netdisco / share / views / ajax / device / details.tt Maximize Restore History

Download this file

details.tt    171 lines (168 with data), 6.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
[% 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 %]&q=[% d.location | uri %]&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 %]&q=[% d.vendor | uri %]&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 %]&q=[% d.model | uri %]&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 %]&q=[% d.os_ver | uri %]&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>
[% IF settings._extra_device_details.size %]
<tr>
[% FOREACH config IN settings._extra_device_details %]
<td>
[% config.label %]
</td>
<td>
[% TRY %]
[% INCLUDE "plugin/${config.name}/device_details.tt" %]
[% CATCH %]
<!-- dummy content required by Template Toolkit TRY -->
[% END %]
</td>
[% END %]
</tr>
[% END %]
<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>
[% IF d.power_modules.size %]
<tr>
<td>PoE Status</td>
<td>
[% FOREACH m IN d.power_modules %]
[% UNLESS m.module == 1 %]
<br/>
[% END %]
Module [% m.module %]: [% m.status | html_entity %], [% m.capable_ports %] power-capable ports, [% m.powered_ports %] powered ([% m.disabled_ports %] admin disabled, [% m.errored_ports %] errors), [% m.pwr_committed %]/[% m.power %] watts committed.
[% END %]
</td>
</tr>
[% END %]
<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 nd_deep-horizon 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 may be removed from the database</p></li>
</ul>
</blockquote>
<textarea id="nd_devdel-log" class="input-block-level" rows="2" data-form="delete"
placeholder="Enter a log message" name="log"></textarea>
<label class="checkbox">
<input id="nd_devdel-archive" type="checkbox" data-form="delete" name="archive">
<h4 class="nd_unbolden">Archive Nodes</h4>
</label>
<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">Cancel</button>
<button class="btn btn-danger nd_adminbutton" name="delete" data-dismiss="modal">Confirm</button>
</div>
</div>
</td>
</tr>
[% END %]
</tbody>
</table>