@debugkit/dashboard 0.8.0 → 0.10.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.
- package/dist/client/assets/_authed-3se5Egqg.js +1 -0
- package/dist/client/assets/_authed-BfFWbTOO.js +1 -0
- package/dist/client/assets/app-code-BKWbvUMR.js +1 -0
- package/dist/client/assets/closed-issues-Cl-8l4oR.js +1 -0
- package/dist/client/assets/{copy-button-ORgLIh59.js → copy-button-BwRd5q7l.js} +1 -1
- package/dist/client/assets/customers-Cf-R8BOg.js +1 -0
- package/dist/client/assets/empty-state-njgr1sWu.js +7 -0
- package/dist/client/assets/endpoints-BMqAUNyE.js +1 -0
- package/dist/client/assets/events._eventId-CVRZJ-bU.js +2 -0
- package/dist/client/assets/exchange-view-DVwSLcXF.js +2 -0
- package/dist/client/assets/index-DEnCDILF.js +10 -0
- package/dist/client/assets/{invite._token-CxXek2SP.js → invite._token-CKAfd5iB.js} +1 -1
- package/dist/client/assets/issues._fingerprint-Cm72LNM_.js +55 -0
- package/dist/client/assets/login-BTxOhEbN.js +1 -0
- package/dist/client/assets/request-panel-DmtFRF8Z.js +1 -0
- package/dist/client/assets/services._service-CU1a45f3.js +1 -0
- package/dist/client/assets/{sessions._sessionId-3wNImMqM.js → sessions._sessionId-LRo3QNQP.js} +1 -1
- package/dist/client/assets/settings-Ctzvl2LL.js +1 -0
- package/dist/client/assets/src-BiKxgjA_.js +3 -0
- package/dist/client/assets/styles-Tcq0pvWj.css +2 -0
- package/dist/client/assets/{team-Bud2-07A.js → team-xlrjhEGp.js} +1 -1
- package/dist/client/assets/{timeline-BSDhQPpY.js → timeline-WXE49N62.js} +1 -1
- package/dist/client/assets/ui-DRjjeSWy.js +1 -0
- package/dist/client/assets/version-banner-BYe4PVzv.js +1 -0
- package/dist/server/assets/_authed-Bn-IktVS.js +120 -0
- package/dist/server/assets/_authed-RXh7GpoE.js +252 -0
- package/dist/server/assets/_tanstack-start-manifest_v-C4dQ3MxD.js +122 -0
- package/dist/server/assets/app-code-BQL_FcSx.js +212 -0
- package/dist/server/assets/app-name-BcbY1BZN.js +11 -0
- package/dist/server/assets/closed-issues-o9U80FXv.js +45 -0
- package/dist/server/assets/config-Bp8m0B8q.js +57 -0
- package/dist/server/assets/{customers-CvSLt_xV.js → customers-CD84Bz4P.js} +11 -6
- package/dist/server/assets/{demo-BRTkdmQJ.js → demo-D-o8m75S.js} +225 -8
- package/dist/server/assets/{dynamodb-B0V3ZO20.js → dynamodb-CcH0cp7R.js} +55 -2
- package/dist/server/assets/empty-state-wz34oAi8.js +163 -0
- package/dist/server/assets/endpoints-8N389Poe.js +248 -0
- package/dist/server/assets/{endpoints-mPQXpH8C.js → endpoints-C0Cxc_-x.js} +38 -36
- package/dist/server/assets/{events._eventId-pkQBQ9sL.js → events._eventId-BOHkNO5W.js} +90 -351
- package/dist/server/assets/exchange-view-DzoSBt_R.js +112 -0
- package/dist/server/assets/{firestore-Jd-LeWZI.js → firestore-DyvYMiz3.js} +13 -2
- package/dist/server/assets/{fns-Di0vMpkQ.js → fns-BcVGbSID.js} +22 -7
- package/dist/server/assets/fns-DE03YExD.js +831 -0
- package/dist/server/assets/{invite._token-LwWF5YxP.js → invite._token-DhlACkIe.js} +3 -3
- package/dist/server/assets/{issues._fingerprint-DAA0QCuA.js → issues._fingerprint-BBd-_Nn5.js} +400 -28
- package/dist/server/assets/{login-DqjCU4DJ.js → login-CbfdHJvg.js} +3 -3
- package/dist/server/assets/{memory-aqsrtEUn.js → memory-CZBUh1Zc.js} +129 -5
- package/dist/server/assets/{errors-C2KEDL7l.js → queries-wha4cZbw.js} +1442 -129
- package/dist/server/assets/request-panel-DpCSwl2q.js +162 -0
- package/dist/server/assets/{router-C0Dauj2C.js → router-BXkzR89j.js} +197 -91
- package/dist/server/assets/services._service-DWjFFGON.js +309 -0
- package/dist/server/assets/{sessions._sessionId-D7JPV0M4.js → sessions._sessionId-DDspiPTe.js} +2 -2
- package/dist/server/assets/{settings-Drjd64d7.js → settings-DCLIaZ_p.js} +201 -24
- package/dist/server/assets/{src-C4fNgijW.js → src-B2GKPQyN.js} +1 -1
- package/dist/server/assets/{team-D7iXYnSE.js → team-jd_TmWP4.js} +3 -3
- package/dist/server/assets/ui-C3pl0edn.js +302 -0
- package/dist/server/assets/version-banner-BX34ijG5.js +106 -0
- package/dist/server/assets/versions-YI_zK1ql.js +58 -0
- package/dist/server/assets/warm-C3GbXP1_.js +16 -0
- package/dist/server/server.js +40 -28
- package/package.json +4 -4
- package/dist/client/assets/_authed-CNObwuZh.js +0 -7
- package/dist/client/assets/_authed-CuP-He8G.js +0 -1
- package/dist/client/assets/charts-CUvev8lV.js +0 -55
- package/dist/client/assets/customers-DTMEprFQ.js +0 -1
- package/dist/client/assets/endpoints-lMSO2CdM.js +0 -1
- package/dist/client/assets/events._eventId-bWag-i8J.js +0 -3
- package/dist/client/assets/index-BNpacHyi.js +0 -10
- package/dist/client/assets/issues._fingerprint-BQr85TVY.js +0 -1
- package/dist/client/assets/login-Dlk3GyyC.js +0 -1
- package/dist/client/assets/settings-CzbEYB7k.js +0 -1
- package/dist/client/assets/src-Dq5mIUf0.js +0 -3
- package/dist/client/assets/styles-DPsgRH7g.css +0 -2
- package/dist/client/assets/ui-CEv2y56s.js +0 -1
- package/dist/server/assets/_authed-DkkRwdZl.js +0 -87
- package/dist/server/assets/_authed-DsB8kjZB.js +0 -902
- package/dist/server/assets/_tanstack-start-manifest_v-D1_ErrJK.js +0 -97
- package/dist/server/assets/charts-DzTVqJ8z.js +0 -238
- package/dist/server/assets/fns-B3PHbFwV.js +0 -1295
- package/dist/server/assets/ui-B_XHlLUQ.js +0 -193
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { t as ClosedIssues } from "./closed-issues-o9U80FXv.js";
|
|
2
|
+
import { t as EmptyState } from "./empty-state-wz34oAi8.js";
|
|
3
|
+
import { n as RetentionNote, t as RangePicker } from "./range-picker-0zbSGr3Z.js";
|
|
4
|
+
import { c as LevelRow, f as levelName, m as toneClass, p as timeAgo } from "./ui-C3pl0edn.js";
|
|
5
|
+
import { B as endpointsOf, G as serviceTile, H as isOpen, K as servicesOf, P as HEALTH_ORDER, U as pct, V as failing, W as plural, q as whoseLine, z as endpointLevel } from "./queries-wha4cZbw.js";
|
|
6
|
+
import { t as bodyView } from "./exchange-view-DzoSBt_R.js";
|
|
7
|
+
import { r as Route } from "./router-BXkzR89j.js";
|
|
8
|
+
import { Link, useNavigate } from "@tanstack/react-router";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
// src/routes/_authed/services.$service.tsx?tsr-split=component
|
|
11
|
+
/**
|
|
12
|
+
* One service, one level down from the health wall: its endpoints worst first, each with what
|
|
13
|
+
* the server said, how often, and the issues behind it (one click from the cause and the fix).
|
|
14
|
+
*/
|
|
15
|
+
function ServicePage() {
|
|
16
|
+
const report = Route.useLoaderData();
|
|
17
|
+
const { service } = Route.useParams();
|
|
18
|
+
const search = Route.useSearch();
|
|
19
|
+
const navigate = useNavigate({ from: Route.fullPath });
|
|
20
|
+
if (!report) return /* @__PURE__ */ jsx(EmptyState, {});
|
|
21
|
+
const { range } = report;
|
|
22
|
+
const keep = {
|
|
23
|
+
app: report.app,
|
|
24
|
+
range: search.range,
|
|
25
|
+
from: search.from,
|
|
26
|
+
to: search.to
|
|
27
|
+
};
|
|
28
|
+
const endpoints = endpointsOf(service, report.endpoints);
|
|
29
|
+
const grouped = servicesOf(endpoints)[0];
|
|
30
|
+
const summary = grouped && {
|
|
31
|
+
...grouped,
|
|
32
|
+
key: service
|
|
33
|
+
};
|
|
34
|
+
const now = Date.parse(report.generatedAt);
|
|
35
|
+
const tile = summary && serviceTile(summary, endpoints, now);
|
|
36
|
+
const rows = endpoints.map((e) => ({
|
|
37
|
+
e,
|
|
38
|
+
level: endpointLevel(e)
|
|
39
|
+
})).sort((a, b) => HEALTH_ORDER[b.level] - HEALTH_ORDER[a.level] || failing(b.e) - failing(a.e));
|
|
40
|
+
const broken = rows.filter((r) => r.level !== "healthy");
|
|
41
|
+
const healthy = rows.filter((r) => r.level === "healthy");
|
|
42
|
+
const closed = /* @__PURE__ */ new Map();
|
|
43
|
+
for (const e of endpoints) for (const p of e.problems) if (!isOpen(p.issueStatus)) closed.set(p.fingerprint, {
|
|
44
|
+
...p,
|
|
45
|
+
status: p.issueStatus
|
|
46
|
+
});
|
|
47
|
+
return /* @__PURE__ */ jsxs("main", {
|
|
48
|
+
className: "mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("div", {
|
|
51
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
52
|
+
children: [/* @__PURE__ */ jsxs("nav", {
|
|
53
|
+
"aria-label": "Breadcrumb",
|
|
54
|
+
className: "text-sm text-muted",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Link, {
|
|
57
|
+
to: "/",
|
|
58
|
+
search: keep,
|
|
59
|
+
className: "hover:text-ink hover:underline",
|
|
60
|
+
children: "Health"
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsx("span", {
|
|
63
|
+
"aria-hidden": true,
|
|
64
|
+
children: " › "
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx("span", {
|
|
67
|
+
className: "text-ink",
|
|
68
|
+
"aria-current": "page",
|
|
69
|
+
children: tile?.name ?? service
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}), /* @__PURE__ */ jsx(RangePicker, {
|
|
73
|
+
value: range,
|
|
74
|
+
today: report.generatedAt.slice(0, 10),
|
|
75
|
+
onChange: (r) => navigate({ search: (s) => ({
|
|
76
|
+
...s,
|
|
77
|
+
...r
|
|
78
|
+
}) })
|
|
79
|
+
}, `${range.preset}${range.from}${range.to}`)]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsx(RetentionNote, {
|
|
82
|
+
rangeFrom: range.from,
|
|
83
|
+
retention: report.retention
|
|
84
|
+
}),
|
|
85
|
+
!tile ? /* @__PURE__ */ jsxs("p", {
|
|
86
|
+
className: "text-sm text-muted",
|
|
87
|
+
children: [
|
|
88
|
+
service,
|
|
89
|
+
" had no calls or failures in ",
|
|
90
|
+
range.label,
|
|
91
|
+
"."
|
|
92
|
+
]
|
|
93
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
94
|
+
/* @__PURE__ */ jsxs("header", { children: [
|
|
95
|
+
/* @__PURE__ */ jsxs("p", {
|
|
96
|
+
className: "text-xs font-bold uppercase tracking-wide",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx("span", {
|
|
99
|
+
className: toneClass(tile.level, "text"),
|
|
100
|
+
children: levelName(tile.level)
|
|
101
|
+
}),
|
|
102
|
+
tile.live && /* @__PURE__ */ jsx("span", {
|
|
103
|
+
className: `ml-2 normal-case ${toneClass(tile.level, "text")}`,
|
|
104
|
+
children: "· Still happening"
|
|
105
|
+
}),
|
|
106
|
+
tile.sideLabel && /* @__PURE__ */ jsx("span", {
|
|
107
|
+
className: "ml-2 rounded-full border border-line px-1.5 py-px normal-case text-muted",
|
|
108
|
+
children: tile.sideLabel
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ jsx("h1", {
|
|
113
|
+
className: "mt-1 text-2xl font-semibold tracking-tight",
|
|
114
|
+
children: tile.name
|
|
115
|
+
}),
|
|
116
|
+
tile.outage && /* @__PURE__ */ jsxs("p", {
|
|
117
|
+
role: "status",
|
|
118
|
+
className: `mt-2 rounded-lg border-2 px-3 py-2 text-sm font-semibold ${toneClass("critical", "surface")}`,
|
|
119
|
+
children: [
|
|
120
|
+
tile.outage,
|
|
121
|
+
". ",
|
|
122
|
+
whoseLine(tile)
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsxs("p", {
|
|
126
|
+
className: "mt-1 text-sm text-muted",
|
|
127
|
+
children: [
|
|
128
|
+
tile.measure,
|
|
129
|
+
" in ",
|
|
130
|
+
range.label,
|
|
131
|
+
tile.lastFailure ? `, the last ${timeAgo(tile.lastFailure, now)}` : "",
|
|
132
|
+
". ",
|
|
133
|
+
plural(endpoints.length, "endpoint"),
|
|
134
|
+
", worst first."
|
|
135
|
+
]
|
|
136
|
+
})
|
|
137
|
+
] }),
|
|
138
|
+
broken.length > 0 ? /* @__PURE__ */ jsx("ol", {
|
|
139
|
+
className: "space-y-3",
|
|
140
|
+
"aria-label": "Failing endpoints, worst first",
|
|
141
|
+
children: broken.map(({ e, level }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(LevelRow, {
|
|
142
|
+
level,
|
|
143
|
+
aside: e.failureRate !== null ? `${pct(e.failureRate)} failed` : plural(e.failures, "failure"),
|
|
144
|
+
children: /* @__PURE__ */ jsx(EndpointProblems, {
|
|
145
|
+
row: e,
|
|
146
|
+
keep,
|
|
147
|
+
now,
|
|
148
|
+
service
|
|
149
|
+
})
|
|
150
|
+
}) }, e.endpoint))
|
|
151
|
+
}) : /* @__PURE__ */ jsxs("p", {
|
|
152
|
+
className: "rounded-lg border border-level-healthy-edge bg-level-healthy-bg px-3 py-2 text-sm text-level-healthy-fg",
|
|
153
|
+
children: [
|
|
154
|
+
"Every call to ",
|
|
155
|
+
tile.name,
|
|
156
|
+
" worked in ",
|
|
157
|
+
range.label,
|
|
158
|
+
"."
|
|
159
|
+
]
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsx(ClosedIssues, {
|
|
162
|
+
issues: [...closed.values()],
|
|
163
|
+
keep,
|
|
164
|
+
now
|
|
165
|
+
}),
|
|
166
|
+
healthy.length > 0 && /* @__PURE__ */ jsxs("section", {
|
|
167
|
+
"aria-label": "Healthy endpoints",
|
|
168
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
169
|
+
className: "mb-2 text-sm font-semibold text-muted",
|
|
170
|
+
children: "Healthy"
|
|
171
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
172
|
+
className: "grid gap-2 sm:grid-cols-2 lg:grid-cols-3",
|
|
173
|
+
children: healthy.map(({ e }) => /* @__PURE__ */ jsxs("li", {
|
|
174
|
+
className: "rounded-lg border border-level-healthy-edge bg-level-healthy-bg px-3 py-2 text-sm text-level-healthy-fg",
|
|
175
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
176
|
+
className: "font-mono text-xs",
|
|
177
|
+
children: [
|
|
178
|
+
e.method,
|
|
179
|
+
" ",
|
|
180
|
+
e.path
|
|
181
|
+
]
|
|
182
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
183
|
+
className: "block text-xs",
|
|
184
|
+
children: [e.calls?.toLocaleString() ?? "—", " calls, none failed"]
|
|
185
|
+
})]
|
|
186
|
+
}, e.endpoint))
|
|
187
|
+
})]
|
|
188
|
+
})
|
|
189
|
+
] })
|
|
190
|
+
]
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/** One failing endpoint: what the server said, how often, and the issues behind it. */
|
|
194
|
+
function EndpointProblems({ row, keep, now, service }) {
|
|
195
|
+
const said = [...row.statuses.slice(0, 3).map((s) => `${s.key} ×${s.count}`)];
|
|
196
|
+
const code = row.backendCodes[0];
|
|
197
|
+
const open = row.problems.filter((p) => isOpen(p.issueStatus));
|
|
198
|
+
const message = row.backendMessages[0];
|
|
199
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
200
|
+
className: "space-y-2",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsxs("div", {
|
|
203
|
+
className: "flex flex-wrap items-baseline justify-between gap-2",
|
|
204
|
+
children: [/* @__PURE__ */ jsxs("h2", {
|
|
205
|
+
className: "break-all font-mono text-sm font-semibold",
|
|
206
|
+
children: [
|
|
207
|
+
row.method,
|
|
208
|
+
" ",
|
|
209
|
+
row.path
|
|
210
|
+
]
|
|
211
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
212
|
+
className: "tabular text-xs text-muted",
|
|
213
|
+
children: [row.calls !== null ? `${(row.failedCalls ?? 0).toLocaleString()} of ${plural(row.calls, "call")} failed` : plural(row.failures, "stored failure"), row.lastFailure ? ` · last ${timeAgo(row.lastFailure, now)}` : ""]
|
|
214
|
+
})]
|
|
215
|
+
}),
|
|
216
|
+
(said.length > 0 || code || message) && /* @__PURE__ */ jsxs("p", {
|
|
217
|
+
className: "text-sm",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsx("span", {
|
|
220
|
+
className: "text-muted",
|
|
221
|
+
children: "The server said: "
|
|
222
|
+
}),
|
|
223
|
+
said.join(", "),
|
|
224
|
+
(code || message) && /* @__PURE__ */ jsxs(Fragment, { children: [said.length ? " · " : "", /* @__PURE__ */ jsx("span", {
|
|
225
|
+
className: "font-semibold",
|
|
226
|
+
children: [code?.key, message?.key && `"${message.key}"`].filter(Boolean).join(" ")
|
|
227
|
+
})] })
|
|
228
|
+
]
|
|
229
|
+
}),
|
|
230
|
+
row.lastAnswer?.body && /* @__PURE__ */ jsxs("details", {
|
|
231
|
+
open: true,
|
|
232
|
+
className: "rounded-lg border border-line bg-panel-2 p-2",
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsxs("summary", {
|
|
235
|
+
className: "cursor-pointer text-xs font-medium text-muted hover:text-ink",
|
|
236
|
+
children: [
|
|
237
|
+
"What the server answered last, ",
|
|
238
|
+
row.lastAnswer.status,
|
|
239
|
+
", ",
|
|
240
|
+
timeAgo(row.lastAnswer.ts, now)
|
|
241
|
+
]
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ jsx("pre", {
|
|
244
|
+
className: "mt-1.5 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed",
|
|
245
|
+
children: bodyView({ body: row.lastAnswer.body })?.text ?? row.lastAnswer.body
|
|
246
|
+
}),
|
|
247
|
+
/* @__PURE__ */ jsx(Link, {
|
|
248
|
+
to: "/issues/$fingerprint",
|
|
249
|
+
params: { fingerprint: row.lastAnswer.fingerprint },
|
|
250
|
+
search: {
|
|
251
|
+
...keep,
|
|
252
|
+
app: keep.app ?? ""
|
|
253
|
+
},
|
|
254
|
+
className: "text-xs text-accent hover:underline",
|
|
255
|
+
children: "The request and the whole response →"
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
}),
|
|
259
|
+
open.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
260
|
+
className: "space-y-1.5",
|
|
261
|
+
"aria-label": `What's causing it on ${row.method ?? ""} ${row.path ?? row.endpoint}`,
|
|
262
|
+
children: open.map((p) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Link, {
|
|
263
|
+
to: "/issues/$fingerprint",
|
|
264
|
+
params: { fingerprint: p.fingerprint },
|
|
265
|
+
search: {
|
|
266
|
+
...keep,
|
|
267
|
+
app: keep.app ?? ""
|
|
268
|
+
},
|
|
269
|
+
className: "group flex flex-wrap items-center justify-between gap-2 rounded-lg border border-line bg-panel-2 px-3 py-2 text-sm hover:border-accent focus-visible:outline-2 focus-visible:outline-accent",
|
|
270
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
271
|
+
className: "min-w-0 break-words",
|
|
272
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
273
|
+
className: "font-medium",
|
|
274
|
+
children: p.title
|
|
275
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
276
|
+
className: "tabular block text-xs text-muted",
|
|
277
|
+
children: [
|
|
278
|
+
p.count,
|
|
279
|
+
"× · ",
|
|
280
|
+
p.status,
|
|
281
|
+
" · ",
|
|
282
|
+
[p.platforms.join(", "), p.versions.slice(0, 2).map((v) => `app ${v}`).join(", ")].filter(Boolean).join(" · "),
|
|
283
|
+
" · last ",
|
|
284
|
+
timeAgo(p.lastSeen, now)
|
|
285
|
+
]
|
|
286
|
+
})]
|
|
287
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
288
|
+
className: "shrink-0 text-xs font-semibold text-accent group-hover:underline",
|
|
289
|
+
children: "Cause and fix →"
|
|
290
|
+
})]
|
|
291
|
+
}) }, p.fingerprint))
|
|
292
|
+
}),
|
|
293
|
+
row.problems.length > 0 && !open.length && /* @__PURE__ */ jsx("p", {
|
|
294
|
+
className: "text-sm text-muted",
|
|
295
|
+
children: "Its issues are all resolved or ignored (listed at the bottom): these failures came before that, or are still being looked at."
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ jsx(Link, {
|
|
298
|
+
to: "/endpoints",
|
|
299
|
+
search: {
|
|
300
|
+
...keep,
|
|
301
|
+
endpoint: row.endpoint
|
|
302
|
+
},
|
|
303
|
+
className: "inline-block text-xs text-accent hover:underline",
|
|
304
|
+
children: "Every failure on this endpoint, with traces →"
|
|
305
|
+
})
|
|
306
|
+
]
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
export { ServicePage as component };
|
package/dist/server/assets/{sessions._sessionId-D7JPV0M4.js → sessions._sessionId-DDspiPTe.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as CopyButton } from "./copy-button-D3RddzTw.js";
|
|
2
2
|
import { a as joined, i as clock, n as ICON, r as OutcomeBadge, s as roundedSpan, t as CrumbBody } from "./timeline-MDRNDhiA.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as Route } from "./router-
|
|
3
|
+
import { n as Card } from "./ui-C3pl0edn.js";
|
|
4
|
+
import { n as Route } from "./router-BXkzR89j.js";
|
|
5
5
|
import { Link } from "@tanstack/react-router";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
// src/routes/_authed/sessions.$sessionId.tsx?tsr-split=component
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { B as OWNER_INFO, O as hostKindLabel, P as normaliseHostMatch, z as OWNERS } from "./memory-CZBUh1Zc.js";
|
|
2
|
+
import { n as Card, p as timeAgo, t as AppOptions } from "./ui-C3pl0edn.js";
|
|
3
|
+
import { n as validAppName, t as appLabel } from "./app-name-BcbY1BZN.js";
|
|
4
|
+
import { i as partText, r as useVersionStatus, t as UpgradeCommand } from "./version-banner-BX34ijG5.js";
|
|
5
|
+
import { C as saveRetention, S as saveAppSettings, w as sendTestAlert, x as restampExisting } from "./fns-BcVGbSID.js";
|
|
6
|
+
import { c as Route } from "./router-BXkzR89j.js";
|
|
5
7
|
import { useState } from "react";
|
|
6
8
|
import { useNavigate, useRouter } from "@tanstack/react-router";
|
|
7
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -14,7 +16,8 @@ var CHOICES = [
|
|
|
14
16
|
365
|
|
15
17
|
];
|
|
16
18
|
function SettingsPage() {
|
|
17
|
-
const { apps, settings, seenHosts } = Route.useLoaderData();
|
|
19
|
+
const { apps, settings, seenHosts, names } = Route.useLoaderData();
|
|
20
|
+
const versions = useVersionStatus();
|
|
18
21
|
const navigate = useNavigate({ from: Route.fullPath });
|
|
19
22
|
const router = useRouter();
|
|
20
23
|
const [days, setDays] = useState(String(settings?.retentionDays ?? 60));
|
|
@@ -83,20 +86,36 @@ function SettingsPage() {
|
|
|
83
86
|
children: [
|
|
84
87
|
/* @__PURE__ */ jsxs("div", {
|
|
85
88
|
className: "flex flex-wrap items-end justify-between gap-3",
|
|
86
|
-
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
90
|
+
/* @__PURE__ */ jsx("p", {
|
|
91
|
+
className: "text-xs uppercase tracking-wide text-muted",
|
|
92
|
+
children: "Settings"
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx("h1", {
|
|
95
|
+
className: "text-2xl font-semibold tracking-tight",
|
|
96
|
+
children: appLabel(settings.app, settings.displayName)
|
|
97
|
+
}),
|
|
98
|
+
settings.displayName && /* @__PURE__ */ jsx("p", {
|
|
99
|
+
className: "font-mono text-xs text-muted",
|
|
100
|
+
children: settings.app
|
|
101
|
+
})
|
|
102
|
+
] }), apps.length > 1 && /* @__PURE__ */ jsx("select", {
|
|
93
103
|
"aria-label": "App",
|
|
94
104
|
value: settings.app,
|
|
95
105
|
onChange: (e) => navigate({ search: { app: e.target.value } }),
|
|
96
106
|
className: "rounded-md border border-line bg-panel px-2 py-1.5 text-sm",
|
|
97
|
-
children:
|
|
107
|
+
children: /* @__PURE__ */ jsx(AppOptions, {
|
|
108
|
+
apps,
|
|
109
|
+
names
|
|
110
|
+
})
|
|
98
111
|
})]
|
|
99
112
|
}),
|
|
113
|
+
versions && /* @__PURE__ */ jsx(VersionsCard, { status: versions }),
|
|
114
|
+
canEdit && /* @__PURE__ */ jsx(AppName, {
|
|
115
|
+
app: settings.app,
|
|
116
|
+
name: settings.displayName,
|
|
117
|
+
onStatus: setStatus
|
|
118
|
+
}, settings.app + settings.displayName),
|
|
100
119
|
/* @__PURE__ */ jsxs(Card, {
|
|
101
120
|
title: "Data retention",
|
|
102
121
|
subtitle: "Your data lives in your own database, so you decide how long to keep it.",
|
|
@@ -375,6 +394,76 @@ function FlowsAndAlerts({ settings, onStatus }) {
|
|
|
375
394
|
})
|
|
376
395
|
] });
|
|
377
396
|
}
|
|
397
|
+
/** The app's display name: what people see it as. The id stays what the SDK sends and what links use. */
|
|
398
|
+
function AppName({ app, name, onStatus }) {
|
|
399
|
+
const router = useRouter();
|
|
400
|
+
const [value, setValue] = useState(name);
|
|
401
|
+
const [busy, setBusy] = useState(false);
|
|
402
|
+
const cleaned = validAppName(value);
|
|
403
|
+
const next = typeof cleaned === "string" ? void 0 : cleaned.name;
|
|
404
|
+
const changed = next !== void 0 && next !== name;
|
|
405
|
+
const save = async () => {
|
|
406
|
+
setBusy(true);
|
|
407
|
+
onStatus(null);
|
|
408
|
+
const out = await saveAppSettings({ data: {
|
|
409
|
+
app,
|
|
410
|
+
displayName: value
|
|
411
|
+
} }).catch((e) => ({
|
|
412
|
+
ok: false,
|
|
413
|
+
error: e.message
|
|
414
|
+
}));
|
|
415
|
+
setBusy(false);
|
|
416
|
+
if (!out.ok) return onStatus({
|
|
417
|
+
tone: "error",
|
|
418
|
+
text: out.error
|
|
419
|
+
});
|
|
420
|
+
onStatus({
|
|
421
|
+
tone: "ok",
|
|
422
|
+
text: next ? `Saved. ${app} now shows as "${next}".` : `Saved. The app shows as ${app} again.`
|
|
423
|
+
});
|
|
424
|
+
await router.invalidate();
|
|
425
|
+
};
|
|
426
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
427
|
+
title: "App name",
|
|
428
|
+
subtitle: "What people see this app as. The app id stays the same in the SDK, links and keys.",
|
|
429
|
+
children: [/* @__PURE__ */ jsxs("form", {
|
|
430
|
+
className: "flex flex-wrap items-end gap-2",
|
|
431
|
+
onSubmit: (e) => {
|
|
432
|
+
e.preventDefault();
|
|
433
|
+
if (changed) save();
|
|
434
|
+
},
|
|
435
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
436
|
+
className: "min-w-0 flex-1 text-xs text-muted",
|
|
437
|
+
children: ["Display name", /* @__PURE__ */ jsx("input", {
|
|
438
|
+
value,
|
|
439
|
+
onChange: (e) => setValue(e.target.value),
|
|
440
|
+
placeholder: app,
|
|
441
|
+
maxLength: 60,
|
|
442
|
+
className: "mt-1 w-full rounded-md border border-line bg-panel px-2 py-1.5 text-sm text-ink"
|
|
443
|
+
})]
|
|
444
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
445
|
+
type: "submit",
|
|
446
|
+
disabled: !changed || busy,
|
|
447
|
+
className: "rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white disabled:opacity-40",
|
|
448
|
+
children: "Save"
|
|
449
|
+
})]
|
|
450
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
451
|
+
className: "mt-2 text-xs text-muted",
|
|
452
|
+
children: [
|
|
453
|
+
"Leave it empty to show the id (",
|
|
454
|
+
app,
|
|
455
|
+
")."
|
|
456
|
+
]
|
|
457
|
+
})]
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
var EMPTY_ROW = {
|
|
461
|
+
match: "",
|
|
462
|
+
name: "",
|
|
463
|
+
owner: "",
|
|
464
|
+
kind: "",
|
|
465
|
+
provider: ""
|
|
466
|
+
};
|
|
378
467
|
/** Owners a host can be given; leaving it unset lets the classifier decide. */
|
|
379
468
|
var HOST_OWNERS = OWNERS.filter((o) => o !== "unknown");
|
|
380
469
|
function HostNames({ app, hosts, seen, onStatus }) {
|
|
@@ -384,12 +473,12 @@ function HostNames({ app, hosts, seen, onStatus }) {
|
|
|
384
473
|
id: i,
|
|
385
474
|
match: h.match,
|
|
386
475
|
name: h.name,
|
|
387
|
-
owner: h.owner ?? ""
|
|
476
|
+
owner: h.owner ?? "",
|
|
477
|
+
kind: h.kind ?? "",
|
|
478
|
+
provider: h.provider ?? ""
|
|
388
479
|
})) : [{
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
name: "",
|
|
392
|
-
owner: ""
|
|
480
|
+
...EMPTY_ROW,
|
|
481
|
+
id: 0
|
|
393
482
|
}]);
|
|
394
483
|
const [busy, setBusy] = useState(false);
|
|
395
484
|
const named = new Set(rows.map((r) => normaliseHostMatch(r.match)));
|
|
@@ -400,10 +489,9 @@ function HostNames({ app, hosts, seen, onStatus }) {
|
|
|
400
489
|
} : r));
|
|
401
490
|
const add = (match = "") => {
|
|
402
491
|
setRows((rs) => [...rs.filter((r) => r.match || r.name), {
|
|
492
|
+
...EMPTY_ROW,
|
|
403
493
|
id: nextId,
|
|
404
|
-
match
|
|
405
|
-
name: "",
|
|
406
|
-
owner: ""
|
|
494
|
+
match
|
|
407
495
|
}]);
|
|
408
496
|
setNextId((n) => n + 1);
|
|
409
497
|
};
|
|
@@ -415,7 +503,9 @@ function HostNames({ app, hosts, seen, onStatus }) {
|
|
|
415
503
|
hosts: rows.map((r) => ({
|
|
416
504
|
match: r.match,
|
|
417
505
|
name: r.name,
|
|
418
|
-
...r.owner ? { owner: r.owner } : {}
|
|
506
|
+
...r.owner ? { owner: r.owner } : {},
|
|
507
|
+
...r.kind ? { kind: r.kind } : {},
|
|
508
|
+
...r.kind === "upstream" && r.provider.trim() ? { provider: r.provider } : {}
|
|
419
509
|
}))
|
|
420
510
|
} }).catch((e) => ({
|
|
421
511
|
ok: false,
|
|
@@ -442,7 +532,7 @@ function HostNames({ app, hosts, seen, onStatus }) {
|
|
|
442
532
|
rows.map((r, i) => /* @__PURE__ */ jsxs("div", {
|
|
443
533
|
role: "group",
|
|
444
534
|
"aria-label": `Host ${i + 1}`,
|
|
445
|
-
className: "grid gap-2 rounded-lg border border-line p-3 sm:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)
|
|
535
|
+
className: "grid gap-2 rounded-lg border border-line p-3 sm:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)_auto_auto_auto] sm:items-end sm:border-0 sm:p-0",
|
|
446
536
|
children: [
|
|
447
537
|
/* @__PURE__ */ jsxs("label", {
|
|
448
538
|
className: "min-w-0 text-xs text-muted",
|
|
@@ -479,6 +569,40 @@ function HostNames({ app, hosts, seen, onStatus }) {
|
|
|
479
569
|
}, o))]
|
|
480
570
|
})]
|
|
481
571
|
}),
|
|
572
|
+
/* @__PURE__ */ jsxs("div", {
|
|
573
|
+
className: "text-xs text-muted",
|
|
574
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
575
|
+
className: "block",
|
|
576
|
+
children: ["Whose service", /* @__PURE__ */ jsxs("select", {
|
|
577
|
+
value: r.kind,
|
|
578
|
+
onChange: (e) => update(r.id, { kind: e.target.value }),
|
|
579
|
+
className: `mt-1 w-full text-ink ${box}`,
|
|
580
|
+
children: [
|
|
581
|
+
/* @__PURE__ */ jsx("option", {
|
|
582
|
+
value: "",
|
|
583
|
+
children: "From the owner"
|
|
584
|
+
}),
|
|
585
|
+
/* @__PURE__ */ jsx("option", {
|
|
586
|
+
value: "ours",
|
|
587
|
+
children: hostKindLabel("ours")
|
|
588
|
+
}),
|
|
589
|
+
/* @__PURE__ */ jsx("option", {
|
|
590
|
+
value: "upstream",
|
|
591
|
+
children: "Upstream (a third party)"
|
|
592
|
+
})
|
|
593
|
+
]
|
|
594
|
+
})]
|
|
595
|
+
}), r.kind === "upstream" && /* @__PURE__ */ jsxs("label", {
|
|
596
|
+
className: "mt-1 block",
|
|
597
|
+
children: ["Upstream's name", /* @__PURE__ */ jsx("input", {
|
|
598
|
+
value: r.provider,
|
|
599
|
+
onChange: (e) => update(r.id, { provider: e.target.value }),
|
|
600
|
+
placeholder: "Provider name",
|
|
601
|
+
maxLength: 40,
|
|
602
|
+
className: `mt-1 w-full text-ink ${box}`
|
|
603
|
+
})]
|
|
604
|
+
})]
|
|
605
|
+
}),
|
|
482
606
|
/* @__PURE__ */ jsx("button", {
|
|
483
607
|
type: "button",
|
|
484
608
|
onClick: () => setRows((rs) => rs.filter((x) => x.id !== r.id)),
|
|
@@ -507,7 +631,7 @@ function HostNames({ app, hosts, seen, onStatus }) {
|
|
|
507
631
|
}),
|
|
508
632
|
/* @__PURE__ */ jsx("p", {
|
|
509
633
|
className: "text-xs text-muted",
|
|
510
|
-
children: "A path names part of a host: api.example.com/payments covers /payments/… only; the longest match wins. The owner decides who server errors from that host are passed to."
|
|
634
|
+
children: "A path names part of a host: api.example.com/payments covers /payments/… only; the longest match wins. The owner decides who server errors from that host are passed to. Mark a host, or a path on your own gateway, as upstream when your backend passes those calls on to a third party, such as a payment, messaging or telecom provider: Health then says when that service is down, rather than your backend or the app."
|
|
511
635
|
}),
|
|
512
636
|
/* @__PURE__ */ jsxs("div", {
|
|
513
637
|
className: "flex flex-wrap gap-2",
|
|
@@ -528,4 +652,57 @@ function HostNames({ app, hosts, seen, onStatus }) {
|
|
|
528
652
|
})
|
|
529
653
|
});
|
|
530
654
|
}
|
|
655
|
+
/** Only ingest or the dashboard a patch behind: nothing is missing yet. */
|
|
656
|
+
var patchOnly = (s) => s.level === "note" && s.behind.some((p) => p.part !== "sdk");
|
|
657
|
+
var upperFirst = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
658
|
+
var PART_LABEL = {
|
|
659
|
+
sdk: "App SDK (newest seen)",
|
|
660
|
+
ingest: "Ingest",
|
|
661
|
+
dashboard: "This dashboard"
|
|
662
|
+
};
|
|
663
|
+
/** The project's deBug versions, and what to run when one is behind. */
|
|
664
|
+
function VersionsCard({ status }) {
|
|
665
|
+
const behind = new Set(status.behind.map((p) => p.part));
|
|
666
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
667
|
+
title: "deBug versions",
|
|
668
|
+
subtitle: "Your app's SDK, your ingest and this dashboard are released together and work best on the same version.",
|
|
669
|
+
children: [/* @__PURE__ */ jsx("dl", {
|
|
670
|
+
className: "grid grid-cols-[minmax(8rem,auto)_1fr] gap-x-4 gap-y-1.5 text-sm",
|
|
671
|
+
children: status.parts.map((p) => /* @__PURE__ */ jsxs("div", {
|
|
672
|
+
className: "contents",
|
|
673
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
674
|
+
className: "text-muted",
|
|
675
|
+
children: PART_LABEL[p.part]
|
|
676
|
+
}), /* @__PURE__ */ jsxs("dd", {
|
|
677
|
+
className: behind.has(p.part) ? "font-medium text-sev-high" : "",
|
|
678
|
+
children: [p.version ?? (p.part === "sdk" ? "not seen yet" : "predates version tracking"), p.at && /* @__PURE__ */ jsxs("span", {
|
|
679
|
+
className: "ml-2 text-xs text-muted",
|
|
680
|
+
title: p.at,
|
|
681
|
+
children: [
|
|
682
|
+
p.part === "sdk" ? "seen" : "recorded",
|
|
683
|
+
" ",
|
|
684
|
+
timeAgo(p.at)
|
|
685
|
+
]
|
|
686
|
+
})]
|
|
687
|
+
})]
|
|
688
|
+
}, p.part))
|
|
689
|
+
}), status.level === "none" ? /* @__PURE__ */ jsx("p", {
|
|
690
|
+
className: "mt-3 text-xs text-muted",
|
|
691
|
+
children: "All in step."
|
|
692
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
693
|
+
className: "mt-3 space-y-2 text-sm",
|
|
694
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
695
|
+
className: status.level === "banner" ? "" : "text-muted",
|
|
696
|
+
children: [upperFirst(status.behind.map(partText).join(" and ")), patchOnly(status) ? `: a patch behind ${status.newest}, so nothing's missing, but worth catching up.` : `, behind ${status.newest}.`]
|
|
697
|
+
}), status.behind.some((p) => p.part !== "sdk") ? /* @__PURE__ */ jsx(UpgradeCommand, { status }) : /* @__PURE__ */ jsxs("p", {
|
|
698
|
+
className: "text-xs text-muted",
|
|
699
|
+
children: [
|
|
700
|
+
"Update @debugkit/sdk in your app to ",
|
|
701
|
+
status.newest,
|
|
702
|
+
"."
|
|
703
|
+
]
|
|
704
|
+
})]
|
|
705
|
+
})]
|
|
706
|
+
});
|
|
707
|
+
}
|
|
531
708
|
export { SettingsPage as component };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { n as Card, p as timeAgo } from "./ui-C3pl0edn.js";
|
|
2
|
+
import { T as setMemberRole, b as removeFromTeam, h as inviteToTeam, t as cancelInvite } from "./fns-BcVGbSID.js";
|
|
3
|
+
import { s as Route } from "./router-BXkzR89j.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { useRouter } from "@tanstack/react-router";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|