couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r900999 - in /couchdb/trunk/share: Makefile.am www/database.html www/dialog/_compact_cleanup.html www/dialog/_compact_database.html www/dialog/_compact_view.html www/dialog/_view_cleanup.html www/script/futon.browse.js www/style/layout.css
Date Tue, 19 Jan 2010 23:23:44 GMT
Author: cmlenz
Date: Tue Jan 19 23:23:43 2010
New Revision: 900999

URL: http://svn.apache.org/viewvc?rev=900999&view=rev
Log:
Futon: Merge the different compaction/cleanup buttons into a single button on the database
page, which will bring up a dialog allowing you to choose which type of compaction/cleanup
to perform.

Added:
    couchdb/trunk/share/www/dialog/_compact_cleanup.html
      - copied, changed from r900988, couchdb/trunk/share/www/dialog/_compact_database.html
Removed:
    couchdb/trunk/share/www/dialog/_compact_database.html
    couchdb/trunk/share/www/dialog/_compact_view.html
    couchdb/trunk/share/www/dialog/_view_cleanup.html
Modified:
    couchdb/trunk/share/Makefile.am
    couchdb/trunk/share/www/database.html
    couchdb/trunk/share/www/script/futon.browse.js
    couchdb/trunk/share/www/style/layout.css

Modified: couchdb/trunk/share/Makefile.am
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/Makefile.am?rev=900999&r1=900998&r2=900999&view=diff
==============================================================================
--- couchdb/trunk/share/Makefile.am (original)
+++ couchdb/trunk/share/Makefile.am Tue Jan 19 23:23:43 2010
@@ -40,9 +40,7 @@
     www/custom_test.html \
     www/database.html \
     www/dialog/_admin_party.html \
-    www/dialog/_compact_database.html \
-    www/dialog/_compact_view.html \
-    www/dialog/_view_cleanup.html \
+    www/dialog/_compact_cleanup.html \
     www/dialog/_create_admin.html \
     www/dialog/_login.html \
     www/dialog/_signup.html \

Modified: couchdb/trunk/share/www/database.html
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/database.html?rev=900999&r1=900998&r2=900999&view=diff
==============================================================================
--- couchdb/trunk/share/www/database.html [utf-8] (original)
+++ couchdb/trunk/share/www/database.html [utf-8] Tue Jan 19 23:23:43 2010
@@ -115,10 +115,8 @@
           $.futon.storage.set("per_page", this.value);
         });
         $("#toolbar button.add").click(page.newDocument);
-        $("#toolbar button.compact").click(page.compactDatabase);
-        $("#toolbar button.viewcleanup").click(page.viewCleanup);
+        $("#toolbar button.compact").click(page.compactAndCleanup);
         $("#toolbar button.delete").click(page.deleteDatabase);
