You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2016/04/04 17:17:32 UTC

fauxton commit: updated refs/heads/master to f6a1f82

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 2e825dda4 -> f6a1f8201


Style update for metadata page

The metadata page was kinda ugly, and Tim White recently made
a few aesthetic changes to the page. This implements them and
generally smartens up the page a bit.


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

Branch: refs/heads/master
Commit: f6a1f8201d9baedca2e7869d51953da4389d85c3
Parents: 2e825dd
Author: Ben Keen <be...@gmail.com>
Authored: Tue Mar 8 13:11:47 2016 -0800
Committer: Ben Keen <be...@gmail.com>
Committed: Mon Apr 4 08:18:37 2016 -0700

----------------------------------------------------------------------
 app/addons/documents/assets/less/documents.less |  32 +++++
 .../designdocinfo/components.react.jsx          | 139 ++++++++++++-------
 assets/less/fauxton.less                        |   4 +
 3 files changed, 121 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f6a1f820/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index e068946..787b775 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -88,7 +88,39 @@ button.beautify {
 }
 
 .metadata-page {
+  font-size: 14px;
   padding: 20px;
+
+  .preheading {
+    font-size: 14px;
+  }
+  h2 {
+    margin: 5px 0 15px;
+  }
+  h3 {
+    font-size: 22px;
+    margin-top: 12px;
+  }
+  header {
+    border-bottom: 1px solid #cccccc;
+    padding-bottom: 10px;
+  }
+  .icon-question-sign {
+    margin-left: 4px;
+  }
+  section {
+    line-height: 21px;
+    width: 100%;
+
+    ul {
+      list-style-type: none;
+      margin: 0 0 15px;
+      padding: 0;
+    }
+    .item-title {
+      margin-right: 6px;
+    }
+  }
 }
 
 button.delete {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f6a1f820/app/addons/documents/designdocinfo/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/designdocinfo/components.react.jsx b/app/addons/documents/designdocinfo/components.react.jsx
index 1ee03f6..c877dc4 100644
--- a/app/addons/documents/designdocinfo/components.react.jsx
+++ b/app/addons/documents/designdocinfo/components.react.jsx
@@ -16,12 +16,14 @@ define([
   'react',
   './stores',
   './actions',
-  '../../components/react-components.react'
+  '../../components/react-components.react',
+  '../../fauxton/components.react'
 ],
 
-function (app, FauxtonAPI, React, Stores, Actions, ReactComponents) {
+function (app, FauxtonAPI, React, Stores, Actions, ReactComponents, GeneralComponents) {
   var designDocInfoStore = Stores.designDocInfoStore;
   var LoadLines = ReactComponents.LoadLines;
+  var Clipboard = GeneralComponents.Clipboard;
 
 
   var DesignDocInfo = React.createClass({
@@ -50,8 +52,15 @@ function (app, FauxtonAPI, React, Stores, Actions, ReactComponents) {
       this.setState(this.getStoreState());
     },
 
+    showCopiedMessage: function () {
+      FauxtonAPI.addNotification({
+        type: 'success',
+        msg: 'The MD5 sha has been copied to your clipboard.',
+        clear: true
+      });
+    },
+
     render: function () {
-      var formatSize = app.helpers.formatSize;
       var getDocUrl = app.helpers.getDocUrl;
       var viewIndex = this.state.viewIndex;
 
@@ -59,66 +68,88 @@ function (app, FauxtonAPI, React, Stores, Actions, ReactComponents) {
         return <LoadLines />;
       }
 
+      var actualSize = (viewIndex.data_size) ? viewIndex.data_size.toLocaleString('en') : 0;
+      var dataSize = (viewIndex.disk_size) ? viewIndex.disk_size.toLocaleString('en') : 0;
+
       return (
-      <div className="metadata-page">
-        <header className="page-header">
-          <h2>Design Document Metadata: _design/{this.state.ddocName} </h2>
-          <p className="help">Information about the specified design document, including the index,
-            index size and current status of the design document and associated index information.
-            <a href={getDocUrl('DESIGN_DOC_METADATA')} className="help-link" target="_blank" data-bypass="true">
-              <i className="icon-question-sign" />
+        <div className="metadata-page">
+          <header>
+            <div className="preheading">Design Document Metadata</div>
+            <h2>_design/{this.state.ddocName}</h2>
+
+            <p className="help">
+              Information about the specified design document, including the index, index size and current status of the
+              design document and associated index information.
+              <a href={getDocUrl('DESIGN_DOC_METADATA')} className="help-link" target="_blank" data-bypass="true">
+                <i className="icon-question-sign" />
               </a>
-          </p>
-        </header>
-        <div className="row-fluid">
-          <div className="span6">
-            <header>
-              <h3>Status</h3>
-            </header>
-            <dl>
-              <dt>Updater</dt>
-              <dd>{viewIndex.updater_running}</dd>
-              <dt>Compact</dt>
-              <dd>{viewIndex.compact_running }</dd>
-              <dt>Waiting Commit</dt>
-              <dd>{viewIndex.waiting_commit }</dd>
-              <dt>Waiting Clients</dt>
-              <dd>{viewIndex.waiting_clients }</dd>
-              <dt>Update Sequence</dt>
-              <dd>{viewIndex.update_seq }</dd>
-              <dt>Purge Sequence</dt>
-              <dd>{viewIndex.purge_seq }</dd>
-            </dl>
-          </div>
-          <div className="span6">
-            <header>
-              <h3>Information</h3>
-            </header>
-            <dl>
-              <dt>Language</dt>
-              <dd>{viewIndex.language }</dd>
-              <dt>Signature</dt>
-              <dd>{viewIndex.signature }</dd>
-            </dl>
-            <header>
-              <h3>Storage</h3>
-            </header>
-            <dl>
-              <dt>Data Size</dt>
-              <dd>{formatSize(viewIndex.data_size) }</dd>
-              <dt>Disk Size</dt>
-              <dd>{formatSize(viewIndex.disk_size) }</dd>
-            </dl>
-          </div>
+            </p>
+          </header>
+
+          <section className="container">
+            <h3>Index Information</h3>
+
+            <ul>
+              <li>
+                <span className="item-title">Language:</span>
+                <span className="capitalize">{viewIndex.language}</span>
+              </li>
+              <li>
+                <span className="item-title">Currently being updated?</span>
+                {viewIndex.updater_running ? 'Yes' : 'No'}
+              </li>
+              <li>
+                <span className="item-title">Currently running compaction?</span>
+                {viewIndex.compact_running ? 'Yes' : 'No'}
+              </li>
+              <li>
+                <span className="item-title">Waiting for a commit?</span>
+                {viewIndex.waiting_commit ? 'Yes' : 'No'}
+              </li>
+            </ul>
+
+            <ul>
+              <li>
+                <span className="item-title">Clients waiting for the index:</span>
+                {viewIndex.waiting_clients}
+              </li>
+              <li>
+                <span className="item-title">Update sequence on DB:</span>
+                {viewIndex.update_seq}
+              </li>
+              <li>
+                <span className="item-title">Processed purge sequence:</span>
+                {viewIndex.purge_seq}
+              </li>
+              <li>
+                <span className="item-title">Actual data size (bytes):</span>
+                {actualSize}
+              </li>
+              <li>
+                <span className="item-title">Data size on disk (bytes):</span>
+                {dataSize}
+              </li>
+            </ul>
+
+            <ul>
+              <li>
+                <span className="item-title">MD5 Signature:</span>
+                <Clipboard
+                  onClipboardClick={this.showCopiedMessage}
+                  text={viewIndex.signature} />
+              </li>
+            </ul>
+
+          </section>
+
         </div>
-      </div>
       );
     }
   });
 
 
-
   return {
     DesignDocInfo: DesignDocInfo
   };
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f6a1f820/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 349c9ca..ba65035 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -719,3 +719,7 @@ body .control-toggle-include-docs span {
     }
   }
 }
+
+.capitalize {
+  text-transform: capitalize;
+}