couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject git commit: Update list of databases display
Date Tue, 19 Mar 2013 00:46:00 GMT
Updated Branches:
  refs/heads/fauxton da7860c42 -> 35a699e6e


Update list of databases display


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/35a699e6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/35a699e6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/35a699e6

Branch: refs/heads/fauxton
Commit: 35a699e6e6e61339d59f2456ea10017d072928a3
Parents: da7860c
Author: Russell Branca <chewbranca@gmail.com>
Authored: Mon Mar 18 17:45:56 2013 -0700
Committer: Russell Branca <chewbranca@gmail.com>
Committed: Mon Mar 18 17:45:56 2013 -0700

----------------------------------------------------------------------
 src/fauxton/app/modules/databases/resources.js |   13 +++++++++++++
 src/fauxton/app/templates/databases/item.html  |    5 +++--
 src/fauxton/app/templates/databases/list.html  |    7 +++++++
 3 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/35a699e6/src/fauxton/app/modules/databases/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/resources.js b/src/fauxton/app/modules/databases/resources.js
index 5549a70..d0c655d 100644
--- a/src/fauxton/app/modules/databases/resources.js
+++ b/src/fauxton/app/modules/databases/resources.js
@@ -96,6 +96,19 @@ function(app, FauxtonAPI, Documents) {
       this.database = options.database;
     },
 
+    numDocs: function() {
+      return this.get("doc_count");
+    },
+
+    updateSeq: function(full) {
+      var updateSeq = this.get("update_seq");
+      if (full) {
+        return updateSeq;
+      } else {
+        return updateSeq.split('-')[0];
+      }
+    },
+
     humanSize: function() {
       // cribbed from http://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable
       var i = -1;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/35a699e6/src/fauxton/app/templates/databases/item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/databases/item.html b/src/fauxton/app/templates/databases/item.html
index 26040dc..5ffcefd 100644
--- a/src/fauxton/app/templates/databases/item.html
+++ b/src/fauxton/app/templates/databases/item.html
@@ -20,5 +20,6 @@ the License.
 <td>
   <a href="#/database/<%= database.get("name") %>/_all_docs?limit=100"><%=
database.get("name") %></a>
 </td>
-<td><%= database.status.get("disk_size")  %></td>
-<td><%= database.status.get("doc_count")  %></td>
+<td><%= database.status.humanSize() %></td>
+<td><%= database.status.numDocs() %></td>
+<td><%= database.status.updateSeq() %></td>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/35a699e6/src/fauxton/app/templates/databases/list.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/databases/list.html b/src/fauxton/app/templates/databases/list.html
index d27f497..e07dcfd 100644
--- a/src/fauxton/app/templates/databases/list.html
+++ b/src/fauxton/app/templates/databases/list.html
@@ -23,6 +23,13 @@ the License.
   </form>
 </div>
 <table class="databases table table-striped">
+  <thead>
+    <th></th>
+    <th>Name</th>
+    <th>Size</th>
+    <th>Number of Documents</th>
+    <th>Update Seq</th>
+  </thead>
   <tbody>
   </tbody>
 </table>


Mime
View raw message