Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -284,17 +284,25 @@ theme = gr.themes.Default(
|
|
284 |
# --- Interface Gradio ---
|
285 |
with gr.Blocks(theme=theme) as interface:
|
286 |
gr.Markdown("# Processamento de Relat贸rios de Tarefas")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
with gr.Row(): # Crie uma nova linha para os bot玫es
|
288 |
download_html_btn = gr.Button("Baixar Relat贸rio HTML")
|
289 |
download_pdf_btn = gr.Button("Baixar Relat贸rio PDF")
|
290 |
-
pdf_output = gr.File(label="Download PDF Report", visible=False, elem_id="pdf_output")
|
291 |
|
292 |
def wrapper(html_file, excel_files):
|
293 |
html_content, html_path, pdf_path = processar_relatorio(html_file, excel_files)
|
294 |
-
return
|
295 |
-
output_html: html_content,
|
296 |
-
pdf_output: pdf_path, # Retorna o caminho do PDF para o componente oculto
|
297 |
-
}
|
298 |
|
299 |
generate_btn.click(
|
300 |
fn=wrapper,
|
|
|
284 |
# --- Interface Gradio ---
|
285 |
with gr.Blocks(theme=theme) as interface:
|
286 |
gr.Markdown("# Processamento de Relat贸rios de Tarefas")
|
287 |
+
with gr.Row():
|
288 |
+
with gr.Column():
|
289 |
+
gr.Markdown("## Arquivo HTML (alunos.htm)")
|
290 |
+
html_file = gr.File(label="Arraste o arquivo .htm aqui", type="binary")
|
291 |
+
with gr.Column():
|
292 |
+
gr.Markdown("## Arquivos Excel (Relat贸rios de Tarefas)")
|
293 |
+
excel_files = gr.Files(label="Arraste os arquivos .xlsx aqui", type="binary", file_count="multiple")
|
294 |
+
|
295 |
+
generate_btn = gr.Button("Gerar Relat贸rio", variant="primary") # Destaque no bot茫o
|
296 |
+
output_html = gr.HTML()
|
297 |
+
pdf_output = gr.File(label="Download PDF Report", visible=False, elem_id="pdf_output")
|
298 |
+
|
299 |
with gr.Row(): # Crie uma nova linha para os bot玫es
|
300 |
download_html_btn = gr.Button("Baixar Relat贸rio HTML")
|
301 |
download_pdf_btn = gr.Button("Baixar Relat贸rio PDF")
|
|
|
302 |
|
303 |
def wrapper(html_file, excel_files):
|
304 |
html_content, html_path, pdf_path = processar_relatorio(html_file, excel_files)
|
305 |
+
return html_content, html_path, pdf_path
|
|
|
|
|
|
|
306 |
|
307 |
generate_btn.click(
|
308 |
fn=wrapper,
|