@flight-framework/devtools 1.0.2 → 2.0.0

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.
@@ -162,64 +162,64 @@ export function renderCachePanel(entriesList, metrics) {
162
162
  expired: '#ef4444',
163
163
  };
164
164
  const sortedEntries = [...entriesList].sort((a, b) => b.lastAccessedAt - a.lastAccessedAt);
165
- return `
166
- <div class="flight-dt-cache-panel">
167
- <div class="flight-dt-cache-summary">
168
- <div class="flight-dt-metric">
169
- <span class="flight-dt-metric-value">${metrics.totalEntries}</span>
170
- <span class="flight-dt-metric-label">Entries</span>
171
- </div>
172
- <div class="flight-dt-metric">
173
- <span class="flight-dt-metric-value">${formatBytes(metrics.totalSize)}</span>
174
- <span class="flight-dt-metric-label">Size</span>
175
- </div>
176
- <div class="flight-dt-metric ${metrics.hitRate >= 80 ? 'flight-dt-metric--good' : metrics.hitRate >= 50 ? '' : 'flight-dt-metric--warning'}">
177
- <span class="flight-dt-metric-value">${metrics.hitRate.toFixed(1)}%</span>
178
- <span class="flight-dt-metric-label">Hit Rate</span>
179
- </div>
180
- <div class="flight-dt-metric">
181
- <span class="flight-dt-metric-value">${metrics.totalHits}</span>
182
- <span class="flight-dt-metric-label">Hits</span>
183
- </div>
184
- </div>
185
-
186
- ${metrics.uniqueTags.length > 0 ? `
187
- <div class="flight-dt-cache-tags">
188
- ${metrics.uniqueTags.slice(0, 8).map(tag => `
189
- <button class="flight-dt-tag" data-tag="${escapeHtml(tag)}" title="Click to invalidate">
190
- ${escapeHtml(tag)}
191
- </button>
192
- `).join('')}
193
- ${metrics.uniqueTags.length > 8 ? `<span class="flight-dt-tag-more">+${metrics.uniqueTags.length - 8}</span>` : ''}
194
- </div>
195
- ` : ''}
196
-
197
- <div class="flight-dt-cache-list">
198
- ${sortedEntries.slice(0, 15).map(entry => `
199
- <div class="flight-dt-cache-entry" data-key="${escapeHtml(entry.key)}">
200
- <div class="flight-dt-cache-entry-header">
201
- <span class="flight-dt-cache-status" style="background: ${statusColors[entry.status]}" title="${entry.status}"></span>
202
- <span class="flight-dt-cache-key" title="${escapeHtml(entry.key)}">${escapeHtml(truncateKey(entry.key))}</span>
203
- <span class="flight-dt-cache-size">${formatBytes(entry.size)}</span>
204
- </div>
205
- <div class="flight-dt-cache-entry-meta">
206
- <span class="flight-dt-cache-hits">${entry.hits} hits</span>
207
- <span class="flight-dt-cache-time">${formatRelativeTime(entry.lastAccessedAt)}</span>
208
- ${entry.ttl ? `<span class="flight-dt-cache-ttl">TTL: ${entry.ttl}s</span>` : ''}
209
- </div>
210
- </div>
211
- `).join('')}
212
- ${sortedEntries.length > 15 ? `<div class="flight-dt-cache-more">+ ${sortedEntries.length - 15} more entries</div>` : ''}
213
- </div>
214
-
215
- ${sortedEntries.length === 0 ? '<div class="flight-dt-empty">No cache entries</div>' : ''}
216
-
217
- <div class="flight-dt-cache-actions">
218
- <button class="flight-dt-btn flight-dt-btn--danger" data-action="clear-cache">
219
- Clear All
220
- </button>
221
- </div>
222
- </div>
165
+ return `
166
+ <div class="flight-dt-cache-panel">
167
+ <div class="flight-dt-cache-summary">
168
+ <div class="flight-dt-metric">
169
+ <span class="flight-dt-metric-value">${metrics.totalEntries}</span>
170
+ <span class="flight-dt-metric-label">Entries</span>
171
+ </div>
172
+ <div class="flight-dt-metric">
173
+ <span class="flight-dt-metric-value">${formatBytes(metrics.totalSize)}</span>
174
+ <span class="flight-dt-metric-label">Size</span>
175
+ </div>
176
+ <div class="flight-dt-metric ${metrics.hitRate >= 80 ? 'flight-dt-metric--good' : metrics.hitRate >= 50 ? '' : 'flight-dt-metric--warning'}">
177
+ <span class="flight-dt-metric-value">${metrics.hitRate.toFixed(1)}%</span>
178
+ <span class="flight-dt-metric-label">Hit Rate</span>
179
+ </div>
180
+ <div class="flight-dt-metric">
181
+ <span class="flight-dt-metric-value">${metrics.totalHits}</span>
182
+ <span class="flight-dt-metric-label">Hits</span>
183
+ </div>
184
+ </div>
185
+
186
+ ${metrics.uniqueTags.length > 0 ? `
187
+ <div class="flight-dt-cache-tags">
188
+ ${metrics.uniqueTags.slice(0, 8).map(tag => `
189
+ <button class="flight-dt-tag" data-tag="${escapeHtml(tag)}" title="Click to invalidate">
190
+ ${escapeHtml(tag)}
191
+ </button>
192
+ `).join('')}
193
+ ${metrics.uniqueTags.length > 8 ? `<span class="flight-dt-tag-more">+${metrics.uniqueTags.length - 8}</span>` : ''}
194
+ </div>
195
+ ` : ''}
196
+
197
+ <div class="flight-dt-cache-list">
198
+ ${sortedEntries.slice(0, 15).map(entry => `
199
+ <div class="flight-dt-cache-entry" data-key="${escapeHtml(entry.key)}">
200
+ <div class="flight-dt-cache-entry-header">
201
+ <span class="flight-dt-cache-status" style="background: ${statusColors[entry.status]}" title="${entry.status}"></span>
202
+ <span class="flight-dt-cache-key" title="${escapeHtml(entry.key)}">${escapeHtml(truncateKey(entry.key))}</span>
203
+ <span class="flight-dt-cache-size">${formatBytes(entry.size)}</span>
204
+ </div>
205
+ <div class="flight-dt-cache-entry-meta">
206
+ <span class="flight-dt-cache-hits">${entry.hits} hits</span>
207
+ <span class="flight-dt-cache-time">${formatRelativeTime(entry.lastAccessedAt)}</span>
208
+ ${entry.ttl ? `<span class="flight-dt-cache-ttl">TTL: ${entry.ttl}s</span>` : ''}
209
+ </div>
210
+ </div>
211
+ `).join('')}
212
+ ${sortedEntries.length > 15 ? `<div class="flight-dt-cache-more">+ ${sortedEntries.length - 15} more entries</div>` : ''}
213
+ </div>
214
+
215
+ ${sortedEntries.length === 0 ? '<div class="flight-dt-empty">No cache entries</div>' : ''}
216
+
217
+ <div class="flight-dt-cache-actions">
218
+ <button class="flight-dt-btn flight-dt-btn--danger" data-action="clear-cache">
219
+ Clear All
220
+ </button>
221
+ </div>
222
+ </div>
223
223
  `;
224
224
  }
225
225
  function truncateKey(key) {
@@ -237,136 +237,136 @@ function escapeHtml(str) {
237
237
  /**
238
238
  * CSS styles for the cache panel
239
239
  */
240
- export const cachePanelStyles = `
241
- .flight-dt-cache-panel {
242
- padding: 8px;
243
- }
244
-
245
- .flight-dt-cache-summary {
246
- display: flex;
247
- gap: 16px;
248
- padding: 8px;
249
- background: rgba(255, 255, 255, 0.05);
250
- border-radius: 6px;
251
- margin-bottom: 12px;
252
- }
253
-
254
- .flight-dt-metric--good .flight-dt-metric-value {
255
- color: #22c55e;
256
- }
257
-
258
- .flight-dt-cache-tags {
259
- display: flex;
260
- flex-wrap: wrap;
261
- gap: 6px;
262
- margin-bottom: 12px;
263
- }
264
-
265
- .flight-dt-tag {
266
- background: rgba(139, 92, 246, 0.2);
267
- border: 1px solid rgba(139, 92, 246, 0.3);
268
- color: #a78bfa;
269
- padding: 2px 8px;
270
- border-radius: 12px;
271
- font-size: 10px;
272
- cursor: pointer;
273
- }
274
-
275
- .flight-dt-tag:hover {
276
- background: rgba(139, 92, 246, 0.3);
277
- }
278
-
279
- .flight-dt-tag-more {
280
- font-size: 10px;
281
- color: #666;
282
- padding: 2px 8px;
283
- }
284
-
285
- .flight-dt-cache-list {
286
- display: flex;
287
- flex-direction: column;
288
- gap: 4px;
289
- max-height: 200px;
290
- overflow-y: auto;
291
- }
292
-
293
- .flight-dt-cache-entry {
294
- padding: 6px 8px;
295
- background: rgba(255, 255, 255, 0.03);
296
- border-radius: 4px;
297
- }
298
-
299
- .flight-dt-cache-entry-header {
300
- display: flex;
301
- align-items: center;
302
- gap: 8px;
303
- }
304
-
305
- .flight-dt-cache-status {
306
- width: 8px;
307
- height: 8px;
308
- border-radius: 50%;
309
- }
310
-
311
- .flight-dt-cache-key {
312
- flex: 1;
313
- font-family: monospace;
314
- font-size: 11px;
315
- color: #e0e0e0;
316
- overflow: hidden;
317
- text-overflow: ellipsis;
318
- white-space: nowrap;
319
- }
320
-
321
- .flight-dt-cache-size {
322
- font-family: monospace;
323
- font-size: 11px;
324
- color: #888;
325
- }
326
-
327
- .flight-dt-cache-entry-meta {
328
- display: flex;
329
- gap: 12px;
330
- margin-top: 4px;
331
- font-size: 10px;
332
- color: #666;
333
- }
334
-
335
- .flight-dt-cache-more {
336
- text-align: center;
337
- font-size: 11px;
338
- color: #666;
339
- padding: 8px;
340
- }
341
-
342
- .flight-dt-cache-actions {
343
- margin-top: 12px;
344
- display: flex;
345
- justify-content: flex-end;
346
- }
347
-
348
- .flight-dt-btn {
349
- padding: 4px 12px;
350
- border: 1px solid #444;
351
- border-radius: 4px;
352
- background: transparent;
353
- color: #888;
354
- font-size: 11px;
355
- cursor: pointer;
356
- }
357
-
358
- .flight-dt-btn:hover {
359
- color: #e0e0e0;
360
- border-color: #666;
361
- }
362
-
363
- .flight-dt-btn--danger {
364
- border-color: rgba(239, 68, 68, 0.3);
365
- color: #ef4444;
366
- }
367
-
368
- .flight-dt-btn--danger:hover {
369
- background: rgba(239, 68, 68, 0.1);
370
- }
240
+ export const cachePanelStyles = `
241
+ .flight-dt-cache-panel {
242
+ padding: 8px;
243
+ }
244
+
245
+ .flight-dt-cache-summary {
246
+ display: flex;
247
+ gap: 16px;
248
+ padding: 8px;
249
+ background: rgba(255, 255, 255, 0.05);
250
+ border-radius: 6px;
251
+ margin-bottom: 12px;
252
+ }
253
+
254
+ .flight-dt-metric--good .flight-dt-metric-value {
255
+ color: #22c55e;
256
+ }
257
+
258
+ .flight-dt-cache-tags {
259
+ display: flex;
260
+ flex-wrap: wrap;
261
+ gap: 6px;
262
+ margin-bottom: 12px;
263
+ }
264
+
265
+ .flight-dt-tag {
266
+ background: rgba(139, 92, 246, 0.2);
267
+ border: 1px solid rgba(139, 92, 246, 0.3);
268
+ color: #a78bfa;
269
+ padding: 2px 8px;
270
+ border-radius: 12px;
271
+ font-size: 10px;
272
+ cursor: pointer;
273
+ }
274
+
275
+ .flight-dt-tag:hover {
276
+ background: rgba(139, 92, 246, 0.3);
277
+ }
278
+
279
+ .flight-dt-tag-more {
280
+ font-size: 10px;
281
+ color: #666;
282
+ padding: 2px 8px;
283
+ }
284
+
285
+ .flight-dt-cache-list {
286
+ display: flex;
287
+ flex-direction: column;
288
+ gap: 4px;
289
+ max-height: 200px;
290
+ overflow-y: auto;
291
+ }
292
+
293
+ .flight-dt-cache-entry {
294
+ padding: 6px 8px;
295
+ background: rgba(255, 255, 255, 0.03);
296
+ border-radius: 4px;
297
+ }
298
+
299
+ .flight-dt-cache-entry-header {
300
+ display: flex;
301
+ align-items: center;
302
+ gap: 8px;
303
+ }
304
+
305
+ .flight-dt-cache-status {
306
+ width: 8px;
307
+ height: 8px;
308
+ border-radius: 50%;
309
+ }
310
+
311
+ .flight-dt-cache-key {
312
+ flex: 1;
313
+ font-family: monospace;
314
+ font-size: 11px;
315
+ color: #e0e0e0;
316
+ overflow: hidden;
317
+ text-overflow: ellipsis;
318
+ white-space: nowrap;
319
+ }
320
+
321
+ .flight-dt-cache-size {
322
+ font-family: monospace;
323
+ font-size: 11px;
324
+ color: #888;
325
+ }
326
+
327
+ .flight-dt-cache-entry-meta {
328
+ display: flex;
329
+ gap: 12px;
330
+ margin-top: 4px;
331
+ font-size: 10px;
332
+ color: #666;
333
+ }
334
+
335
+ .flight-dt-cache-more {
336
+ text-align: center;
337
+ font-size: 11px;
338
+ color: #666;
339
+ padding: 8px;
340
+ }
341
+
342
+ .flight-dt-cache-actions {
343
+ margin-top: 12px;
344
+ display: flex;
345
+ justify-content: flex-end;
346
+ }
347
+
348
+ .flight-dt-btn {
349
+ padding: 4px 12px;
350
+ border: 1px solid #444;
351
+ border-radius: 4px;
352
+ background: transparent;
353
+ color: #888;
354
+ font-size: 11px;
355
+ cursor: pointer;
356
+ }
357
+
358
+ .flight-dt-btn:hover {
359
+ color: #e0e0e0;
360
+ border-color: #666;
361
+ }
362
+
363
+ .flight-dt-btn--danger {
364
+ border-color: rgba(239, 68, 68, 0.3);
365
+ color: #ef4444;
366
+ }
367
+
368
+ .flight-dt-btn--danger:hover {
369
+ background: rgba(239, 68, 68, 0.1);
370
+ }
371
371
  `;
372
372
  //# sourceMappingURL=cache-panel.js.map