simoncck commited on
Commit
ab95cca
·
verified ·
1 Parent(s): fd9d395

Update browser_automation_ui.html

Browse files
Files changed (1) hide show
  1. browser_automation_ui.html +24 -24
browser_automation_ui.html CHANGED
@@ -239,33 +239,33 @@
239
 
240
 
241
  async function refreshSessions() {
242
- // const listEl = document.getElementById("sessionList");
243
- // listEl.innerHTML = "<li style='padding:4px 6px;'>Loading...</li>";
244
  const sessions = await listSessions();
245
- // listEl.innerHTML = "";
246
- // sessions.forEach((s) => {
247
- // const li = document.createElement("li");
248
- // li.textContent = s.session_id;
249
- // li.className = "session-item" +
250
- // (s.session_id === currentSessionId ? " active" : "");
251
- // li.onclick = () => selectSession(li, s.session_id);
252
 
253
- // // individual close button (🗑) inside each li
254
- // const closeBtn = document.createElement("span");
255
- // closeBtn.innerHTML = "&nbsp;🗑";
256
- // closeBtn.style.cursor = "pointer";
257
- // closeBtn.onclick = (e) => {
258
- // e.stopPropagation();
259
- // closeSession(s.session_id);
260
- // };
261
- // li.appendChild(closeBtn);
262
 
263
- // listEl.appendChild(li);
264
- // });
265
- // if (sessions.length === 0) {
266
- // listEl.innerHTML = "<li style='padding:4px 6px;color:#94a3b8;'>No active sessions</li>";
267
- // }
268
- renderSessionList();
269
  }
270
 
271
  function selectSession(li, id) {
 
239
 
240
 
241
  async function refreshSessions() {
242
+ const listEl = document.getElementById("sessionList");
243
+ listEl.innerHTML = "<li style='padding:4px 6px;'>Loading...</li>";
244
  const sessions = await listSessions();
245
+ listEl.innerHTML = "";
246
+ sessions.forEach((s) => {
247
+ const li = document.createElement("li");
248
+ li.textContent = s.session_id;
249
+ li.className = "session-item" +
250
+ (s.session_id === currentSessionId ? " active" : "");
251
+ li.onclick = () => selectSession(li, s.session_id);
252
 
253
+ // individual close button (🗑) inside each li
254
+ const closeBtn = document.createElement("span");
255
+ closeBtn.innerHTML = "&nbsp;🗑";
256
+ closeBtn.style.cursor = "pointer";
257
+ closeBtn.onclick = (e) => {
258
+ e.stopPropagation();
259
+ closeSession(s.session_id);
260
+ };
261
+ li.appendChild(closeBtn);
262
 
263
+ listEl.appendChild(li);
264
+ });
265
+ if (sessions.length === 0) {
266
+ listEl.innerHTML = "<li style='padding:4px 6px;color:#94a3b8;'>No active sessions</li>";
267
+ }
268
+ // renderSessionList();
269
  }
270
 
271
  function selectSession(li, id) {