relocate repo files so ND2 is the only code

This commit is contained in:
Oliver Gorwits
2017-04-14 23:08:55 +01:00
parent 9a016ea6ba
commit d23b32500f
469 changed files with 0 additions and 6920 deletions

View File

@@ -0,0 +1,33 @@
package App::Netdisco::Web::Plugin::Device::Details;
use Dancer ':syntax';
use Dancer::Plugin::Ajax;
use Dancer::Plugin::DBIC;
use Dancer::Plugin::Auth::Extensible;
use App::Netdisco::Web::Plugin;
register_device_tab({ tag => 'details', label => 'Details' });
# device details table
ajax '/ajax/content/device/details' => require_login sub {
my $q = param('q');
my $device = schema('netdisco')->resultset('Device')
->search_for_device($q) or send_error('Bad device', 400);
my @results
= schema('netdisco')->resultset('Device')
->search( { 'me.ip' => $device->ip } )->with_times()
->hri->all;
my @power
= schema('netdisco')->resultset('DevicePower')
->search( { 'me.ip' => $device->ip } )->with_poestats->hri->all;
content_type('text/html');
template 'ajax/device/details.tt', {
d => $results[0], p => \@power
}, { layout => undef };
};
1;