claude-code-templates 1.14.16 → 1.15.1
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/bin/create-claude-config.js +5 -1
- package/package.json +2 -1
- package/src/analytics/core/AgentAnalyzer.js +17 -3
- package/src/analytics/core/ProcessDetector.js +23 -7
- package/src/analytics/core/StateCalculator.js +102 -33
- package/src/analytics/data/DataCache.js +7 -7
- package/src/analytics-web/chats_mobile.html +2590 -0
- package/src/analytics-web/components/App.js +10 -10
- package/src/analytics-web/components/SessionTimer.js +1 -1
- package/src/analytics-web/components/Sidebar.js +5 -14
- package/src/analytics-web/index.html +932 -78
- package/src/analytics.js +263 -5
- package/src/chats-mobile.js +682 -0
- package/src/claude-api-proxy.js +460 -0
- package/src/index.js +43 -5
- package/src/analytics-web/components/AgentsPage.js +0 -4761
|
@@ -8,7 +8,7 @@ class App {
|
|
|
8
8
|
this.services = services;
|
|
9
9
|
|
|
10
10
|
this.components = {};
|
|
11
|
-
this.currentPage = '
|
|
11
|
+
this.currentPage = null; // Don't set default page yet
|
|
12
12
|
this.isInitialized = false;
|
|
13
13
|
|
|
14
14
|
this.init();
|
|
@@ -93,8 +93,7 @@ class App {
|
|
|
93
93
|
// Initialize pages
|
|
94
94
|
this.components.pages = {};
|
|
95
95
|
|
|
96
|
-
//
|
|
97
|
-
await this.loadPage(this.currentPage);
|
|
96
|
+
// Don't load any page yet - wait for routing to determine the correct page
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
/**
|
|
@@ -109,9 +108,7 @@ class App {
|
|
|
109
108
|
|
|
110
109
|
// Set initial route
|
|
111
110
|
const initialHash = window.location.hash.slice(1) || 'dashboard';
|
|
112
|
-
|
|
113
|
-
this.navigateToPage(initialHash);
|
|
114
|
-
}
|
|
111
|
+
this.navigateToPage(initialHash);
|
|
115
112
|
}
|
|
116
113
|
|
|
117
114
|
/**
|
|
@@ -149,7 +146,7 @@ class App {
|
|
|
149
146
|
* @param {string} page - Page to navigate to
|
|
150
147
|
*/
|
|
151
148
|
async navigateToPage(page) {
|
|
152
|
-
if (page === this.currentPage) return;
|
|
149
|
+
if (page === this.currentPage && this.currentPage !== null) return;
|
|
153
150
|
|
|
154
151
|
try {
|
|
155
152
|
this.showGlobalLoading();
|
|
@@ -190,7 +187,7 @@ class App {
|
|
|
190
187
|
throw new Error('App content container not found');
|
|
191
188
|
}
|
|
192
189
|
|
|
193
|
-
console.log(
|
|
190
|
+
console.log(`🚀 Loading page: ${page} (optimized - single page load)`);
|
|
194
191
|
|
|
195
192
|
// First, destroy any existing page component for this page
|
|
196
193
|
if (this.components.pages[page] && this.components.pages[page].destroy) {
|
|
@@ -199,10 +196,10 @@ class App {
|
|
|
199
196
|
this.components.pages[page] = null;
|
|
200
197
|
}
|
|
201
198
|
|
|
202
|
-
//
|
|
199
|
+
// Clear content container
|
|
203
200
|
contentContainer.innerHTML = '';
|
|
204
201
|
|
|
205
|
-
// Create
|
|
202
|
+
// Create new page component
|
|
206
203
|
await this.createPageComponent(page, contentContainer);
|
|
207
204
|
|
|
208
205
|
// Call showPage for any additional setup
|
|
@@ -271,6 +268,9 @@ class App {
|
|
|
271
268
|
* Cleanup current page
|
|
272
269
|
*/
|
|
273
270
|
async cleanupCurrentPage() {
|
|
271
|
+
// Skip cleanup if no current page
|
|
272
|
+
if (!this.currentPage) return;
|
|
273
|
+
|
|
274
274
|
// Clean up global references
|
|
275
275
|
if (this.currentPage === 'agents' && typeof window !== 'undefined' && window.claudeAnalyticsApp) {
|
|
276
276
|
window.claudeAnalyticsApp.agentsPage = undefined;
|
|
@@ -10,7 +10,7 @@ class SessionTimer {
|
|
|
10
10
|
this.sessionData = null;
|
|
11
11
|
this.updateInterval = null;
|
|
12
12
|
this.isInitialized = false;
|
|
13
|
-
this.refreshInterval =
|
|
13
|
+
this.refreshInterval = 5000; // 5 seconds to reduce server load
|
|
14
14
|
this.SESSION_DURATION = 5 * 60 * 60 * 1000; // 5 hours in milliseconds
|
|
15
15
|
this.isTooltipVisible = false; // Track tooltip state globally
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sidebar -
|
|
3
|
-
*
|
|
2
|
+
* Sidebar - Analytics dashboard sidebar
|
|
3
|
+
* Simple sidebar focused only on analytics dashboard functionality
|
|
4
4
|
*/
|
|
5
5
|
class Sidebar {
|
|
6
6
|
constructor(container, onNavigate) {
|
|
@@ -40,7 +40,7 @@ class Sidebar {
|
|
|
40
40
|
|
|
41
41
|
<div class="sidebar-content">
|
|
42
42
|
<ul class="nav-menu">
|
|
43
|
-
<li class="nav-item ${this.currentPage === 'dashboard' ? 'active' : ''}" data-page="dashboard" title="Dashboard">
|
|
43
|
+
<li class="nav-item ${this.currentPage === 'dashboard' ? 'active' : ''}" data-page="dashboard" title="Analytics Dashboard">
|
|
44
44
|
<a href="#" class="nav-link">
|
|
45
45
|
<div class="nav-icon">
|
|
46
46
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
@@ -50,16 +50,6 @@ class Sidebar {
|
|
|
50
50
|
<span class="nav-text">Dashboard</span>
|
|
51
51
|
</a>
|
|
52
52
|
</li>
|
|
53
|
-
<li class="nav-item ${this.currentPage === 'agents' ? 'active' : ''}" data-page="agents" title="Agent Chats">
|
|
54
|
-
<a href="#" class="nav-link">
|
|
55
|
-
<div class="nav-icon">
|
|
56
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
57
|
-
<path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4l4 4 4-4h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"/>
|
|
58
|
-
</svg>
|
|
59
|
-
</div>
|
|
60
|
-
<span class="nav-text">Chats</span>
|
|
61
|
-
</a>
|
|
62
|
-
</li>
|
|
63
53
|
</ul>
|
|
64
54
|
</div>
|
|
65
55
|
|
|
@@ -126,7 +116,7 @@ class Sidebar {
|
|
|
126
116
|
navigateToPage(page) {
|
|
127
117
|
if (page === this.currentPage) return;
|
|
128
118
|
|
|
129
|
-
|
|
119
|
+
// Handle navigation to the specified page
|
|
130
120
|
|
|
131
121
|
// Notify parent component for actual navigation
|
|
132
122
|
if (this.onNavigate) {
|
|
@@ -181,6 +171,7 @@ class Sidebar {
|
|
|
181
171
|
statusText.textContent = status === 'connected' ? 'Live' : 'Offline';
|
|
182
172
|
}
|
|
183
173
|
}
|
|
174
|
+
|
|
184
175
|
|
|
185
176
|
/**
|
|
186
177
|
* Destroy sidebar
|