From 5d482e151b31438399e9ceb09e6414f19f9b4d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wanderlei=20H=C3=BCttel?= Date: Tue, 7 Nov 2017 16:08:34 -0200 Subject: [PATCH] Tweak add new feature to get file size before compression --- application/models/Job.php | 9 ++++- .../views/scripts/job/find-filters.phtml | 35 +++++++++++++++--- .../scripts/job/terminated-dashboard.phtml | 8 ++-- .../views/scripts/job/terminated.phtml | 4 +- html/images/logviewer-small.png | Bin 0 -> 779 bytes html/images/logviewer.png | Bin 1270 -> 1086 bytes 6 files changed, 43 insertions(+), 13 deletions(-) create mode 100755 html/images/logviewer-small.png diff --git a/application/models/Job.php b/application/models/Job.php index 40156e27..d9d09733 100755 --- a/application/models/Job.php +++ b/application/models/Job.php @@ -746,8 +746,8 @@ function getSelectFilteredJob($date_begin, $time_begin, $date_end, $time_end, $select->joinLeft(array('c' => 'Client'), 'j.ClientId = c.ClientId', array('ClientName' => 'c.Name')); $select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'p.Name')); $select->joinLeft(array('f' => 'FileSet'), 'j.FileSetId = f.FileSetId', array('FileSet')); - $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job'); - + $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job'); + $select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize')); $select->where( "('" . $date_begin . ' ' . $time_begin . "' <= j.StartTime) AND (j.StartTime <= '" . $date_end . ' ' . $time_end . "')" ); @@ -857,6 +857,7 @@ function getByJobId($jobid) $select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name')); $select->joinLeft(array('f' => 'FileSet'), 'j.FileSetId = f.FileSetId', array('FileSet')); $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job'); + $select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize')); $select->where("j.JobId = '$jobid'"); $select->order(array("StartTime", "JobId")); //$sql = $select->__toString(); echo "
$sql
"; exit; // for !!!debug!!! @@ -917,6 +918,7 @@ function getByJobName($jobname) $select->joinLeft(array('p' => 'Pool'), 'j.PoolId = p.PoolId', array('PoolName' => 'Name')); $select->joinLeft(array('f' => 'FileSet'), 'j.FileSetId = f.FileSetId', array('FileSet')); $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job'); + $select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize')); $select->where("j.Name = '$jobname'"); $select->order(array("StartTime desc", "JobId desc")); //$sql = $select->__toString(); echo "
$sql
"; exit; // for !!!debug!!! @@ -974,6 +976,7 @@ function getByVolumeName($volname) $select->joinLeft(array('o' => 'JobMedia'), 'j.JobId = o.JobId', array('JobId')); $select->joinLeft(array('m' => 'Media'), 'm.MediaId = o.MediaId', array('MediaId')); $select->joinLeft(array('sd'=> 'webacula_jobdesc'), 'j.Name = sd.name_job'); + $select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize')); $select->where("m.VolumeName = '$volname'"); $select->order(array("StartTime", "j.JobId")); @@ -1139,6 +1142,7 @@ function getLastJobRun($numjob) $select->joinInner(array('s' => 'Status'), "j.JobStatus = s.JobStatus" , array('jobstatuslong'=>'JobStatusLong')); break; } + $select->joinLeft(array('wjs'=> 'webacula_job_size'), 'j.JobId = wjs.JobId', array('FileSize' => 'FileSize')); $select->where("j.JobStatus IN ('T', 'E', 'e', 'f', 'A', 'W', 'D')"); $select->where("j.Type = 'B'"); $select->order(array("sortStartTime DESC")); @@ -1396,6 +1400,7 @@ function getJobBeforeDate($date_before, $client_id_from, $file_set) " ORDER BY Job.StartTime ASC"; break; } + //echo "
$sql
"; exit; // for !!!debug!!! $stmt = $this->db->query($sql); $ajob_inc = $stmt->fetchAll(); unset($stmt); diff --git a/application/views/scripts/job/find-filters.phtml b/application/views/scripts/job/find-filters.phtml index 3d9bb29f..e97c3907 100755 --- a/application/views/scripts/job/find-filters.phtml +++ b/application/views/scripts/job/find-filters.phtml @@ -13,7 +13,7 @@ ?>
-
+
escape($this->title); ?> @@ -51,7 +51,9 @@ translate->_("Status"); ?> translate->_("Level"); ?> translate->_("Files"); ?> - translate->_("Bytes"); ?> + translate->_("Bytes Stored"); ?> + translate->_("Bytes Copied"); ?> + translate->_("Software Compression"); ?> translate->_("Errors"); ?> translate->_("Client"); ?> translate->_("Pool"); ?> @@ -147,7 +149,7 @@ escape($line['level']);?> ', $this->convBytes($line['jobbytes']), ''; ?> - + + ', $this->convBytes($line['filesize']), ''; + ?> + + ', $this->escape( number_format((1-($jobbytes/$filesize))*100,2) ), ' %'; + } else { + echo '-'; + } + ?> +
- \ No newline at end of file + diff --git a/application/views/scripts/job/terminated-dashboard.phtml b/application/views/scripts/job/terminated-dashboard.phtml index 361c26ce..4879aa4c 100755 --- a/application/views/scripts/job/terminated-dashboard.phtml +++ b/application/views/scripts/job/terminated-dashboard.phtml @@ -37,7 +37,7 @@ translate->_("Level"); ?> translate->_("Files"); ?> translate->_("Bytes"); ?> - translate->_("Errors"); ?> + translate->_("Log"); ?> @@ -152,7 +152,7 @@ -'; + echo ''; else { if ( $line['reviewed'] > 0 ) { // reviewed icon @@ -168,7 +168,7 @@ $this->translate->_("View Messages"), '"'; if ( $line['reviewed'] == 0 ) echo ' class="text-center danger" '; - echo '>', $this->escape($line['joberrors']), ''; + echo '>'; } ?> @@ -193,4 +193,4 @@

