diff --git a/Netdisco/Changes b/Netdisco/Changes index 809b93fc..ab23a445 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -1,4 +1,10 @@ -2.024001 - +2.024002 - 2014-02-27 + + [NEW FEATURES] + + * User Reports via config, without requiring HTML or Perl + +2.024001 - 2014-02-25 [BUG FIXES] diff --git a/Netdisco/lib/App/Netdisco/DB/Result/Virtual/GenericReport.pm b/Netdisco/lib/App/Netdisco/DB/Result/Virtual/GenericReport.pm new file mode 100644 index 00000000..bbab1286 --- /dev/null +++ b/Netdisco/lib/App/Netdisco/DB/Result/Virtual/GenericReport.pm @@ -0,0 +1,13 @@ +package App::Netdisco::DB::Result::Virtual::GenericReport; + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->table_class('DBIx::Class::ResultSource::View'); +__PACKAGE__->table("generic_report"); +__PACKAGE__->result_source_instance->is_virtual(1); +__PACKAGE__->result_source_instance->view_definition(q{}); + +1; diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index 1bda3475..9512c8c7 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -222,6 +222,50 @@ Value: List of Modules. Default: Empty List. List of additional L names to load. See also the C setting. +=head3 C + +Value: Dictionary 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: + 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 + ORDER BY name + +Each key of the C configuration is an alias for the report, and +becomes part of the web path. Within the tree you must provide each of the +keys shown: + +=head4 C + +Section of the Reports menu where this report will appear. See +L for the full list. + +=head4 C