-        $("#toolbar button.compactview").click(page.compactView);
 
         $('#jumpto input').suggest(function(text, callback) {
           page.db.allDocs({
@@ -163,10 +161,8 @@
       </div>
       <ul id="toolbar">
         <li><button class="add">New Document</button></li>
-        <li><button class="compact">Compact Database…</button></li>
-        <li><button class="viewcleanup">View Cleanup…</button></li>
+        <li><button class="compact">Compact &amp; Cleanup…</button></li>
         <li><button class="delete">Delete Database…</button></li>
-        <li><button class="compactview" style="display: none">Compact View…</button></li>
       </ul>
 
       <div id="viewcode" class="collapsed" style="display: none">

Copied: couchdb/trunk/share/www/dialog/_compact_cleanup.html (from r900988, couchdb/trunk/share/www/dialog/_compact_database.html)
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/dialog/_compact_cleanup.html?p2=couchdb/trunk/share/www/dialog/_compact_cleanup.html&p1=couchdb/trunk/share/www/dialog/_compact_database.html&r1=900988&r2=900999&rev=900999&view=diff
==============================================================================
--- couchdb/trunk/share/www/dialog/_compact_database.html [utf-8] (original)
+++ couchdb/trunk/share/www/dialog/_compact_cleanup.html [utf-8] Tue Jan 19 23:23:43 2010
@@ -13,16 +13,39 @@
 
 -->
 <form action="" method="post">
-  <h2>Compact Database</h2>
-  <fieldset>
+  <h2>Compact &amp; Cleanup</h2>
+  <fieldset class="radiogroup">
+    <label>
+      <input type="radio" name="action" value="compact_database" checked>
+      Compact Database
+    </label>
     <p class="help">
       Compacting a database removes deleted documents and previous revisions.
       It is an <strong>irreversible operation</strong> and may take
       a while to complete for large databases.
     </p>
+    <hr>
+    <label>
+      <input type="radio" name="action" value="compact_views">
+      Compact Views
+    </label>
+    <p class="help">
+      View compaction will affect all views in this design document. This
+      operation may take some time to complete. Your views will still operate
+      normally during compaction.
+    </p>
+    <hr>
+    <label>
+      <input type="radio" name="action" value="view_cleanup">
+      Cleanup Views
+    </label>
+    <p class="help">
+      Cleaning up views in a database removes old view files still stored
+      on the filesystem. It is an <strong>irreversible operation</strong>.
+    </p>
   </fieldset>
   <div class="buttons">
-    <button type="submit">Compact</button>
+    <button type="submit">Run</button>
     <button type="button" class="cancel">Cancel</button>
   </div>
 </form>

Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=900999&r1=900998&r2=900999&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Tue Jan 19 23:23:43 2010
@@ -140,40 +140,22 @@
         location.href = "document.html?" + encodeURIComponent(db.name);
       }
 
-      this.compactDatabase = function() {
-        $.showDialog("dialog/_compact_database.html", {
+      this.compactAndCleanup = function() {
+        $.showDialog("dialog/_compact_cleanup.html", {
           submit: function(data, callback) {
-            db.compact({
-              success: function(resp) {
-                callback();
-              }
-            });
-          }
-        });
-      }
-
-      this.viewCleanup = function() {
-        $.showDialog("dialog/_view_cleanup.html", {
-          submit: function(data, callback) {
-            db.viewCleanup({
-              success: function(resp) {
-                callback();
-              }
-            });
-          }
-        });
-      }
-
-      this.compactView = function() {
-        var groupname = page.viewName.substring(8,
-            page.viewName.indexOf('/_view'));
-        $.showDialog("dialog/_compact_view.html", {
-          submit: function(data, callback) {
-            db.compactView(groupname, {
-              success: function(resp) {
-                callback();
-              }
-            });
+            switch (data.action) {
+              case "compact_database":
+                db.compact({success: function(resp) { callback() }});
+                break;
+              case "compact_views":
+                var groupname = page.viewName.substring(8,
+                    page.viewName.indexOf("/_view"));
+                db.compactView(groupname, {success: function(resp) { callback() }});
+                break;
+              case "view_cleanup": 
+                db.viewCleanup({success: function(resp) { callback() }});
+                break;
+            }
           }
         });
       }

Modified: couchdb/trunk/share/www/style/layout.css
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/style/layout.css?rev=900999&r1=900998&r2=900999&view=diff
==============================================================================
--- couchdb/trunk/share/www/style/layout.css (original)
+++ couchdb/trunk/share/www/style/layout.css Tue Jan 19 23:23:43 2010
@@ -237,8 +237,6 @@
 #toolbar button:active { background-position: 2px -62px; color: #000; }
 #toolbar button.add { background-image: url(../image/add.png); }
 #toolbar button.compact { background-image: url(../image/compact.png); }
-#toolbar button.viewcleanup { background-image: url(../image/compact.png); }
-#toolbar button.compactview { background-image: url(../image/compact.png); }
 #toolbar button.delete { background-image: url(../image/delete.png); }
 #toolbar button.load { background-image: url(../image/load.png); }
 #toolbar button.run { background-image: url(../image/run.png); }
@@ -290,6 +288,11 @@
 #dialog fieldset input { background-color: #e9e9e9; vertical-align: middle; }
 #dialog fieldset input.error { background-color: #f9e4e4; }
 #dialog fieldset div.error { padding-top: .3em; color: #b33; }
+#dialog fieldset.radiogroup { padding-top: 1em; }
+#dialog fieldset.radiogroup label { position: relative; padding-left: 25px; }
+#dialog fieldset.radiogroup input { position: absolute; left: 5px; top: 2px; }
+#dialog fieldset.radiogroup p.help { margin-top: .5em; margin-left: 25px; }
+#dialog fieldset.radiogroup hr { border-color: #333; margin-left: 25px; }
 #dialog .buttons { padding: 0 .5em .5em; text-align: right; }
 #dialog .buttons button { background: #444; border: 1px solid #aaa;
   color: #ddd; cursor: pointer; font-size: 90%; font-weight: normal;



Mime
View raw message