Spaces:
Sleeping
Sleeping
Sync app from GitHub Actions
Browse files- src/ui/app_factory.py +32 -18
- src/ui/theme.py +45 -0
src/ui/app_factory.py
CHANGED
|
@@ -4421,7 +4421,7 @@ def create_app() -> gr.Blocks:
|
|
| 4421 |
interactive=False,
|
| 4422 |
allow_custom_value=True,
|
| 4423 |
)
|
| 4424 |
-
refresh_report_btn = gr.Button("Refresh dashboard", variant="primary")
|
| 4425 |
report_kpis = gr.HTML(value="")
|
| 4426 |
report_coverage_bars = gr.HTML(value=coverage_bars_html([]))
|
| 4427 |
report_validator_page = gr.State(value=1)
|
|
@@ -4429,17 +4429,17 @@ def create_app() -> gr.Blocks:
|
|
| 4429 |
report_validator_table = gr.HTML(
|
| 4430 |
value=paged_activity_html("Validator activity", ["Validator", "Validations"], []),
|
| 4431 |
)
|
| 4432 |
-
with gr.Row():
|
| 4433 |
-
report_validator_prev_btn = gr.Button("Previous validator page")
|
| 4434 |
-
report_validator_next_btn = gr.Button("Next validator page")
|
| 4435 |
report_recent_table = gr.HTML(
|
| 4436 |
value=paged_activity_html("Recent activity", ["Timestamp", "Validator", "Status", "Detection"], []),
|
| 4437 |
)
|
| 4438 |
-
with gr.Row():
|
| 4439 |
-
report_recent_prev_btn = gr.Button("Previous recent page")
|
| 4440 |
-
report_recent_next_btn = gr.Button("Next recent page")
|
| 4441 |
report_status = gr.Markdown("")
|
| 4442 |
-
with gr.Group(elem_classes=["bn-report-panel"]):
|
| 4443 |
gr.HTML(
|
| 4444 |
section_header_html(
|
| 4445 |
"Download",
|
|
@@ -4448,13 +4448,19 @@ def create_app() -> gr.Blocks:
|
|
| 4448 |
class_name="bn-panel-soft",
|
| 4449 |
)
|
| 4450 |
)
|
| 4451 |
-
with gr.Row():
|
| 4452 |
-
report_export_csv_btn = gr.Button("Download CSV", variant="primary")
|
| 4453 |
-
report_export_xlsx_btn = gr.Button("Download XLSX")
|
| 4454 |
report_export_status = gr.Markdown("")
|
| 4455 |
-
|
| 4456 |
-
|
| 4457 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4458 |
)
|
| 4459 |
|
| 4460 |
def _list_project_detections(project_slug: str) -> list[Detection]:
|
|
@@ -4664,15 +4670,23 @@ def create_app() -> gr.Blocks:
|
|
| 4664 |
inputs=[report_project_selector, report_validator_page, report_recent_page],
|
| 4665 |
outputs=[report_kpis, report_coverage_bars, report_validator_table, report_recent_table, report_validator_page, report_recent_page, report_status],
|
| 4666 |
)
|
| 4667 |
-
report_export_csv_btn.click(
|
| 4668 |
fn=lambda project_slug, session: _prepare_report_export(project_slug, "csv", session),
|
| 4669 |
inputs=[report_project_selector, session_state],
|
| 4670 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4671 |
)
|
| 4672 |
-
report_export_xlsx_btn.click(
|
| 4673 |
fn=lambda project_slug, session: _prepare_report_export(project_slug, "xlsx", session),
|
| 4674 |
inputs=[report_project_selector, session_state],
|
| 4675 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4676 |
)
|
| 4677 |
|
| 4678 |
# ===== TAB 6: Settings =====
|
|
|
|
| 4421 |
interactive=False,
|
| 4422 |
allow_custom_value=True,
|
| 4423 |
)
|
| 4424 |
+
refresh_report_btn = gr.Button("Refresh dashboard", variant="primary", elem_classes=["bn-clean-action"])
|
| 4425 |
report_kpis = gr.HTML(value="")
|
| 4426 |
report_coverage_bars = gr.HTML(value=coverage_bars_html([]))
|
| 4427 |
report_validator_page = gr.State(value=1)
|
|
|
|
| 4429 |
report_validator_table = gr.HTML(
|
| 4430 |
value=paged_activity_html("Validator activity", ["Validator", "Validations"], []),
|
| 4431 |
)
|
| 4432 |
+
with gr.Row(elem_classes=["bn-clean-button-row"]):
|
| 4433 |
+
report_validator_prev_btn = gr.Button("Previous validator page", elem_classes=["bn-clean-action"])
|
| 4434 |
+
report_validator_next_btn = gr.Button("Next validator page", elem_classes=["bn-clean-action"])
|
| 4435 |
report_recent_table = gr.HTML(
|
| 4436 |
value=paged_activity_html("Recent activity", ["Timestamp", "Validator", "Status", "Detection"], []),
|
| 4437 |
)
|
| 4438 |
+
with gr.Row(elem_classes=["bn-clean-button-row"]):
|
| 4439 |
+
report_recent_prev_btn = gr.Button("Previous recent page", elem_classes=["bn-clean-action"])
|
| 4440 |
+
report_recent_next_btn = gr.Button("Next recent page", elem_classes=["bn-clean-action"])
|
| 4441 |
report_status = gr.Markdown("")
|
| 4442 |
+
with gr.Group(elem_classes=["bn-report-panel", "bn-report-download-panel"]):
|
| 4443 |
gr.HTML(
|
| 4444 |
section_header_html(
|
| 4445 |
"Download",
|
|
|
|
| 4448 |
class_name="bn-panel-soft",
|
| 4449 |
)
|
| 4450 |
)
|
| 4451 |
+
with gr.Row(elem_classes=["bn-clean-button-row"]):
|
| 4452 |
+
report_export_csv_btn = gr.Button("Download CSV", variant="primary", elem_classes=["bn-clean-action"])
|
| 4453 |
+
report_export_xlsx_btn = gr.Button("Download XLSX", elem_classes=["bn-clean-action"])
|
| 4454 |
report_export_status = gr.Markdown("")
|
| 4455 |
+
report_export_csv_file = gr.DownloadButton(
|
| 4456 |
+
"Download prepared CSV",
|
| 4457 |
+
elem_id="bn-report-export-csv-download",
|
| 4458 |
+
elem_classes=["bn-autodownload-target"],
|
| 4459 |
+
)
|
| 4460 |
+
report_export_xlsx_file = gr.DownloadButton(
|
| 4461 |
+
"Download prepared XLSX",
|
| 4462 |
+
elem_id="bn-report-export-xlsx-download",
|
| 4463 |
+
elem_classes=["bn-autodownload-target"],
|
| 4464 |
)
|
| 4465 |
|
| 4466 |
def _list_project_detections(project_slug: str) -> list[Detection]:
|
|
|
|
| 4670 |
inputs=[report_project_selector, report_validator_page, report_recent_page],
|
| 4671 |
outputs=[report_kpis, report_coverage_bars, report_validator_table, report_recent_table, report_validator_page, report_recent_page, report_status],
|
| 4672 |
)
|
| 4673 |
+
report_export_csv_event = report_export_csv_btn.click(
|
| 4674 |
fn=lambda project_slug, session: _prepare_report_export(project_slug, "csv", session),
|
| 4675 |
inputs=[report_project_selector, session_state],
|
| 4676 |
+
outputs=[report_export_csv_file, report_export_status],
|
| 4677 |
+
)
|
| 4678 |
+
report_export_csv_event.then(
|
| 4679 |
+
fn=None,
|
| 4680 |
+
js="() => document.querySelector('#bn-report-export-csv-download button, #bn-report-export-csv-download')?.click()",
|
| 4681 |
)
|
| 4682 |
+
report_export_xlsx_event = report_export_xlsx_btn.click(
|
| 4683 |
fn=lambda project_slug, session: _prepare_report_export(project_slug, "xlsx", session),
|
| 4684 |
inputs=[report_project_selector, session_state],
|
| 4685 |
+
outputs=[report_export_xlsx_file, report_export_status],
|
| 4686 |
+
)
|
| 4687 |
+
report_export_xlsx_event.then(
|
| 4688 |
+
fn=None,
|
| 4689 |
+
js="() => document.querySelector('#bn-report-export-xlsx-download button, #bn-report-export-xlsx-download')?.click()",
|
| 4690 |
)
|
| 4691 |
|
| 4692 |
# ===== TAB 6: Settings =====
|
src/ui/theme.py
CHANGED
|
@@ -586,6 +586,18 @@ body,
|
|
| 586 |
background: #ffffff !important;
|
| 587 |
}
|
| 588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 589 |
.bn-card-body {
|
| 590 |
border: 1px solid var(--bn-border) !important;
|
| 591 |
border-radius: 8px !important;
|
|
@@ -624,6 +636,21 @@ button.bn-soft-action:hover {
|
|
| 624 |
background: #bfdbfe !important;
|
| 625 |
}
|
| 626 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 627 |
.bn-admin-panel button.secondary:not(.bn-delete-project-action),
|
| 628 |
.bn-admin-panel button.lg.secondary:not(.bn-delete-project-action) {
|
| 629 |
border: 1px solid #93c5fd !important;
|
|
@@ -665,6 +692,24 @@ button.bn-soft-action:hover {
|
|
| 665 |
font-weight: 790 !important;
|
| 666 |
}
|
| 667 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 668 |
.bn-media-panel .gradio-image,
|
| 669 |
.bn-media-panel .gradio-audio {
|
| 670 |
border-radius: 8px !important;
|
|
|
|
| 586 |
background: #ffffff !important;
|
| 587 |
}
|
| 588 |
|
| 589 |
+
.bn-admin-panel .block:has(button),
|
| 590 |
+
.bn-admin-panel .form:has(button),
|
| 591 |
+
.bn-report-panel .block:has(button),
|
| 592 |
+
.bn-report-panel .form:has(button),
|
| 593 |
+
.bn-clean-button-row,
|
| 594 |
+
.bn-clean-button-row .block,
|
| 595 |
+
.bn-clean-button-row .form,
|
| 596 |
+
.bn-clean-action,
|
| 597 |
+
.bn-soft-action {
|
| 598 |
+
background: transparent !important;
|
| 599 |
+
}
|
| 600 |
+
|
| 601 |
.bn-card-body {
|
| 602 |
border: 1px solid var(--bn-border) !important;
|
| 603 |
border-radius: 8px !important;
|
|
|
|
| 636 |
background: #bfdbfe !important;
|
| 637 |
}
|
| 638 |
|
| 639 |
+
.bn-clean-action button.secondary,
|
| 640 |
+
button.bn-clean-action.secondary {
|
| 641 |
+
border: 1px solid #93c5fd !important;
|
| 642 |
+
border-radius: 8px !important;
|
| 643 |
+
background: #dbeafe !important;
|
| 644 |
+
color: #075985 !important;
|
| 645 |
+
font-weight: 760 !important;
|
| 646 |
+
}
|
| 647 |
+
|
| 648 |
+
.bn-clean-action button.secondary:hover,
|
| 649 |
+
button.bn-clean-action.secondary:hover {
|
| 650 |
+
border-color: #60a5fa !important;
|
| 651 |
+
background: #bfdbfe !important;
|
| 652 |
+
}
|
| 653 |
+
|
| 654 |
.bn-admin-panel button.secondary:not(.bn-delete-project-action),
|
| 655 |
.bn-admin-panel button.lg.secondary:not(.bn-delete-project-action) {
|
| 656 |
border: 1px solid #93c5fd !important;
|
|
|
|
| 692 |
font-weight: 790 !important;
|
| 693 |
}
|
| 694 |
|
| 695 |
+
.bn-report-download-panel,
|
| 696 |
+
.bn-report-download-panel .block,
|
| 697 |
+
.bn-report-download-panel .form {
|
| 698 |
+
background: #ffffff !important;
|
| 699 |
+
}
|
| 700 |
+
|
| 701 |
+
.bn-report-download-panel {
|
| 702 |
+
margin-top: 12px;
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
.bn-autodownload-target {
|
| 706 |
+
position: absolute !important;
|
| 707 |
+
width: 1px !important;
|
| 708 |
+
height: 1px !important;
|
| 709 |
+
overflow: hidden !important;
|
| 710 |
+
clip-path: inset(50%) !important;
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
.bn-media-panel .gradio-image,
|
| 714 |
.bn-media-panel .gradio-audio {
|
| 715 |
border-radius: 8px !important;
|