summaryrefslogtreecommitdiff
path: root/share/www/script/jquery.couch.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-09-16 20:24:48 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-09-16 20:24:48 +0000
commit70155ce87a85a5b70a225f350863e7ed50097345 (patch)
treec70671528ecbf4574e3718be0291ed52e5759d08 /share/www/script/jquery.couch.js
parent7748f4bdc38d34b6c078693446ce638e2d0767ae (diff)
Add HTTP API for getting the complete config, and add a page to Futon that displays the configuration.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@696041 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/jquery.couch.js')
-rw-r--r--share/www/script/jquery.couch.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index 2121cf0c..bd77bf80 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -32,6 +32,23 @@
});
},
+ config: function(options, section, option, value) {
+ $.ajax({
+ type: "GET", url: "/_config/",
+ complete: function(req) {
+ var resp = $.httpData(req, "json");
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
+ } else if (options.error) {
+ options.error(req.status, resp.error, resp.reason);
+ } else {
+ alert("An error occurred retrieving the server configuration: " +
+ resp.reason);
+ }
+ }
+ });
+ },
+
db: function(name) {
return {
name: name,