@mantiq/heartbeat 0.1.3 → 0.1.5

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Observability, APM, and request/query/exception tracing for MantiqJS. Self-contained dashboard at `/_heartbeat`.
4
4
 
5
- Part of [MantiqJS](https://github.com/abdullahkhan/mantiq) — a batteries-included TypeScript web framework for Bun.
5
+ Part of [MantiqJS](https://github.com/mantiqjs/mantiq) — a batteries-included TypeScript web framework for Bun.
6
6
 
7
7
  ## Installation
8
8
 
@@ -12,7 +12,7 @@ bun add @mantiq/heartbeat
12
12
 
13
13
  ## Documentation
14
14
 
15
- See the [MantiqJS repository](https://github.com/abdullahkhan/mantiq) for full documentation.
15
+ See the [MantiqJS repository](https://github.com/mantiqjs/mantiq) for full documentation.
16
16
 
17
17
  ## License
18
18
 
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@mantiq/heartbeat",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Observability, APM & queue monitoring for MantiqJS",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Abdullah Khan",
8
- "homepage": "https://github.com/abdullahkhan/mantiq/tree/main/packages/heartbeat",
8
+ "homepage": "https://github.com/mantiqjs/mantiq/tree/main/packages/heartbeat",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/abdullahkhan/mantiq.git",
11
+ "url": "https://github.com/mantiqjs/mantiq.git",
12
12
  "directory": "packages/heartbeat"
13
13
  },
14
14
  "bugs": {
15
- "url": "https://github.com/abdullahkhan/mantiq/issues"
15
+ "url": "https://github.com/mantiqjs/mantiq/issues"
16
16
  },
17
17
  "keywords": [
18
18
  "mantiq",
@@ -29,7 +29,6 @@ export async function renderCachePage(store: HeartbeatStore, basePath: string):
29
29
  })
30
30
 
31
31
  const content = `
32
- <h1 class="page-title">Cache</h1>
33
32
  <div class="stats">
34
33
  ${stat('Hit Rate', hitRate, `${hits} hits / ${misses} misses`)}
35
34
  ${stat('Hits', hits.toString())}
@@ -16,7 +16,6 @@ export async function renderEventsPage(store: HeartbeatStore, basePath: string):
16
16
  })
17
17
 
18
18
  const content = `
19
- <h1 class="page-title">Events</h1>
20
19
  <div class="card">
21
20
  ${table(['Event', 'Listeners', 'Time'], rows)}
22
21
  </div>
@@ -30,7 +30,6 @@ export async function renderExceptionsPage(store: HeartbeatStore, basePath: stri
30
30
  })
31
31
 
32
32
  const content = `
33
- <h1 class="page-title">Exceptions</h1>
34
33
  <div class="stats">
35
34
  ${stat('Total', entries.length.toString())}
36
35
  ${stat('Groups', groups.length.toString(), 'Unique')}
@@ -29,7 +29,6 @@ export async function renderJobsPage(store: HeartbeatStore, basePath: string): P
29
29
  })
30
30
 
31
31
  const content = `
32
- <h1 class="page-title">Jobs</h1>
33
32
  <div class="stats">
34
33
  ${stat('Processed', processed.toString(), 'Completed')}
35
34
  ${stat('Failed', failed.toString())}
@@ -50,7 +50,6 @@ export async function renderOverviewPage(store: HeartbeatStore, metrics: Metrics
50
50
  ], labels)
51
51
 
52
52
  const content = `
53
- <h1 class="page-title">Overview</h1>
54
53
  <div class="stats">
55
54
  ${stat('Requests', requestCount.toLocaleString(), 'Total recorded')}
56
55
  ${stat('P95 Latency', formatDuration(p95), 'Response time')}
@@ -16,7 +16,6 @@ export function renderPerformancePage(metrics: MetricsCollector, basePath: strin
16
16
  const errorRate = totalRequests > 0 ? ((totalErrors / totalRequests) * 100).toFixed(1) + '%' : '0%'
17
17
 
18
18
  const content = `
19
- <h1 class="page-title">Performance</h1>
20
19
 
21
20
  <div class="card mb">
22
21
  <div class="card-title">Latency</div>
@@ -30,7 +30,6 @@ export async function renderQueriesPage(store: HeartbeatStore, basePath: string)
30
30
  })
31
31
 
