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 4079da6d
authored
2024-07-22 10:18:11 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Auto actualizacion andando
1 parent
9deeb531
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
38 deletions
static/src/historico.js
templates/form.html
templates/historico.html
static/src/historico.js
View file @
4079da6
document
.
addEventListener
(
'DOMContentLoaded'
,
()
=>
{
function
CargarLista
()
{
const
requestData
=
{
const
requestData
=
{
"token"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"token"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"url"
:
"https://validacion.hgtsa.com.ar/api_rto/diaria"
,
"url"
:
"https://validacion.hgtsa.com.ar/api_rto/diaria"
,
...
@@ -24,22 +24,51 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -24,22 +24,51 @@ document.addEventListener('DOMContentLoaded', () => {
.
catch
(
error
=>
{
.
catch
(
error
=>
{
console
.
error
(
'Error:'
,
error
);
console
.
error
(
'Error:'
,
error
);
});
});
}
)
;
};
// Function to create the list items
// Function to create the list items
function
createHistoricoList
(
data
)
{
function
createHistoricoList
(
data
)
{
const
historicoDiv
=
document
.
getElementById
(
'div_historico'
);
const
historicoDiv
=
document
.
getElementById
(
'div_historico'
);
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
const
div
=
document
.
createElement
(
'div'
);
const
div
=
document
.
createElement
(
'div'
);
div
.
textContent
=
inspeccion
.
name
;
div
.
textContent
=
inspeccion
.
name
+
" "
+
inspeccion
.
resultado
+
" "
+
inspeccion
.
fecha
+
" "
;
const
button
=
document
.
createElement
(
'button'
);
const
button
=
document
.
createElement
(
'button'
);
button
.
className
=
'PDFButton'
;
button
.
className
=
'PDFButton'
;
button
.
id
=
inspeccion
.
name
;
button
.
id
=
inspeccion
.
name
;
button
.
textContent
=
'
ir historico
'
;
button
.
textContent
=
'
Ir dominio
'
;
div
.
appendChild
(
button
);
div
.
appendChild
(
button
);
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
document
.
createElement
(
'br'
));
historicoDiv
.
appendChild
(
document
.
createElement
(
'br'
));
});
});
}
}
const
chatUrl
=
'https://api.hgt.com.ar/poll/rto_061_update/dewfrfgbeolkgkteprlk,hptrlk,hqff'
;
let
pendingRequests
=
0
;
async
function
fetchChat
()
{
while
(
true
)
{
try
{
const
response
=
await
fetch
(
chatUrl
);
const
data
=
await
response
.
json
();
if
(
data
.
proccess
===
true
)
{
// Agregamos el mensaje al div id="chat-messages" debajo del último mensaje
//alert("se deve actualizar")
CargarLista
();
}
}
catch
(
error
)
{
// Si ocurre un error, esperamos 5 segundos antes de volver a intentarlo
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
5000
));
}
}
}
window
.
addEventListener
(
'load'
,
()
=>
{
CargarLista
();
fetchChat
();
});
templates/form.html
View file @
4079da6
...
@@ -220,11 +220,16 @@
...
@@ -220,11 +220,16 @@
<button
class=
"PDFButton"
onclick=
"collectToSearch('data')"
>
<button
class=
"PDFButton"
onclick=
"collectToSearch('data')"
>
Ticket Fosa
Ticket Fosa
</button>
</button>
<button
class=
"PDFButton"
onclick=
"location.href='/historico'"
>
Historico
</button>
</div>
</div>
<button
class=
"PDFButton loginB"
onclick=
"location.href='/login'"
>
<button
class=
"PDFButton loginB"
onclick=
"location.href='/login'"
>
Login
Login
</button>
</button>
</div>
</div>
<div
id=
"message"
class=
"MessageContainer"
onclick=
"this.style.display = 'none'"
style=
"display: none;"
>
<div
id=
"message"
class=
"MessageContainer"
onclick=
"this.style.display = 'none'"
style=
"display: none;"
>
<div
class=
"Message"
style=
"text-align: center;"
>
<div
class=
"Message"
style=
"text-align: center;"
>
...
...
templates/historico.html
View file @
4079da6
...
@@ -24,43 +24,11 @@
...
@@ -24,43 +24,11 @@
</div>
</div>
<div
class=
"PDFButtonContainerFixed"
>
<div
class=
"PDFButtonContainerFixed"
>
<button
class=
"PDFButton"
onclick=
<button
class=
"PDFButton"
onclick=
"location.href='/'"
>
"window.open(
Carga
compile(
(new PDF2()).pdf( collectToConvert() ),
new jsPDF('portrait', 'pt', 'a4')
)
.output('bloburl')
)"
;
>
Pdf Informe
</button>
</button>
<img
id=
"maha"
src=
"{{ url_for('static', filename = 'assets/maha.png') }}"
style=
"display: none;"
>
</div>
</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>
...
...
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