aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2017-08-01 09:31:37 +0200
committerLoïc Collignon <loic.collignon@iot.bzh>2017-08-01 09:31:37 +0200
commit4f50493fc0ef4d0c33124ebf52908849196ad685 (patch)
treebac574da687e5846a2d35c2e22fb8018fd64bebd
parent4754c538c8b987b54ebf363f97123fc43d909c76 (diff)
fixed some an issue on the html UI.
Change-Id: Iabf8fb1220117b63dae74cd477fa02461a023118 Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
-rw-r--r--ll-auth-binding/htdocs/IdentityBinding2.js11
-rw-r--r--ll-auth-binding/htdocs/auth2.html8
2 files changed, 18 insertions, 1 deletions
diff --git a/ll-auth-binding/htdocs/IdentityBinding2.js b/ll-auth-binding/htdocs/IdentityBinding2.js
index 26495ba..695b872 100644
--- a/ll-auth-binding/htdocs/IdentityBinding2.js
+++ b/ll-auth-binding/htdocs/IdentityBinding2.js
@@ -30,6 +30,8 @@
function onopen() {
document.getElementById("background").style.background = "lightgray";
+ document.getElementById("main").style.visibility = "visible";
+ callbinder("ll-auth", "getuser", "");
ws.onevent("*", gotevent);
}
@@ -40,6 +42,11 @@
function replyok(obj) {
console.log("replyok:" + JSON.stringify(obj));
document.getElementById("output").innerHTML = "OK: "+JSON.stringify(obj);
+
+ document.getElementById("usertitle").innerHTML = "A valid user is logged in";
+ document.getElementById("userid").innerHTML = obj.response.user;
+ document.getElementById("userdevice").innerHTML = obj.response.device;
+ document.getElementById("background").style.background = "lightgreen";
}
function replyerr(obj) {
@@ -49,8 +56,10 @@
function gotevent(obj) {
console.log("gotevent:" + JSON.stringify(obj));
- //document.getElementById("outevt").innerHTML = (evtidx++) +": "+JSON.stringify(obj);
+ document.getElementById("outevt").innerHTML = (evtidx++) +": "+JSON.stringify(obj);
+ document.getElementById("question").innerHTML = "";
+ document.getElementById("output").innerHTML = "";
document.getElementById("message").innerHTML = "";
if (obj.event == "ll-auth/login") {
diff --git a/ll-auth-binding/htdocs/auth2.html b/ll-auth-binding/htdocs/auth2.html
index 01e5e4f..356be1c 100644
--- a/ll-auth-binding/htdocs/auth2.html
+++ b/ll-auth-binding/htdocs/auth2.html
@@ -15,5 +15,13 @@
</ul>
</div>
<div id="message" style="color:red;"></div>
+ <div id="main" style="visibility:hidden">
+ <h2>Debug: </h2>
+ <ol>
+ <li>Question <div id="question"></div></li>
+ <li>Response <div id="output"></div></li>
+ <li>Events: <div id="outevt"></div></li>
+ </ol>
+ </div>
</body>
</html>