simoncck commited on
Commit
dadf71d
Β·
verified Β·
1 Parent(s): e7cf110

Update static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +26 -25
static/index.html CHANGED
@@ -6,7 +6,7 @@
6
  <title>Browser-Use Server Interface</title>
7
  <style>
8
  body {
9
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
10
  max-width: 800px;
11
  margin: 0 auto;
12
  padding: 20px;
@@ -108,8 +108,7 @@
108
  <form id="taskForm">
109
  <div class="form-group">
110
  <label for="task">Task Description:</label>
111
- <textarea id="task" name="task" placeholder="Describe what you want the browser to do...
112
- Example: Go to google.com and search for 'Python programming'" required></textarea>
113
  </div>
114
 
115
  <div class="form-group">
@@ -120,6 +119,8 @@ Example: Go to google.com and search for 'Python programming'" required></textar
120
  <option value="gpt-4-turbo">GPT-4 Turbo</option>
121
  <option value="claude-3-haiku-20240307">Claude 3 Haiku</option>
122
  <option value="claude-3-sonnet-20240229">Claude 3 Sonnet</option>
 
 
123
  </select>
124
  </div>
125
 
@@ -130,19 +131,19 @@ Example: Go to google.com and search for 'Python programming'" required></textar
130
 
131
  <div class="examples">
132
  <h3>Example Tasks (Click to use):</h3>
133
- <div class="example" onclick="setTask('Go to google.com and search for Python programming')">
134
  πŸ” Search Google for "Python programming"
135
  </div>
136
- <div class="example" onclick="setTask('Navigate to github.com and find the trending repositories')">
137
  πŸ“ˆ Check GitHub trending repositories
138
  </div>
139
- <div class="example" onclick="setTask('Go to example.com and get the page title and main heading')">
140
  πŸ“„ Get page title from example.com
141
  </div>
142
- <div class="example" onclick="setTask('Visit news.ycombinator.com and get the top 3 story titles')">
143
  πŸ“° Get top stories from Hacker News
144
  </div>
145
- <div class="example" onclick="setTask('Go to wikipedia.org and search for artificial intelligence')">
146
  πŸ“š Search Wikipedia for "artificial intelligence"
147
  </div>
148
  </div>
@@ -150,29 +151,29 @@ Example: Go to google.com and search for 'Python programming'" required></textar
150
 
151
  <script>
152
  function setTask(taskText) {
153
- document.getElementById('task').value = taskText;
154
  }
155
 
156
- document.getElementById('taskForm').addEventListener('submit', async function(e) {
157
  e.preventDefault();
158
 
159
- const task = document.getElementById('task').value;
160
- const model = document.getElementById('model').value;
161
- const submitBtn = document.getElementById('submitBtn');
162
- const resultDiv = document.getElementById('result');
163
 
164
  // Show loading state
165
  submitBtn.disabled = true;
166
- submitBtn.textContent = 'Running Task...';
167
- resultDiv.style.display = 'block';
168
- resultDiv.className = 'result loading';
169
- resultDiv.textContent = 'Task is running... This may take a while depending on the complexity.';
170
 
171
  try {
172
- const response = await fetch('/run-task', {
173
- method: 'POST',
174
  headers: {
175
- 'Content-Type': 'application/json',
176
  },
177
  body: JSON.stringify({
178
  task: task,
@@ -183,18 +184,18 @@ Example: Go to google.com and search for 'Python programming'" required></textar
183
  const data = await response.json();
184
 
185
  if (data.success) {
186
- resultDiv.className = 'result success';
187
  resultDiv.textContent = `βœ… Task completed successfully!\n\nResult:\n${data.result}`;
188
  } else {
189
- resultDiv.className = 'result error';
190
  resultDiv.textContent = `❌ Task failed:\n\n${data.error}`;
191
  }
192
  } catch (error) {
193
- resultDiv.className = 'result error';
194
  resultDiv.textContent = `❌ Network error:\n\n${error.message}`;
195
  } finally {
196
  submitBtn.disabled = false;
197
- submitBtn.textContent = 'Run Task';
198
  }
199
  });
200
  </script>
 
6
  <title>Browser-Use Server Interface</title>
7
  <style>
8
  body {
9
+ font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;
10
  max-width: 800px;
11
  margin: 0 auto;
12
  padding: 20px;
 
108
  <form id="taskForm">
109
  <div class="form-group">
110
  <label for="task">Task Description:</label>
111
+ <textarea id="task" name="task" placeholder="Describe what you want the browser to do...\nExample: Go to google.com and search for \'Python programming\'" required></textarea>
 
112
  </div>
113
 
114
  <div class="form-group">
 
119
  <option value="gpt-4-turbo">GPT-4 Turbo</option>
120
  <option value="claude-3-haiku-20240307">Claude 3 Haiku</option>
121
  <option value="claude-3-sonnet-20240229">Claude 3 Sonnet</option>
122
+ <option value="gemini-pro">Gemini Pro</option>
123
+ <option value="gemini-1.5-pro-latest">Gemini 1.5 Pro Latest</option>
124
  </select>
125
  </div>
126
 
 
131
 
132
  <div class="examples">
133
  <h3>Example Tasks (Click to use):</h3>
134
+ <div class="example" onclick="setTask(\'Go to google.com and search for Python programming\')">
135
  πŸ” Search Google for "Python programming"
136
  </div>
137
+ <div class="example" onclick="setTask(\'Navigate to github.com and find the trending repositories\')">
138
  πŸ“ˆ Check GitHub trending repositories
139
  </div>
140
+ <div class="example" onclick="setTask(\'Go to example.com and get the page title and main heading\')">
141
  πŸ“„ Get page title from example.com
142
  </div>
143
+ <div class="example" onclick="setTask(\'Visit news.ycombinator.com and get the top 3 story titles\')">
144
  πŸ“° Get top stories from Hacker News
145
  </div>
146
+ <div class="example" onclick="setTask(\'Go to wikipedia.org and search for artificial intelligence\')">
147
  πŸ“š Search Wikipedia for "artificial intelligence"
148
  </div>
149
  </div>
 
151
 
152
  <script>
153
  function setTask(taskText) {
154
+ document.getElementById(\'task\').value = taskText;
155
  }
156
 
157
+ document.getElementById(\'taskForm\').addEventListener(\'submit\', async function(e) {
158
  e.preventDefault();
159
 
160
+ const task = document.getElementById(\'task\').value;
161
+ const model = document.getElementById(\'model\').value;
162
+ const submitBtn = document.getElementById(\'submitBtn\');
163
+ const resultDiv = document.getElementById(\'result\');
164
 
165
  // Show loading state
166
  submitBtn.disabled = true;
167
+ submitBtn.textContent = \'Running Task...\';
168
+ resultDiv.style.display = \'block\';
169
+ resultDiv.className = \'result loading\';
170
+ resultDiv.textContent = \'Task is running... This may take a while depending on the complexity.\';
171
 
172
  try {
173
+ const response = await fetch(\'/run-task\', {
174
+ method: \'POST\',
175
  headers: {
176
+ \'Content-Type\': \'application/json\',
177
  },
178
  body: JSON.stringify({
179
  task: task,
 
184
  const data = await response.json();
185
 
186
  if (data.success) {
187
+ resultDiv.className = \'result success\';
188
  resultDiv.textContent = `βœ… Task completed successfully!\n\nResult:\n${data.result}`;
189
  } else {
190
+ resultDiv.className = \'result error\';
191
  resultDiv.textContent = `❌ Task failed:\n\n${data.error}`;
192
  }
193
  } catch (error) {
194
+ resultDiv.className = \'result error\';
195
  resultDiv.textContent = `❌ Network error:\n\n${error.message}`;
196
  } finally {
197
  submitBtn.disabled = false;
198
+ submitBtn.textContent = \'Run Task\';
199
  }
200
  });
201
  </script>