Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
- Alignments in tables and some other stuff
  • Loading branch information
fbergkemper committed Jan 30, 2014
1 parent cee72c5 commit 8ac1bb9
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 46 deletions.
Expand Up @@ -46,7 +46,7 @@ public function __invoke($time, $format="short")
{

if(empty($time)) {
$this->result = "-";
return $this->result = "never";
}
else {

Expand Down Expand Up @@ -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";
}

}

Expand Down
2 changes: 1 addition & 1 deletion module/Client/view/client/client/details.phtml
Expand Up @@ -27,7 +27,7 @@ $this->headTitle($title);
<tr><td>Autoprune</td><td><?php echo $this->escapeHtml($client->autoprune); ?></td></tr>
<tr><td>Fileretention</td><td><?php echo $this->printRetention($client->fileretention) . " days"; ?></td></tr>
<tr><td>Jobretention</td><td><?php echo $this->printRetention($client->jobretention) . " days"; ?></td></tr>
<tr><td>Last successful backup</td><td><a href="<?php echo $this->url('job', array('action'=>'details', 'id' => $job->jobid)); ?>"><?php echo $this->printHumanReadableTimeperiod($job->endtime, "short")?> (Level: <?php echo $this->printJobLevel($job->level); ?>)</a></td></tr>
<tr><td>Last successful backup</td><td><a href="<?php echo $this->url('job', array('action'=>'details', 'id' => $job->jobid)); ?>" title="<?php echo $job->endtime; ?>"><?php echo $this->printHumanReadableTimeperiod($job->endtime, "fuzzy")?> (Level: <?php echo $this->printJobLevel($job->level); ?>)</a></td></tr>

</table>

Expand Down
23 changes: 14 additions & 9 deletions module/Media/view/media/media/index.phtml
Expand Up @@ -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
Expand Down Expand Up @@ -47,10 +48,10 @@ $this->headTitle($title);
<th>Type</th>
<th>Last written</th>
<th>Status</th>
<th>Retention</th>
<th>Maximum bytes</th>
<th>Current bytes</th>
<th>Free bytes</th>
<th><div align="right">Retention / Expires</div></th>
<th><div align="right">Maximum bytes</div></th>
<th><div align="right">Current bytes</div></th>
<th><div align="right">Free bytes</div></th>

</tr>

Expand All @@ -62,12 +63,16 @@ $this->headTitle($title);
<td><?php echo $this->escapeHtml($volume->volumename); ?></td>
<td><a href="<?php echo $this->url('storage', array('action'=>'details')); ?>"><?php echo $this->escapeHtml($volume->storageid); ?></a></td>
<td><?php echo $this->escapeHtml($volume->mediatype); ?></td>
<td><?php echo $this->printHumanReadableTimeperiod($volume->lastwritten, "short"); ?></td>
<td><div title="<?php echo $volume->lastwritten; ?>"><?php echo $this->printHumanReadableTimeperiod($volume->lastwritten, "fuzzy"); ?></div></td>
<td><?php echo $this->escapeHtml($volume->volstatus); ?></td>
<td><?php echo $this->printRetention($volume->volretention) . " days"; ?></td>
<td><?php echo $this->printBytes($volume->maxvolbytes); ?></td>
<td><?php echo $this->printBytes($volume->volbytes); ?></td>
<td><?php echo $this->printBytes($volume->maxvolbytes - $volume->volbytes); ?></td>

<!-- <?php if($volume->volstatus == "Append") : ?> -->
<td><div align="right"><?php echo $this->printRetention($volume->volretention) . " / " . $this->printRetention($volume->volretention) . " days"; ?></div></td>
<!-- <?php endif; ?> -->

<td><div align="right"><?php echo $this->printBytes($volume->maxvolbytes); ?></div></td>
<td><div align="right"><?php echo $this->printBytes($volume->volbytes); ?></div></td>
<td><div align="right"><?php echo $this->printBytes($volume->maxvolbytes - $volume->volbytes); ?></div></td>

</tr>

Expand Down
42 changes: 21 additions & 21 deletions module/Pool/view/pool/pool/details.phtml
Expand Up @@ -49,12 +49,12 @@ $this->headTitle($title);
<th>Pool ID</th>
<th>Pool name</th>
<th>Pool type</th>
<th>Volumes</th>
<th>Maximum volumes</th>
<th>Volume retention</th>
<th>Maximum volume jobs</th>
<th>Maximum volume files</th>
<th>Maximum volume bytes</th>
<th><div align="right">Volumes</div></th>
<th><div align="right">Maximum volumes</div></th>
<th><div align="right">Volume retention</div></th>
<th><div align="right">Maximum volume jobs</div></th>
<th><div align="right">Maximum volume files</div></th>
<th><div align="right">Maximum volume bytes</div></th>


