couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject couchdb commit: updated refs/heads/1.x.x to fc9ab29
Date Fri, 31 Oct 2014 16:39:25 GMT
Repository: couchdb
Updated Branches:
  refs/heads/1.x.x ee0742c50 -> fc9ab293c


Replicate only specified document ids

COUCHDB-1011

Signed-off-by: Alexander Shorin <kxepal@apache.org>


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

Branch: refs/heads/1.x.x
Commit: fc9ab293cd1a9d74c78f8378b26d1c1a6a9d77e5
Parents: ee0742c
Author: Nikolai Teofilov <n.teofilov@gmail.com>
Authored: Sat Jan 8 22:41:34 2011 +0100
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Fri Oct 31 19:37:11 2014 +0300

----------------------------------------------------------------------
 share/www/replicator.html | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fc9ab293/share/www/replicator.html
----------------------------------------------------------------------
diff --git a/share/www/replicator.html b/share/www/replicator.html
index 132dde1..79d136a 100644
--- a/share/www/replicator.html
+++ b/share/www/replicator.html
@@ -103,13 +103,33 @@ specific language governing permissions and limitations under the License.
           if ($("#continuous")[0].checked) {
             repOpts.continuous = true;
           }
+
+          if ($("#doc_ids").val()){
+            try {
+               var doc_ids = JSON.parse($("#doc_ids").val());
+               if ($.isArray(doc_ids)) {
+                  repOpts.doc_ids = doc_ids;
+               } else {
+                  $("#records tbody.footer td")
+                    .text('Invalid format! Should be: ["doc1", "doc2", ...]'); 
+                  return false;
+               }
+            } catch (e) {
+               $("#records tbody.footer td")
+                 .text('Invalid format! Should be: ["doc1", "doc2", ...]');
+               return false;
+            }
+          }
           $.couch.replicate(source, target, {
             success: function(resp) {
-              if (resp._local_id) {
+              if ( resp.history == null || resp._local_id) {
                 $("<tr><th></th></tr>")
                   .find("th").text(JSON.stringify(resp)).end()
                   .appendTo("#records tbody.content");
                 $("#records tbody tr").removeClass("odd").filter(":odd").addClass("odd");
+                $("#records tbody.footer td")
+                  .text((resp._local_id)? "Continuous replication" :
+                                          "Named document replication");
               } else {
                 $.each(resp.history, function(idx, record) {
                   $("<tr><th></th></tr>")
@@ -163,6 +183,7 @@ specific language governing permissions and limitations under the License.
           </p>
         </fieldset>
         <p class="actions">
+          <label style="float: left; padding-left: 5px">Document IDs: <input type="text"
id="doc_ids" name="doc_ids" size="25" value=""></label>
           <label><input type="checkbox" name="continuous" value="continuous" id="continuous">
Continuous</label>
           <button id="replicate" type="button">Replicate</button>
         </p>


Mime
View raw message