Changeset 1656

Show
Ignore:
Timestamp:
11/10/08 13:19:52 (2 months ago)
Author:
duncan
Message:

Page Titles:

  • Add to cgi's
  • Add in missing on reports
  • Amend capitalisation on some titles
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/opsview-core/lib/Reports/Report.pm

    r1521 r1656  
    195195} 
    196196 
     197=item my_type_is 
     198 
     199Returns "scheduled report" 
     200 
     201=cut 
     202 
     203sub my_type_is { 
     204  return "scheduled report"; 
     205} 
     206 
    197207=back 
    198208 
  • trunk/opsview-core/lib/Reports/Selection.pm

    r1521 r1656  
    6060} 
    6161 
     62=item my_type_is 
     63 
     64Returns "report selection" 
     65 
     66=cut 
     67 
     68sub my_type_is { 
     69  return "report selection"; 
     70} 
     71 
    6272=back 
    6373 
  • trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Graph.pm

    r1521 r1656  
    4848        my ($self, $c, @args) = @_; 
    4949        $c->stash( submit_name => "plain" ); 
     50        $c->stash->{ page_title } .= ' > '.$c->loc('Graphs'); 
    5051        $self->NEXT::auto($c, @args); 
    5152} 
  • trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Hypergraph.pm

    r1576 r1656  
    3232        my $host = $c->model("OpsviewDB::Host")->retrieve(1); 
    3333        $c->stash->{ center_on } = $host->name; 
    34         $c->stash->{ page_title } .= ' > '.$c->loc('Parent tree') ; 
     34        $c->stash->{ page_title } .= ' > '.$c->loc('Parent Tree') ; 
    3535} 
    3636 
  • trunk/opsview-web/lib/Opsview/Web/Controller/Admin/Snmptrap.pm

    r1576 r1656  
    4343        $_ = "" unless (defined $_); 
    4444        $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' ); 
    4646} 
    4747 
     
    5353        my @hosts_with_tracing = Opsview::Host->search( snmptrap_tracing => 1 ); 
    5454        $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' ); 
    5656} 
    5757 
  • trunk/opsview-web/lib/Opsview/Web/Controller/Root.pm

    r1635 r1656  
    516516sub about : Local { 
    517517  my ( $self, $c ) = @_; 
     518  $c->stash->{page_title} .= ' > ' . $c->loc( 'About' ); 
    518519} 
    519520 
  • trunk/opsview-web/lib/Opsview/Web/Controller/Status.pm

    r1576 r1656  
    5353        my @hosts = sort { $a->name cmp $b->name } @validhosts; 
    5454        $c->stash( list => \@hosts ); 
    55     $c->stash->{page_title} .= ' > '.$c->loc('Network traffic'); 
     55       $c->stash->{page_title} .= ' > '.$c->loc('Network Traffic'); 
    5656} 
    5757 
  • trunk/opsview-web/lib/Opsview/Web/Controller/WrapCGI.pm

    r1521 r1656  
    2323use strict; 
    2424use warnings; 
    25 use base qw/Opsview::Web::ControllerBase::WrapCGI/; 
     25use base qw/Opsview::Web::ControllerBase::WrapCGI Opsview::Web::Utils/; 
    2626 
    2727__PACKAGE__->config( 
     
    5858sub avail :Path('avail.cgi') { 
    5959  my ($self, $c) = @_; 
     60  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Availability Report' ); 
     61  $self->setup_specific_page_titles( $c ); 
    6062  $self->cgi_to_process($c => 'avail.cgi'); 
    6163} 
     
    7981sub extinfo :Path('extinfo.cgi') { 
    8082  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  } 
    81100  $self->cgi_to_process($c => 'extinfo.cgi'); 
    82101} 
     
    84103sub histogram :Path('histogram.cgi') { 
    85104  my ($self, $c) = @_; 
     105  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Alert Histogram' ); 
     106  $self->setup_specific_page_titles( $c ); 
    86107  $self->cgi_to_process($c => 'histogram.cgi'); 
    87108} 
     
    89110sub mrtg_rrd :Path('mrtg-rrd.cgi') { 
    90111  my ($self, $c, $arg) = @_; 
     112 
     113  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Network Traffic' ); 
    91114 
    92115  # As mrtg-rrd.cgi doesn't implement any access control, we do it here 
     
    100123    $c->detach("/soft_error"); 
    101124  } 
     125  $self->setup_specific_page_titles( $c ); 
    102126  my $it = Opsview::Host->search( ip => $hostname ); 
    103127  unless ($it->count) { 
     
    129153sub history :Path('history.cgi') { 
    130154  my ($self, $c) = @_; 
     155  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Alert History' ); 
     156  $self->setup_specific_page_titles( $c ); 
    131157  $self->cgi_to_process($c => 'history.cgi'); 
    132158} 
     
    134160sub new_config :Path('config.cgi') { 
    135161  my ($self, $c) = @_; 
     162  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Nagios Configuration' ); 
    136163  $self->cgi_to_process($c => 'config.cgi'); 
    137164} 
     
    139166sub tac :Path('tac.cgi') { 
    140167  my ($self, $c) = @_; 
     168  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Tactical View' ); 
    141169  $self->cgi_to_process($c => 'tac.cgi'); 
    142170} 
     
    144172sub outages :Path('outages.cgi') { 
    145173  my ($self, $c) = @_; 
     174  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Network Outages' ); 
    146175  $self->cgi_to_process($c => 'outages.cgi'); 
    147176} 
     
    149178sub notifications :Path('notifications.cgi') { 
    150179  my ($self, $c) = @_; 
     180  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Notifications' ); 
     181  $self->setup_specific_page_titles( $c ); 
    151182  $self->cgi_to_process($c => 'notifications.cgi'); 
    152183} 
     
    169200sub trends :Path('trends.cgi') { 
    170201  my ($self, $c) = @_; 
     202  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Trends' ); 
     203  $self->setup_specific_page_titles( $c ); 
    171204  $self->cgi_to_process($c => 'trends.cgi'); 
    172205} 
     
    174207sub showlog :Path('showlog.cgi') { 
    175208  my ($self, $c) = @_; 
     209  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Log Display' ); 
    176210  $self->cgi_to_process($c => 'showlog.cgi'); 
    177211} 
     
    179213sub summary :Path('summary.cgi') { 
    180214  my ($self, $c) = @_; 
     215  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Alert Summary' ); 
    181216  $self->cgi_to_process($c => 'summary.cgi'); 
    182217} 
     
    184219sub status :Path('status.cgi') { 
    185220  my ($self, $c) = @_; 
     221  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Status' ); 
     222  $self->setup_specific_page_titles( $c ); 
    186223  $self->cgi_to_process($c => 'status.cgi'); 
    187224} 
     
    189226sub statusmap :Path('statusmap.cgi') { 
    190227  my ($self, $c) = @_; 
     228  $c->stash->{ page_title } .= ' > ' . $c->loc( 'Status Map' ); 
    191229  $self->cgi_to_process($c => 'statusmap.cgi'); 
    192230} 
  • trunk/opsview-web/lib/Opsview/Web/Utils.pm

    r1521 r1656  
    6868} 
    6969 
     70sub 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 
    70911;