- \ No newline at end of file + diff --git a/application/views/scripts/job/terminated.phtml b/application/views/scripts/job/terminated.phtml index e4766e3a..02b53341 100755 --- a/application/views/scripts/job/terminated.phtml +++ b/application/views/scripts/job/terminated.phtml @@ -228,7 +228,9 @@  escape($line['durationtime']);?> - + "> + baseUrl, '/wblogbook/writelogbook/name_job/', $this->escape($line['jobname']), diff --git a/html/images/logviewer-small.png b/html/images/logviewer-small.png new file mode 100755 index 0000000000000000000000000000000000000000..e608b3c6589d39b98661b91fee4b4dac6302d045 GIT binary patch literal 779 zcmV+m1N8ifP)8bO`I4>C-%-{lF9VmoBMK37dDX4`N0DR9-a^9fk&__cmBFt zYOX!_aA08Ib*0n+t#!NEY+ldi3!hZSPv56U#LnY~A8(vHI5haV5wdS{I}t`oq%q_y zVWdeSx7B+8waLlPdIC3px%Fx`le)1HYISt%m>A64m?zDaAF;T!h#mQQePeU#?3u}L z_W-y4xFeImyBn+Y(Xr=W5NV}|v<3uHLPkl##4vmB9?IXUr}h<|8$bSHyaUL<_r`78 z9xDzVByB0YI3d)ANE^b$;6<906bz1(5ki!G&zso&0|}xM$1w$`Uj(rxF+3?lVj$86 zFV^JxGRTY#@X~I;5`wgp5`?51YEnvI0Am0Q0FR;sDFg-qhSVMaL(Q@*9(6V$S0srb zpOzRP(S}wKVOt841f?V5I9lAZLfX#$6oz4|xwdKw8H;YDS=iX7)()6k59mgkoF!?j z{tL!*{V@D~5Ae!~<9@rd_3`2Uf>{0gKEqi>DW74`PV;Or!$>|ut^N-~_^ds2Kb<;z zW@9&?0KT|*@%EeN-Yy>MFOIj||LAnKP)SI;)g)-UjMxI-^AMOL`<(tuw}1bw`_v@@ zT)+AARG%;x9LG6jj6n!Nr_=d!Zf@>ZrPO<_>xz24UVG>^C$4?{RpTjOC)d9DZhsht z2e!9^_W5_;X#t!#dFri{r7l;i)s*YH3o9!t6Eib24^%JU%H>PJ)i1BCpFI6?aAgwV(Ria&Dh6_5i4fMHJy+OCrBabgOG`>AC4~^e{C{0KpU)?bP)CswC_rvIwCs@}UU zl9rgx;2e1Gyw%4!7w#kcSG2aaHlE333Ykpi4uD$#BoVpoc6+l{s}+MF*e?_c3QrLA z9^2d7veW6@$>;MQTDCpscY|2R^T5oILLzBftfKIwR4RSpdESGirKS2!Kmh>E96LNb zTpAe}`4U7gJPr|ahK4aRK83;2Jgl^XO4}pf^U_Yre#7^DY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