From 32771b5adacae8f7fe1ffe8c57f1fc15ea33bb48 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 2 Mar 2014 23:29:09 +0000 Subject: [PATCH] Support for data munging in User Reports --- Netdisco/Changes | 1 + Netdisco/Makefile.PL | 1 + .../lib/App/Netdisco/Manual/Configuration.pod | 22 +++++++++-- .../lib/App/Netdisco/Web/GenericReport.pm | 39 +++++++++++++------ Netdisco/share/config.yml | 1 + .../share/views/ajax/report/generic_report.tt | 4 +- .../views/ajax/report/generic_report_csv.tt | 4 +- 7 files changed, 53 insertions(+), 19 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 1dafb6a3..7e118885 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -5,6 +5,7 @@ * Wildcard support on Device Port MAC Search * Wildcard support on Node name/MAC Search * User Reports appear in "My Reports" menu if no category is given + * (beta) Support for data munging in User Reports * Permit clipboard copy of device IP from Job Queue rows * Failed Job Device IPs link to Discover form with pre-filled Discover IP * Unknown device page has pre-filled Discover IP diff --git a/Netdisco/Makefile.PL b/Netdisco/Makefile.PL index b03fe665..81b8fe87 100644 --- a/Netdisco/Makefile.PL +++ b/Netdisco/Makefile.PL @@ -34,6 +34,7 @@ requires 'Net::LDAP' => 0; requires 'Net::MAC' => 2.103622; requires 'Net::NBName' => 0.26; requires 'NetAddr::IP' => 4.068; +requires 'Opcode' => 1.07; requires 'Path::Class' => 0.32; requires 'Plack' => 1.0023; requires 'Plack::Middleware::Expires' => 0.03; diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index d12e2bdd..1d6ef89d 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -243,8 +243,14 @@ code or HTML templates. For example: 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: +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 +Netdisco's home area. The script can access C<$config> for its configuration +and C<@data> for the retrieved data. It should return a list of munged data. + +Within the tree you can provide each of the keys below: =head4 C