diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index 86037362..2a6bceaf 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -224,13 +224,13 @@ C setting. =head3 C -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 +242,8 @@ code or HTML templates. For example: FROM device d ORDER BY name -Each key of the C configuration is an alias for the report, and -becomes part of the web path. +The C of each item in the C 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 key into the C directory of diff --git a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod index 2115019a..089e4457 100644 --- a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod +++ b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod @@ -36,6 +36,30 @@ but they are backwards compatible. =back +=head1 2.029000 + +=head2 Incompatible Changes + +The configuration item C is now a list (used to be a dictionary). +Each item in the list must have a C entry which was previously the +dictionary key. For example: + + 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 + +You I reconfigure. Old configuration will not be migrated. + =head1 2.028000 =head2 General Changes diff --git a/Netdisco/lib/App/Netdisco/Web/GenericReport.pm b/Netdisco/lib/App/Netdisco/Web/GenericReport.pm index 2f86fa7f..bc31e19d 100644 --- a/Netdisco/lib/App/Netdisco/Web/GenericReport.pm +++ b/Netdisco/lib/App/Netdisco/Web/GenericReport.pm @@ -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/); diff --git a/Netdisco/share/config.yml b/Netdisco/share/config.yml index 4b67febd..17fd165a 100644 --- a/Netdisco/share/config.yml +++ b/Netdisco/share/config.yml @@ -78,7 +78,7 @@ web_plugins: extra_web_plugins: [] jobqueue_refresh: 10 safe_password_store: true -reports: {} +reports: [] # ------------- # NETDISCO CORE