diff options
author | Russell Branca <chewbranca@gmail.com> | 2013-03-18 17:45:56 -0700 |
---|---|---|
committer | Russell Branca <chewbranca@gmail.com> | 2013-03-18 17:45:56 -0700 |
commit | 35a699e6e6e61339d59f2456ea10017d072928a3 (patch) | |
tree | 4c5a3828922e2b5f2282012d61d141c20fa12860 | |
parent | da7860c4270e8cb8ea18678384ec6ba06cf594bb (diff) | |
download | couchdb-35a699e6e6e61339d59f2456ea10017d072928a3.tar.gz |
Update list of databases display
-rw-r--r-- | src/fauxton/app/modules/databases/resources.js | 13 | ||||
-rw-r--r-- | src/fauxton/app/templates/databases/item.html | 5 | ||||
-rw-r--r-- | src/fauxton/app/templates/databases/list.html | 7 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/fauxton/app/modules/databases/resources.js b/src/fauxton/app/modules/databases/resources.js index 5549a709a..d0c655d7c 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; diff --git a/src/fauxton/app/templates/databases/item.html b/src/fauxton/app/templates/databases/item.html index 26040dc90..5ffcefdcc 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> diff --git a/src/fauxton/app/templates/databases/list.html b/src/fauxton/app/templates/databases/list.html index d27f49720..e07dcfd15 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> |