summaryrefslogtreecommitdiff
path: root/share/www/replicator.html
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-06-16 16:36:04 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-06-16 16:36:04 +0000
commit4ccf61a343c2437fb574bf00e4e3da5e48e17548 (patch)
tree221db389d86a37737e967f94fb1ecddbd8ea8331 /share/www/replicator.html
parentbc50bbf1e8bd7474f0cb91975dfbf7a7bbc1922b (diff)
add continuous replication support to Futon
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@955290 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/replicator.html')
-rw-r--r--share/www/replicator.html24
1 files changed, 18 insertions, 6 deletions
diff --git a/share/www/replicator.html b/share/www/replicator.html
index 9a53e0ea..70c0a86c 100644
--- a/share/www/replicator.html
+++ b/share/www/replicator.html
@@ -78,17 +78,28 @@ specific language governing permissions and limitations under the License.
$("#records tbody.content").empty();
var source = $("#from_local")[0].checked ? $("#from_name").val() : $("#from_url").val();
var target = $("#to_local")[0].checked ? $("#to_name").val() : $("#to_url").val();
+ var repOpts = {};
+ if ($("#continuous")[0].checked) {
+ repOpts.continuous = true;
+ }
$.couch.replicate(source, target, {
success: function(resp) {
- $.each(resp.history, function(idx, record) {
+ if (resp._local_id) {
$("<tr><th></th></tr>")
- .find("th").text(JSON.stringify(record)).end()
+ .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("Replication session " + resp.session_id);
+ $("#records tbody tr").removeClass("odd").filter(":odd").addClass("odd");
+ } else {
+ $.each(resp.history, function(idx, record) {
+ $("<tr><th></th></tr>")
+ .find("th").text(JSON.stringify(record)).end()
+ .appendTo("#records tbody.content");
+ });
+ $("#records tbody tr").removeClass("odd").filter(":odd").addClass("odd");
+ $("#records tbody.footer td").text("Replication session " + resp.session_id);
+ }
}
- });
+ }, repOpts);
});
});
</script>
@@ -123,6 +134,7 @@ specific language governing permissions and limitations under the License.
</p>
</fieldset>
<p class="actions">
+ <label><input type="checkbox" name="continuous" value="continuous" id="continuous"> Continuous</label>
<button id="replicate" type="button">Replicate</button>
</p>
</form>