add macwalk and arpnip buttons to device details
This commit is contained in:
@@ -4,6 +4,8 @@ use Dancer ':syntax';
|
||||
use Dancer::Plugin::Ajax;
|
||||
use Dancer::Plugin::DBIC;
|
||||
|
||||
use Try::Tiny;
|
||||
|
||||
sub add_job {
|
||||
my ($jobtype, $device) = @_;
|
||||
|
||||
@@ -13,6 +15,8 @@ sub add_job {
|
||||
and $device->addr ne '0.0.0.0';
|
||||
}
|
||||
|
||||
try {
|
||||
# job might already be in the queue, so this could die
|
||||
schema('netdisco')->resultset('Admin')->create({
|
||||
($device ? (device => $device->addr) : ()),
|
||||
action => $jobtype,
|
||||
@@ -20,6 +24,7 @@ sub add_job {
|
||||
username => session('user'),
|
||||
userip => request->remote_address,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
# we have a separate list for jobs needing a device to avoid queueing
|
||||
|
||||
@@ -99,7 +99,15 @@
|
||||
<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>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user