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
10 months ago
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Auto actualizacion andando
1 parent
9deeb531
Hide 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
=
{
"token"
:
"sdñÑREgerqw3$E#]ÑgdfbversdfFfew435"
,
"url"
:
"https://validacion.hgtsa.com.ar/api_rto/diaria"
,
...
...
@@ -24,22 +24,51 @@ document.addEventListener('DOMContentLoaded', () => {
.
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
;
div
.
textContent
=
inspeccion
.
name
+
" "
+
inspeccion
.
resultado
+
" "
+
inspeccion
.
fecha
+
" "
;
const
button
=
document
.
createElement
(
'button'
);
button
.
className
=
'PDFButton'
;
button
.
id
=
inspeccion
.
name
;
button
.
textContent
=
'
ir historico
'
;
button
.
textContent
=
'
Ir dominio
'
;
div
.
appendChild
(
button
);
historicoDiv
.
appendChild
(
div
);
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
();
});
This diff is collapsed.
Click to expand it.
templates/form.html
View file @
4079da6
...
...
@@ -220,11 +220,16 @@
<button
class=
"PDFButton"
onclick=
"collectToSearch('data')"
>
Ticket Fosa
</button>
<button
class=
"PDFButton"
onclick=
"location.href='/historico'"
>
Historico
</button>
</div>
<button
class=
"PDFButton loginB"
onclick=
"location.href='/login'"
>
Login
</button>
</div>
<div
id=
"message"
class=
"MessageContainer"
onclick=
"this.style.display = 'none'"
style=
"display: none;"
>
<div
class=
"Message"
style=
"text-align: center;"
>
...
...
This diff is collapsed.
Click to expand it.
templates/historico.html
View file @
4079da6
...
...
@@ -24,43 +24,11 @@
</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
class=
"PDFButton"
onclick=
"location.href='/'"
>
Carga
</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>
...
...
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