</tr>
Expand All @@ -64,12 +64,12 @@ $this->headTitle($title);
<td><?php echo $this->escapeHtml($pool->poolid); ?></td>
<td><?php echo $this->escapeHtml($pool->name); ?></td>
<td><?php echo $this->escapeHtml($pool->pooltype); ?></td>
<td><?php echo $this->escapeHtml($pool->numvols); ?></td>
<td><?php echo $this->escapeHtml($pool->maxvols); ?></td>
<td><?php echo $this->printRetention($pool->volretention) . " days"; ?></td>
<td><?php echo $this->escapeHtml($pool->maxvoljobs); ?></td>
<td><?php echo $this->escapeHtml($pool->maxvolfiles); ?></td>
<td><?php echo $this->printBytes($pool->maxvolbytes); ?></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->numvols); ?></div></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->maxvols); ?></div></td>
<td><div align="right"><?php echo $this->printRetention($pool->volretention) . " days"; ?></div></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->maxvoljobs); ?></div></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->maxvolfiles); ?></div></td>
<td><div align="right"><?php echo $this->printBytes($pool->maxvolbytes); ?></div></td>

</tr>

Expand Down Expand Up @@ -102,10 +102,10 @@ $this->headTitle($title);
<th>Type</th>
<th>Last written</th>
<th>Status</th>
<th>Retention</th>
<th>Maximum bytes</th>
<th>Current bytes</th>
<th>Free bytes</th>
<th><div align="right">Retention</div></th>
<th><div align="right">Maximum bytes</div></th>
<th><div align="right">Current bytes</div></th>
<th><div align="right">Free bytes</div></th>

</tr>

Expand All @@ -117,12 +117,12 @@ $this->headTitle($title);
<td><?php echo $this->escapeHtml($volume->volumename); ?></td>
<td><a href="<?php echo $this->url('storage', array('action'=>'details')); ?>"><?php echo $this->escapeHtml($volume->storageid); ?></a></td>
<td><?php echo $this->escapeHtml($volume->mediatype); ?></td>
<td><?php echo $this->printHumanReadableTimeperiod($volume->lastwritten, "short"); ?></td>
<td><div title="<?php echo $volume->lastwritten; ?>"><?php echo $this->printHumanReadableTimeperiod($volume->lastwritten, "fuzzy"); ?></div></td>
<td><?php echo $this->escapeHtml($volume->volstatus); ?></td>
<td><?php echo $this->printRetention($volume->volretention) . " days"; ?></td>
<td><?php echo $this->printBytes($volume->maxvolbytes); ?></td>
<td><?php echo $this->printBytes($volume->volbytes); ?></td>
<td><?php echo $this->printBytes($volume->maxvolbytes - $volume->volbytes); ?></td>
<td><div align="right"><?php echo $this->printRetention($volume->volretention) . " days"; ?></div></td>
<td><div align="right"><?php echo $this->printBytes($volume->maxvolbytes); ?></div></td>
<td><div align="right"><?php echo $this->printBytes($volume->volbytes); ?></div></td>
<td><div align="right"><?php echo $this->printBytes($volume->maxvolbytes - $volume->volbytes); ?></div></td>

</tr>

Expand Down
25 changes: 13 additions & 12 deletions module/Pool/view/pool/pool/index.phtml
Expand Up @@ -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
Expand Down Expand Up @@ -44,12 +45,12 @@ $this->headTitle($title);
<th>Pool ID</th>
<th>Pool name</th>
<th>Pool type</th>
<th>Volumes</th>
<th>Maximum volumes</th>
<th>Volume retention</th>
<th>Maximum volume jobs</th>
<th>Maximum volume files</th>
<th>Maximum volume bytes</th>
<th><div align="right">Volumes</div></th>
<th><div align="right">Maximum volumes</div></th>
<th><div align="right">Volume retention</div></th>
<th><div align="right">Maximum volume jobs</div></th>
<th><div align="right">Maximum volume files</div></th>
<th><div align="right">Maximum volume bytes</div></th>

</tr>

Expand All @@ -60,12 +61,12 @@ $this->headTitle($title);
<td><a href="<?php echo $this->url('pool', array('action'=>'details', 'id' => $pool->poolid)); ?>"><?php echo $this->escapeHtml($pool->poolid); ?></a></td>
<td><a href="<?php echo $this->url('pool', array('action'=>'details', 'id' => $pool->poolid)); ?>"><?php echo $this->escapeHtml($pool->name); ?></a></td>
<td><?php echo $this->escapeHtml($pool->pooltype); ?></td>
<td><?php echo $this->escapeHtml($pool->numvols); ?></td>
<td><?php echo $this->escapeHtml($pool->maxvols); ?></td>
<td><?php echo $this->printRetention($pool->volretention) . " days"; ?></td>
<td><?php echo $this->escapeHtml($pool->maxvoljobs); ?></td>
<td><?php echo $this->escapeHtml($pool->maxvolfiles); ?></td>
<td><?php echo $this->printBytes($pool->maxvolbytes); ?></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->numvols); ?></div></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->maxvols); ?></div></td>
<td><div align="right"><div align="right"><?php echo $this->printRetention($pool->volretention) . " days"; ?></div></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->maxvoljobs); ?></div></td>
<td><div align="right"><?php echo $this->escapeHtml($pool->maxvolfiles); ?></div></td>
<td><div align="right"><?php echo $this->printBytes($pool->maxvolbytes); ?></div></td>

</tr>

Expand Down
Binary file added public/img/bareo-xl.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/img/bareos.png
Binary file not shown.
Binary file modified public/img/favicon.ico
Binary file not shown.

0 comments on commit 8ac1bb9

Please sign in to comment.