Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 1a574118
authored
2024-07-26 12:45:01 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Implementacion de interfor de buscador
1 parent
206235a7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
3 deletions
main.py
protected_static/buscador.js
templates/buscador.html
templates/form.html
templates/historico.html
main.py
View file @
1a57411
...
...
@@ -71,6 +71,16 @@ def historico():
bypass
=
False
)
@app.route
(
'/buscador'
)
def
buscador
():
if
"login"
not
in
request
.
cookies
:
return
redirect
(
url_for
(
"login"
))
return
render_template
(
"buscador.html"
,
bypass
=
False
)
@app.route
(
'/login'
,
methods
=
[
'GET'
,
'POST'
])
def
login
():
if
request
.
method
==
"GET"
:
...
...
protected_static/buscador.js
View file @
1a57411
...
...
@@ -10,7 +10,7 @@ function CargarLista() {
"clear"
:
true
,
"params"
:
{
"ApiKey"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"id_cent"
:
id
_cent
"id_cent"
:
id
CentGlobal
}
};
...
...
@@ -66,7 +66,7 @@ function createHistoricoList(data) {
async
function
fetchChat
()
{
const
MensajeDiv
=
document
.
getElementById
(
'DivMensajeFijo'
);
const
MensajeCaida
=
"Se perdio contacto con el server, revise conexcion a internet"
MensajeDiv
.
innerText
=
"Escuchando novedades"
//
MensajeDiv.innerText = "Escuchando novedades"
while
(
true
)
{
try
{
const
response
=
await
fetch
(
chatUrl
);
...
...
@@ -87,10 +87,57 @@ async function fetchChat() {
}
function
BuscarLista
(
fecha
,
dominio
)
{
const
requestData
=
{
"token"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"url"
:
"https://hgt.hgt.com.ar/api_rto/buscador"
,
"clear"
:
true
,
"params"
:
{
"ApiKey"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"id_cent"
:
idCentGlobal
,
//"id_cent": "61",
"fecha"
:
fecha
,
"dominio"
:
dominio
}
};
fetch
(
'https://api.hgt.com.ar/redirect'
,
{
method
:
'POST'
,
headers
:
{
'Accept'
:
'application/json'
,
"Content-Type"
:
"application/json"
},
body
:
JSON
.
stringify
(
requestData
)
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
createHistoricoList
(
data
);
})
.
catch
(
error
=>
{
console
.
error
(
'Error:'
,
error
);
});
};
async
function
IniciarInterfaceBusqueda
()
{
const
searchForm
=
document
.
getElementById
(
'searchForm'
);
searchForm
.
addEventListener
(
'submit'
,
function
(
event
)
{
event
.
preventDefault
();
// Prevent the form from submitting normally
//console.log("Presionando boton busqueda")
const
fecha
=
document
.
getElementById
(
'date_input'
).
value
;
const
dominio
=
document
.
getElementById
(
'domain_input'
).
value
;
if
(
fecha
===
""
&&
dominio
===
""
)
{
alert
(
"Carge los parametros de busqueda"
);
return
;
// Stop further execution if validation fails
}
else
{
BuscarLista
(
fecha
,
dominio
);
}
})
}
////////////INICIO ACTIVIDAD
...
...
@@ -98,5 +145,6 @@ async function fetchChat() {
window
.
addEventListener
(
'load'
,
()
=>
{
//CargarLista();
fetchChat
();
//fetchChat();
IniciarInterfaceBusqueda
();
});
\ No newline at end of file
templates/buscador.html
0 → 100755
View file @
1a57411
<html
lang=
"es"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<link
rel=
"stylesheet"
href=
"{{ url_for('static', filename = 'styles/general.css') }}"
>
<script
src=
"/protected_static/buscador.js"
></script>
<!--INCLUIMOS LA FUENTE
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/cmu-typewriter" type="text/css" />
-->
<title>
Pruebas de Alineamiento
</title>
<style>
.custom-hr
{
border
:
none
;
border-top
:
1px
solid
#000
;
/* Personaliza el color y grosor aquí */
width
:
66.67%
;
/* Dos tercios del ancho de la página */
margin
:
20px
0
;
/* Ajusta el espacio alrededor de la línea aquí */
margin-left
:
0
;
/* Alinea la línea al inicio (izquierda) */
}
</style>
</head>
<body>
<div
>
<!--
<div class="MessageFixed" id="DivMensajeFijo">
</div>
-->
<div
class=
"DataCard"
>
<form
id=
"searchForm"
>
<div>
<label
for=
"date_input"
>
Fecha:
</label>
<input
type=
"date"
id=
"date_input"
name=
"date_input"
>
</div>
<div>
<label
for=
"domain_input"
>
Dominio:
</label>
<input
type=
"text"
id=
"domain_input"
name=
"domain_input"
>
</div>
<button
class=
"PDFButton"
type=
"submit"
id=
"id_boton_busqueda"
>
Buscar
</button>
</form>
<hr
class=
"custom-hr"
>
Resultados de la busqueda
<br>
<div
id=
"div_historico"
>
<hr
class=
"custom-hr"
>
Sin resultados
<hr
class=
"custom-hr"
>
</div>
</div>
<div
class=
"PDFButtonContainerFixed"
>
<h3>
Buscador
</h3>
<button
class=
"PDFButton"
onclick=
"location.href='/historico'"
>
Historico
</button>
<button
class=
"PDFButton"
onclick=
"location.href='/'"
>
Carga
</button>
</div>
</div>
<div
id=
"message"
class=
"MessageContainer"
onclick=
"this.style.display = 'none'"
style=
"display: none;"
>
<div
class=
"Message"
style=
"text-align: center;"
>
<p
id =
"msg"
></p>
<span
class =
"X"
>
x
<span>
</div>
</div>
</body>
</html>
\ No newline at end of file
templates/form.html
View file @
1a57411
...
...
@@ -224,6 +224,10 @@
<button
class=
"PDFButton"
onclick=
"location.href='/historico'"
>
Historico
</button>
<button
class=
"PDFButton"
onclick=
"location.href='/buscador'"
>
Buscador
</button>
</div>
<button
class=
"PDFButton loginB"
onclick=
"location.href='/login'"
>
...
...
templates/historico.html
View file @
1a57411
...
...
@@ -37,6 +37,10 @@
<h3>
Dominios del dia
</h3>
<button
class=
"PDFButton"
onclick=
"location.href='/buscador'"
>
Buscador
</button>
<button
class=
"PDFButton"
onclick=
"location.href='/'"
>
Carga
</button>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment