my $dbh = $bweb->{dbh};
my $debug = $bweb->{debug};
-my $graph = CGI::param('graph') || 'begin';
+my $graph = CGI::param('graph') || 'job_size';
my $legend = CGI::param('legend') || 'on' ;
$legend = ($legend eq 'on')?1:0;
if (defined $arg->{ach} and defined $arg->{drive} and defined $arg->{slot})
{
- my $b = new Bconsole(pref => $conf, log_stdout => 1) ;
+ my $a = Bweb::Autochanger::get('S1_L80', $bweb);
+ my $b = new Bconsole(pref => $conf, timeout => 300, log_stdout => 1) ;
# TODO : use template here
print "<pre>\n";
- $b->send_cmd_with_drive("mount slot=$arg->{slot} storage='$arg->{ach}'",
+ $b->send_cmd_with_drive("mount slot=$arg->{slot} storage=\"" . $a->get_drive_name($arg->{drive}) . '"',
$arg->{drive});
print "</pre>\n";
} else {
} elsif ($action eq 'ach_unload') {
my $arg = $bweb->get_form('drive', 'slot', 'ach');
+
if (defined $arg->{ach} and defined $arg->{drive} and defined $arg->{slot})
{
- my $b = new Bconsole(pref => $conf, log_stdout => 1) ;
+ my $a = Bweb::Autochanger::get('S1_L80', $bweb);
+ my $b = new Bconsole(pref => $conf, timeout => 300, log_stdout => 1) ;
# TODO : use template here
print "<pre>\n";
- $b->send_cmd_with_drive("umount storage='$arg->{ach}'",
+ $b->send_cmd_with_drive("umount storage=\"" . $a->get_drive_name($arg->{drive}) . '"',
$arg->{drive});
+
print "</pre>\n";
} else {
}
}
+sub get_drive_name
+{
+ my ($self, $index) = @_;
+ return $self->{drive_name}->[$index];
+}
+
# TODO : do a tapeinfo request to get informations
sub tapeinfo
{
height => 480,
jobid => 0,
slot => 0,
- drive => undef,
+ drive => 0,
priority => 10,
age => 60*60*24*7,
days => 1,
}
+ if ($what{db_jobnames}) {
+ my $query = "
+SELECT DISTINCT Job.Name AS jobname
+FROM Job
+";
+
+ my $jobnames = $self->dbh_selectall_hashref($query, 'jobname');
+
+ $ret{db_jobnames} = [sort {lc($a->{jobname}) cmp lc($b->{jobname}) }
+ values %$jobnames] ;
+
+ }
+
return \%ret;
}
my $fields = $self->get_form(qw/age level status clients filesets
db_clients limit db_filesets width height
- qclients qfilesets/);
+ qclients qfilesets qjobnames db_jobnames/);
my $url = CGI::url(-full => 0,
$slots = join(",", @{ $arg->{slots} });
}
- my $t = 60*scalar( @{ $arg->{slots} });
+ my $t = 60*scalar( @{ $arg->{slots} }) + 300 ;
my $b = new Bconsole(pref => $self->{info}, timeout => $t,log_stdout => 1);
print "<h1>This command can take long time, be patient...</h1>";
print "<pre>" ;
</button>
</form>
</td>
+ <td>
+ <form action='?'>
+ <input type='hidden' name='age' value='2678400'>
+ <input type='hidden' name='client' value='<TMPL_VAR Client>'>
+ <input type='hidden' name='jobname' value='<TMPL_VAR jobname>'>
+ <button class='formulaire' name='action' value='graph' title='view trends'>
+ View stats<br/>
+ <img src='/bweb/chart.png'>
+ </button>
+ </form>
+ </td>
</table>
</div>
</select>
</td>
<td valign='top'>
- <h2>File Set</h2>
- <select name='fileset' size='15' class='formulaire' multiple>
-<TMPL_LOOP NAME=db_filesets>
- <option><TMPL_VAR NAME=fileset></option>
+ <h2>Job Name</h2>
+ <select name='jobname' size='15' class='formulaire' multiple>
+<TMPL_LOOP NAME=db_jobnames>
+ <option><TMPL_VAR NAME=jobname></option>
</TMPL_LOOP>
</select>
</td>
document.getElementById('age_<TMPL_VAR age>').selected=true;
</TMPL_IF>
-<TMPL_IF selfilesets>
+<TMPL_IF qfilesets>
for (var i=0; i < document.form1.fileset.length; ++i) {
- <TMPL_LOOP selfilesets>
+ <TMPL_LOOP qfilesets>
if (document.form1.fileset[i].value == <TMPL_VAR name>) {
document.form1.fileset[i].selected = true;
}
}
</TMPL_IF>
+<TMPL_IF qjobnames>
+ for (var i=0; i < document.form1.jobname.length; ++i) {
+ <TMPL_LOOP qjobnames>
+ if (document.form1.jobname[i].value == <TMPL_VAR name>) {
+ document.form1.jobname[i].selected = true;
+ }
+ </TMPL_LOOP>
+ }
+</TMPL_IF>
+
<TMPL_IF graph>
document.getElementById('<TMPL_VAR graph>').selected=true;
</TMPL_IF>