-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
89 lines (80 loc) · 3.61 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html ng-app="ESC_WebApp">
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="443649814858-mro16g0khkij6ca25la6m4jcl0evcebt.apps.googleusercontent.com">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<a href="#" onclick="signOut();">Sign out</a>
<script>
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
/* TESTING BLOCK */
var profile = auth2.currentUser.get().getBasicProfile();
console.log(profile);
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail());
console.log('ID_token: '+ gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse().id_token);
/* TESTING BLOCK */
auth2.signOut().then(function () {
console.log('User signed out.');
});
}
</script>
<div class="public_sensors" ng-controller="PublicSensorController as publicSensorCtrl">
<h2>Public sensors</h2>
<ul>
<li ng-repeat="sensor in publicSensorCtrl.sensors"><a href ng-click="publicSensorCtrl.showData($index)">
<!--{ "uuid": "3f650b6a-b794-4af5-860c-708a9a3c6801", "access": "public", "type": 5, "owner": { "emails": [ "[email protected]" ] } }-->
Uuid: {{sensor.uuid}}<br>
Access: {{sensor.access}}<br>
Type: {{sensor.type}}<br>
Index: {{$index}}
</a>
</li>
</ul>
</div>
<div class="private_sensors" ng-controller="PrivateSensorController as privateSensorCtrl">
<h2>Private sensors</h2>
<a href ng-click="privateSensorCtrl.alertLoggedPerson()">Log logged person</a>
</div>
<div class="form">
<!-- Review Form -->
<form name="reviewForm" ng-controller="RegistrationController as registrationCtrl"
ng-submit="registrationCtrl.register()">
<!-- Review Form -->
<h4>Register sensor</h4>
<fieldset class="form-group">
<textarea ng-model="registrationCtrl.registration.uuid" class="form-control"
placeholder="sensor_uuid..." title="Review"></textarea>
</fieldset>
<fieldset class="form-group">
<textarea ng-model="registrationCtrl.registration.hub_uuid" class="form-control"
placeholder="hub_uuid..." title="Review"></textarea>
</fieldset>
<fieldset class="form-group">
<textarea ng-model="registrationCtrl.registration.secret" class="form-control"
placeholder="secret..." title="Review"></textarea>
</fieldset>
<fieldset class="form-group">
<textarea ng-model="reviewCtrl.registration.type" class="form-control"
placeholder="type..." title="Review"></textarea>
</fieldset>
<fieldset class="form-group">
<textarea ng-model="registrationCtrl.registration.s_type" class="form-control"
placeholder="s_type..." title="Review"></textarea>
</fieldset>
<fieldset class="form-group">
<input type="submit" class="btn btn-primary pull-right" value="Register sensor."/>
</fieldset>
</form>
</div>
</body>
</html>