add discover button to device details page

This commit is contained in:
Oliver Gorwits
2013-05-14 21:05:01 +01:00
parent 11fd8bf964
commit 55c6d4fe63
5 changed files with 20 additions and 4 deletions

View File

@@ -107,6 +107,11 @@ td div.input-append {
margin-bottom: 0px; margin-bottom: 0px;
} }
/* admin buttons in the device details view */
td > form.nd_inline-form {
margin-bottom: 2px;
}
/* fix layout of form fields inside the (pseudo devices) table */ /* fix layout of form fields inside the (pseudo devices) table */
.nd_center-cell input { .nd_center-cell input {
margin-bottom: 0px; margin-bottom: 0px;

View File

@@ -32,7 +32,7 @@
<td class="nd_center-cell">[% row.status.ucfirst | html_entity %]</td> <td class="nd_center-cell">[% row.status.ucfirst | html_entity %]</td>
[% END %] [% END %]
<td class="nd_center-cell"><a class="nd_linkcell" <td class="nd_center-cell"><a class="nd_linkcell"
href="[% device_ports %]&q=[% row.device | uri %]">[% row.device | html_entity %]</a></td> href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.device | html_entity %]</a></td>
<td class="nd_center-cell">[% row.port | html_entity %]</td> <td class="nd_center-cell">[% row.port | html_entity %]</td>
<td class="nd_center-cell">[% row.subaction | html_entity %]</td> <td class="nd_center-cell">[% row.subaction | html_entity %]</td>
<td class="nd_center-cell">[% row.username | html_entity %]</td> <td class="nd_center-cell">[% row.username | html_entity %]</td>

View File

@@ -22,7 +22,7 @@
<tr> <tr>
<form name="update"> <form name="update">
<td class="nd_center-cell"><a class="nd_linkcell" <td class="nd_center-cell"><a class="nd_linkcell"
href="[% device_ports %]&q=[% row.dns | uri %]">[% row.dns | html_entity %]</a></td> href="[% uri_for('/device') %]?q=[% row.dns | uri %]">[% row.dns | html_entity %]</a></td>
<td class="nd_center-cell">[% row.ip | html_entity %]</td> <td class="nd_center-cell">[% row.ip | html_entity %]</td>
<td class="nd_center-cell"><input name="ports" type="number" value="[% row.port_count | html_entity %]"></td> <td class="nd_center-cell"><input name="ports" type="number" value="[% row.port_count | html_entity %]"></td>
<td class="nd_center-cell"> <td class="nd_center-cell">

View File

@@ -44,10 +44,10 @@
<tr> <tr>
<form name="del"> <form name="del">
<td class="nd_center-cell"><a class="nd_linkcell" <td class="nd_center-cell"><a class="nd_linkcell"
href="[% device_ports %]&q=[% row.dev1 | uri %]">[% row.dev1 | html_entity %]</a></td> href="[% uri_for('/device') %]?q=[% row.dev1 | uri %]">[% row.dev1 | html_entity %]</a></td>
<td class="nd_center-cell">[% row.port1 | html_entity %]</td> <td class="nd_center-cell">[% row.port1 | html_entity %]</td>
<td class="nd_center-cell"><a class="nd_linkcell" <td class="nd_center-cell"><a class="nd_linkcell"
href="[% device_ports %]&q=[% row.dev2 | uri %]">[% row.dev2 | html_entity %]</a></td> href="[% uri_for('/device') %]?q=[% row.dev2 | uri %]">[% row.dev2 | html_entity %]</a></td>
<td class="nd_center-cell">[% row.port2 | html_entity %]</td> <td class="nd_center-cell">[% row.port2 | html_entity %]</td>
<td class="nd_center-cell"> <td class="nd_center-cell">
<input name="dev1" type="hidden" value="[% row.dev1 | html_entity %]"> <input name="dev1" type="hidden" value="[% row.dev1 | html_entity %]">

View File

@@ -93,5 +93,16 @@
<td>VTP Domain</td> <td>VTP Domain</td>
<td>[% d.vtp_domain | html_entity %]</td> <td>[% d.vtp_domain | html_entity %]</td>
</tr> </tr>
[% IF vars.user.admin %]
<tr>
<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">Rediscover</button>
</form>
</td>
</tr>
[% END %]
</tbody> </tbody>
</table> </table>