-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
191 lines (151 loc) · 6.01 KB
/
Copy pathindex.html
File metadata and controls
191 lines (151 loc) · 6.01 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>dataLab</title>
<link rel="stylesheet" href="./node_modules/react-grid-layout/css/styles.css">
<link rel="stylesheet" href- "/node_modules/react-resizable/css/styles.css">
<link rel="stylesheet" href="./assets/css/resizeStyles.css">
<link rel="stylesheet" href="./assets/css/Header.css">
<!--<link rel="stylesheet" href="./assets/css/bootstrap-theme.css">
<link rel="stylesheet" href="./assets/css/bootstrap-social.css">
<link rel="stylesheet" href="./assets/css/bootstrap.css">-->
<link rel="stylesheet" href="./assets/css/font-awesome.css">
<link rel="stylesheet" href="./assets/css/customGentelalla.css">
<link rel="stylesheet" href="./assets/css/bubble_chart.css">
<!--<link rel="stylesheet" href="./assets/css/reset.css">-->
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
<style>
.hidden {
display: none;
}
h3 {
margin-top: 0;
}
label {
margin: 5px 0;
color: #777;
}
/*.container-fluid {
background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%) !important;
}*/
</style>
</head>
<!--style = "background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);"-->
<body >
<div id='main'>
</div>
<!--<div class="container">
<div>
<h1>Auth0 Electron</h1>
<button class="btn btn-primary btn-login">Login</button>
<button class="btn btn-primary btn-logout">Logout</button>
</div>
<div class="profile">
<div>
<img class="avatar" style="width: 75px;border-radius:50%">
</div>
<div class="profile-section hidden">
<label for="">Username</label>
<h3 class="name"></h3>
<label for="">Email</label>
<h3 class="email"></h3>
</div>
</div>
</div>-->
<script src="https://www.gstatic.com/firebasejs/3.9.0/firebase.js"></script>
<script>
// Initialize Firebase
var firebase = require("firebase/app");
require("firebase/auth");
require("firebase/database");
var config = {
apiKey: "AIzaSyC2eCmqugkqPku0klbbAsYWUE7zWQ1uUKc",
authDomain: "powerdata-4aafd.firebaseapp.com",
databaseURL: "https://powerdata-4aafd.firebaseio.com",
projectId: "powerdata-4aafd",
storageBucket: "powerdata-4aafd.appspot.com",
messagingSenderId: "199200737729"
};
firebase.initializeApp(config);
</script>
<script src="https://cdn.auth0.com/js/lock/10.15/lock.min.js"></script>
<script src="https://cdn.auth0.com/w2/auth0-6.7.js"></script>
<script>
// $ = document.querySelector.bind(document);
// // var lock = new Auth0Lock('H_0BdQzChMQaVnTgE2iiV4vUpaHdWaYX', 'powerdata.auth0.com', {
// // auth: {
// // redirect: false,
// // sso: false
// // }
// // });
// // var auth0 = new Auth0({ domain : 'powerdata.auth0.com', clientID: 'H_0BdQzChMQaVnTgE2iiV4vUpaHdWaYX'})
// var idToken = localStorage.getItem('id_token') || null;
// var profile = JSON.parse(localStorage.getItem('profile')) || null;
// if (idToken && profile) {
// $('.avatar').src = profile.picture;
// $('.name').textContent = profile.nickname;
// $('.email').textContent = profile.email;
// $('.profile-section').classList.remove('hidden');
// $('.btn-login').classList.add('hidden');
// $('.btn-logout').classList.remove('hidden');
// } else {
// $('.profile-section').classList.add('hidden');
// $('.btn-login').classList.remove('hidden');
// $('.btn-logout').classList.add('hidden');
// }
// $('.btn-login').addEventListener('click', function() {
// lock.show();
// });
// lock.on('authenticated', (authResult) => {
// localStorage.setItem('id_token', authResult.idToken);
// lock.getProfile(authResult.idToken, (err, profile) => {
// console.log("profile is ", profile)
// var options = {
// id_token : authResult.idToken,
// api : 'firebase',
// scope : 'openid name email displayName',
// target: 'H_0BdQzChMQaVnTgE2iiV4vUpaHdWaYX'
// };
// auth0.getDelegationToken(options, function(err, result) {
// console.log('err is ', err)
// if(!err) {
// console.log("result is ", result)
// // Exchange the delegate token for a Firebase auth token
// firebase.auth().signInWithCustomToken(result.id_token)
// .then(()=> firebase.database().ref('users').push(profile))
// .catch(function(error) {
// console.log(error);
// });
// }
// });
// localStorage.setItem('profile', JSON.stringify(profile));
// $('.profile-section').classList.remove('hidden');
// $('.avatar').src = profile.picture;
// $('.name').textContent = profile.nickname;
// $('.email').textContent = profile.email;
// $('.btn-login').classList.add('hidden');
// $('.btn-logout').classList.remove('hidden');
// });
// lock.hide();
// });
// $('.btn-logout').addEventListener('click', function() {
// localStorage.removeItem('profile');
// localStorage.removeItem('id_token');
// $('.profile-section').classList.add('hidden');
// $('.avatar').src = '';
// $('.name').textContent = null;
// $('.email').textContent = null;
// $('.btn-login').classList.remove('hidden');
// $('.btn-logout').classList.add('hidden');
// });
</script>
</body>
<script>
// You can also require other files to run in this process
require('./renderer.js')
require('./assets/bundle.js')
</script>
</body>
</html>