mirror of
https://github.com/browser-use/web-ui.git
synced 2026-03-22 11:17:17 +08:00
Merge branch 'main' into main
This commit is contained in:
11
.vscode/settings.json
vendored
Normal file
11
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"python.analysis.typeCheckingMode": "basic",
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "charliermarsh.ruff",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.ruff": "explicit",
|
||||
"source.organizeImports.ruff": "explicit"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
assets/web-ui.png
Normal file
BIN
assets/web-ui.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -3,3 +3,4 @@ langchain-google-genai>=2.0.8
|
||||
pyperclip
|
||||
gradio
|
||||
langchain-ollama
|
||||
|
||||
|
||||
@@ -189,4 +189,4 @@ def encode_image(img_path):
|
||||
return None
|
||||
with open(img_path, "rb") as fin:
|
||||
image_data = base64.b64encode(fin.read()).decode("utf-8")
|
||||
return image_data
|
||||
return image_data
|
||||
26
webui.py
26
webui.py
@@ -467,7 +467,7 @@ def create_ui(theme_name="Ocean"):
|
||||
run_button = gr.Button("▶️ Run Agent", variant="primary", scale=2)
|
||||
stop_button = gr.Button("⏹️ Stop", variant="stop", scale=1)
|
||||
|
||||
with gr.TabItem("🎬 Recordings", id=5):
|
||||
with gr.TabItem("📊 Results", id=5):
|
||||
recording_display = gr.Video(label="Latest Recording")
|
||||
|
||||
with gr.Group():
|
||||
@@ -490,6 +490,28 @@ def create_ui(theme_name="Ocean"):
|
||||
model_thoughts_output = gr.Textbox(
|
||||
label="Model Thoughts", lines=3, show_label=True
|
||||
)
|
||||
|
||||
with gr.TabItem("🎥 Recordings", id=6):
|
||||
def list_recordings(save_recording_path):
|
||||
if not os.path.exists(save_recording_path):
|
||||
return []
|
||||
recordings = glob.glob(os.path.join(save_recording_path, "*.[mM][pP]4")) + glob.glob(os.path.join(save_recording_path, "*.[wW][eE][bB][mM]"))
|
||||
return recordings
|
||||
|
||||
recordings_gallery = gr.Gallery(
|
||||
label="Recordings",
|
||||
value=list_recordings("./tmp/record_videos"),
|
||||
columns=3,
|
||||
height="auto",
|
||||
object_fit="contain"
|
||||
)
|
||||
|
||||
refresh_button = gr.Button("🔄 Refresh Recordings", variant="secondary")
|
||||
refresh_button.click(
|
||||
fn=list_recordings,
|
||||
inputs=save_recording_path,
|
||||
outputs=recordings_gallery
|
||||
)
|
||||
|
||||
# Attach the callback to the LLM provider dropdown
|
||||
llm_provider.change(
|
||||
@@ -526,4 +548,4 @@ def main():
|
||||
demo.launch(server_name=args.ip, server_port=args.port)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
Reference in New Issue
Block a user