diff --git a/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php b/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php index f198bb97..b5e15854 100644 --- a/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php +++ b/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php @@ -46,7 +46,7 @@ public function __invoke($time, $format="short") { if(empty($time)) { - $this->result = "-"; + return $this->result = "never"; } else { @@ -97,9 +97,74 @@ public function __invoke($time, $format="short") } elseif($format == "fuzzy") { - // TODO + $t1 = explode("-", $time); + $t2 = explode("-", date("Y-m-d", time("NOW"))); + + $d1 = mktime(0, 0, 0, (int)$t1[1],(int)$t1[2],(int)$t1[0]); + $d2 = mktime(0, 0, 0, (int)$t2[1],(int)$t2[2],(int)$t2[0]); + + $interval = ($d2 - $d1) / (3600 * 24); + + if($interval < 1) { + +/* + +STILL BUGGY TEST CODE + + $tmp = explode(" ", $time); + $t1 = explode(":", $tmp[1]); + $t2 = explode(":", date("H:i:s", time("NOW"))); + $h1 = $t1[0]; + $h2 = $t2[0]; - $this->result = "~TODO ago"; + if($h1 > $h2) { + $interval = (24 - $h1) + ($h2); + } + else { + $interval = $h2 - $h1; + } + + if($interval <= 1) { + + $tmp = explode(" ", $time); + $t1 = explode(":", $tmp[1]); + $t2 = explode(":", date("H:i:s", time("NOW"))); + $m1 = $t1[1]; + $m2 = $t2[1]; + + if($m1 > $m2) { + $interval = (60 - $m1) + ($m2); + } + else { + $interval = $m2 - $m1; + } + + if($interval > 1) { + return $this->result = "about " . $interval . " minute(s) ago"; + } + else { + return $this->result = " just now"; + } + + } + elseif($interval < 24) { + return $this->result = "about " . $interval . " hour(s) ago"; + } +*/ + return $this->result = "today"; + + } + elseif($interval <= 31 && $interval >= 1) { + $this->result = "about " . $interval . " day(s) ago"; + } + elseif($interval >= 31 && $interval <= 365) { + $interval = round($interval / 31, 0, PHP_ROUND_HALF_UP); + $this->result = "about " . $interval . " month ago"; + } + elseif($interval > 365) { + $interval = round($interval / 12, 1, PHP_ROUND_HALF_UP); + $this->result = "about " . $interval . " year(s) ago"; + } } diff --git a/module/Client/view/client/client/details.phtml b/module/Client/view/client/client/details.phtml index 0dd4f542..3bc8b88a 100644 --- a/module/Client/view/client/client/details.phtml +++ b/module/Client/view/client/client/details.phtml @@ -27,7 +27,7 @@ $this->headTitle($title); AutopruneescapeHtml($client->autoprune); ?> FileretentionprintRetention($client->fileretention) . " days"; ?> JobretentionprintRetention($client->jobretention) . " days"; ?> -Last successful backupprintHumanReadableTimeperiod($job->endtime, "short")?> (Level: printJobLevel($job->level); ?>) +Last successful backupprintHumanReadableTimeperiod($job->endtime, "fuzzy")?> (Level: printJobLevel($job->level); ?>) diff --git a/module/Media/view/media/media/index.phtml b/module/Media/view/media/media/index.phtml index cba8fd17..eebe3aff 100644 --- a/module/Media/view/media/media/index.phtml +++ b/module/Media/view/media/media/index.phtml @@ -7,6 +7,7 @@ * @link http://github.com/fbergkemper/barbossa for the canonical source repository * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) + * @author Frank Bergkemper * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -47,10 +48,10 @@ $this->headTitle($title); Type Last written Status - Retention - Maximum bytes - Current bytes - Free bytes +
Retention / Expires
+
Maximum bytes
+
Current bytes
+
Free bytes
@@ -62,12 +63,16 @@ $this->headTitle($title); escapeHtml($volume->volumename); ?> escapeHtml($volume->storageid); ?> escapeHtml($volume->mediatype); ?> - printHumanReadableTimeperiod($volume->lastwritten, "short"); ?> +
printHumanReadableTimeperiod($volume->lastwritten, "fuzzy"); ?>
escapeHtml($volume->volstatus); ?> - printRetention($volume->volretention) . " days"; ?> - printBytes($volume->maxvolbytes); ?> - printBytes($volume->volbytes); ?> - printBytes($volume->maxvolbytes - $volume->volbytes); ?> + + +
printRetention($volume->volretention) . " / " . $this->printRetention($volume->volretention) . " days"; ?>
+ + +
printBytes($volume->maxvolbytes); ?>
+
printBytes($volume->volbytes); ?>
+
printBytes($volume->maxvolbytes - $volume->volbytes); ?>
diff --git a/module/Pool/view/pool/pool/details.phtml b/module/Pool/view/pool/pool/details.phtml index ab4d86d4..5c813a28 100644 --- a/module/Pool/view/pool/pool/details.phtml +++ b/module/Pool/view/pool/pool/details.phtml @@ -49,12 +49,12 @@ $this->headTitle($title); Pool ID Pool name Pool type - Volumes - Maximum volumes - Volume retention - Maximum volume jobs - Maximum volume files - Maximum volume bytes +
Volumes
+
Maximum volumes
+
Volume retention
+
Maximum volume jobs
+
Maximum volume files
+
Maximum volume bytes
@@ -64,12 +64,12 @@ $this->headTitle($title); escapeHtml($pool->poolid); ?> escapeHtml($pool->name); ?> escapeHtml($pool->pooltype); ?> - escapeHtml($pool->numvols); ?> - escapeHtml($pool->maxvols); ?> - printRetention($pool->volretention) . " days"; ?> - escapeHtml($pool->maxvoljobs); ?> - escapeHtml($pool->maxvolfiles); ?> - printBytes($pool->maxvolbytes); ?> +
escapeHtml($pool->numvols); ?>
+
escapeHtml($pool->maxvols); ?>
+
printRetention($pool->volretention) . " days"; ?>
+
escapeHtml($pool->maxvoljobs); ?>
+
escapeHtml($pool->maxvolfiles); ?>
+
printBytes($pool->maxvolbytes); ?>
@@ -102,10 +102,10 @@ $this->headTitle($title); Type Last written Status - Retention - Maximum bytes - Current bytes - Free bytes +
Retention
+
Maximum bytes
+
Current bytes
+
Free bytes
@@ -117,12 +117,12 @@ $this->headTitle($title); escapeHtml($volume->volumename); ?> escapeHtml($volume->storageid); ?> escapeHtml($volume->mediatype); ?> - printHumanReadableTimeperiod($volume->lastwritten, "short"); ?> +
printHumanReadableTimeperiod($volume->lastwritten, "fuzzy"); ?>
escapeHtml($volume->volstatus); ?> - printRetention($volume->volretention) . " days"; ?> - printBytes($volume->maxvolbytes); ?> - printBytes($volume->volbytes); ?> - printBytes($volume->maxvolbytes - $volume->volbytes); ?> +
printRetention($volume->volretention) . " days"; ?>
+
printBytes($volume->maxvolbytes); ?>
+
printBytes($volume->volbytes); ?>
+
printBytes($volume->maxvolbytes - $volume->volbytes); ?>
diff --git a/module/Pool/view/pool/pool/index.phtml b/module/Pool/view/pool/pool/index.phtml index e30a4957..d9ce6120 100644 --- a/module/Pool/view/pool/pool/index.phtml +++ b/module/Pool/view/pool/pool/index.phtml @@ -7,6 +7,7 @@ * @link http://github.com/fbergkemper/barbossa for the canonical source repository * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) + * @author Frank Bergkemper * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -44,12 +45,12 @@ $this->headTitle($title); Pool ID Pool name Pool type - Volumes - Maximum volumes - Volume retention - Maximum volume jobs - Maximum volume files - Maximum volume bytes +
Volumes
+
Maximum volumes
+
Volume retention
+
Maximum volume jobs
+
Maximum volume files
+
Maximum volume bytes
@@ -60,12 +61,12 @@ $this->headTitle($title); escapeHtml($pool->poolid); ?> escapeHtml($pool->name); ?> escapeHtml($pool->pooltype); ?> - escapeHtml($pool->numvols); ?> - escapeHtml($pool->maxvols); ?> - printRetention($pool->volretention) . " days"; ?> - escapeHtml($pool->maxvoljobs); ?> - escapeHtml($pool->maxvolfiles); ?> - printBytes($pool->maxvolbytes); ?> +
escapeHtml($pool->numvols); ?>
+
escapeHtml($pool->maxvols); ?>
+
printRetention($pool->volretention) . " days"; ?>
+
escapeHtml($pool->maxvoljobs); ?>
+
escapeHtml($pool->maxvolfiles); ?>
+
printBytes($pool->maxvolbytes); ?>
diff --git a/public/img/bareo-xl.png b/public/img/bareo-xl.png new file mode 100644 index 00000000..4138bb08 Binary files /dev/null and b/public/img/bareo-xl.png differ diff --git a/public/img/bareos.png b/public/img/bareos.png deleted file mode 100644 index cb6f1e29..00000000 Binary files a/public/img/bareos.png and /dev/null differ diff --git a/public/img/favicon.ico b/public/img/favicon.ico index a06eee09..f6d75282 100644 Binary files a/public/img/favicon.ico and b/public/img/favicon.ico differ