summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorleonoverweel <l.overweel@gmail.com>2017-02-27 01:13:21 +0100
committerleonoverweel <l.overweel@gmail.com>2017-02-27 01:13:21 +0100
commit14499db34c8c1b173691de16e47d29f58c4c39be (patch)
treec4e8faa5e0d4936453b06f8eb4d13156980bfea4 /static
parent1b942d9e9d5b2c08d09fb8f294437ea99a889962 (diff)
Update index.hmtl for local testing
Diffstat (limited to 'static')
-rw-r--r--static/index.html31
1 files changed, 11 insertions, 20 deletions
diff --git a/static/index.html b/static/index.html
index 39bb6460..744f7d27 100644
--- a/static/index.html
+++ b/static/index.html
@@ -1,36 +1,26 @@
<script src="https://apis.google.com/js/platform.js" async defer></script>
-<meta name="google-signin-client_id" content="184853849394-v89e96desio4dub3360vg32p1l4r3jqd.apps.googleusercontent.com">
+<meta name="google-signin-client_id" content="561588943542-fq7065hk47qdf3lfsc50ebll4spi6u76.apps.googleusercontent.com">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
<script>
function onSignIn(googleUser) {
var id_token = googleUser.getAuthResponse().id_token;
- var xhr = new XMLHttpRequest();
- xhr.open('POST', 'https://opendc.ewi.tudelft.nl/tokensignin');
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
-
- xhr.onload = function() {
- console.log('Signed in as: ' + xhr.responseText);
- console.log('Token: ' + id_token);
- };
- xhr.send('idtoken=' + id_token);
-
- var profile = googleUser.getBasicProfile();
-
- var socket = io.connect('https://' + document.domain + ':' + location.port);
+ var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on('connect', function() {
socket.emit('request', {
id: 234,
- path: "/v1/simulations/{simulationId}/experiments/{experimentId}/statistics/task-durations",
+ path: "/v1/simulations/{simulationId}",
method: "GET",
parameters: {
body: {
+
},
path: {
- simulationId: 1,
- experimentId: 1
+ simulationId: 1
},
- query: {email:'l.overweel@gmail.com'}
+ query: {
+ email:'l.overweel@gmail.com'
+ }
},
token: id_token
});
@@ -42,8 +32,7 @@ function onSignIn(googleUser) {
}
</script>
-<div class="g-signin2" data-onsuccess="onSignIn"></div>
-<a href="#" onclick="signOut();">Sign out</a>
+
<script>
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
@@ -53,3 +42,5 @@ function onSignIn(googleUser) {
}
</script>
+<div class="g-signin2" data-onsuccess="onSignIn"></div>
+<a href="#" onclick="signOut();">Sign out</a>