agentgui 1.0.660 → 1.0.661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/static/index.html +1 -1
- package/static/js/conversations.js +20 -4
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -3047,7 +3047,7 @@
|
|
|
3047
3047
|
<button class="clone-cancel-btn" id="cloneCancelBtn" title="Cancel">×</button>
|
|
3048
3048
|
</div>
|
|
3049
3049
|
<ul class="sidebar-list" data-conversation-list>
|
|
3050
|
-
<li class="sidebar-empty" data-conversation-empty>
|
|
3050
|
+
<li class="sidebar-empty" data-conversation-empty>Loading...</li>
|
|
3051
3051
|
</ul>
|
|
3052
3052
|
<!-- PM2 Monitor Panel: hidden until active processes detected -->
|
|
3053
3053
|
<div class="pm2-monitor-panel" id="pm2MonitorPanel" style="display:none">
|
|
@@ -46,13 +46,14 @@ class ConversationManager {
|
|
|
46
46
|
async init() {
|
|
47
47
|
this.newBtn?.addEventListener('click', () => this.openFolderBrowser());
|
|
48
48
|
this.setupDelegatedListeners();
|
|
49
|
-
|
|
50
|
-
this.loadConversations();
|
|
49
|
+
this.showLoading();
|
|
51
50
|
this.setupWebSocketListener();
|
|
52
51
|
this.setupFolderBrowser();
|
|
53
52
|
this.setupCloneUI();
|
|
54
53
|
this.setupDeleteAllButton();
|
|
55
54
|
|
|
55
|
+
await Promise.all([this.loadAgents(), this.loadConversations()]);
|
|
56
|
+
|
|
56
57
|
this._pollInterval = setInterval(() => this.loadConversations(), 30000);
|
|
57
58
|
|
|
58
59
|
window.addEventListener('beforeunload', () => this.destroy());
|
|
@@ -67,7 +68,10 @@ class ConversationManager {
|
|
|
67
68
|
|
|
68
69
|
async loadAgents() {
|
|
69
70
|
try {
|
|
70
|
-
const
|
|
71
|
+
const base = window.__BASE_URL || '/gm';
|
|
72
|
+
const res = await fetch(base + '/api/agents');
|
|
73
|
+
if (!res.ok) throw new Error('HTTP ' + res.status);
|
|
74
|
+
const data = await res.json();
|
|
71
75
|
for (const agent of data.agents || []) {
|
|
72
76
|
this.agents.set(agent.id, agent);
|
|
73
77
|
}
|
|
@@ -409,9 +413,21 @@ class ConversationManager {
|
|
|
409
413
|
}
|
|
410
414
|
}
|
|
411
415
|
|
|
416
|
+
showLoading() {
|
|
417
|
+
if (!this.listEl) return;
|
|
418
|
+
this.listEl.innerHTML = '';
|
|
419
|
+
if (this.emptyEl) {
|
|
420
|
+
this.emptyEl.textContent = 'Loading...';
|
|
421
|
+
this.emptyEl.style.display = 'block';
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
412
425
|
async loadConversations() {
|
|
413
426
|
try {
|
|
414
|
-
const
|
|
427
|
+
const base = window.__BASE_URL || '/gm';
|
|
428
|
+
const res = await fetch(base + '/api/conversations');
|
|
429
|
+
if (!res.ok) throw new Error('HTTP ' + res.status);
|
|
430
|
+
const data = await res.json();
|
|
415
431
|
const convList = data.conversations || [];
|
|
416
432
|
|
|
417
433
|
this._updateConversations(convList, 'poll');
|