fix: Remove hardcoded ports, support custom port configuration

- Replace all hardcoded localhost:8000/3000/8501 with environment variables
- Frontend: Use API_PORT env var in next.config.ts
- Backend: Use API_PORT env var in editor.py and quality.py
- Web UI: Use API_PORT and EDITOR_PORT env vars in all Streamlit pages
- Update dev.sh to pass environment variables to all services
- Add .env.example with port configuration template

Now supports custom ports via environment variables:
  API_PORT=8080 EDITOR_PORT=3001 WEB_PORT=8502 ./dev.sh

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-01-10 16:13:02 +08:00
parent 6bf16936af
commit 3f59b324ad
8 changed files with 61 additions and 18 deletions

View File

@@ -33,6 +33,9 @@ from web.components.header import render_header
from web.i18n import tr
from web.utils.async_helpers import run_async
# Get ports from environment
EDITOR_PORT = os.getenv("EDITOR_PORT", "3000")
# Page config
st.set_page_config(
page_title="History - Pixelle-Video",
@@ -363,7 +366,7 @@ def render_task_detail_modal(task_id: str, pixelle_video):
)
# Open in Editor button
editor_url = f"http://localhost:3000/editor?storyboard_id={task_id}"
editor_url = f"http://localhost:{EDITOR_PORT}/editor?storyboard_id={task_id}"
st.markdown(
f'''
<a href="{editor_url}" target="_blank" style="text-decoration: none;">