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 81f7b6f4
authored
11 months ago
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
historico
1 parent
e851536d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
0 deletions
main.py
static/src/historico.js
templates/historico.html
main.py
View file @
81f7b6f
...
@@ -53,6 +53,16 @@ def main():
...
@@ -53,6 +53,16 @@ def main():
bypass
=
False
bypass
=
False
)
)
@app.route
(
'/historico'
)
def
historico
():
if
"login"
not
in
request
.
cookies
:
return
redirect
(
url_for
(
"login"
))
return
render_template
(
"historico.html"
,
bypass
=
False
)
@app.route
(
'/login'
,
methods
=
[
'GET'
,
'POST'
])
@app.route
(
'/login'
,
methods
=
[
'GET'
,
'POST'
])
def
login
():
def
login
():
if
request
.
method
==
"GET"
:
if
request
.
method
==
"GET"
:
...
...
This diff is collapsed.
Click to expand it.
static/src/historico.js
0 → 100644
View file @
81f7b6f
document
.
addEventListener
(
'DOMContentLoaded'
,
()
=>
{
const
requestData
=
{
"token"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"url"
:
"https://validacion.hgtsa.com.ar/api_rto/diaria"
,
"clear"
:
true
,
"params"
:
{
"ApiKey"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"id_cent"
:
"061"
}
};
fetch
(
'https://api.hgt.com.ar/redirect'
,
{
method
:
'POST'
,
headers
:
{
'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'
);
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
const
div
=
document
.
createElement
(
'div'
);
div
.
textContent
=
inspeccion
.
name
;
const
button
=
document
.
createElement
(
'button'
);
button
.
className
=
'PDFButton'
;
button
.
id
=
inspeccion
.
name
;
button
.
textContent
=
'ir historico'
;
div
.
appendChild
(
button
);
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
document
.
createElement
(
'br'
));
});
}
This diff is collapsed.
Click to expand it.
templates/historico.html
0 → 100755
View file @
81f7b6f
<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=
"{{ url_for('static', filename = 'src/historico.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>
</head>
<body>
<div
>
<div
class=
"MessageFixed"
>
Los datos con signo de pregunta '?' son datos no encontrados o faltantes.
<br>
Pueden ser completados a mano antes de convertir a PDF.
<br>
De no ser completados, se completaran automáticamente con el valor del campo 'Por defecto' al final de la página.
</div>
<div
class=
"DataCard"
id=
"div_historico"
>
</div>
<div
class=
"PDFButtonContainerFixed"
>
<button
class=
"PDFButton"
onclick=
"window.open(
compile(
(new PDF2()).pdf( collectToConvert() ),
new jsPDF('portrait', 'pt', 'a4')
)
.output('bloburl')
)"
;
>
Pdf Informe
</button>
<img
id=
"maha"
src=
"{{ url_for('static', filename = 'assets/maha.png') }}"
style=
"display: none;"
>
</div>
<!--
<div class="PDFButtonContainerFixed">
<button class="PDFButton" id="boton_pdf_maha_reporte">
Linea 1
</button>
<button class="PDFButton" id="boton_pdf_maha_reporte2">
Linea 2
</button>
<button class="PDFButton" onclick=
"window.open(
compile(
(new PDF2()).pdf( collectToConvert() ),
new jsPDF('portrait', 'pt', 'a4')
)
.output('bloburl')
)";
>
Linea 2
</button>
<img id="maha" src="{{ url_for('static', filename = 'assets/maha2.png') }}" style="display: none;">
</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
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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