Edge Case fixes, bug fixes, and UI Cleanup.
Build Docker Image / docker (push) Successful in 6s

This commit is contained in:
2026-04-09 11:21:23 -07:00
parent 8667f547e6
commit 0e410a1f6c
5 changed files with 256 additions and 6 deletions
+22 -4
View File
@@ -137,6 +137,7 @@ def render_sitemap_tab() -> None:
st.info("Run a crawl to generate a sitemap CSV.")
return
sitemap_builder = get_sitemap_module()
summary = result_data["summary"]
csv_path = Path(result_data["output_path"])
state_path = Path(result_data["state_path"])
@@ -184,6 +185,19 @@ def render_sitemap_tab() -> None:
mime="text/plain",
)
cleanup_targets = [path for path in (csv_path, state_path, log_path) if path.exists()]
if cleanup_targets:
st.caption("Cleanup removes the sitemap CSV, crawl state, and crawl log for this run.")
if st.button("Delete Crawl Files"):
removed_paths = sitemap_builder.cleanup_run_files(csv_path)
st.session_state.pop("sitemap_result", None)
if removed_paths:
removed_names = ", ".join(path.name for path in removed_paths)
st.success(f"Deleted: {removed_names}")
else:
st.info("No crawl files were present to delete.")
return
crawl_output = (result_data.get("stdout") or "").strip()
if crawl_output:
st.text_area("Crawler Output", value=crawl_output, height=220, disabled=True)
@@ -196,12 +210,16 @@ def render_sitemap_tab() -> None:
def main() -> None:
st.set_page_config(page_title="WDW Tools", layout="wide")
st.header("WDW Sitemap And Import Tools")
sitemap_tab, importer_tab = st.tabs(["Sitemap Generator", "Page Importer"])
selected_tool = st.radio(
"Tool",
["Sitemap Generator", "Page Importer"],
horizontal=True,
label_visibility="collapsed",
)
with sitemap_tab:
if selected_tool == "Sitemap Generator":
render_sitemap_tab()
with importer_tab:
else:
page_importer_app = get_page_importer_module()
page_importer_app.render_app()