#342 Job Queue Add Hostname or FQDN
This commit is contained in:
@@ -90,6 +90,17 @@ __PACKAGE__->has_many( device_skips => 'App::Netdisco::DB::Result::DeviceSkip',
|
|||||||
{ cascade_copy => 0, cascade_update => 0, cascade_delete => 0 }
|
{ cascade_copy => 0, cascade_update => 0, cascade_delete => 0 }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
=head2 target
|
||||||
|
|
||||||
|
Returns the single C<device> to which this Job entry was associated.
|
||||||
|
|
||||||
|
The JOIN is of type LEFT, in case the C<device> is not in the database.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
__PACKAGE__->belongs_to( target => 'App::Netdisco::DB::Result::Device',
|
||||||
|
{ 'foreign.ip' => 'self.device' }, { join_type => 'LEFT' } );
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
=head2 summary
|
=head2 summary
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ sub jq_complete {
|
|||||||
|
|
||||||
sub jq_log {
|
sub jq_log {
|
||||||
return schema('netdisco')->resultset('Admin')->search({}, {
|
return schema('netdisco')->resultset('Admin')->search({}, {
|
||||||
|
prefetch => 'target',
|
||||||
order_by => { -desc => [qw/entered device action/] },
|
order_by => { -desc => [qw/entered device action/] },
|
||||||
rows => 50,
|
rows => 50,
|
||||||
})->with_times->hri->all;
|
})->with_times->hri->all;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
[% IF row.action == 'discover' AND row.status == 'error' %]
|
[% IF row.action == 'discover' AND row.status == 'error' %]
|
||||||
<a href="[% uri_for('/') %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
<a href="[% uri_for('/') %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<a href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
<a href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.target.dns || row.device | html_entity %]</a>
|
||||||
[% END %]
|
[% END %]
|
||||||
</td>
|
</td>
|
||||||
<td class="nd_center-cell">[% row.port | html_entity %]</td>
|
<td class="nd_center-cell">[% row.port | html_entity %]</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user