mirror of
https://github.com/babysor/MockingBird.git
synced 2024-03-22 13:11:31 +08:00
feat: support colab web ui
This commit is contained in:
parent
4892b2e2d4
commit
459cc1162a
9
web.py
9
web.py
@ -1,9 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
import typer
|
||||
from pyngrok import ngrok
|
||||
|
||||
cli = typer.Typer()
|
||||
|
||||
|
||||
@cli.command()
|
||||
def launch(port: int = typer.Option(2023, "--port", "-p")) -> None:
|
||||
"""Start a graphical UI server for the opyrator.
|
||||
@ -15,7 +17,14 @@ def launch(port: int = typer.Option(2023, "--port", "-p")) -> None:
|
||||
sys.path.append(os.getcwd())
|
||||
|
||||
from control.mkgui.base.ui.streamlit_ui import launch_ui
|
||||
|
||||
launch_ui(port)
|
||||
|
||||
# Setup a tunnel to the streamlit port 2023
|
||||
|
||||
public_url = ngrok.connect(port="2023")
|
||||
print(public_url)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli()
|
Loading…
x
Reference in New Issue
Block a user