background-color: #E6E6E6;
}
+.pSliceFinished,.pSliceNotFinished
+ {
+ height: 9px;
+ margin-right: 1px;
+ margin-bottom: 1px;
+ border: solid 1px #CCCCCC;
+ background-color: #E6E6E6;
+}
+
.pSliceFull, .pSliceRead_Only,.pSliceArchive, .pSliceUsed, .pSliceDisabled,
.pSliceCrit {
border: solid 1px #BD0C10;
background-color: #FFCE00;
}
-.pSlicePurged, .pSliceRecycle, .pSliceOk {
+.pSliceFinished, .pSlicePurged, .pSliceRecycle, .pSliceOk {
border: solid 1px #009900;
background-color: #00FF00;
}
return parent;
}
+function percent_finish(value, parent)
+{
+ var type;
+
+ var nb = parseInt(value*300/100, 10);
+ parent.title = parseInt(value*100,10)/100 + "% finished (approximate)";
+
+ var img=document.createElement('img');
+ img.className="pSliceFinished";
+ img.src="/bweb/pix.png";
+ img.width=nb;
+ parent.appendChild(img);
+
+ if (value >= 100) {
+ return;
+ }
+
+ nb = parseInt((100-value)*300/100, 10);
+ img=document.createElement('img');
+ img.className="pSliceNotFinished";
+ img.src="/bweb/pix.png";
+ img.width=nb;
+ parent.appendChild(img);
+}
+
function percent_usage(value, parent)
{
var nb_elt=percent_usage_nb_slice;
<table>
<tr>
- <td> <b> Job Name: </b> <td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
+ <td> <b> Job Name: </b> </td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
</tr>
<tr>
- <td> <b> Processing file: </b> <td> <td> <TMPL_VAR "processing file"> </td>
+ <td> <b> Processing file: </b> </td> <td> <TMPL_VAR "processing file"> </td>
</tr>
<tr>
- <td> <b> Speed: </b> <td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
+ <td> <b> Speed: </b> </td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
</tr>
<tr>
- <td> <b> Files Examined: </b> <td> <td> <TMPL_VAR "files examined"></td>
+ <td> <b> Files Examined: </b> </td> <td> <TMPL_VAR "files examined"></td>
</tr>
<tr>
- <td> <b> Bytes: </b> <td> <td> <TMPL_VAR bytes></td>
+ <td> <b> Bytes: </b> </td> <td> <TMPL_VAR bytes></td>
</tr>
+
+ <tr>
+ <td> <b> Bytes done </b> </td><td> <div id='progress1'><td>
+ </tr>
+ <tr>
+ <td> <b> Files done </b> </td><td> <div id='progress2'><td>
+ </tr>
+
</table>
<form name='form1' action='?' method='GET'>
<button type="submit" class="bp" name='action' value='dsp_cur_job'
</div>
<script type="text/javascript" language="JavaScript">
+<TMPL_IF last_jobbytes>
+ percent_finish(<TMPL_VAR jobfiles>*100/<TMPL_VAR last_jobfiles>, document.getElementById('progress1'));
+ percent_finish(<TMPL_VAR jobbytes>*100/<TMPL_VAR last_jobbytes>, document.getElementById('progress2'));
+</TMPL_IF>
bweb_add_refresh();
</script>
</td><td valign='top'>
<h2>Status</h2>
<select name='status' class='formulaire'>
- <option id='status_Any' value='Any'>Any</option>
<option id='status_T' value='T'>Ok</option>
<option id='status_f' value='f'>Error</option>
<option id='status_A' value='A'>Canceled</option>
+ <option id='status_Any' value='Any'>Any</option>
</select>
</td>
</tr>
<table>
<tr>
- <td> <b> Nombre Job: </b> <td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
+ <td> <b> Nombre Job: </b> </td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
</tr>
<tr>
- <td> <b> Archivo en proceso: </b> <td> <td> <TMPL_VAR "processing file"> </td>
+ <td> <b> Archivo en proceso: </b> </td> <td> <TMPL_VAR "processing file"> </td>
</tr>
<tr>
- <td> <b> Velocidad: </b> <td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
+ <td> <b> Velocidad: </b> </td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
</tr>
<tr>
- <td> <b> Archivos Examinados: </b> <td> <td> <TMPL_VAR "files examined"></td>
+ <td> <b> Archivos Examinados: </b> </td> <td> <TMPL_VAR "files examined"></td>
</tr>
<tr>
- <td> <b> Bytes: </b> <td> <td> <TMPL_VAR bytes></td>
+ <td> <b> Bytes: </b> </td> <td> <TMPL_VAR bytes></td>
</tr>
+ <tr>
+ <td> <b> Bytes done </b> </td><td> <div id='progress1'><td>
+ </tr>
+ <tr>
+ <td> <b> Files done </b> </td><td> <div id='progress2'><td>
+ </tr>
+
</table>
<form name='form1' action='?' method='GET'>
<button type="submit" class="bp" name='action' value='dsp_cur_job'
</div>
<script type="text/javascript" language="JavaScript">
+<TMPL_IF last_jobbytes>
+ percent_finish(<TMPL_VAR jobfiles>*100/<TMPL_VAR last_jobfiles>, document.getElementById('progress1'));
+ percent_finish(<TMPL_VAR jobbytes>*100/<TMPL_VAR last_jobbytes>, document.getElementById('progress2'));
+</TMPL_IF>
bweb_add_refresh();
</script>
</td><td valign='top'>
<h2>Estado</h2>
<select name='status' class='formulaire'>
- <option id='status_Any' value='Any'>Cualquiera</option>
<option id='status_T' value='T'>Ok</option>
<option id='status_f' value='f'>Error</option>
<option id='status_A' value='A'>Cancelado</option>
+ <option id='status_Any' value='Any'>Cualquiera</option>
</select>
</td>
</tr>
<table>
<tr>
- <td> <b> Nom du job : </b> <td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
+ <td> <b> Nom du job : </b> </td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
</tr>
<tr>
- <td> <b> Fichier en cours : </b> <td> <td> <TMPL_VAR "processing file"> </td>
+ <td> <b> Fichier en cours : </b> </td> <td> <TMPL_VAR "processing file"> </td>
</tr>
<tr>
- <td> <b> Vitesse : </b> <td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
+ <td> <b> Vitesse : </b> </td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
</tr>
<tr>
- <td> <b> Fichiers vus : </b> <td> <td> <TMPL_VAR "files examined"></td>
+ <td> <b> Fichiers vus : </b> </td> <td> <TMPL_VAR "files examined"></td>
</tr>
<tr>
- <td> <b> Taille : </b> <td> <td> <TMPL_VAR bytes></td>
+ <td> <b> Taille : </b> </td> <td> <TMPL_VAR bytes></td>
</tr>
+ <tr>
+ <td> <b> Bytes done </b> </td><td> <div id='progress1'><td>
+ </tr>
+ <tr>
+ <td> <b> Files done </b> </td><td> <div id='progress2'><td>
+ </tr>
+
</table>
<form name='form1' action='?' method='GET'>
<button type="submit" class="bp" name='action' value='dsp_cur_job'
</div>
<script type="text/javascript" language="JavaScript">
+<TMPL_IF last_jobbytes>
+ percent_finish(<TMPL_VAR jobfiles>*100/<TMPL_VAR last_jobfiles>, document.getElementById('progress1'));
+ percent_finish(<TMPL_VAR jobbytes>*100/<TMPL_VAR last_jobbytes>, document.getElementById('progress2'));
+</TMPL_IF>
bweb_add_refresh();
</script>
</td><td valign='top'>
<h2>Statut</h2>
<select name='status' class='formulaire'>
- <option id='status_Any' value='Any'>Tous</option>
<option id='status_T' value='T'>Ok</option>
<option id='status_f' value='f'>Erreur</option>
<option id='status_A' value='A'>Annulé</option>
+ <option id='status_Any' value='Any'>Tous</option>
</select>
</td>
</tr>
sub display_running_job
{
- my ($self, $conf, $jobid) = @_ ;
-
+ my ($self, $conf, $jobid, $last_jobfiles, $last_jobbytes) = @_ ;
my $status = $self->status($conf);
if ($jobid) {
if ($status->{$jobid}) {
- $self->display($status->{$jobid}, "client_job_status.tpl");
+ $status = $status->{$jobid};
+ $status->{last_jobbytes} = $last_jobbytes;
+ $status->{last_jobfiles} = $last_jobfiles;
+ $status->{jobbytes}=$status->{Bytes};
+ $status->{jobbytes} =~ s![, B/s]!!g;
+ $status->{jobfiles}=$status->{Files};
+ $status->{jobfiles} =~ s/,//g;
+ $self->display($status, "client_job_status.tpl");
}
} else {
for my $id (keys %$status) {
my ($self) = @_;
return if $self->cant_do('r_view_running_job');
- my $arg = $self->get_form('client', 'jobid');
+ my $arg = $self->get_form('jobid');
- if (!$arg->{client} and $arg->{jobid}) {
- # get security filter
- my $filter = $self->get_client_filter();
+ return $self->error("Can't get jobid") unless ($arg->{jobid});
- my $query = "
-SELECT Client.Name AS name
+ # get security filter
+ my $filter = $self->get_client_filter();
+
+ my $query = "
+SELECT Client.Name AS name, Job.Name AS jobname,
+ Job.Level AS level
FROM Job INNER JOIN Client USING (ClientId) $filter
WHERE Job.JobId = $arg->{jobid}
";
- my $row = $self->dbh_selectrow_hashref($query);
-
- if ($row) {
- $arg->{client} = $row->{name};
- CGI::param('client', $arg->{client});
- }
+ my $row = $self->dbh_selectrow_hashref($query);
+
+ if ($row) {
+ $arg->{client} = $row->{name};
+ } else {
+ return $self->error("Can't get client");
}
- if ($arg->{client}) {
- my $cli = new Bweb::Client(name => $arg->{client});
- $cli->display_running_job($self->{info}, $arg->{jobid});
- if ($arg->{jobid}) {
- $self->get_job_log();
+ $query = "
+SELECT temp.jobname AS jobname, AVG(JobBytes) AS jobbytes,
+ AVG(JobFiles) AS jobfiles, COUNT(1) AS nb
+FROM (
+ SELECT Job.Name AS jobname,
+ JobBytes AS jobbytes,
+ JobFiles AS jobfiles
+ FROM Job INNER JOIN Client USING (ClientId) $filter
+ WHERE Job.Name = '$row->{jobname}'
+ AND Job.Level = '$row->{level}'
+ AND Job.JobStatus = 'T'
+ ORDER BY StartTime DESC
+ LIMIT 4
+) AS temp GROUP BY temp.jobname
+";
+
+ $row = $self->dbh_selectrow_hashref($query);
+
+ if ($row) {
+ if ($row->{nb} >= 1) {
+ $arg->{jobbytes} = $row->{jobbytes};
+ $arg->{jobfiles} = $row->{jobfiles};
+ } else {
+ $arg->{jobbytes} = $arg->{jobfiles} = 0;
}
- } else {
- $self->error("Can't get client or jobid");
+ }
+ my $cli = new Bweb::Client(name => $arg->{client});
+ $cli->display_running_job($self->{info}, $arg->{jobid},
+ $arg->{jobfiles}, $arg->{jobbytes});
+ if ($arg->{jobid}) {
+ $self->get_job_log();
}
}
+09Mar08
+ebl Add progress bar to backup screen (files and bytes estimation)
+
07Mar08
ebl Fix btime.pl
<table>
<tr>
- <td> <b> __Job Name:__ </b> <td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
+ <td> <b> __Job Name:__ </b> </td> <td> <TMPL_VAR jobname> (<TMPL_VAR jobid>) <td>
</tr>
<tr>
- <td> <b> __Processing file:__ </b> <td> <td> <TMPL_VAR "processing file"> </td>
+ <td> <b> __Processing file:__ </b> </td> <td> <TMPL_VAR "processing file"> </td>
</tr>
<tr>
- <td> <b> __Speed:__ </b> <td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
+ <td> <b> __Speed:__ </b> </td> <td> <TMPL_VAR "bytes/sec"> B/s</td>
</tr>
<tr>
- <td> <b> __Files Examined:__ </b> <td> <td> <TMPL_VAR "files examined"></td>
+ <td> <b> __Files Examined:__ </b> </td> <td> <TMPL_VAR "files examined"></td>
</tr>
<tr>
- <td> <b> __Bytes:__ </b> <td> <td> <TMPL_VAR bytes></td>
+ <td> <b> __Bytes:__ </b> </td> <td> <TMPL_VAR bytes></td>
</tr>
+ <tr>
+ <td> <b> __Bytes done__ </b> </td><td> <div id='progress1'><td>
+ </tr>
+ <tr>
+ <td> <b> __Files done__ </b> </td><td> <div id='progress2'><td>
+ </tr>
+
</table>
<form name='form1' action='?' method='GET'>
<button type="submit" class="bp" name='action' value='dsp_cur_job'
</div>
<script type="text/javascript" language="JavaScript">
+<TMPL_IF last_jobbytes>
+ percent_finish(<TMPL_VAR jobfiles>*100/<TMPL_VAR last_jobfiles>, document.getElementById('progress1'));
+ percent_finish(<TMPL_VAR jobbytes>*100/<TMPL_VAR last_jobbytes>, document.getElementById('progress2'));
+</TMPL_IF>
bweb_add_refresh();
</script>
</td><td valign='top'>
<h2>__Status__</h2>
<select name='status' class='formulaire'>
- <option id='status_Any' value='Any'>__Any__</option>
<option id='status_T' value='T'>__Ok__</option>
<option id='status_f' value='f'>__Error__</option>
<option id='status_A' value='A'>__Canceled__</option>
+ <option id='status_Any' value='Any'>__Any__</option>
</select>
</td>
</tr>