diff --git a/server/go/camlistored/ui/index.html b/server/go/camlistored/ui/index.html
index 61b721f2b..7137b8f9c 100644
--- a/server/go/camlistored/ui/index.html
+++ b/server/go/camlistored/ui/index.html
@@ -1,15 +1,17 @@
Camlistored UI
-
+
+ Camlistored UI
-Camlistored UI
-
-
+
diff --git a/server/go/camlistored/ui/ui.js b/server/go/camlistored/ui/ui.js
index c9c5dedf6..0b3598b63 100644
--- a/server/go/camlistored/ui/ui.js
+++ b/server/go/camlistored/ui/ui.js
@@ -14,16 +14,33 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+var disco = null;
+
function discover() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState != 4) { return; }
if (xhr.status != 200) {
console.log("no status 200; got " + xhr.status);
+ return;
}
- var disco = JSON.parse(xhr.responseText);
- alert(JSON.stringify(disco));
+ disco = JSON.parse(xhr.responseText);
+ document.getElementById("discores").innerHTML = JSON.stringify(disco);
};
xhr.open("GET", "./?camli.mode=config", true);
xhr.send();
}
+
+function search() {
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState != 4) { return; }
+ if (xhr.status != 200) {
+ console.log("no status 200; got " + xhr.status);
+ return;
+ }
+ document.getElementById("searchres").innerHTML = "" + xhr.responseText + "
";
+ };
+ xhr.open("GET", disco.searchRoot + "camli/search", true);
+ xhr.send();
+}