Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
agetic
sitio-firebase
Commits
00272c6c
Commit
00272c6c
authored
Mar 17, 2020
by
Ivan Tancara
Browse files
Merge branch 'master' of gitlab.agetic.gob.bo:dbarra/sitio-firebase
parents
35b6de32
8c8c58b9
Pipeline
#2304
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
0 → 100644
View file @
00272c6c
# 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
frontend/index.html
View file @
00272c6c
...
...
@@ -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"
>
ENVI
AR
</button>
<input
type=
"text"
id=
"user"
required
placeholder=
"Usuario"
>
<input
type=
"
password"
id=
"password
"
required
placeholder=
"Contraseña"
>
<button
type=
"submit"
>
INGRES
AR
</button>
</form>
</section>
<section
id=
"data"
>
...
...
frontend/style.css
View file @
00272c6c
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment