couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r645171 - in /incubator/couchdb/trunk/share/www: browse/index.html script/browse.js script/pprint.js style/layout.css
Date Sat, 05 Apr 2008 20:17:29 GMT
Author: cmlenz
Date: Sat Apr  5 13:17:27 2008
New Revision: 645171

URL: http://svn.apache.org/viewvc?rev=645171&view=rev
Log:
Improve database listing page.

Modified:
    incubator/couchdb/trunk/share/www/browse/index.html
    incubator/couchdb/trunk/share/www/script/browse.js
    incubator/couchdb/trunk/share/www/script/pprint.js
    incubator/couchdb/trunk/share/www/style/layout.css

Modified: incubator/couchdb/trunk/share/www/browse/index.html
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/browse/index.html?rev=645171&r1=645170&r2=645171&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/browse/index.html [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/browse/index.html [utf-8] Sat Apr  5 13:17:27 2008
@@ -24,6 +24,7 @@
     <script src="../script/jquery.dialog.js"></script>
     <script src="../script/couch.js"></script>
     <script src="../script/browse.js"></script>
+    <script src="../script/pprint.js"></script>
     <script>
       var page = new CouchIndexPage();
       $(document).ready(function() {
@@ -47,15 +48,16 @@
         <thead>
           <tr>
             <th>Name</th>
-            <th>Number of Documents</th>
-            <th>Update Seq</th>
+            <th class="size">Size</th>
+            <th class="count">Number of Documents</th>
+            <th class="seq">Update Seq</th>
           </tr>
         </thead>
         <tbody class="content">
         </tbody>
         <tbody class="footer">
           <tr>
-            <td colspan="3"></td>
+            <td colspan="4"></td>
           </tr>
         </tbody>
       </table>

Modified: incubator/couchdb/trunk/share/www/script/browse.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/browse.js?rev=645171&r1=645170&r2=645171&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/browse.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/browse.js [utf-8] Sat Apr  5 13:17:27 2008
@@ -41,8 +41,9 @@
       var info = new CouchDB(dbName).info();
       $("#databases tbody.content").append(
         "<tr><th><a href='database.html?" + dbName + "'>" +
-        dbName + "</a></th><td>" + info.doc_count +"</td><td>"
+
-        info.update_seq + "</td></tr>");
+        dbName + "</a></th><td class='size'>" + prettyPrintSize(info.size)
+
+        "</td><td class='count'>" + info.doc_count +
+        "</td><td class='seq'>" + info.update_seq + "</td></tr>");
       $("#databases tbody tr:odd").addClass("odd");
       $("#databases tbody.footer tr td").text(allDbs.length + " database(s)");
     }

Modified: incubator/couchdb/trunk/share/www/script/pprint.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/pprint.js?rev=645171&r1=645170&r2=645171&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/pprint.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/pprint.js [utf-8] Sat Apr  5 13:17:27 2008
@@ -10,7 +10,7 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-/* JSON pretty printing */
+// JSON pretty printing
 
 function prettyPrintJSON(val, indent, linesep, depth) {
   indent = indent != null ? indent : 4;
@@ -57,4 +57,18 @@
       return buf.join("");
     }
   }
+}
+
+// File size pretty printing
+
+function prettyPrintSize(size) {
+  var jump = 512;
+  if (size < jump) return size + " bytes";
+  var units = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
+  var i = 0;
+  while (size >= jump && i < units.length) {
+    i += 1;
+    size /= 1024
+  }
+  return size.toFixed(1) + ' ' + units[i - 1];
 }

Modified: incubator/couchdb/trunk/share/www/style/layout.css
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/style/layout.css?rev=645171&r1=645170&r2=645171&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/style/layout.css (original)
+++ incubator/couchdb/trunk/share/www/style/layout.css Sat Apr  5 13:17:27 2008
@@ -159,7 +159,8 @@
 
 #footer { background: #ddd; border-top: 1px solid #bbb; color: #000;
   font-size: 80%; opacity: .7; padding: 5px 10px; position: absolute; right: 0;
-  bottom: 0; height: 10px; width: 190px; text-align: right;
+  bottom: 0; height: 1.3em; width: 190px; text-align: right;
+  white-space: nowrap;
 }
 #view { position: absolute; left: 0; right: 210px; top: 0; bottom: 0;
   height: 100%;
@@ -273,6 +274,13 @@
 #viewcode div.bottom button.save { font-weight: bold; }
 #viewcode.expanded label { background-position: 0 -96px; }
 #viewcode.expanded textarea, #viewcode.expanded div.bottom { display: block; }
+
+/* Database table */
+
+#databases thead th.size, #databases thead th.count, #databases thead th.seq,
+#databases tbody td.size, #databases tbody td.count, #databases tbody td.seq {
+  text-align: right;
+}
 
 /* Documents table */
 



Mime
View raw message