#!/usr/local/bin/perl # index.cgi # Display a list of scheduled dumps require './fsdump-lib.pl'; &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1); @fslist = &supported_filesystems(); if (!@fslist && !$supports_tar) { print "
",&text('index_ecommands', "dump"),"
\n";
&ui_print_footer("/", $text{'index'});
exit;
}
print &ui_subheading($text{'index_jobs'});
@alldumps = &list_dumps();
@dumps = grep { &can_edit_dir($_) } @alldumps;
&foreign_require("cron", "cron-lib.pl");
if (@dumps) {
($nontar) = grep { $_->{'fs'} ne 'tar' } @dumps;
print &ui_form_start("delete_dumps.cgi", "post");
@links = ( &select_all_link("d"),
&select_invert_link("d") );
print &ui_links_row(\@links);
@tds = ( "width=5" );
print &ui_columns_start([
"",
$text{'dump_dir'},
$text{'dump_fs'},
$nontar ? ( $text{'dump_level'} ) : ( ),
$text{'dump_dest'},
$text{'dump_sched'},
$text{'dump_when'},
$text{'index_action'} ], 100, 0, \@tds);
foreach $d (@dumps) {
local @cols;
@dirs = &dump_directories($d);
$dirs = join("
", map { &html_escape($_) } @dirs);
if ($access{'edit'}) {
push(@cols, "".
"$dirs");
}
else {
push(@cols, "$dirs");
}
push(@cols, uc($d->{'fs'}));
push(@cols, &html_escape($d->{'level'})) if ($nontar);
push(@cols, "".&dump_dest($d)."");
push(@cols, $d->{'enabled'} ? $text{'yes'} : $text{'no'});
$using_strftime++ if ($d->{'file'} =~ /%/ ||
$d->{'hfile'} =~ /%/);
if ($d->{'follow'}) {
$f = &get_dump($d->{'follow'});
push(@cols, &text('index_follow',
"$f->{'dir'}"));
}
else {
push(@cols, &cron::when_text($d, 1));
}
push(@cols, "".
"$text{'index_now'}");
print &ui_checked_columns_row(\@cols, \@tds, "d", $d->{'id'});
}
print &ui_columns_end();
print &ui_links_row(\@links);
print &ui_form_end([ [ "delete", $text{'index_delete'} ] ]);
}
elsif (!@alldumps) {
print "$text{'index_none'}
\n"; } else { print "$text{'index_none2'}
\n"; } if ($using_strftime && !$config{'date_subs'}) { print "$text{'index_nostrftime'}", "
\n"; } # Form to add print "
\n"; if ($access{'restore'}) { # Display restore button print &ui_hr(); print &ui_buttons_start(); @fstypes = ( ); push(@fstypes, &supported_filesystems()) if (!$config{'always_tar'}); push(@fstypes, "tar") if ($supports_tar); if (@fstypes > 1) { print &ui_buttons_row("restore_form.cgi", $text{'index_restore'}, $text{'index_restoremsg'}, undef, &ui_select("fs", undef, [ map { [ $_, uc($_) ] } @fstypes ])); } else { print &ui_buttons_row("restore_form.cgi", $text{'index_restore2'}, $text{'index_restoremsg'}, &ui_hidden("fs", $fstypes[0])); } print &ui_buttons_end(); } # Display running backup jobs list, if any &foreign_require("proc", "proc-lib.pl"); @procs = &proc::list_processes(); @running = grep { &can_edit_dir($_) } &running_dumps(\@procs); if (@running) { print &ui_hr(); print &ui_subheading($text{'index_running'}); print &ui_columns_start([ $text{'dump_dir'}, $text{'dump_dest'}, $text{'index_start'}, $text{'index_status'}, $text{'index_action'} ], 100); foreach $d (@running) { @dirs = &dump_directories($d); $dirs = join("