summaryrefslogtreecommitdiff
path: root/share/www/replicator.html
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/replicator.html')
-rw-r--r--share/www/replicator.html47
1 files changed, 32 insertions, 15 deletions
diff --git a/share/www/replicator.html b/share/www/replicator.html
index 5a09ca16..32f3e20f 100644
--- a/share/www/replicator.html
+++ b/share/www/replicator.html
@@ -20,7 +20,7 @@ specific language governing permissions and limitations under the License.
<link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
<script src="script/json2.js"></script>
<script src="script/sha1.js"></script>
- <script src="script/jquery.js?1.3.2"></script>
+ <script src="script/jquery.js?1.4.2"></script>
<script src="script/jquery.couch.js?0.11.0"></script>
<script src="script/jquery.dialog.js?0.11.0"></script>
<script src="script/futon.js?0.11.0"></script>
@@ -41,6 +41,7 @@ specific language governing permissions and limitations under the License.
$.couch.allDbs({
success: function(dbs) {
+ dbs.sort();
$("fieldset select").each(function() {
var select = this;
$.each(dbs, function(idx, dbName) {
@@ -77,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>
@@ -103,25 +115,30 @@ specific language governing permissions and limitations under the License.
<fieldset id="source">
<legend>Replicate changes from:</legend>
<p>
- <label><input type="radio" id="from_local" name="from_type" value="local" checked> Local</label>
- <label>database: <select id="from_name" name="from_name"></select></label>
+ <input type="radio" id="from_local" name="from_type" value="local" checked>
+ <label for="from_local">Local Database: </label>
+ <select id="from_name" name="from_name"></select>
</p><p>
- <label><input type="radio" id="from_to_remote" name="from_type" value="remote"> Remote</label>
- <label>database: <input type="text" id="from_url" name="from_url" size="30" value="http://" disabled></label>
+ <input type="radio" id="from_to_remote" name="from_type" value="remote">
+ <label for="from_to_remote">Remote database: </label>
+ <input type="text" id="from_url" name="from_url" size="30" value="http://" disabled>
</p>
</fieldset>
<p class="swap"><button id="swap" tabindex="99">⇄</button></p>
<fieldset id="target">
<legend>to:</legend>
<p>
- <label><input type="radio" id="to_local" name="to_type" value="local" checked> Local</label>
- <label>database: <select id="to_name" name="to_name"></select></label>
+ <input type="radio" id="to_local" name="to_type" value="local" checked>
+ <label for="to_local">Local database: </label>
+ <select id="to_name" name="to_name"></select>
</p><p>
- <label><input type="radio" id="to_remote" name="to_type" value="remote"> Remote</label>
- <label>database: <input type="text" id="to_url" name="to_url" size="30" value="http://" disabled></label>
+ <input type="radio" id="to_remote" name="to_type" value="remote">
+ <label for="to_remote">Remote database: </label>
+ <input type="text" id="to_url" name="to_url" size="30" value="http://" disabled>
</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>