]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Enhanced pools and volume page
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 31 Jan 2011 16:53:14 +0000 (17:53 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:37 +0000 (14:43 +0200)
 - Different background for odd and even lines in pools and volumes page

gui/bacula-web/bweb.inc.php
gui/bacula-web/templates/pools.tpl

index ba2685e5d18408deacf7423ed3bde83c2b4ff70f..8e2c68ec5b0df09252d2088d674ff225532afed2 100644 (file)
@@ -327,12 +327,16 @@ class Bweb extends DB {
                                                                                }
                                                                                // Media used bytes in a human format
                                                                                $media['volbytes'] = $this->human_file_size( $media['volbytes'] );
-                                                                               //echo "volume " . $media['volumename'] . 'vol bytes' .$media['volbytes'] . '<br />';
                                                                        } else {
                                                                                $media['lastwritten'] = "N/A";
                                                                                $media['expire']      = "N/A";
                                                                                $media['volbytes']        = "0 KB";
                                                                        }                                                               
+                                                               
+                                                               // Odd or even row
+                                                               if( count(  $volumes[ $pool['name'] ] ) % 2)
+                                                                       $media['class'] = 'odd';
+
                                                                // Add the media in pool array
                                                                array_push( $volumes[ $pool['name']], $media);
                                                        }
index db836ea471a6a628d68e8d8076057d8f34a9ec95..e2932ff042d3d8c1a05c048e948af63f6cb58afd 100644 (file)
                <table class="list" border="0">
                        {foreach from=$pool item=volume}
                        <tr>
-                               <td width="120">{$volume.volumename}</td>
-                               <td width="120">{$volume.volbytes}</td>
-                               <td width="120">{$volume.mediatype}</td>
-                               <td width="140">{$volume.expire}</td>
-                               <td width="140">{$volume.lastwritten}</td>
-                               <td>{$volume.volstatus}</td>
+                               <td width="120" class="{$volume.class}">{$volume.volumename}</td>
+                               <td width="120" class="{$volume.class}">{$volume.volbytes}</td>
+                               <td width="120" class="{$volume.class}">{$volume.mediatype}</td>
+                               <td width="140" class="{$volume.class}">{$volume.expire}</td>
+                               <td width="140" class="{$volume.class}">{$volume.lastwritten}</td>
+                               <td class="{$volume.class}">{$volume.volstatus}</td>
                        </tr>
                        {foreachelse}
                        <tr>