make an App::Netdisco dist using Module::Install
This commit is contained in:
44
Netdisco/lib/App/Netdisco.pm
Normal file
44
Netdisco/lib/App/Netdisco.pm
Normal file
@@ -0,0 +1,44 @@
|
||||
package App::Netdisco;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use 5.10.0;
|
||||
|
||||
use File::ShareDir 'module_dir';
|
||||
use Path::Class;
|
||||
|
||||
our $VERSION = '2.00_009';
|
||||
|
||||
BEGIN {
|
||||
if (not length $ENV{DANCER_APPDIR}
|
||||
or not -f file($ENV{DANCER_APPDIR}, 'config.yml')) {
|
||||
|
||||
my $auto = dir(File::ShareDir::module_dir('App::Netdisco'))->absolute;
|
||||
|
||||
$ENV{DANCER_APPDIR} ||= $auto->stringify;
|
||||
$ENV{DANCER_CONFDIR} ||= $auto->stringify;
|
||||
|
||||
$ENV{DANCER_ENVDIR} ||= $auto->subdir('environments')->stringify;
|
||||
$ENV{DANCER_PUBLIC} ||= $auto->subdir('public')->stringify;
|
||||
$ENV{DANCER_VIEWS} ||= $auto->subdir('views')->stringify;
|
||||
}
|
||||
}
|
||||
|
||||
=head1 App::Netdisco
|
||||
|
||||
Netdisco is an Open Source web-based network management tool.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Oliver Gorwits <oliver@cpan.org>
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
This software is copyright (c) 2012 by The Netdisco Developer Team.
|
||||
|
||||
This is free software; you can redistribute it and/or modify it under
|
||||
the same terms as the Perl 5 programming language system itself.
|
||||
|
||||
=cut
|
||||
|
||||
1;
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB;
|
||||
package App::Netdisco::DB;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -20,7 +20,7 @@ our $VERSION = 3; # schema version used for upgrades, keep as integer
|
||||
use Path::Class;
|
||||
use File::Basename;
|
||||
|
||||
my (undef, $libpath, undef) = fileparse( $INC{ 'Netdisco/DB.pm' } );
|
||||
my (undef, $libpath, undef) = fileparse( $INC{ 'App/Netdisco/DB.pm' } );
|
||||
our $schema_versions_dir = Path::Class::Dir->new($libpath)
|
||||
->subdir("DB", "schema_versions")->stringify;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Admin;
|
||||
package App::Netdisco::DB::Result::Admin;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Device;
|
||||
package App::Netdisco::DB::Result::Device;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -91,7 +91,7 @@ all the interface IP aliases configured on the Device.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( device_ips => 'Netdisco::DB::Result::DeviceIp', 'ip' );
|
||||
__PACKAGE__->has_many( device_ips => 'App::Netdisco::DB::Result::DeviceIp', 'ip' );
|
||||
|
||||
=head2 vlans
|
||||
|
||||
@@ -100,7 +100,7 @@ configured on or known by this Device.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( vlans => 'Netdisco::DB::Result::DeviceVlan', 'ip' );
|
||||
__PACKAGE__->has_many( vlans => 'App::Netdisco::DB::Result::DeviceVlan', 'ip' );
|
||||
|
||||
=head2 ports
|
||||
|
||||
@@ -108,7 +108,7 @@ Returns the set of ports on this Device.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( ports => 'Netdisco::DB::Result::DevicePort', 'ip' );
|
||||
__PACKAGE__->has_many( ports => 'App::Netdisco::DB::Result::DevicePort', 'ip' );
|
||||
|
||||
=head2 port_vlans
|
||||
|
||||
@@ -121,7 +121,7 @@ only on Ports on this Device.
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
port_vlans => 'Netdisco::DB::Result::DevicePortVlan',
|
||||
port_vlans => 'App::Netdisco::DB::Result::DevicePortVlan',
|
||||
'ip', { join_type => 'RIGHT' }
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DeviceIp;
|
||||
package App::Netdisco::DB::Result::DeviceIp;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -42,7 +42,7 @@ Returns the entry from the C<device> table to which this IP alias relates.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip' );
|
||||
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip' );
|
||||
|
||||
=head2 device_port
|
||||
|
||||
@@ -53,7 +53,7 @@ routed port or virtual interface).
|
||||
|
||||
__PACKAGE__->add_unique_constraint(['alias']);
|
||||
|
||||
__PACKAGE__->belongs_to( device_port => 'Netdisco::DB::Result::DevicePort',
|
||||
__PACKAGE__->belongs_to( device_port => 'App::Netdisco::DB::Result::DevicePort',
|
||||
{ 'foreign.port' => 'self.port', 'foreign.ip' => 'self.ip' } );
|
||||
|
||||
1;
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DeviceModule;
|
||||
package App::Netdisco::DB::Result::DeviceModule;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DevicePort;
|
||||
package App::Netdisco::DB::Result::DevicePort;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -72,7 +72,7 @@ Returns the Device table entry to which the given Port is related.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip');
|
||||
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip');
|
||||
|
||||
=head2 nodes / active_nodes / nodes_with_age / active_nodes_with_age
|
||||
|
||||
@@ -88,7 +88,7 @@ days/weeks/months/years".
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( nodes => 'Netdisco::DB::Result::Node',
|
||||
__PACKAGE__->has_many( nodes => 'App::Netdisco::DB::Result::Node',
|
||||
{
|
||||
'foreign.switch' => 'self.ip',
|
||||
'foreign.port' => 'self.port',
|
||||
@@ -96,7 +96,7 @@ __PACKAGE__->has_many( nodes => 'Netdisco::DB::Result::Node',
|
||||
{ join_type => 'LEFT' },
|
||||
);
|
||||
|
||||
__PACKAGE__->has_many( nodes_with_age => 'Netdisco::DB::Result::Virtual::NodeWithAge',
|
||||
__PACKAGE__->has_many( nodes_with_age => 'App::Netdisco::DB::Result::Virtual::NodeWithAge',
|
||||
{
|
||||
'foreign.switch' => 'self.ip',
|
||||
'foreign.port' => 'self.port',
|
||||
@@ -104,7 +104,7 @@ __PACKAGE__->has_many( nodes_with_age => 'Netdisco::DB::Result::Virtual::NodeWit
|
||||
{ join_type => 'LEFT' },
|
||||
);
|
||||
|
||||
__PACKAGE__->has_many( active_nodes => 'Netdisco::DB::Result::Virtual::ActiveNode',
|
||||
__PACKAGE__->has_many( active_nodes => 'App::Netdisco::DB::Result::Virtual::ActiveNode',
|
||||
{
|
||||
'foreign.switch' => 'self.ip',
|
||||
'foreign.port' => 'self.port',
|
||||
@@ -112,7 +112,7 @@ __PACKAGE__->has_many( active_nodes => 'Netdisco::DB::Result::Virtual::ActiveNod
|
||||
{ join_type => 'LEFT' },
|
||||
);
|
||||
|
||||
__PACKAGE__->has_many( active_nodes_with_age => 'Netdisco::DB::Result::Virtual::ActiveNodeWithAge',
|
||||
__PACKAGE__->has_many( active_nodes_with_age => 'App::Netdisco::DB::Result::Virtual::ActiveNodeWithAge',
|
||||
{
|
||||
'foreign.switch' => 'self.ip',
|
||||
'foreign.port' => 'self.port',
|
||||
@@ -132,7 +132,7 @@ database.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( neighbor_alias => 'Netdisco::DB::Result::DeviceIp',
|
||||
__PACKAGE__->belongs_to( neighbor_alias => 'App::Netdisco::DB::Result::DeviceIp',
|
||||
{ 'foreign.alias' => 'self.remote_ip' },
|
||||
{ join_type => 'LEFT' },
|
||||
);
|
||||
@@ -144,7 +144,7 @@ device port.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->might_have( power => 'Netdisco::DB::Result::DevicePortPower', {
|
||||
__PACKAGE__->might_have( power => 'App::Netdisco::DB::Result::DevicePortPower', {
|
||||
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
|
||||
});
|
||||
|
||||
@@ -155,7 +155,7 @@ port, where the VLANs are all tagged.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( port_vlans_tagged => 'Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
|
||||
__PACKAGE__->has_many( port_vlans_tagged => 'App::Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
|
||||
{
|
||||
'foreign.ip' => 'self.ip',
|
||||
'foreign.port' => 'self.port',
|
||||
@@ -185,7 +185,7 @@ The JOIN is of type LEFT, in case the OUI table has not been populated.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( oui => 'Netdisco::DB::Result::Oui',
|
||||
__PACKAGE__->belongs_to( oui => 'App::Netdisco::DB::Result::Oui',
|
||||
sub {
|
||||
my $args = shift;
|
||||
return {
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DevicePortLog;
|
||||
package App::Netdisco::DB::Result::DevicePortLog;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DevicePortPower;
|
||||
package App::Netdisco::DB::Result::DevicePortPower;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -39,7 +39,7 @@ Returns the entry from the C<port> table for which this Power entry applies.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( port => 'Netdisco::DB::Result::DevicePort', {
|
||||
__PACKAGE__->belongs_to( port => 'App::Netdisco::DB::Result::DevicePort', {
|
||||
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DevicePortSsid;
|
||||
package App::Netdisco::DB::Result::DevicePortSsid;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DevicePortVlan;
|
||||
package App::Netdisco::DB::Result::DevicePortVlan;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -50,7 +50,7 @@ VLAN is configured.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip' );
|
||||
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip' );
|
||||
|
||||
=head2 port
|
||||
|
||||
@@ -58,7 +58,7 @@ Returns the entry from the C<port> table on which this VLAN is configured.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( port => 'Netdisco::DB::Result::DevicePort', {
|
||||
__PACKAGE__->belongs_to( port => 'App::Netdisco::DB::Result::DevicePort', {
|
||||
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@ detail, typically in order that the C<name> can be retrieved.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( vlan => 'Netdisco::DB::Result::DeviceVlan', {
|
||||
__PACKAGE__->belongs_to( vlan => 'App::Netdisco::DB::Result::DeviceVlan', {
|
||||
'foreign.ip' => 'self.ip', 'foreign.vlan' => 'self.vlan',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DevicePortWireless;
|
||||
package App::Netdisco::DB::Result::DevicePortWireless;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DevicePower;
|
||||
package App::Netdisco::DB::Result::DevicePower;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DeviceRoute;
|
||||
package App::Netdisco::DB::Result::DeviceRoute;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::DeviceVlan;
|
||||
package App::Netdisco::DB::Result::DeviceVlan;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -45,7 +45,7 @@ Returns the entry from the C<device> table on which this VLAN entry was discover
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip' );
|
||||
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip' );
|
||||
|
||||
=head2 port_vlans_tagged
|
||||
|
||||
@@ -53,7 +53,7 @@ Link relationship for C<tagging_ports>, see below.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( port_vlans_tagged => 'Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
|
||||
__PACKAGE__->has_many( port_vlans_tagged => 'App::Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
|
||||
{ 'foreign.ip' => 'self.ip', 'foreign.vlan' => 'self.vlan' },
|
||||
);
|
||||
|
||||
@@ -63,7 +63,7 @@ Link relationship to support C<native_ports>, see below.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( port_vlans_native => 'Netdisco::DB::Result::Virtual::DevicePortVlanNative',
|
||||
__PACKAGE__->has_many( port_vlans_native => 'App::Netdisco::DB::Result::Virtual::DevicePortVlanNative',
|
||||
{ 'foreign.ip' => 'self.ip', 'foreign.vlan' => 'self.vlan' },
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Log;
|
||||
package App::Netdisco::DB::Result::Log;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Node;
|
||||
package App::Netdisco::DB::Result::Node;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -60,7 +60,7 @@ database but the relation is being used in C<search()>.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device',
|
||||
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device',
|
||||
{ 'foreign.ip' => 'self.switch' }, { join_type => 'LEFT' } );
|
||||
|
||||
=head2 device_port
|
||||
@@ -74,7 +74,7 @@ database but the relation is being used in C<search()>.
|
||||
=cut
|
||||
|
||||
# device port may have been deleted (reconfigured modules?) but node remains
|
||||
__PACKAGE__->belongs_to( device_port => 'Netdisco::DB::Result::DevicePort',
|
||||
__PACKAGE__->belongs_to( device_port => 'App::Netdisco::DB::Result::DevicePort',
|
||||
{ 'foreign.ip' => 'self.switch', 'foreign.port' => 'self.port' },
|
||||
{ join_type => 'LEFT' }
|
||||
);
|
||||
@@ -89,7 +89,7 @@ the current Node's.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( ips => 'Netdisco::DB::Result::NodeIp',
|
||||
__PACKAGE__->has_many( ips => 'App::Netdisco::DB::Result::NodeIp',
|
||||
{ 'foreign.mac' => 'self.mac', 'foreign.active' => 'self.active' } );
|
||||
|
||||
=head2 oui
|
||||
@@ -101,7 +101,7 @@ The JOIN is of type LEFT, in case the OUI table has not been populated.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( oui => 'Netdisco::DB::Result::Oui', 'oui',
|
||||
__PACKAGE__->belongs_to( oui => 'App::Netdisco::DB::Result::Oui', 'oui',
|
||||
{ join_type => 'LEFT' } );
|
||||
|
||||
=head1 ADDITIONAL COLUMNS
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::NodeIp;
|
||||
package App::Netdisco::DB::Result::NodeIp;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -50,7 +50,7 @@ The JOIN is of type LEFT, in case the OUI table has not been populated.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to( oui => 'Netdisco::DB::Result::Oui',
|
||||
__PACKAGE__->belongs_to( oui => 'App::Netdisco::DB::Result::Oui',
|
||||
sub {
|
||||
my $args = shift;
|
||||
return {
|
||||
@@ -77,7 +77,7 @@ include independent C<active> fields.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( node_ips => 'Netdisco::DB::Result::NodeIp',
|
||||
__PACKAGE__->has_many( node_ips => 'App::Netdisco::DB::Result::NodeIp',
|
||||
{ 'foreign.mac' => 'self.mac' } );
|
||||
|
||||
=head2 nodes
|
||||
@@ -93,7 +93,7 @@ See also the C<node_sightings> helper routine, below.
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->has_many( nodes => 'Netdisco::DB::Result::Node',
|
||||
__PACKAGE__->has_many( nodes => 'App::Netdisco::DB::Result::Node',
|
||||
{ 'foreign.mac' => 'self.mac' } );
|
||||
|
||||
my $search_attr = {
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::NodeMonitor;
|
||||
package App::Netdisco::DB::Result::NodeMonitor;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::NodeNbt;
|
||||
package App::Netdisco::DB::Result::NodeNbt;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::NodeWireless;
|
||||
package App::Netdisco::DB::Result::NodeWireless;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Oui;
|
||||
package App::Netdisco::DB::Result::Oui;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Process;
|
||||
package App::Netdisco::DB::Result::Process;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Session;
|
||||
package App::Netdisco::DB::Result::Session;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Subnet;
|
||||
package App::Netdisco::DB::Result::Subnet;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Topology;
|
||||
package App::Netdisco::DB::Result::Topology;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::User;
|
||||
package App::Netdisco::DB::Result::User;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::UserLog;
|
||||
package App::Netdisco::DB::Result::UserLog;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
@@ -1,10 +1,10 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Virtual::ActiveNode;
|
||||
package App::Netdisco::DB::Result::Virtual::ActiveNode;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'Netdisco::DB::Result::Node';
|
||||
use base 'App::Netdisco::DB::Result::Node';
|
||||
|
||||
__PACKAGE__->load_components('Helper::Row::SubClass');
|
||||
__PACKAGE__->subclass;
|
||||
@@ -1,10 +1,10 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Virtual::ActiveNodeWithAge;
|
||||
package App::Netdisco::DB::Result::Virtual::ActiveNodeWithAge;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'Netdisco::DB::Result::Virtual::ActiveNode';
|
||||
use base 'App::Netdisco::DB::Result::Virtual::ActiveNode';
|
||||
|
||||
__PACKAGE__->load_components('Helper::Row::SubClass');
|
||||
__PACKAGE__->subclass;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::DB::Result::Virtual::DeviceLinks;
|
||||
package App::Netdisco::DB::Result::Virtual::DeviceLinks;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@@ -1,10 +1,10 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Virtual::DevicePortVlanNative;
|
||||
package App::Netdisco::DB::Result::Virtual::DevicePortVlanNative;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'Netdisco::DB::Result::DevicePortVlan';
|
||||
use base 'App::Netdisco::DB::Result::DevicePortVlan';
|
||||
|
||||
__PACKAGE__->load_components('Helper::Row::SubClass');
|
||||
__PACKAGE__->subclass;
|
||||
@@ -1,10 +1,10 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Virtual::DevicePortVlanTagged;
|
||||
package App::Netdisco::DB::Result::Virtual::DevicePortVlanTagged;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'Netdisco::DB::Result::DevicePortVlan';
|
||||
use base 'App::Netdisco::DB::Result::DevicePortVlan';
|
||||
|
||||
__PACKAGE__->load_components('Helper::Row::SubClass');
|
||||
__PACKAGE__->subclass;
|
||||
@@ -1,10 +1,10 @@
|
||||
use utf8;
|
||||
package Netdisco::DB::Result::Virtual::NodeWithAge;
|
||||
package App::Netdisco::DB::Result::Virtual::NodeWithAge;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'Netdisco::DB::Result::Node';
|
||||
use base 'App::Netdisco::DB::Result::Node';
|
||||
|
||||
__PACKAGE__->load_components('Helper::Row::SubClass');
|
||||
__PACKAGE__->subclass;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::DB::ResultSet::Device;
|
||||
package App::Netdisco::DB::ResultSet::Device;
|
||||
use base 'DBIx::Class::ResultSet';
|
||||
|
||||
use strict;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::DB::ResultSet::DevicePort;
|
||||
package App::Netdisco::DB::ResultSet::DevicePort;
|
||||
use base 'DBIx::Class::ResultSet';
|
||||
|
||||
use strict;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::DB::ResultSet::Node;
|
||||
package App::Netdisco::DB::ResultSet::Node;
|
||||
use base 'DBIx::Class::ResultSet';
|
||||
|
||||
use strict;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::DB::ResultSet::NodeIp;
|
||||
package App::Netdisco::DB::ResultSet::NodeIp;
|
||||
use base 'DBIx::Class::ResultSet';
|
||||
|
||||
use strict;
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::Daemon::DB;
|
||||
package App::Netdisco::Daemon::DB;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@@ -13,7 +13,7 @@ our $VERSION = 1; # schema version used for upgrades, keep as integer
|
||||
use Path::Class;
|
||||
use File::Basename;
|
||||
|
||||
my (undef, $libpath, undef) = fileparse( $INC{ 'Netdisco/Daemon/DB.pm' } );
|
||||
my (undef, $libpath, undef) = fileparse( $INC{ 'App/Netdisco/Daemon/DB.pm' } );
|
||||
our $schema_versions_dir = Path::Class::Dir->new($libpath)
|
||||
->subdir("DB", "schema_versions")->stringify;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use utf8;
|
||||
package Netdisco::Daemon::DB::Result::Admin;
|
||||
package App::Netdisco::Daemon::DB::Result::Admin;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Daemon::Worker::Interactive;
|
||||
package App::Netdisco::Daemon::Worker::Interactive;
|
||||
|
||||
use Dancer qw/:moose :syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
@@ -8,8 +8,8 @@ use Role::Tiny;
|
||||
use namespace::clean;
|
||||
|
||||
# add dispatch methods for interactive actions
|
||||
with 'Netdisco::Daemon::Worker::Interactive::DeviceActions',
|
||||
'Netdisco::Daemon::Worker::Interactive::PortActions';
|
||||
with 'App::Netdisco::Daemon::Worker::Interactive::DeviceActions',
|
||||
'App::Netdisco::Daemon::Worker::Interactive::PortActions';
|
||||
|
||||
sub worker_body {
|
||||
my $self = shift;
|
||||
@@ -1,7 +1,7 @@
|
||||
package Netdisco::Daemon::Worker::Interactive::DeviceActions;
|
||||
package App::Netdisco::Daemon::Worker::Interactive::DeviceActions;
|
||||
|
||||
use Netdisco::Util::Connect qw/snmp_connect get_device/;
|
||||
use Netdisco::Daemon::Worker::Interactive::Util ':all';
|
||||
use App::Netdisco::Util::Connect qw/snmp_connect get_device/;
|
||||
use App::Netdisco::Daemon::Worker::Interactive::Util ':all';
|
||||
|
||||
use Role::Tiny;
|
||||
use namespace::clean;
|
||||
@@ -1,8 +1,8 @@
|
||||
package Netdisco::Daemon::Worker::Interactive::PortActions;
|
||||
package App::Netdisco::Daemon::Worker::Interactive::PortActions;
|
||||
|
||||
use Netdisco::Util::Connect ':all';
|
||||
use Netdisco::Util::Permissions ':all';
|
||||
use Netdisco::Daemon::Worker::Interactive::Util ':all';
|
||||
use App::Netdisco::Util::Connect ':all';
|
||||
use App::Netdisco::Util::Permissions ':all';
|
||||
use App::Netdisco::Daemon::Worker::Interactive::Util ':all';
|
||||
|
||||
use Role::Tiny;
|
||||
use namespace::clean;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Daemon::Worker::Interactive::Util;
|
||||
package App::Netdisco::Daemon::Worker::Interactive::Util;
|
||||
|
||||
# support utilities for Daemon Actions
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package Netdisco::Daemon::Worker::Manager;
|
||||
package App::Netdisco::Daemon::Worker::Manager;
|
||||
|
||||
use Dancer qw/:moose :syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
|
||||
use Netdisco::Util::DeviceProperties 'is_discoverable';
|
||||
use App::Netdisco::Util::DeviceProperties 'is_discoverable';
|
||||
use Try::Tiny;
|
||||
|
||||
use Role::Tiny;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Util::Connect;
|
||||
package App::Netdisco::Util::Connect;
|
||||
|
||||
use Dancer qw/:syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
@@ -17,7 +17,7 @@ our %EXPORT_TAGS = (
|
||||
/],
|
||||
);
|
||||
|
||||
=head1 Netdisco::Util::Connect
|
||||
=head1 App::Netdisco::Util::Connect
|
||||
|
||||
A set of helper subroutines to support parts of the Netdisco application.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Util::DeviceProperties;
|
||||
package App::Netdisco::Util::DeviceProperties;
|
||||
|
||||
use Dancer qw/:syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
@@ -18,7 +18,7 @@ our %EXPORT_TAGS = (
|
||||
/],
|
||||
);
|
||||
|
||||
=head1 Netdisco::Util::DeviceProperties;
|
||||
=head1 App::Netdisco::Util::DeviceProperties;
|
||||
|
||||
A set of helper subroutines to support parts of the Netdisco application.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package Netdisco::Util::Permissions;
|
||||
package App::Netdisco::Util::Permissions;
|
||||
|
||||
use Dancer qw/:syntax :script/;
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
|
||||
use Netdisco::Util::DeviceProperties ':all';
|
||||
use App::Netdisco::Util::DeviceProperties ':all';
|
||||
|
||||
use base 'Exporter';
|
||||
our @EXPORT = ();
|
||||
@@ -16,7 +16,7 @@ our %EXPORT_TAGS = (
|
||||
/],
|
||||
);
|
||||
|
||||
=head1 Netdisco::Util::Permissions
|
||||
=head1 App::Netdisco::Util::Permissions
|
||||
|
||||
A set of helper subroutines to support parts of the Netdisco application.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Util::Web;
|
||||
package App::Netdisco::Util::Web;
|
||||
|
||||
use base 'Exporter';
|
||||
our @EXPORT = ();
|
||||
@@ -11,7 +11,7 @@ our %EXPORT_TAGS = (
|
||||
/],
|
||||
);
|
||||
|
||||
=head1 Netdisco::Util::Web
|
||||
=head1 App::Netdisco::Util::Web
|
||||
|
||||
A set of helper subroutines to support parts of the Netdisco application.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Web;
|
||||
package App::Netdisco::Web;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::Ajax;
|
||||
@@ -9,11 +9,11 @@ use Socket6 (); # to ensure dependency is met
|
||||
use HTML::Entities (); # to ensure dependency is met
|
||||
use URI::QueryParam (); # part of URI, to add helper methods
|
||||
|
||||
use Netdisco::Web::AuthN;
|
||||
use Netdisco::Web::Search;
|
||||
use Netdisco::Web::Device;
|
||||
use Netdisco::Web::PortControl;
|
||||
use Netdisco::Web::Inventory;
|
||||
use App::Netdisco::Web::AuthN;
|
||||
use App::Netdisco::Web::Search;
|
||||
use App::Netdisco::Web::Device;
|
||||
use App::Netdisco::Web::PortControl;
|
||||
use App::Netdisco::Web::Inventory;
|
||||
|
||||
hook 'before_template' => sub {
|
||||
my $tokens = shift;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Web::AuthN;
|
||||
package App::Netdisco::Web::AuthN;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::DBIC;
|
||||
@@ -1,11 +1,11 @@
|
||||
package Netdisco::Web::Device;
|
||||
package App::Netdisco::Web::Device;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::Ajax;
|
||||
use Dancer::Plugin::DBIC;
|
||||
|
||||
use NetAddr::IP::Lite ':lower';
|
||||
use Netdisco::Util::Web (); # for sort_port
|
||||
use App::Netdisco::Util::Web (); # for sort_port
|
||||
|
||||
hook 'before' => sub {
|
||||
# list of port detail columns
|
||||
@@ -241,7 +241,7 @@ ajax '/ajax/content/device/ports' => sub {
|
||||
if param('c_neighbors');
|
||||
|
||||
# sort ports (empty set would be a 'no records' msg)
|
||||
my $results = [ sort { &Netdisco::Util::Web::sort_port($a->port, $b->port) } $set->all ];
|
||||
my $results = [ sort { &App::Netdisco::Util::Web::sort_port($a->port, $b->port) } $set->all ];
|
||||
return unless scalar @$results;
|
||||
|
||||
content_type('text/html');
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Web::Inventory;
|
||||
package App::Netdisco::Web::Inventory;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::DBIC;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Web::PortControl;
|
||||
package App::Netdisco::Web::PortControl;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::Ajax;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Netdisco::Web::Search;
|
||||
package App::Netdisco::Web::Search;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::Ajax;
|
||||
1
Netdisco/lib/auto/App/Netdisco
Symbolic link
1
Netdisco/lib/auto/App/Netdisco
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../share
|
||||
Reference in New Issue
Block a user