Commit 00272c6c authored by Ivan Tancara's avatar Ivan Tancara
Browse files

Merge branch 'master' of gitlab.agetic.gob.bo:dbarra/sitio-firebase

parents 35b6de32 8c8c58b9
Pipeline #2304 failed with stages
# FRONTEND
#### Cambiar la linea 9 del archivo index.html por la url que sera el backend en produccion
#### Ejemplo de URL
## var url = 'https://test.agetic.gob.bo/backend-api/send'
\ No newline at end of file
......@@ -6,9 +6,14 @@
<title>.:: Sitio ::.</title>
<link rel="stylesheet" href="./style.css">
<script type="text/javascript">
function login () {
document.getElementById('login').style.display = 'none';
document.getElementById('data').style.display = 'block';
var url = 'http://localhost:5000/send';
function login () {
if (document.getElementById('user').value === 'admin' && document.getElementById('password').value === '123456') {
document.getElementById('login').style.display = 'none';
document.getElementById('data').style.display = 'block';
} else {
alert('Datos incorrectos');
}
}
async function postData(url = '', data = {}) {
const response = await fetch(url, {
......@@ -26,12 +31,12 @@
return await response.json();
}
function sendData () {
postData('http://localhost:5000/send', {
postData(url, {
titulo: document.querySelector('#title').value,
text: document.querySelector('#description').value
})
.then((data) => {
console.log(data);
alert('Mensaje enviado');
});
}
</script>
......@@ -40,9 +45,9 @@
<div class="main">
<section id="login">
<form action="#" onsubmit="event.preventDefault(); login();" class="login">
<input type="text" required placeholder="Usuario">
<input type="text" required placeholder="Contraseña">
<button type="submit">ENVIAR</button>
<input type="text" id="user" required placeholder="Usuario">
<input type="password" id="password" required placeholder="Contraseña">
<button type="submit">INGRESAR</button>
</form>
</section>
<section id="data">
......
......@@ -16,6 +16,12 @@ body {
margin: 10px;
width: calc(100% - 40px);
}
.main input[type="password"] {
padding: 10px;
outline: none;
margin: 10px;
width: calc(100% - 40px);
}
.main button[type="submit"] {
padding: 10px 0;
outline: none;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment