Squashed commit of the following:
* Support for stuffing other locations into @INC at runtime * Reports config is now a list (see ReleaseNotes) commit19756faf57Merge:2e8afbe29d3ac7Author: Oliver Gorwits <oliver@cpan.org> Date: Thu Jul 31 21:32:30 2014 +0100 Merge branch 'master' into og-autoload Conflicts: Netdisco/share/public/javascripts/netdisco_portcontrol.js commit2e8afbeea6Merge:d340c3b18f507eAuthor: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 23 20:09:18 2014 +0100 Merge branch 'master' into og-autoload commitd340c3b135Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jul 7 22:25:38 2014 +0100 tweak dirty css commit032cd82c46Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jul 6 23:05:17 2014 +0100 add dirty classes commit2b72c989faMerge:1b8ac7cb77025fAuthor: Oliver Gorwits <oliver@cpan.org> Date: Fri Jul 4 11:28:01 2014 +0100 Merge branch 'og-autoload' of ssh://git.code.sf.net/p/netdisco/netdisco-ng into og-autoload commitb77025f34cAuthor: Oliver Gorwits <oliver@cpan.org> Date: Thu Jul 3 23:35:35 2014 +0100 hide save icon commit5df5a73aedAuthor: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 2 22:31:18 2014 +0100 blue color commita3bf20f074Merge:1839f26db53c00Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 2 15:17:25 2014 +0100 Merge branch 'master' into og-autoload commit1b8ac7ca1fMerge:1839f26db53c00Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 2 09:23:31 2014 +0100 Merge branch 'master' into og-autoload commit1839f2634bAuthor: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 2 03:43:53 2014 +0100 add jquery.fix.clone.js commit3eee9f1997Author: Oliver Gorwits <oliver@cpan.org> Date: Wed Jul 2 00:08:27 2014 +0100 save button css commit95b6cb61b3Merge:13957e858e5d05Author: Oliver Gorwits <oliver@cpan.org> Date: Tue Jul 1 21:50:01 2014 +0100 Merge branch 'master' into og-autoload Conflicts: Netdisco/share/config.yml commit13957e82dcMerge:bedbec66abcebaAuthor: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 30 22:50:40 2014 +0100 Merge branch 'og-autoload' of ssh://git.code.sf.net/p/netdisco/netdisco-ng into og-autoload commitbedbec6b4bAuthor: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 30 22:49:49 2014 +0100 css fixes commit6e2d5a4b48Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 30 21:30:26 2014 +0100 css fixes commit755fc92c59Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 30 13:05:43 2014 +0100 reports now a list not a hash commit6abcebafbeAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 29 12:41:47 2014 +0100 start as non-root if port switch not required commite5e0c0c8d1Author: Oliver Gorwits <oliver@cpan.org> Date: Sat Jun 28 13:10:51 2014 +0100 fix err in docs commit6d680aabedAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat Jun 28 11:10:23 2014 +0100 move content commitd2668d6db7Author: Oliver Gorwits <oliver@cpan.org> Date: Fri Jun 27 00:30:54 2014 +0100 minor styling commite46cbd252dAuthor: Oliver Gorwits <oliver@cpan.org> Date: Thu Jun 26 23:19:19 2014 +0100 add bootstrap-switch checkbox styling commit5b0a723c9fAuthor: Oliver Gorwits <oliver@cpan.org> Date: Wed Jun 25 22:20:57 2014 +0100 typo in defaults commite45fa89c44Author: Oliver Gorwits <oliver@cpan.org> Date: Tue Jun 24 22:42:45 2014 +0100 css for configuration pane commit62c53a5e49Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 23 23:33:26 2014 +0100 minor typo commitcaedbdadc6Author: Oliver Gorwits <oliver@cpan.org> Date: Mon Jun 23 20:35:30 2014 +0100 properly search the template path!! [#103] commit5742bc7856Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 22 23:13:53 2014 +0100 fix registering template paths commit2b09476f29Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 22 22:19:35 2014 +0100 allow INC stuffing via NETDISCO_INC env var commit7c47a277beMerge:128e96f3a1cd19Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 22 22:17:11 2014 +0100 Merge branch 'master' into og-autoload commit128e96f9a3Author: Oliver Gorwits <oliver@cpan.org> Date: Sun Jun 22 20:48:01 2014 +0100 use Module::Find to load Auto things and Web
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
2.028014
|
||||
2.029000
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* [#108] Port Bounce port control feature (down and up in succession)
|
||||
* Support for stuffing other locations into @INC at runtime
|
||||
* Reports config is now a list (see ReleaseNotes)
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ requires 'HTTP::Tiny' => 0.029;
|
||||
requires 'JSON' => 0;
|
||||
requires 'List::MoreUtils' => 0.33;
|
||||
requires 'MIME::Base64' => 3.13;
|
||||
requires 'Module::Find' => 0.12;
|
||||
requires 'Module::Load' => 0.32;
|
||||
requires 'Moo' => 1.001000;
|
||||
requires 'MCE' => 1.408;
|
||||
|
||||
@@ -12,6 +12,9 @@ BEGIN {
|
||||
unshift @INC,
|
||||
dir($FindBin::RealBin)->parent->subdir('lib')->stringify,
|
||||
dir($FindBin::RealBin, 'lib')->stringify;
|
||||
|
||||
unshift @INC,
|
||||
split m/:/, ($ENV{NETDISCO_INC} || '');
|
||||
}
|
||||
|
||||
use App::Netdisco;
|
||||
|
||||
@@ -18,6 +18,9 @@ BEGIN {
|
||||
unshift @INC,
|
||||
dir($FindBin::RealBin)->parent->subdir('lib')->stringify,
|
||||
dir($FindBin::RealBin, 'lib')->stringify;
|
||||
|
||||
unshift @INC,
|
||||
split m/:/, ($ENV{NETDISCO_INC} || '');
|
||||
}
|
||||
|
||||
use App::Netdisco;
|
||||
|
||||
@@ -7,6 +7,9 @@ use 5.010_000;
|
||||
our $VERSION = '2.028013';
|
||||
use App::Netdisco::Configuration;
|
||||
|
||||
use Module::Find ();
|
||||
Module::Find::usesub 'App::NetdiscoE::Init';
|
||||
|
||||
=head1 NAME
|
||||
|
||||
App::Netdisco - An open source web-based network management tool.
|
||||
|
||||
@@ -3,6 +3,11 @@ package App::Netdisco::Configuration;
|
||||
use App::Netdisco::Environment;
|
||||
use Dancer ':script';
|
||||
|
||||
BEGIN {
|
||||
# stuff useful locations into @INC
|
||||
unshift @INC, @{ (setting('include_paths') || []) };
|
||||
}
|
||||
|
||||
# set up database schema config from simple config vars
|
||||
if (ref {} eq ref setting('database')) {
|
||||
my $name = (setting('database')->{name} || 'netdisco');
|
||||
@@ -60,6 +65,14 @@ setting('schedule')->{expire} ||= setting('schedule')->{expiry}
|
||||
if setting('schedule') and exists setting('schedule')->{expiry};
|
||||
delete config->{'schedule'}->{'expiry'};
|
||||
|
||||
# upgrade reports config from hash to list
|
||||
if (setting('reports') and ref {} eq ref setting('reports')) {
|
||||
config->{'reports'} = [ map {{
|
||||
tag => $_,
|
||||
%{ setting('reports')->{$_} }
|
||||
}} keys %{ setting('reports') } ];
|
||||
}
|
||||
|
||||
# set max outstanding requests for AnyEvent::DNS
|
||||
$ENV{'PERL_ANYEVENT_MAX_OUTSTANDING_DNS'}
|
||||
= setting('dns')->{max_outstanding} || 50;
|
||||
|
||||
@@ -72,6 +72,14 @@ Value: Format String. Default: C<< '[%P] %U %L %m' >>.
|
||||
Structure of the log messages. See L<Dancer::Logger::Abstract/"logger_format">
|
||||
for details.
|
||||
|
||||
=head3 C<include_paths>
|
||||
|
||||
Value: List. Default: Empty List.
|
||||
|
||||
Additional library paths for the application (both web frontend and backend
|
||||
poller daemons). You can also use a colon-separated list in the
|
||||
"C<NETDISCO_INC>" environment variable.
|
||||
|
||||
=head2 Web Frontend
|
||||
|
||||
=head3 C<domain_suffix>
|
||||
@@ -224,13 +232,13 @@ C<web_plugins> setting.
|
||||
|
||||
=head3 C<reports>
|
||||
|
||||
Value: Dictionary of Reports Hashes. Default: None.
|
||||
Value: List of Reports Hashes. Default: None.
|
||||
|
||||
Use this configuration to add reports to Netdisco without writing any Perl
|
||||
code or HTML templates. For example:
|
||||
|
||||
reports:
|
||||
power_inventory:
|
||||
- tag: power_inventory
|
||||
category: Device
|
||||
label: 'Power Supply Inventory'
|
||||
columns:
|
||||
@@ -242,8 +250,8 @@ code or HTML templates. For example:
|
||||
FROM device d
|
||||
ORDER BY name
|
||||
|
||||
Each key of the C<reports> configuration is an alias for the report, and
|
||||
becomes part of the web path.
|
||||
The C<key> of each item in the C<reports> configuration is an alias for the
|
||||
report, and becomes part of the web path.
|
||||
|
||||
You can munge the data retrieved from the database by placing a Perl script
|
||||
with the same name as the C<reports> key into the C<site_plugins> directory of
|
||||
@@ -604,7 +612,7 @@ token-ring-default,fddinet-default,trnet-default.
|
||||
On some devices, per-VLAN macsuck will timeout with specific VLAN numbers. You
|
||||
can put those numbers (or their names) into this list to have them skipped.
|
||||
|
||||
=head3 C<macsucl_no_devicevlan>
|
||||
=head3 C<macsuck_no_devicevlan>
|
||||
|
||||
Value: List of "IP:vlan-number" or "IP:vlan-name". Default: Empty List.
|
||||
|
||||
|
||||
@@ -36,6 +36,31 @@ but they are backwards compatible.
|
||||
|
||||
=back
|
||||
|
||||
=head1 2.029000
|
||||
|
||||
=head2 General Notices
|
||||
|
||||
The configuration item C<reports> is now a list (used to be a dictionary).
|
||||
Each item in the list must have a C<tag> entry which was previously the
|
||||
dictionary key. For example, now use:
|
||||
|
||||
reports:
|
||||
- tag: power_inventory
|
||||
category: Device
|
||||
label: 'Power Supply Inventory'
|
||||
columns:
|
||||
- {name: 'Name'}
|
||||
- {ps1_type: 'PS1 Type'}
|
||||
- {ps1_status: 'PS1 Status'}
|
||||
query: |
|
||||
SELECT d.name, d.ps1_type, d.ps1_status
|
||||
FROM device d
|
||||
WHERE d.ps1_type IS NOT NULL
|
||||
ORDER BY name
|
||||
|
||||
Old configuration will be continue to work, but we recommend you reconfigure
|
||||
anyway.
|
||||
|
||||
=head1 2.028000
|
||||
|
||||
=head2 Incompatible Changes
|
||||
|
||||
@@ -345,9 +345,9 @@ template file of your own in your plugin, you need a new path:
|
||||
register_template_path(
|
||||
dist_dir( 'App-Netdisco-Web-Plugin-Search-MyNewFeature' ));
|
||||
|
||||
The registered path will be searched before the built-in C<App::Netdisco>
|
||||
path. We recommend use of the L<File::ShareDir> module to package and ship
|
||||
templates along with your plugin, as shown.
|
||||
The "C<views>" subdirectory of the registered path will be searched before the
|
||||
built-in C<App::Netdisco> path. We recommend use of the L<File::ShareDir>
|
||||
module to package and ship templates along with your plugin, as shown.
|
||||
|
||||
Each path added using C<register_template_path> is searched I<before> any
|
||||
existing paths in the template config. See the
|
||||
|
||||
@@ -10,20 +10,13 @@ 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 Path::Class 'dir';
|
||||
use Module::Find ();
|
||||
use Module::Load ();
|
||||
use App::Netdisco::Util::Web 'interval_to_daterange';
|
||||
|
||||
use App::Netdisco::Web::AuthN;
|
||||
use App::Netdisco::Web::Static;
|
||||
use App::Netdisco::Web::Search;
|
||||
use App::Netdisco::Web::Device;
|
||||
use App::Netdisco::Web::Report;
|
||||
use App::Netdisco::Web::AdminTask;
|
||||
use App::Netdisco::Web::TypeAhead;
|
||||
use App::Netdisco::Web::PortControl;
|
||||
use App::Netdisco::Web::Statistics;
|
||||
use App::Netdisco::Web::Password;
|
||||
use App::Netdisco::Web::GenericReport;
|
||||
# FIXME: need to avoid splat so that this can be reordered
|
||||
Module::Find::usesub 'App::NetdiscoE::Web';
|
||||
Module::Find::usesub 'App::Netdisco::Web';
|
||||
|
||||
sub _load_web_plugins {
|
||||
my $plugin_list = shift;
|
||||
|
||||
@@ -11,8 +11,8 @@ use Safe;
|
||||
|
||||
use vars qw/$config @data/;
|
||||
|
||||
foreach my $r (keys %{setting('reports')}) {
|
||||
my $report = setting('reports')->{$r};
|
||||
foreach my $report (@{setting('reports')}) {
|
||||
my $r = $report->{tag};
|
||||
|
||||
register_report({
|
||||
tag => $r,
|
||||
@@ -41,7 +41,7 @@ foreach my $r (keys %{setting('reports')}) {
|
||||
# Data Munging support...
|
||||
|
||||
my $compartment = Safe->new;
|
||||
$config = setting('reports')->{$r};
|
||||
$config = $report;
|
||||
$compartment->share(qw/$config @data/);
|
||||
$compartment->permit_only(qw/:default sort/);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
log: 'warning'
|
||||
logger_format: '[%P] %U %L %m'
|
||||
include_paths: []
|
||||
|
||||
# ------------
|
||||
# WEB FRONTEND
|
||||
@@ -78,7 +79,7 @@ web_plugins:
|
||||
extra_web_plugins: []
|
||||
jobqueue_refresh: 10
|
||||
safe_password_store: true
|
||||
reports: {}
|
||||
reports: []
|
||||
table_pagesize: 10
|
||||
|
||||
# -------------
|
||||
@@ -271,6 +272,7 @@ engines:
|
||||
start_tag: '[%'
|
||||
end_tag: '%]'
|
||||
PRE_CHOMP: 1
|
||||
INCLUDE_PATH: []
|
||||
layout: 'main'
|
||||
plugins:
|
||||
Auth::Extensible:
|
||||
|
||||
Reference in New Issue
Block a user