32
32
  const content = `
33
- <h1 class="page-title">Queries</h1>
34
33
  <div class="stats">
35
34
  ${stat('Total', entries.length.toString())}
36
35
  ${stat('Slow', slowCount.toString(), '> threshold')}
@@ -51,24 +51,24 @@ export async function renderRequestDetailPage(store: HeartbeatStore, uuid: strin
51
51
  const mdEscaped = md.replace(/\\/g, '\\\\').replace(/`/g, '\\`').replace(/\$/g, '\\$')
52
52
 
53
53
  const content = `
54
- <div style="display:flex;align-items:center;gap:12px;margin-bottom:14px">
55
- <a href="${basePath}/requests" style="color:var(--fg-3);text-decoration:none;font-size:13px">&larr; Requests</a>
56
- <div style="margin-left:auto">
54
+ <div style="display:flex;align-items:center;gap:12px;margin-bottom:16px">
55
+ <a href="${basePath}/requests" style="color:var(--fg-3);text-decoration:none;font-size:13px;display:flex;align-items:center;gap:4px">&larr; <span>Requests</span></a>
56
+ <div style="margin-left:auto;display:flex;align-items:center;gap:8px">
57
57
  <button class="copy-btn" onclick="copyMd()" title="Copy full request as Markdown">${COPY_ICON}<span>Copy as Markdown</span></button>
58
58
  </div>
59
59
  </div>
60
60
 
61
- <div class="copy-bar">
62
- <code>${entry.uuid}</code>
63
- <button class="copy-btn" onclick="copyText('${entry.uuid}', this)" title="Copy ID">${COPY_ICON}</button>
64
- </div>
65
-
66
- <div class="copy-bar">
67
- <code style="color:var(--fg-1);font-size:13px;font-weight:500">${escapeHtml(requestLine)}</code>
68
- ${statusBadge(c.status)}
69
- ${durationBadge(c.duration)}
70
- <span class="sm dim" style="flex-shrink:0">${timeStr}</span>
71
- <button class="copy-btn" onclick="copyText('${escapeHtml(requestLine)}', this)" title="Copy request">${COPY_ICON}</button>
61
+ <div class="card mb" style="padding:16px 18px">
62
+ <div style="display:flex;align-items:center;gap:10px;flex-wrap:wrap">
63
+ <code style="color:var(--fg-1);font-size:14px;font-weight:600;letter-spacing:-.01em">${escapeHtml(requestLine)}</code>
64
+ ${statusBadge(c.status)}
65
+ ${durationBadge(c.duration)}
66
+ <span class="sm dim" style="flex-shrink:0">${timeStr}</span>
67
+ <button class="copy-btn" onclick="copyText('${escapeHtml(requestLine)}', this)" title="Copy request" style="margin-left:auto">${COPY_ICON}</button>
68
+ </div>
69
+ <div style="margin-top:8px">
70
+ <code class="sm dim" style="font-size:11px">${entry.uuid}</code>
71
+ </div>
72
72
  </div>
73
73
 
74
74
  <div class="stats">
@@ -20,7 +20,6 @@ export async function renderRequestsPage(store: HeartbeatStore, basePath: string
20
20
  })
21
21
 
22
22
  const content = `
23
- <h1 class="page-title">Requests</h1>
24
23
  <div class="card">
25
24
  ${table(['Method', 'Path', 'Status', 'Duration', 'IP', 'Time'], rows)}
26
25
  </div>
@@ -51,6 +51,7 @@ export function renderLayout(options: {
51
51
  </aside>
52
52
  <main>
53
53
  <div class="topbar">
54
+ <h1 class="page-title">${title}</h1>
54
55
  <button class="theme-btn" onclick="toggleTheme()" title="Toggle theme">${ICONS.moon}</button>
55
56
  </div>
56
57
  ${content}
@@ -156,8 +157,8 @@ body{
156
157
 
157
158
  /* Main */
158
159
  main{margin-left:200px;flex:1;padding:24px 28px;max-width:1200px;position:relative}
159
- .topbar{display:flex;justify-content:flex-end;margin-bottom:8px}
160
- .page-title{font-size:18px;font-weight:600;letter-spacing:-.02em;margin-bottom:20px;color:var(--fg-0)}
160
+ .topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}
161
+ .page-title{font-size:18px;font-weight:600;letter-spacing:-.02em;color:var(--fg-0);margin:0}
161
162
 
162
163
  /* Cards */
163
164
  .card{