fix(dashboard): resolved NameError and handled NoneType for media export
This commit is contained in:
parent
604a50ce17
commit
73735b0669
1 changed files with 95 additions and 89 deletions
|
|
@ -548,6 +548,7 @@ def main():
|
|||
|
||||
st.divider()
|
||||
|
||||
if selected_sub:
|
||||
# Export options
|
||||
st.subheader("📤 Export Data")
|
||||
|
||||
|
|
@ -626,7 +627,7 @@ def main():
|
|||
else:
|
||||
st.info(f"No media found for {selected_sub}. Run with `--mode full` to download media.")
|
||||
|
||||
with tab6:
|
||||
with tab_map["📋 Job History"]:
|
||||
st.header("📋 Job History")
|
||||
|
||||
try:
|
||||
|
|
@ -680,7 +681,7 @@ def main():
|
|||
st.error(f"Failed to load job history: {e}")
|
||||
st.info("Make sure the database is initialized.")
|
||||
|
||||
with tab7:
|
||||
with tab_map["🔌 Integrations"]:
|
||||
st.header("🔌 Integrations & Settings")
|
||||
|
||||
# REST API Section
|
||||
|
|
@ -789,11 +790,14 @@ def main():
|
|||
# Parquet Export
|
||||
st.subheader("📦 Parquet Export")
|
||||
|
||||
all_targets = available_data['subreddits'] + available_data['users']
|
||||
|
||||
col1, col2 = st.columns(2)
|
||||
with col1:
|
||||
export_sub = st.selectbox("Select subreddit to export", subreddits, key="parquet_export")
|
||||
export_sub = st.selectbox("Select target to export", all_targets, key="parquet_export")
|
||||
with col2:
|
||||
if st.button("📦 Export to Parquet"):
|
||||
if export_sub:
|
||||
target_name = export_sub.replace('r_', '').replace('u_', '')
|
||||
with st.spinner(f"Exporting {target_name} to Parquet..."):
|
||||
import subprocess
|
||||
|
|
@ -808,6 +812,8 @@ def main():
|
|||
st.code(result.stdout[-500:] if len(result.stdout) > 500 else result.stdout)
|
||||
else:
|
||||
st.error(f"❌ Export failed: {result.stderr}")
|
||||
else:
|
||||
st.error("Select a target first")
|
||||
|
||||
# List existing parquet files
|
||||
parquet_dir = Path("data/parquet")
|
||||
|
|
|
|||
Loading…
Reference in a new issue