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 f9473c3a
authored
2024-07-31 10:47:49 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
boton de ir anda logica de manejo de objeto
1 parent
daa8f0c1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
5 deletions
.gitignore
main.py
protected_static/historico.js
tareas
.gitignore
View file @
f9473c3
...
@@ -5,3 +5,4 @@ test.py
...
@@ -5,3 +5,4 @@ test.py
*.pdf
*.pdf
users.json
users.json
static/css/cmu-typewriter
static/css/cmu-typewriter
*.swp
main.py
View file @
f9473c3
...
@@ -219,6 +219,15 @@ def anomalies():
...
@@ -219,6 +219,15 @@ def anomalies():
return
render_template
(
"anomalies.html"
,
anomalies
=
anom
)
return
render_template
(
"anomalies.html"
,
anomalies
=
anom
)
@app.route
(
'/report_static'
,
methods
=
[
'POST'
])
def
ReporteEstatico
():
if
"login"
not
in
request
.
cookies
:
return
redirect
(
url_for
(
"login"
))
return
json
.
dumps
(
answer
)
@app.route
(
'/report'
,
methods
=
[
'POST'
])
@app.route
(
'/report'
,
methods
=
[
'POST'
])
def
report
():
def
report
():
if
"login"
not
in
request
.
cookies
:
if
"login"
not
in
request
.
cookies
:
...
...
protected_static/historico.js
View file @
f9473c3
...
@@ -28,20 +28,32 @@ function CargarLista() {
...
@@ -28,20 +28,32 @@ function CargarLista() {
// Function to create the list items
// Function to create the list items
function
createHistoricoList
(
data
)
{
function
createHistoricoList
(
data
)
{
//console.log(data)
const
historicoDiv
=
document
.
getElementById
(
'div_historico'
);
const
historicoDiv
=
document
.
getElementById
(
'div_historico'
);
historicoDiv
.
innerHTML
=
""
;
historicoDiv
.
innerHTML
=
""
;
//historicoDiv.innerText = "Dominios del dia"
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
// Crear un campo oculto para almacenar el objeto data como JSON string
const
hiddenInput
=
document
.
createElement
(
'input'
);
hiddenInput
.
type
=
'hidden'
;
hiddenInput
.
id
=
inspeccion
.
numeroplanilla
+
'data-json'
;
hiddenInput
.
value
=
JSON
.
stringify
(
inspeccion
);
//historicoDiv.appendChild(hiddenInput);
const
button
=
document
.
createElement
(
'button'
);
const
button
=
document
.
createElement
(
'button'
);
button
.
className
=
'PDFButton'
;
button
.
className
=
'PDFButton'
;
button
.
id
=
inspeccion
.
n
ame
;
button
.
id
=
inspeccion
.
n
umeroplanilla
;
button
.
textContent
=
'Ir dominio '
;
button
.
textContent
=
'Ir dominio '
;
button
.
addEventListener
(
'click'
,
()
=>
{
handleButtonClick
(
inspeccion
);
});
const
div
=
document
.
createElement
(
'div'
);
const
div
=
document
.
createElement
(
'div'
);
//div.textContent = inspeccion.name + " " + inspeccion.resultado + " " + inspeccion.fecha + " ";
const
titulo
=
document
.
createElement
(
'H4'
);
const
titulo
=
document
.
createElement
(
'H4'
);
titulo
.
textContent
=
inspeccion
.
name
+
" "
+
inspeccion
.
resultado
;
titulo
.
textContent
=
inspeccion
.
name
+
" "
+
inspeccion
.
resultado
;
const
ftl
=
document
.
createElement
(
'H6'
);
const
ftl
=
document
.
createElement
(
'H6'
);
ftl
.
textContent
=
"Linea "
+
inspeccion
.
linea
+
", Planilla "
+
inspeccion
.
numeroplanilla
+
", Categoria "
+
inspeccion
.
categoria
;
ftl
.
textContent
=
"Linea "
+
inspeccion
.
linea
+
", Planilla "
+
inspeccion
.
numeroplanilla
+
", Categoria "
+
inspeccion
.
categoria
;
...
@@ -49,13 +61,21 @@ function createHistoricoList(data) {
...
@@ -49,13 +61,21 @@ function createHistoricoList(data) {
div
.
appendChild
(
titulo
);
div
.
appendChild
(
titulo
);
div
.
appendChild
(
ftl
);
div
.
appendChild
(
ftl
);
div
.
appendChild
(
button
);
div
.
appendChild
(
button
);
const
separador
=
document
.
createElement
(
'hr'
)
div
.
appendChild
(
hiddenInput
);
const
separador
=
document
.
createElement
(
'hr'
);
separador
.
className
=
'custom-hr'
;
separador
.
className
=
'custom-hr'
;
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
separador
);
historicoDiv
.
appendChild
(
separador
);
});
});
}
}
function
handleButtonClick
(
inspeccion
)
{
// Aquí puedes definir lo que quieres que suceda cuando se haga clic en el botón
console
.
log
(
'Botón clicado para:'
,
inspeccion
);
// Por ejemplo, podrías redirigir a una página basada en el dominio de inspección
// window.location.href = `http://ejemplo.com/dominio/${inspeccion.name}`;
}
const
chatUrl
=
'https://api.hgt.com.ar/poll/rto_50_update/dewfrfgbeolkgkteprlk,hptrlk,hqff'
;
const
chatUrl
=
'https://api.hgt.com.ar/poll/rto_50_update/dewfrfgbeolkgkteprlk,hptrlk,hqff'
;
let
pendingRequests
=
0
;
let
pendingRequests
=
0
;
...
...
tareas
0 → 100644
View file @
f9473c3
1 - acceder desde historico o desde buscador a los datos
Hay dos tipos de accesos inspeccionado y no inspeccionados
Inspeccionados, trae los datos de laika
No inspeccionado lanza el motor local
* Separa funcion report para reutilizar pasando datos externos
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