Changeset 1656
- Timestamp:
- 11/10/08 13:19:52 (2 months ago)
- Files:
-
- trunk/opsview-core/lib/Reports/Report.pm (modified) (1 diff)
- trunk/opsview-core/lib/Reports/Selection.pm (modified) (1 diff)
- trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Graph.pm (modified) (1 diff)
- trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Hypergraph.pm (modified) (1 diff)
- trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Snmptrap.pm (modified) (2 diffs)
- trunk/opsview-web/lib/Opsview/Web/Controller/Root.pm (modified) (1 diff)
- trunk/opsview-web/lib/Opsview/Web/Controller/Status.pm (modified) (1 diff)
- trunk/opsview-web/lib/Opsview/Web/Controller/WrapCGI.pm (modified) (16 diffs)
- trunk/opsview-web/lib/Opsview/Web/Utils.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/opsview-core/lib/Reports/Report.pm
r1521 r1656 195 195 } 196 196 197 =item my_type_is 198 199 Returns "scheduled report" 200 201 =cut 202 203 sub my_type_is { 204 return "scheduled report"; 205 } 206 197 207 =back 198 208 trunk/opsview-core/lib/Reports/Selection.pm
r1521 r1656 60 60 } 61 61 62 =item my_type_is 63 64 Returns "report selection" 65 66 =cut 67 68 sub my_type_is { 69 return "report selection"; 70 } 71 62 72 =back 63 73 trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Graph.pm
r1521 r1656 48 48 my ($self, $c, @args) = @_; 49 49 $c->stash( submit_name => "plain" ); 50 $c->stash->{ page_title } .= ' > '.$c->loc('Graphs'); 50 51 $self->NEXT::auto($c, @args); 51 52 } trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Hypergraph.pm
r1576 r1656 32 32 my $host = $c->model("OpsviewDB::Host")->retrieve(1); 33 33 $c->stash->{ center_on } = $host->name; 34 $c->stash->{ page_title } .= ' > '.$c->loc('Parent tree') ;34 $c->stash->{ page_title } .= ' > '.$c->loc('Parent Tree') ; 35 35 } 36 36 trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Snmptrap.pm
r1576 r1656 43 43 $_ = "" unless (defined $_); 44 44 $c->stash( number_of_saved_tracing_hosts => $_ ); 45 $c->stash->{ page_title } .= ' > '.$c->loc( 'SNMP trap summary' );45 $c->stash->{ page_title } .= ' > '.$c->loc( 'SNMP Trap Summary' ); 46 46 } 47 47 … … 53 53 my @hosts_with_tracing = Opsview::Host->search( snmptrap_tracing => 1 ); 54 54 $c->stash( hosts_with_tracing => \@hosts_with_tracing ); 55 $c->stash->{ page_title } .= ' > '.$c->loc( 'SNMP trap tracing' );55 $c->stash->{ page_title } .= ' > '.$c->loc( 'SNMP Trap Tracing' ); 56 56 } 57 57 trunk/opsview-web/lib/Opsview/Web/Controller/Root.pm
r1635 r1656 516 516 sub about : Local { 517 517 my ( $self, $c ) = @_; 518 $c->stash->{page_title} .= ' > ' . $c->loc( 'About' ); 518 519 } 519 520 trunk/opsview-web/lib/Opsview/Web/Controller/Status.pm
r1576 r1656 53 53 my @hosts = sort { $a->name cmp $b->name } @validhosts; 54 54 $c->stash( list => \@hosts ); 55 $c->stash->{page_title} .= ' > '.$c->loc('Network traffic');55 $c->stash->{page_title} .= ' > '.$c->loc('Network Traffic'); 56 56 } 57 57 trunk/opsview-web/lib/Opsview/Web/Controller/WrapCGI.pm
r1521 r1656 23 23 use strict; 24 24 use warnings; 25 use base qw/Opsview::Web::ControllerBase::WrapCGI /;25 use base qw/Opsview::Web::ControllerBase::WrapCGI Opsview::Web::Utils/; 26 26 27 27 __PACKAGE__->config( … … 58 58 sub avail :Path('avail.cgi') { 59 59 my ($self, $c) = @_; 60 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Availability Report' ); 61 $self->setup_specific_page_titles( $c ); 60 62 $self->cgi_to_process($c => 'avail.cgi'); 61 63 } … … 79 81 sub extinfo :Path('extinfo.cgi') { 80 82 my ($self, $c) = @_; 83 my $cgi_type = $c->req->param( 'type' ); 84 85 my $page_title = 86 $cgi_type == 0 ? $c->loc( 'Process Information' ) 87 : $cgi_type == 1 ? $c->loc( 'Detail' ) 88 : $cgi_type == 2 ? $c->loc( 'Detail' ) 89 : $cgi_type == 3 ? $c->loc( 'Comments' ) 90 : $cgi_type == 4 ? $c->loc( 'Performance Information' ) 91 : $cgi_type == 6 ? $c->loc( 'Scheduled Downtime' ) 92 : $cgi_type == 7 ? $c->loc( 'Scheduling Queue' ) 93 : '' 94 ; 95 96 if($page_title) { 97 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Status') . ' > ' . $page_title; 98 $self->setup_specific_page_titles( $c ); 99 } 81 100 $self->cgi_to_process($c => 'extinfo.cgi'); 82 101 } … … 84 103 sub histogram :Path('histogram.cgi') { 85 104 my ($self, $c) = @_; 105 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Alert Histogram' ); 106 $self->setup_specific_page_titles( $c ); 86 107 $self->cgi_to_process($c => 'histogram.cgi'); 87 108 } … … 89 110 sub mrtg_rrd :Path('mrtg-rrd.cgi') { 90 111 my ($self, $c, $arg) = @_; 112 113 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Network Traffic' ); 91 114 92 115 # As mrtg-rrd.cgi doesn't implement any access control, we do it here … … 100 123 $c->detach("/soft_error"); 101 124 } 125 $self->setup_specific_page_titles( $c ); 102 126 my $it = Opsview::Host->search( ip => $hostname ); 103 127 unless ($it->count) { … … 129 153 sub history :Path('history.cgi') { 130 154 my ($self, $c) = @_; 155 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Alert History' ); 156 $self->setup_specific_page_titles( $c ); 131 157 $self->cgi_to_process($c => 'history.cgi'); 132 158 } … … 134 160 sub new_config :Path('config.cgi') { 135 161 my ($self, $c) = @_; 162 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Nagios Configuration' ); 136 163 $self->cgi_to_process($c => 'config.cgi'); 137 164 } … … 139 166 sub tac :Path('tac.cgi') { 140 167 my ($self, $c) = @_; 168 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Tactical View' ); 141 169 $self->cgi_to_process($c => 'tac.cgi'); 142 170 } … … 144 172 sub outages :Path('outages.cgi') { 145 173 my ($self, $c) = @_; 174 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Network Outages' ); 146 175 $self->cgi_to_process($c => 'outages.cgi'); 147 176 } … … 149 178 sub notifications :Path('notifications.cgi') { 150 179 my ($self, $c) = @_; 180 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Notifications' ); 181 $self->setup_specific_page_titles( $c ); 151 182 $self->cgi_to_process($c => 'notifications.cgi'); 152 183 } … … 169 200 sub trends :Path('trends.cgi') { 170 201 my ($self, $c) = @_; 202 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Trends' ); 203 $self->setup_specific_page_titles( $c ); 171 204 $self->cgi_to_process($c => 'trends.cgi'); 172 205 } … … 174 207 sub showlog :Path('showlog.cgi') { 175 208 my ($self, $c) = @_; 209 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Log Display' ); 176 210 $self->cgi_to_process($c => 'showlog.cgi'); 177 211 } … … 179 213 sub summary :Path('summary.cgi') { 180 214 my ($self, $c) = @_; 215 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Alert Summary' ); 181 216 $self->cgi_to_process($c => 'summary.cgi'); 182 217 } … … 184 219 sub status :Path('status.cgi') { 185 220 my ($self, $c) = @_; 221 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Status' ); 222 $self->setup_specific_page_titles( $c ); 186 223 $self->cgi_to_process($c => 'status.cgi'); 187 224 } … … 189 226 sub statusmap :Path('statusmap.cgi') { 190 227 my ($self, $c) = @_; 228 $c->stash->{ page_title } .= ' > ' . $c->loc( 'Status Map' ); 191 229 $self->cgi_to_process($c => 'statusmap.cgi'); 192 230 } trunk/opsview-web/lib/Opsview/Web/Utils.pm
r1521 r1656 68 68 } 69 69 70 sub setup_specific_page_titles { 71 my ($self, $c) = @_; 72 my $host = $c->req->param( 'host' ); 73 my $hostgroup = $c->req->param( 'hostgroup' ); 74 my $service = $c->req->param( 'service' ); 75 my $servicegroup = $c->req->param( 'servicegroup' ); 76 77 if($host && $host ne 'null' ) { 78 $c->stash->{page_title} .= ' > ' . $c->loc( 'Host: [_1]', $host ); 79 } 80 if($hostgroup && $hostgroup ne 'null' ) { 81 $c->stash->{page_title} .= ' > ' . $c->loc( 'Hostgroup: [_1]', $hostgroup ); 82 } 83 if($service && $service ne 'null' ) { 84 $c->stash->{page_title} .= ' > ' . $c->loc( 'Service: [_1]', $service ); 85 } 86 if($servicegroup && $servicegroup ne 'null' ) { 87 $c->stash->{page_title} .= ' > ' . $c->loc( 'Servicegroup: [_1]', $servicegroup ); 88 } 89 } 90 70 91 1;
