Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -491,69 +491,69 @@ class ReportGenerator:
|
|
491 |
logging.error(f"Erro no processamento: {str(e)}")
|
492 |
raise
|
493 |
|
494 |
-
# Interface Gradio
|
495 |
-
theme = gr.themes.Default(
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
)
|
501 |
|
502 |
-
with gr.Blocks(theme=theme) as interface:
|
503 |
-
|
504 |
-
|
505 |
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
|
533 |
-
|
534 |
-
|
535 |
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
|
558 |
if __name__ == "__main__":
|
559 |
interface.launch(
|
|
|
491 |
logging.error(f"Erro no processamento: {str(e)}")
|
492 |
raise
|
493 |
|
494 |
+
# Interface Gradio
|
495 |
+
theme = gr.themes.Default(
|
496 |
+
primary_hue="blue",
|
497 |
+
secondary_hue="gray",
|
498 |
+
font=["Arial", "sans-serif"],
|
499 |
+
font_mono=["Courier New", "monospace"],
|
500 |
+
)
|
501 |
|
502 |
+
with gr.Blocks(theme=theme) as interface:
|
503 |
+
gr.Markdown("""
|
504 |
+
# Sistema de Análise de Desempenho Acadêmico
|
505 |
|
506 |
+
Este sistema analisa o desempenho dos alunos e gera um relatório detalhado com:
|
507 |
+
- Análise estatística completa
|
508 |
+
- Visualizações gráficas
|
509 |
+
- Recomendações personalizadas
|
510 |
+
""")
|
511 |
|
512 |
+
with gr.Row():
|
513 |
+
with gr.Column():
|
514 |
+
gr.Markdown("## Lista de Alunos")
|
515 |
+
html_file = gr.File(
|
516 |
+
label="Arquivo HTML com lista de alunos (.htm)",
|
517 |
+
type="binary",
|
518 |
+
file_types=[".htm", ".html"]
|
519 |
+
)
|
520 |
|
521 |
+
with gr.Column():
|
522 |
+
gr.Markdown("## Relatórios de Tarefas")
|
523 |
+
excel_files = gr.Files(
|
524 |
+
label="Arquivos Excel com dados das tarefas (.xlsx)",
|
525 |
+
type="binary",
|
526 |
+
file_count="multiple",
|
527 |
+
file_types=[".xlsx"]
|
528 |
+
)
|
529 |
+
|
530 |
+
with gr.Row():
|
531 |
+
generate_btn = gr.Button("Gerar Relatório", variant="primary", size="lg")
|
532 |
|
533 |
+
with gr.Row():
|
534 |
+
output_html = gr.HTML()
|
535 |
|
536 |
+
with gr.Row():
|
537 |
+
with gr.Column():
|
538 |
+
download_html_btn = gr.File(
|
539 |
+
label="Download Relatório HTML",
|
540 |
+
type="filepath",
|
541 |
+
interactive=False
|
542 |
+
)
|
543 |
+
with gr.Column():
|
544 |
+
download_pdf_btn = gr.File(
|
545 |
+
label="Download Relatório PDF",
|
546 |
+
type="filepath",
|
547 |
+
interactive=False
|
548 |
+
)
|
549 |
+
|
550 |
+
# Conectar eventos
|
551 |
+
generate_btn.click(
|
552 |
+
fn=process_files,
|
553 |
+
inputs=[html_file, excel_files],
|
554 |
+
outputs=[output_html, download_html_btn, download_pdf_btn],
|
555 |
+
api_name="generate_report"
|
556 |
+
)
|
557 |
|
558 |
if __name__ == "__main__":
|
559 |
interface.launch(
|