diff options
author | Loïc Collignon <loic.collignon@iot.bzh> | 2018-01-09 17:17:14 +0100 |
---|---|---|
committer | Loïc Collignon <loic.collignon@iot.bzh> | 2018-01-09 17:17:14 +0100 |
commit | 786a2a295fd452aab5078ce4923cd5fcc2c1b464 (patch) | |
tree | ad77657138f4ea3700413c7eea067d3261cb9346 | |
parent | 8886e67745c30fb40f5eee300bc96df83e75dd49 (diff) |
improve the debug tools
Change-Id: I6152e3719944db82f5907ac4cc6038508e526e51
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
-rw-r--r-- | agl-identity-service/htdocs/identity/identity-binding.js | 20 | ||||
-rw-r--r-- | agl-identity-service/htdocs/identity/index.html | 53 |
2 files changed, 52 insertions, 21 deletions
diff --git a/agl-identity-service/htdocs/identity/identity-binding.js b/agl-identity-service/htdocs/identity/identity-binding.js index bd45c17..55dbb96 100644 --- a/agl-identity-service/htdocs/identity/identity-binding.js +++ b/agl-identity-service/htdocs/identity/identity-binding.js @@ -131,12 +131,28 @@ function callbinder(api, verb, query) { ws.call(api+"/"+verb, query).then(replyok, replyerr); } -function fake_auth() { +function subscribe() { + callbinder("identity", "subscribe", {}); +} + +function getIdentity() { + callbinder("identity", "get", {}); +} + +function logout() { + callbinder("identity", "logout", {}); +} + +function fakeAuth() { var e = document.getElementById("fake-auth-kind"); var arg = { "kind": e.options[e.selectedIndex].value, - "key": document.getElementById("fake-auth-key").value + "key": (document.getElementById("fake-auth-key").value === "custom" ? document.getElementById("fake-auth-key-custom").value : document.getElementById("fake-auth-key").value) } callbinder("identity", "fake-auth", arg); } + +function updateNfcUi() { + document.getElementById('fake-auth-key-custom').disabled = !(document.getElementById("fake-auth-key").value === "custom"); +} diff --git a/agl-identity-service/htdocs/identity/index.html b/agl-identity-service/htdocs/identity/index.html index d5432fb..bbeee51 100644 --- a/agl-identity-service/htdocs/identity/index.html +++ b/agl-identity-service/htdocs/identity/index.html @@ -1,26 +1,41 @@ <!doctype html> <html> - <head> - <title>agl-service-identity</title> - <meta charset="UTF-8"> - <script type="text/javascript" src="AFB-websock.js"></script> - <script type="text/javascript" src="identity-binding.js"></script> - <link rel="stylesheet" type="text/css" href="binding-debug.css" /> - </head> - - <body onload="init();" id="app-body"> + <head> + <title>agl-service-identity</title> + <meta charset="UTF-8"> + <script type="text/javascript" src="AFB-websock.js"></script> + <script type="text/javascript" src="identity-binding.js"></script> + <link rel="stylesheet" type="text/css" href="binding-debug.css" /> + <script> + + </script> + </head> + <body onload="init();" id="app-body"> <div id="debug-panel-container"></div> - <h1>agl-service-identity</h1> - <p> + <h1>agl-service-identity</h1> + <p> <ul> + <li><button onclick="subscribe();">Subscribe</button></li> <li> - <select name="fake-auth-kind" id="fake-auth-kind"> - <option value="nfc" selected="selected">nfc</option> - </select> - <input type="text" name="fake-auth-key" id="fake-auth-key" value="a71d4d00"/> - <button onclick="fake_auth();">fake auth</button> - </li> + <select name="fake-auth-kind" id="fake-auth-kind"> + <option value="nfc" selected="selected">nfc</option> + </select> + <select name="fake-auth-key" id="fake-auth-key" onchange="updateNfcUi();"> + <option value="custom" selected="selected">custom</option> + <option value="b411f7fb">b411f7fb</option> + <option value="d77d901d">d77d901d</option> + <option value="c7350500">c7350500</option> + <option value="448b6df6">448b6df6</option> + <option value="a46f19fc">a46f19fc</option> + <option value="34ea1afc">34ea1afc</option> + <option value="473b4200">473b4200</option> + </select> + <input type="text" name="fake-auth-key-custom" id="fake-auth-key-custom" /> + <button onclick="fakeAuth();">fake auth</button> + </li> + <li><button onclick="getIdentity();">Get identity</button></li> + <li><button onclick="logout();">Log out</button></li> </ul> - </p> - </body> + </p> + </body> </html> |