Spaces:
Sleeping
Sleeping
Pointf5ive commited on
Commit Β·
a38f6a7
1
Parent(s): 7152efa
Fix runtime crash on unsupported show_copy_button
Browse files- smoke_signal_tab.py +24 -3
smoke_signal_tab.py
CHANGED
|
@@ -2398,9 +2398,16 @@ def smoke_signal_tab():
|
|
| 2398 |
interactive=False,
|
| 2399 |
wrap=True,
|
| 2400 |
)
|
| 2401 |
-
ingest_log = gr.Textbox(label="Log", lines=6, interactive=False, elem_classes=["ss-log"]
|
|
|
|
| 2402 |
refresh_btn = gr.Button("β» Refresh Manifest", size="sm")
|
| 2403 |
refresh_btn.click(lambda: load_manifest_df(), outputs=[manifest_table])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2404 |
|
| 2405 |
gr.Markdown("**Update rights class for existing book:**")
|
| 2406 |
with gr.Row():
|
|
@@ -2449,9 +2456,16 @@ def smoke_signal_tab():
|
|
| 2449 |
|
| 2450 |
profile_status = gr.HTML(_profile_status_html())
|
| 2451 |
profile_btn = gr.Button("Re-run Profiler (Optional) β", elem_classes=["ss-btn-run"])
|
| 2452 |
-
profile_log = gr.Textbox(label="Log", lines=10, interactive=False, elem_classes=["ss-log"]
|
|
|
|
| 2453 |
|
| 2454 |
profile_btn.click(run_profile, outputs=[profile_status, profile_log])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2455 |
|
| 2456 |
# ββ STEP 3: OCR βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 2457 |
with gr.TabItem("β’ OCR", id="ss-ocr") as ocr_tab:
|
|
@@ -2487,7 +2501,14 @@ def smoke_signal_tab():
|
|
| 2487 |
value=True,
|
| 2488 |
)
|
| 2489 |
ocr_btn = gr.Button("Run OCR β", elem_classes=["ss-btn-run"])
|
| 2490 |
-
ocr_log = gr.Textbox(label="Log", lines=10, interactive=False, elem_classes=["ss-log"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2491 |
|
| 2492 |
ocr_run_event = ocr_btn.click(
|
| 2493 |
run_ocr,
|
|
|
|
| 2398 |
interactive=False,
|
| 2399 |
wrap=True,
|
| 2400 |
)
|
| 2401 |
+
ingest_log = gr.Textbox(label="Log", lines=6, interactive=False, elem_classes=["ss-log"])
|
| 2402 |
+
ingest_copy_log_btn = gr.Button("Copy Log", size="sm")
|
| 2403 |
refresh_btn = gr.Button("β» Refresh Manifest", size="sm")
|
| 2404 |
refresh_btn.click(lambda: load_manifest_df(), outputs=[manifest_table])
|
| 2405 |
+
ingest_copy_log_btn.click(
|
| 2406 |
+
fn=None,
|
| 2407 |
+
inputs=[ingest_log],
|
| 2408 |
+
outputs=[],
|
| 2409 |
+
js="(logTxt) => { if (navigator && navigator.clipboard) { navigator.clipboard.writeText(logTxt || ''); } return []; }",
|
| 2410 |
+
)
|
| 2411 |
|
| 2412 |
gr.Markdown("**Update rights class for existing book:**")
|
| 2413 |
with gr.Row():
|
|
|
|
| 2456 |
|
| 2457 |
profile_status = gr.HTML(_profile_status_html())
|
| 2458 |
profile_btn = gr.Button("Re-run Profiler (Optional) β", elem_classes=["ss-btn-run"])
|
| 2459 |
+
profile_log = gr.Textbox(label="Log", lines=10, interactive=False, elem_classes=["ss-log"])
|
| 2460 |
+
profile_copy_log_btn = gr.Button("Copy Log", size="sm")
|
| 2461 |
|
| 2462 |
profile_btn.click(run_profile, outputs=[profile_status, profile_log])
|
| 2463 |
+
profile_copy_log_btn.click(
|
| 2464 |
+
fn=None,
|
| 2465 |
+
inputs=[profile_log],
|
| 2466 |
+
outputs=[],
|
| 2467 |
+
js="(logTxt) => { if (navigator && navigator.clipboard) { navigator.clipboard.writeText(logTxt || ''); } return []; }",
|
| 2468 |
+
)
|
| 2469 |
|
| 2470 |
# ββ STEP 3: OCR βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 2471 |
with gr.TabItem("β’ OCR", id="ss-ocr") as ocr_tab:
|
|
|
|
| 2501 |
value=True,
|
| 2502 |
)
|
| 2503 |
ocr_btn = gr.Button("Run OCR β", elem_classes=["ss-btn-run"])
|
| 2504 |
+
ocr_log = gr.Textbox(label="Log", lines=10, interactive=False, elem_classes=["ss-log"])
|
| 2505 |
+
ocr_copy_log_btn = gr.Button("Copy Log", size="sm")
|
| 2506 |
+
ocr_copy_log_btn.click(
|
| 2507 |
+
fn=None,
|
| 2508 |
+
inputs=[ocr_log],
|
| 2509 |
+
outputs=[],
|
| 2510 |
+
js="(logTxt) => { if (navigator && navigator.clipboard) { navigator.clipboard.writeText(logTxt || ''); } return []; }",
|
| 2511 |
+
)
|
| 2512 |
|
| 2513 |
ocr_run_event = ocr_btn.click(
|
| 2514 |
run_ocr,
|