User Reports appear in "My Reports" menu if no category is given

This commit is contained in:
Oliver Gorwits
2014-03-02 20:49:00 +00:00
parent e7b030758b
commit 0448f16d7c
4 changed files with 15 additions and 20 deletions

View File

@@ -4,6 +4,7 @@
* Wildcard support on Device Port MAC Search * Wildcard support on Device Port MAC Search
* Wildcard support on Node name/MAC Search * Wildcard support on Node name/MAC Search
* User Reports appear in "My Reports" menu if no category is given
2.024003 - 2014-02-27 2.024003 - 2014-02-27

View File

@@ -246,11 +246,6 @@ Each key of the C<reports> configuration is an alias for the report, and
becomes part of the web path. Within the tree you must provide each of the becomes part of the web path. Within the tree you must provide each of the
keys shown: keys shown:
=head4 C<category>
Section of the Reports menu where this report will appear. See
L<WritingPlugins|App::Netdisco::Manual::WritingPlugins> for the full list.
=head4 C<label> =head4 C<label>
Title for the Report. Title for the Report.
@@ -266,6 +261,12 @@ SQL which returns the data. Make sure that the columns are named the same as
the keys of the C<columns> configuration. Note the way the SQL is specified in the keys of the C<columns> configuration. Note the way the SQL is specified in
the example above, using the pipe symbol and then indenting the query text. the example above, using the pipe symbol and then indenting the query text.
=head4 C<category> (optional)
Section of the Reports menu where this report will appear. See
L<WritingPlugins|App::Netdisco::Manual::WritingPlugins> for the full list.
If not supplied, reports appear in a I<My Reports> category.
=head3 C<jobqueue_refresh> =head3 C<jobqueue_refresh>
Value: Integer Number. Default: 5. Value: Integer Number. Default: 5.
@@ -349,17 +350,13 @@ stanza is simply a friendly name used by Netdisco to refer to the
configuration. configuration.
snmp_auth: snmp_auth:
- - community: public
community: public - communtiy: mycommunity
-
write: true write: true
communtiy: mycommunity - community: mycommunity2
-
read: false read: false
write: true write: true
community: mycommunity2 - tag: v3example
-
tag: v3example
user: netdisco user: netdisco
auth: auth:
pass: netdiscokey pass: netdiscokey
@@ -367,21 +364,18 @@ configuration.
priv: priv:
pass: netdiscokey2 pass: netdiscokey2
proto: DES proto: DES
- - tag: v3aclexample
tag: v3aclexample
user: netdisco2 user: netdisco2
only: only:
- 192.0.2.0/30 - 192.0.2.0/30
- 172.20.10.0/24 - 172.20.10.0/24
- - tag: v2aclexample
tag: v2aclexample
community: s3kr1t community: s3kr1t
read: false read: false
write: true write: true
only: only:
- 2001:db8::/32 - 2001:db8::/32
For SNMPv1 and SNMPv2, only the C<community> key is required. You can add For SNMPv1 and SNMPv2, only the C<community> key is required. You can add
C<read> and/or C<write> restrictions, and an IP restriction using C<only>. C<read> and/or C<write> restrictions, and an IP restriction using C<only>.
Giving the stanza a C<tag> name is optional, but recommended. Giving the stanza a C<tag> name is optional, but recommended.

View File

@@ -16,7 +16,7 @@ foreach my $r (keys %{setting('reports')}) {
register_report({ register_report({
tag => $r, tag => $r,
label => $report->{label}, label => $report->{label},
category => $report->{category}, category => ($report->{category} || 'My Reports'),
provides_csv => true, provides_csv => true,
}); });

View File

@@ -17,7 +17,7 @@ set(
'_admin_order' => [], '_admin_order' => [],
'_reports_menu' => {}, '_reports_menu' => {},
'_reports' => {}, '_reports' => {},
'_report_order' => [qw/Device Port IP Node VLAN Network Wireless/], '_report_order' => [qw/Device Port IP Node VLAN Network Wireless/, 'My Reports'],
); );
# this is what Dancer::Template::TemplateToolkit does by default # this is what Dancer::Template::TemplateToolkit does by default