]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bweb/cgi/bweb.pl
Rebuild configure
[bacula/bacula] / gui / bweb / cgi / bweb.pl
index 035be12a5e961f2db80ec4eeab2295e11e612a68..8634bfa0183eb3c56d19a848e0001718a6e49c63 100755 (executable)
@@ -11,25 +11,24 @@ use strict ;
    The main author of Bweb is Eric Bollengier.
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
-
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   modify it under the terms of version three of the GNU Affero General Public
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
+   Affero General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
-   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zurich,
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 
 =head1 VERSION
@@ -113,6 +112,12 @@ if ($action eq 'begin') {          # main display
 } elsif ($action eq 'client') {        
     $bweb->display_clients();
 
+} elsif ($action eq 'client_edit') {
+    $bweb->client_edit();
+
+} elsif ($action eq 'client_save') {
+    $bweb->client_save();
+
 } elsif ($action eq 'pool') {
     $bweb->display_pool();
 
@@ -128,7 +133,12 @@ if ($action eq 'begin') {          # main display
 } elsif ($action eq 'location_del') {
     $bweb->location_del();
 
+} elsif ($action eq 'cmd_storage') {
+    $bweb->cmd_storage();
+
 } elsif ($action eq 'media') {
+    $bweb->can_do('r_view_media');
+
     print "<div><table border='0'><tr><td valign='top'>\n";
     my $fields = $bweb->get_form(qw/db_locations db_pools expired
                                    qlocations qpools volstatus qre_media
@@ -162,6 +172,8 @@ if ($action eq 'begin') {           # main display
 
        $a->display_content();
     }
+} elsif ($action eq 'add_media') {
+    $bweb->add_media();
 
 } elsif ($action eq 'eject_media') {
     $bweb->eject_media();
@@ -259,7 +271,7 @@ if ($action eq 'begin') {           # main display
        $bweb->update_slots();
     }
     print "</div><div style='float: left;margin-left: 20px;'>";
-    $bweb->move_media('no');   # enabled = no
+    $bweb->move_media('yes');  # pb with enabled = no for restore
     print "</div>";
 
 } elsif ($action eq 'move_email') {
@@ -324,17 +336,21 @@ if ($action eq 'begin') {         # main display
     $bweb->can_do('r_view_job');
     print "<div><table border='0'><tr><td valign='top'>\n";
     my $fields = $bweb->get_form(qw/status level filter db_clients
-                                   db_filesets 
+                                   db_filesets since
                                    limit age offset qclients qfilesets
                                    jobtype qpools db_pools
                                    db_client_groups qclient_groups/); # drop this to hide 
-
+    if (!CGI::param('since')) {
+       $fields->{hide_since}=1 ;
+       delete $fields->{since};
+    }
     $bweb->display($fields, "display_form_job.tpl");
 
     print "</td><td valign='top'>";
-    $bweb->display_job(age => $arg->{age},  # last 7 days
-                      offset => $arg->{offset},
-                      limit => $arg->{limit});
+    $bweb->display_job(age => $fields->{age},  # last 7 days
+                      since => $fields->{since},
+                      offset => $fields->{offset},
+                      limit => $fields->{limit});
     print "</td></tr></table></div>";
 } elsif ($action eq 'job_group') {
     $bweb->can_do('r_view_job');
@@ -344,6 +360,7 @@ if ($action eq 'begin') {           # main display
 
     $fields->{hide_status} = 1;
     $fields->{hide_type} = 1;
+    $fields->{hide_since}=1;
     $fields->{action} = 'job_group';
 
     $bweb->display($fields, "display_form_job.tpl");
@@ -355,14 +372,27 @@ if ($action eq 'begin') {         # main display
 } elsif ($action eq 'client_stats') {
 
     foreach my $client (CGI::param('client')) {
-       if ($client =~ m/$client_re/) {
+       if ($client =~ $client_re) {
            $bweb->display_client_stats(clientname => $1,
                                        age => $arg->{age});
        }
     }
-
 } elsif ($action eq 'group_stats') {
-    $bweb->display_group_stats(age => $arg->{age});
+    $bweb->can_do('r_view_stat');
+    print "<div><table border='0'><tr><td valign='top'>\n";
+    my $fields = $bweb->get_form(qw/since age 
+                                    db_client_groups qclient_groups/); 
+    $fields->{action}='group_stats';
+    $fields->{hide_level}=1;
+    $fields->{hide_type}=1;
+    $fields->{hide_status}=1;
+
+    $bweb->display($fields, "display_form_job.tpl");
+
+    print "</td><td valign='top'>";
+    $bweb->display_group_stats();
+
+    print "</td></tr></table></div>"
 
 } elsif ($action eq 'running') {
     $bweb->display_running_jobs(1);
@@ -391,7 +421,7 @@ if ($action eq 'begin') {           # main display
     $bweb->can_do('r_client_status');
     my $b;
     foreach my $client (CGI::param('client')) {
-       if ($client =~ m/$client_re/) {
+       if ($client =~ $client_re) {
            $client = $1;
            $b = new Bconsole(pref => $conf) 
                unless ($b) ;
@@ -410,6 +440,9 @@ if ($action eq 'begin') {           # main display
 } elsif ($action eq 'cancel_job') {
     $bweb->cancel_job();
 
+} elsif ($action eq 'cancel_future_job') {
+    $bweb->cancel_future_job();
+
 } elsif  ($action eq 'media_zoom') {
     $bweb->display_media_zoom();
 
@@ -445,6 +478,39 @@ if ($action eq 'begin') {          # main display
 } elsif ($action eq 'fileset_view') {
     $bweb->fileset_view();
 
+} elsif ($action eq 'next_job2') {
+    $bweb->display_next_job();
+
+} elsif ($action eq 'missing') {
+    $bweb->display_missing_job();
+
+} elsif ($action eq 'overview') {
+    $bweb->can_do('r_view_job');
+    print "<div><table border='0'><tr><td valign='top'>\n";
+    my $fields = $bweb->get_form(qw/level filter age jobtype since type
+                                   db_client_groups qclient_groups/); # drop this to hide 
+    $fields->{hide_status}=1;
+    $fields->{view_time_slice}=1;
+    $fields->{action}='overview';
+    $bweb->display($fields, "display_form_job.tpl");
+
+    print "</td><td valign='top'>";
+    $bweb->display_overview();
+    print "</td></tr></table></div>";
+
+} elsif ($action eq 'overview_zoom') {
+    $bweb->can_do('r_view_job');
+    print "<div><table border='0'><tr><td valign='top'>\n";
+    my $fields = $bweb->get_form(qw/level filter age jobtype since type
+                                db_client_groups qclient_groups/); # drop this to hide 
+    $fields->{hide_status}=1;
+    $fields->{view_time_slice}=1;
+    $fields->{action}='overview_zoom';
+    $bweb->display($fields, "display_form_job.tpl");
+    print "</td><td valign='top'>";
+    $bweb->display_overview_zoom();
+    print "</td></tr></table></div>";
+
 } else {
     $bweb->error("Sorry, this action doesn't exist");
 }
@@ -457,27 +523,8 @@ __END__
 
 TODO :
 
- o Affichage des job en cours, termines
- o Affichage du detail d'un job (status client)
- o Acces aux log d'une sauvegarde
- o Cancel d'un job
- o Lancement d'un job
-
- o Affichage des medias (pool, cf bacweb)
- o Affichage de la liste des cartouches
- o Affichage d'un autochangeur
- o Mise a jour des slots
- o Label barcodes
  o Affichage des medias qui ont besoin d'etre change
-
- o Affichage des stats sur les dernieres sauvegardes (cf bacula-web)
- o Affichage des stats sur un type de job
  o Affichage des infos de query.sql
 
  - Affichage des du TapeAlert sur le site
  - Recuperation des erreurs SCSI de /var/log/kern.log
-
- o update d'un volume
- o update d'un pool
-
- o Configuration des autochanger a la main dans un hash dumper