index.html provisional. Lo uso para probar mis recursos. Uds. usenlo para lo que necesiten, una vez se termine el backend, recien se hará el frontend.
This commit is contained in:
parent
3297b3814a
commit
0c1397f770
106
war/index.html
106
war/index.html
@ -1,27 +1,85 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<!DOCTYPE HTML>
|
||||||
<!-- The HTML 4.01 Transitional DOCTYPE declaration-->
|
<html lang="en">
|
||||||
<!-- above set at the top of the file will set -->
|
<head>
|
||||||
<!-- the browser's rendering engine into -->
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
<!-- "Quirks Mode". Replacing this declaration -->
|
<title>Hotel Services</title>
|
||||||
<!-- with a "Standards Mode" doctype is supported, -->
|
|
||||||
<!-- but may lead to some differences in layout. -->
|
|
||||||
|
|
||||||
<html>
|
<meta name="google-signin-client_id" content="746890482047-c734fgap3p3vb6bdoquufn60bsh2p8l9.apps.googleusercontent.com">
|
||||||
<head>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
||||||
<title>Hello App Engine</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
<script src="https://apis.google.com/js/platform.js" async defer></script>
|
||||||
<h1>Hello App Engine!</h1>
|
</head>
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
<body>
|
||||||
<td colspan="2" style="font-weight:bold;">Available Servlets:</td>
|
|
||||||
</tr>
|
<h1>Hotel Services.</h1>
|
||||||
<tr>
|
|
||||||
<td><a href="lab09">Lab09</a></td>
|
Please log in to continue:<br />
|
||||||
</tr>
|
<br />
|
||||||
</table>
|
<div class="g-signin2" data-onsuccess="onSignIn"></div>
|
||||||
</body>
|
|
||||||
|
You can Sign out here:
|
||||||
|
<a href="#" onclick="signOut();">Sign out</a>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function onSignIn(googleUser) {
|
||||||
|
var profile = googleUser.getBasicProfile();
|
||||||
|
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()); // This is null if the 'email' scope is not present.
|
||||||
|
|
||||||
|
var userID = profile.getEmail().substr(0,profile.getEmail().search("@"));
|
||||||
|
console.log("User ID: " + userID);
|
||||||
|
|
||||||
|
var postForm = document.createElement("form");
|
||||||
|
postForm.action = "./users/add";
|
||||||
|
postForm.method = "POST";
|
||||||
|
|
||||||
|
var data = document.createElement("input");
|
||||||
|
data.type = "hidden";
|
||||||
|
data.name = "userID";
|
||||||
|
data.value = userID;
|
||||||
|
postForm.appendChild(data);
|
||||||
|
|
||||||
|
data = document.createElement("input");
|
||||||
|
data.type = "hidden";
|
||||||
|
data.name = "userName";
|
||||||
|
data.value = profile.getName();
|
||||||
|
postForm.appendChild(data);
|
||||||
|
|
||||||
|
data = document.createElement("input");
|
||||||
|
data.type = "hidden";
|
||||||
|
data.name = "userImg";
|
||||||
|
data.value = profile.getImageUrl();
|
||||||
|
postForm.appendChild(data);
|
||||||
|
|
||||||
|
data = document.createElement("input");
|
||||||
|
data.type = "hidden";
|
||||||
|
data.name = "userRole";
|
||||||
|
data.value = "admin";
|
||||||
|
postForm.appendChild(data);
|
||||||
|
|
||||||
|
data = document.createElement("input");
|
||||||
|
data.type = "hidden";
|
||||||
|
data.name = "logIn";
|
||||||
|
data.value = "logIn";
|
||||||
|
postForm.appendChild(data);
|
||||||
|
|
||||||
|
document.body.appendChild(postForm);
|
||||||
|
postForm.submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
function signOut() {
|
||||||
|
var auth2 = gapi.auth2.getAuthInstance();
|
||||||
|
auth2.signOut().then(function () {
|
||||||
|
console.log('User signed out.');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user