mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-10 06:54:44 +00:00
upload website
This commit is contained in:
parent
27145495e7
commit
d3f8b474d0
37
website/firebase-debug.log
Normal file
37
website/firebase-debug.log
Normal file
@ -0,0 +1,37 @@
|
||||
[debug] [2019-01-05T21:05:36.632Z] ----------------------------------------------------------------------
|
||||
[debug] [2019-01-05T21:05:36.634Z] Command: C:\ProgramData\Anaconda3\node.exe C:\ProgramData\Anaconda3\node_modules\firebase-tools\lib\bin\firebase.js serve
|
||||
[debug] [2019-01-05T21:05:36.634Z] CLI Version: 6.2.2
|
||||
[debug] [2019-01-05T21:05:36.634Z] Platform: win32
|
||||
[debug] [2019-01-05T21:05:36.634Z] Node Version: v9.11.1
|
||||
[debug] [2019-01-05T21:05:36.634Z] Time: Sat Jan 05 2019 15:05:36 GMT-0600 (Central Standard Time)
|
||||
[debug] [2019-01-05T21:05:36.634Z] ----------------------------------------------------------------------
|
||||
[debug]
|
||||
[debug] [2019-01-05T21:05:36.642Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
||||
[debug] [2019-01-05T21:05:36.642Z] > authorizing via signed-in user
|
||||
[debug] [2019-01-05T21:05:36.642Z] [iam] checking project titanscoutandroid for permissions ["firebase.projects.get"]
|
||||
[debug] [2019-01-05T21:05:36.644Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
|
||||
[debug] [2019-01-05T21:05:36.644Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
|
||||
<request body omitted>
|
||||
[debug] [2019-01-05T21:05:36.842Z] <<< HTTP RESPONSE 200
|
||||
[debug] [2019-01-05T21:05:36.859Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/titanscoutandroid:testIamPermissions
|
||||
|
||||
[debug] [2019-01-05T21:05:37.163Z] <<< HTTP RESPONSE 200
|
||||
[debug] [2019-01-05T21:05:37.165Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/titanscoutandroid
|
||||
|
||||
[debug] [2019-01-05T21:05:37.366Z] <<< HTTP RESPONSE 200
|
||||
[info]
|
||||
[info] === Serving from 'C:\Users\jlevi\Downloads\tr2022-strategy-master\tr2022-strategy-master\data analysis'...
|
||||
[info]
|
||||
[info] i functions: Preparing to emulate functions.
|
||||
[debug] [2019-01-05T21:05:37.943Z] Fetching environment
|
||||
[debug] [2019-01-05T21:05:37.945Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/1097635313476:getServerAppConfig
|
||||
|
||||
[debug] [2019-01-05T21:05:37.945Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/1097635313476/clients/_:getWebAppConfig
|
||||
|
||||
[debug] [2019-01-05T21:05:38.234Z] <<< HTTP RESPONSE 200
|
||||
[debug] [2019-01-05T21:05:38.234Z] Starting @google-cloud/functions-emulator
|
||||
[debug] [2019-01-05T21:05:38.398Z] <<< HTTP RESPONSE 200
|
||||
[info] i hosting: Serving hosting files from: public
|
||||
[info] + hosting: Local server: http://localhost:5000
|
||||
[debug] [2019-01-05T21:05:39.818Z] Parsing function triggers
|
||||
[info] i functions: No HTTPS functions found. Use firebase functions:shell if you would like to emulate other types of functions.
|
20
website/firebase.json
Normal file
20
website/firebase.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"firestore": {
|
||||
"rules": "firestore.rules",
|
||||
"indexes": "firestore.indexes.json"
|
||||
},
|
||||
"hosting": {
|
||||
"public": "public",
|
||||
"ignore": [
|
||||
"firebase.json",
|
||||
"**/.*",
|
||||
"**/node_modules/**"
|
||||
],
|
||||
"rewrites": [
|
||||
{
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
4
website/firestore.indexes.json
Normal file
4
website/firestore.indexes.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"indexes": [],
|
||||
"fieldOverrides": []
|
||||
}
|
7
website/firestore.rules
Normal file
7
website/firestore.rules
Normal file
@ -0,0 +1,7 @@
|
||||
service cloud.firestore {
|
||||
match /databases/{database}/documents {
|
||||
match /{document=**} {
|
||||
allow read, write;
|
||||
}
|
||||
}
|
||||
}
|
3278
website/package-lock.json
generated
Normal file
3278
website/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
20
website/public/index.html
Normal file
20
website/public/index.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>titanscout</title>
|
||||
<script src="https://www.gstatic.com/firebasejs/5.7.2/firebase.js"></script>
|
||||
<script src="https://cdn.firebase.com/libs/firebaseui/3.5.1/firebaseui.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/3.5.1/firebaseui.css" />
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
|
||||
<script type="text/javascript" src="scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="mainhead">TitanScout- Sign In</h1>
|
||||
<p id="status">You are not signed in.</p>
|
||||
<input type="button" name="Sign Out" value="Sign Out" onclick="signout();" id="signout">
|
||||
<input type="button" name="DelAcc" value="Delete Account" onclick="deleteAccount();" id="deleteacc">
|
||||
<div id="firebaseui-auth-container"></div>
|
||||
</body>
|
||||
</html>
|
88
website/public/scripts.js
Normal file
88
website/public/scripts.js
Normal file
@ -0,0 +1,88 @@
|
||||
// Initialize Firebase
|
||||
var config = {
|
||||
apiKey: "AIzaSyBTuq1Xvp6c8quCspd-1HEJu2GHnd3UKQc",
|
||||
authDomain: "titanscoutandroid.firebaseapp.com",
|
||||
databaseURL: "https://titanscoutandroid.firebaseio.com",
|
||||
projectId: "titanscoutandroid",
|
||||
storageBucket: "titanscoutandroid.appspot.com",
|
||||
messagingSenderId: "1097635313476"
|
||||
};
|
||||
firebase.initializeApp(config);
|
||||
// FirebaseUI config.
|
||||
var uiConfig = {
|
||||
callbacks:{
|
||||
signInSuccessWithAuthResult:function(authResult, redirectUrl) {
|
||||
if (authResult.user) {
|
||||
handleSignedInUser(authResult.user);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//signInSuccessUrl: '<url-to-redirect-to-on-success>',
|
||||
signInOptions: [
|
||||
// Leave the lines as is for the providers you want to offer your users.
|
||||
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
|
||||
//firebase.auth.FacebookAuthProvider.PROVIDER_ID,
|
||||
//firebase.auth.TwitterAuthProvider.PROVIDER_ID,
|
||||
firebase.auth.GithubAuthProvider.PROVIDER_ID,
|
||||
firebase.auth.EmailAuthProvider.PROVIDER_ID,
|
||||
firebase.auth.PhoneAuthProvider.PROVIDER_ID,
|
||||
// firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID
|
||||
],
|
||||
// tosUrl and privacyPolicyUrl accept either url string or a callback
|
||||
// function.
|
||||
// Terms of service url/callback.
|
||||
tosUrl: function(){alert("this is a test app. don't use it");},
|
||||
// Privacy policy url/callback.
|
||||
privacyPolicyUrl: function() {
|
||||
alert("we will steal all of the data");
|
||||
}
|
||||
};
|
||||
var handleSignedInUser = function(user) {
|
||||
document.getElementById("mainhead").innerHTML = "TitanScout- Create Form";
|
||||
if (user.displayName != null){
|
||||
document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;
|
||||
}else if (user.email != null) {
|
||||
document.getElementById('status').innerHTML = "You are signed in as: " + user.email;
|
||||
}else if (user.phoneNumber != null) {
|
||||
document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber;
|
||||
}else{
|
||||
document.getElementById('status').innerHTML = "You are signed in.";
|
||||
}
|
||||
document.getElementById('signout').style.display='inline-block';
|
||||
document.getElementById('deleteacc').style.display='inline-block';
|
||||
}
|
||||
var handleSignedOutUser = function() {
|
||||
document.getElementById("mainhead").innerHTML = "TitanScout- Sign In";
|
||||
document.getElementById('status').innerHTML = "You are not signed in.";
|
||||
document.getElementById('signout').style.display='none';
|
||||
document.getElementById('deleteacc').style.display='none';
|
||||
ui.start('#firebaseui-auth-container', uiConfig);
|
||||
};
|
||||
|
||||
// Initialize the FirebaseUI Widget using Firebase.
|
||||
var ui = new firebaseui.auth.AuthUI(firebase.auth());
|
||||
|
||||
// The start method will wait until the DOM is loaded.
|
||||
ui.start('#firebaseui-auth-container', uiConfig);
|
||||
var deleteAccount = function() {
|
||||
try {
|
||||
firebase.auth().currentUser.delete()
|
||||
handleSignedOutUser()
|
||||
} catch (error) {
|
||||
if (error.code == 'auth/requires-recent-login') {
|
||||
// The user's credential is too old. She needs to sign in again.
|
||||
signout()
|
||||
// The timeout allows the message to be displayed after the UI has
|
||||
// changed to the signed out state.
|
||||
setTimeout(function() {
|
||||
alert('Please sign in again to delete your account.');
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
function signout() {
|
||||
var user = firebase.auth().currentUser;
|
||||
firebase.auth().signOut()
|
||||
handleSignedOutUser()
|
||||
}
|
11
website/public/style.css
Normal file
11
website/public/style.css
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
body{
|
||||
text-align: center;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
#signout{
|
||||
display: none;
|
||||
}
|
||||
#deleteacc{
|
||||
display: none;
|
||||
}
|
Loading…
Reference in New Issue
Block a user