Update app.py
Browse files
app.py
CHANGED
|
@@ -384,7 +384,7 @@ def create_interface():
|
|
| 384 |
)
|
| 385 |
|
| 386 |
# Auto-refresh do mapa
|
| 387 |
-
gr.Timer(30.0, get_updated_map, [], [map_html]
|
| 388 |
|
| 389 |
# Aba 3: Lista de Dispositivos
|
| 390 |
with gr.TabItem("📋 Lista de Dispositivos"):
|
|
@@ -403,11 +403,7 @@ def create_interface():
|
|
| 403 |
)
|
| 404 |
|
| 405 |
# Auto-refresh da tabela
|
| 406 |
-
|
| 407 |
-
get_device_list,
|
| 408 |
-
outputs=devices_table,
|
| 409 |
-
every=30
|
| 410 |
-
)
|
| 411 |
|
| 412 |
# Aba 4: Estatísticas
|
| 413 |
with gr.TabItem("📊 Estatísticas"):
|
|
@@ -422,11 +418,7 @@ def create_interface():
|
|
| 422 |
)
|
| 423 |
|
| 424 |
# Auto-refresh das estatísticas
|
| 425 |
-
|
| 426 |
-
get_statistics,
|
| 427 |
-
outputs=stats_display,
|
| 428 |
-
every=60
|
| 429 |
-
)
|
| 430 |
|
| 431 |
# Aba 5: Administração
|
| 432 |
with gr.TabItem("⚙️ Administração"):
|
|
@@ -483,10 +475,4 @@ def create_interface():
|
|
| 483 |
# Executar aplicação
|
| 484 |
if __name__ == "__main__":
|
| 485 |
demo = create_interface()
|
| 486 |
-
demo.launch(
|
| 487 |
-
server_name="0.0.0.0", # Permite acesso de outros dispositivos na rede
|
| 488 |
-
server_port=7860, # Porta padrão do Gradio
|
| 489 |
-
share=False, # True para criar link público temporário
|
| 490 |
-
debug=True,
|
| 491 |
-
show_error=True
|
| 492 |
-
)
|
|
|
|
| 384 |
)
|
| 385 |
|
| 386 |
# Auto-refresh do mapa
|
| 387 |
+
gr.Timer(30.0, get_updated_map, [], [map_html])
|
| 388 |
|
| 389 |
# Aba 3: Lista de Dispositivos
|
| 390 |
with gr.TabItem("📋 Lista de Dispositivos"):
|
|
|
|
| 403 |
)
|
| 404 |
|
| 405 |
# Auto-refresh da tabela
|
| 406 |
+
gr.Timer(30.0, get_device_list, [], [devices_table])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 407 |
|
| 408 |
# Aba 4: Estatísticas
|
| 409 |
with gr.TabItem("📊 Estatísticas"):
|
|
|
|
| 418 |
)
|
| 419 |
|
| 420 |
# Auto-refresh das estatísticas
|
| 421 |
+
gr.Timer(60.0, get_statistics, [], [stats_display])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
|
| 423 |
# Aba 5: Administração
|
| 424 |
with gr.TabItem("⚙️ Administração"):
|
|
|
|
| 475 |
# Executar aplicação
|
| 476 |
if __name__ == "__main__":
|
| 477 |
demo = create_interface()
|
| 478 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|