con web ui
This commit is contained in:
35
main.py
35
main.py
@@ -219,5 +219,40 @@ def info():
|
||||
click.echo(f" Iterations: {settings.benchmark.iterations}")
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--port",
|
||||
type=int,
|
||||
default=7860,
|
||||
help="Port to run the web interface on (default: 7860)"
|
||||
)
|
||||
@click.option(
|
||||
"--share",
|
||||
is_flag=True,
|
||||
help="Create a public share link (useful for remote access)"
|
||||
)
|
||||
def web(port, share):
|
||||
"""Launch web-based GUI for migration monitoring and control."""
|
||||
setup_logger("") # Configure root logger to show all module logs
|
||||
|
||||
try:
|
||||
from web_ui import launch_ui
|
||||
|
||||
click.echo(f"\n🚀 Starting Migration Dashboard on http://localhost:{port}")
|
||||
if share:
|
||||
click.echo("📡 Creating public share link...")
|
||||
|
||||
launch_ui(share=share, server_port=port)
|
||||
|
||||
except ImportError as e:
|
||||
click.echo(f"✗ Failed to import web_ui module: {e}", err=True)
|
||||
click.echo("Make sure gradio is installed: uv sync", err=True)
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
logger.error(f"Web interface failed: {e}")
|
||||
click.echo(f"✗ Web interface failed: {e}", err=True)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli(obj={})
|
||||
|
||||
Reference in New Issue
Block a user