Explorar el Código

Improved readabiliy of slab dump

- use dl/dt/dd instead of text + br on slab header
- use CSS 3 columns for list of entries
- add a few extra divs to allow more accurate CSS targeting
Frédéric G. MARAND hace 12 años
padre
commit
081c20658c
Se han modificado 1 ficheros con 28 adiciones y 10 borrados
  1. 28 10
      memcache.php

+ 28 - 10
memcache.php

@@ -419,6 +419,30 @@ div.info table td h3 {
 .td-0 a , .td-n a, .tr-0 a , tr-1 a {
     text-decoration:underline;
 }
+div.info table td dl,
+div.info table td dl dt {
+  display: inline;
+}
+div.info table td dl dt {
+  font-weight: bold;
+}
+div.info table td dl dd {
+  display: inline-block;
+  margin-right: 2em;
+  margin-left: 0.5em;
+  width: 12em;
+}
+div.info table td div.slab-dump {
+  -moz-column-count: 3;
+	-moz-column-gap: 20px;
+  -webkit-column-count: 3;
+	-webkit-column-gap: 20px;
+	column-count: 3;
+	column-gap: 20px;
+}
+div.info table td a {
+  display: block;
+}
 div.graph { margin-bottom:1em }
 div.graph h2 { background:rgb(204,204,204);; color:black; font-size:1em; margin:0; padding:0.1em 1em 0.1em 1em; }
 div.graph table { border:solid rgb(204,204,204) 1px; color:black; font-weight:normal; width:100%; }
@@ -799,9 +823,9 @@ EOB;
 				echo
 					"<tr class=tr-$m>",
 					"<td class=td-0><center>",'<a href="',$dumpUrl,'">',$slabId,'</a>',"</center></td>",
-					"<td class=td-last><b>Item count:</b> ",$slab['number'],'<br/><b>Age:</b>',duration($time-$slab['age']),'<br/> <b>Evicted:</b>',((isset($slab['evicted']) && $slab['evicted']==1)? 'Yes':'No');
+					"<td class=td-last><dl class=\"slab-header\"><dt>Item count:</dt><dd>",$slab['number'],'</dd><dt>Age:</dt><dd>',duration($time-$slab['age']),'</dd><dt>Evicted:</dt><dd>',((isset($slab['evicted']) && $slab['evicted']==1)? 'Yes':'No'), '</dd></dl>';
 					if ((isset($_GET['dumpslab']) && $_GET['dumpslab']==$slabId) &&  (isset($_GET['server']) && $_GET['server']==array_search($server,$MEMCACHE_SERVERS))){
-					    echo "<br/><b>Items: item</b><br/>";
+					    echo "<br/><b>Items: item</b><br/><div class=\"slab-dump\">";
 					    $items = dumpCacheSlab($server,$slabId,$slab['number']);
                         // maybe someone likes to do a pagination here :)
 					    $i=1;
@@ -810,16 +834,10 @@ EOB;
 
 
                             echo '<a href="',$PHP_SELF,'&op=4&server=',(array_search($server,$MEMCACHE_SERVERS)),'&key=',base64_encode($itemKey).'">',$itemKey,'</a>';
-                            if ($i++ % 10 == 0) {
-                                echo '<br/>';
-                            }
-                            elseif ($i!=$slab['number']+1){
-                                echo ',';
-                            }
                         }
 					}
 
-					echo "</td></tr>";
+					echo "</div><!-- .slab-dump--></td></tr>";
 				$m=1-$m;
 			}
 		echo <<<EOB
@@ -878,4 +896,4 @@ EOB;
 }
 echo getFooter();
 
-?>
+?>