perkeep/server/camlistored/ui/disco.html

41 lines
1.2 KiB
HTML

<html>
<head>
<title>Camlistored UI</title>
<script src="camli.js"></script>
<script src="sigdebug.js"></script>
<script src="./?camli.mode=config&cb=Camli.onConfiguration"></script>
<script>
// Or get configuration info like this:
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;
}
disco = JSON.parse(xhr.responseText);
document.getElementById("discores").innerHTML = "<pre>" + JSON.stringify(disco, null, 2) + "</pre>";
};
xhr.open("GET", "./?camli.mode=config", true);
xhr.send();
}
</script>
</head>
<body>
<form>
<h2>Root Discovery</h2>
<p><input type="button" id="discobtn" onclick="discover()" value="Do Discovery" /></p>
<div id="discores" style="border: 2px solid gray">(discovery results)</div>
<h2>Signing Discovery</h2>
<p><input type="button" id="sigdiscobtn" onclick="discoverJsonSign()" value="Do jsonSign discovery" /></p>
<div id="sigdiscores" style="border: 2px solid gray">(jsonsign discovery results)</div>
</form>
</body>
</html>