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 206235a7
authored
2024-07-26 09:27:29 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Agrego login desarrollo y base de buscador.js
1 parent
6881c5fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
0 deletions
main.py
protected_static/buscador.js
pruebas.py
main.py
View file @
206235a
...
...
@@ -79,6 +79,26 @@ def login():
)
else
:
try
:
user
=
request
.
json
[
'usuario'
]
pasw
=
request
.
json
[
'contrasena'
]
print
(
user
,
pasw
,
pruebas
.
login
)
if
pruebas
.
login
[
user
]
!=
pasw
:
raise
()
print
(
"Login user desarrollo"
)
response
=
make_response
(
redirect
(
url_for
(
'historico'
)))
#response = make_response('', 200)
response
.
headers
[
'Location'
]
=
"historico"
response
.
set_cookie
(
"login"
,
user
,
60
*
60
*
8
,
httponly
=
True
)
return
response
# Login rapido para desarrollo
except
Exception
as
E
:
print
(
f
"No se encontro usuariodesarrollo {E}"
)
try
:
raise
()
s
=
SI
(
SI
.
Chrome
)
r
=
make_response
(
json
.
dumps
(
...
...
protected_static/buscador.js
0 → 100644
View file @
206235a
const
idCentGlobal
=
'50'
;
///Declaracion de taller
const
chatUrl
=
'https://api.hgt.com.ar/poll/rto_'
+
idCentGlobal
+
'_update/dewfrfgbeolkgkteprlk,hptrlk,hqff'
;
let
pendingRequests
=
0
;
function
CargarLista
()
{
const
requestData
=
{
"token"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"url"
:
"https://hgt.hgt.com.ar/api_rto/diaria"
,
"clear"
:
true
,
"params"
:
{
"ApiKey"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"id_cent"
:
id_cent
}
};
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
);
});
};
// Function to create the list items
function
createHistoricoList
(
data
)
{
const
historicoDiv
=
document
.
getElementById
(
'div_historico'
);
historicoDiv
.
innerHTML
=
""
;
//historicoDiv.innerText = "Dominios del dia"
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
const
button
=
document
.
createElement
(
'button'
);
button
.
className
=
'PDFButton'
;
button
.
id
=
inspeccion
.
name
;
button
.
textContent
=
'Ir dominio '
;
const
div
=
document
.
createElement
(
'div'
);
//div.textContent = inspeccion.name + " " + inspeccion.resultado + " " + inspeccion.fecha + " ";
const
titulo
=
document
.
createElement
(
'H4'
);
titulo
.
textContent
=
inspeccion
.
name
+
" "
+
inspeccion
.
resultado
;
const
ftl
=
document
.
createElement
(
'H6'
);
ftl
.
textContent
=
"Linea "
+
inspeccion
.
linea
+
", Planilla "
+
inspeccion
.
numeroplanilla
+
", Categoria "
+
inspeccion
.
categoria
;
div
.
appendChild
(
titulo
);
div
.
appendChild
(
ftl
);
div
.
appendChild
(
button
);
const
separador
=
document
.
createElement
(
'hr'
)
separador
.
className
=
'custom-hr'
;
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
separador
);
});
}
async
function
fetchChat
()
{
const
MensajeDiv
=
document
.
getElementById
(
'DivMensajeFijo'
);
const
MensajeCaida
=
"Se perdio contacto con el server, revise conexcion a internet"
MensajeDiv
.
innerText
=
"Escuchando novedades"
while
(
true
)
{
try
{
const
response
=
await
fetch
(
chatUrl
);
const
data
=
await
response
.
json
();
if
(
data
.
proccess
===
true
)
{
//CargarLista();
MensajeDiv
.
innerText
=
"Lista Actualizada al "
+
data
.
tiempo
}
if
(
MensajeDiv
.
innerText
==
MensajeCaida
)
{
MensajeDiv
.
innerText
=
"Se recupero conixion al server, Esperando novedades, o recarge la pagina"
}
}
catch
(
error
)
{
MensajeDiv
.
innerText
=
MensajeCaida
;
// Si ocurre un error, esperamos 5 segundos antes de volver a intentarlo
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
5000
));
}
}
}
////////////INICIO ACTIVIDAD
window
.
addEventListener
(
'load'
,
()
=>
{
//CargarLista();
fetchChat
();
});
\ No newline at end of file
pruebas.py
View file @
206235a
login
=
{
"jpdure"
:
"xvc7733455XVC"
}
report
=
{
'header'
:
{
'patente'
:
'PRUEBA12'
,
...
...
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