Commit 81f7b6f4 by Tu Nombre

historico

1 parent e851536d
...@@ -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":
......
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'));
});
}
<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
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!