@apisurf/wireui 0.1.2
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/LICENSE +15 -0
- package/README.md +157 -0
- package/bin/wireui.mjs +233 -0
- package/dist/nitro.json +17 -0
- package/dist/public/assets/collections-CLHcfRfi.js +1 -0
- package/dist/public/assets/globals-CZiNFGaK.css +1 -0
- package/dist/public/assets/index-D5VFd_3H.js +14 -0
- package/dist/public/assets/kv-table-oB5gcq0i.js +2 -0
- package/dist/public/assets/query-BKAhHNIi.js +19 -0
- package/dist/public/assets/requests._requestId-Bu7E2eoI.js +1 -0
- package/dist/public/assets/routes-DDY2CfzA.js +1 -0
- package/dist/public/assets/runs._runId-CzwtVjYq.js +1 -0
- package/dist/public/assets/scoped-DB8raIWx.js +1 -0
- package/dist/public/assets/split-Br1RX2I4.js +1 -0
- package/dist/public/favicon.svg +1 -0
- package/dist/server/_chunks/ssr-renderer.mjs +26 -0
- package/dist/server/_libs/@tanstack/react-router+[...].mjs +15246 -0
- package/dist/server/_libs/h3+rou3+srvx.mjs +2086 -0
- package/dist/server/_libs/hookable.mjs +41 -0
- package/dist/server/_libs/tanstack__history.mjs +369 -0
- package/dist/server/_libs/ufo.mjs +64 -0
- package/dist/server/_runtime.mjs +35 -0
- package/dist/server/_ssr/api-Dw1Zb_PK.mjs +931 -0
- package/dist/server/_ssr/collections-CqidTQpw.mjs +495 -0
- package/dist/server/_ssr/empty-plugin-adapters-CCuiUfKt.mjs +5 -0
- package/dist/server/_ssr/kv-table-DQUkoItO.mjs +458 -0
- package/dist/server/_ssr/query-D4so9xiY.mjs +416 -0
- package/dist/server/_ssr/requests._requestId-BFukRwqL.mjs +942 -0
- package/dist/server/_ssr/router-CPcgc_kh.mjs +3176 -0
- package/dist/server/_ssr/routes-DaV9vGHn.mjs +375 -0
- package/dist/server/_ssr/runs._runId-Df_LmPHa.mjs +836 -0
- package/dist/server/_ssr/scoped-CnQ56K8h.mjs +42 -0
- package/dist/server/_ssr/split-DWrMIs7K.mjs +115 -0
- package/dist/server/_ssr/ssr.mjs +6827 -0
- package/dist/server/_ssr/start-zk_ZfrWl.mjs +4 -0
- package/dist/server/_tanstack-start-manifest_v-CARKjHfs.mjs +50 -0
- package/dist/server/index.mjs +368 -0
- package/package.json +71 -0
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import { require_jsx_runtime, useNavigate } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
2
|
+
import { Card, Dot, Empty, IconCheckCircle, IconCollections, IconXCircle, MethodBadge, Pill, Route$3, SectionTitle, Stat, StatGrid, StatusBadge, TabList, css, cx, formatAgo, formatBytes, formatCount, formatDateTime, formatMs, getScript, mono, pagePad, plural, runTone, runVerdict, scrollPane, tabKey, table, truncate, useNow, useTab, useUnreadable } from "./router-CPcgc_kh.mjs";
|
|
3
|
+
import { useEnvScoped } from "./scoped-CnQ56K8h.mjs";
|
|
4
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/collections-CqidTQpw.js
|
|
5
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
6
|
+
function CollectionPage() {
|
|
7
|
+
const loaded = Route$3.useLoaderData();
|
|
8
|
+
const { tab = "runs", entry } = Route$3.useSearch();
|
|
9
|
+
const navigate = useNavigate({ from: Route$3.fullPath });
|
|
10
|
+
const unreadable = useUnreadable();
|
|
11
|
+
const now = useNow(Date.now());
|
|
12
|
+
const { data } = useEnvScoped(loaded, async (env) => await getScript({ data: {
|
|
13
|
+
entry,
|
|
14
|
+
env
|
|
15
|
+
} }) ?? loaded);
|
|
16
|
+
const { script, runs, endpoints, checks } = data;
|
|
17
|
+
useTab({
|
|
18
|
+
key: tabKey.script(script.entry),
|
|
19
|
+
title: script.file,
|
|
20
|
+
icon: "collection"
|
|
21
|
+
});
|
|
22
|
+
if (unreadable) return unreadable;
|
|
23
|
+
const failedChecks = checks.filter((c) => c.last_status === "fail").length;
|
|
24
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
25
|
+
className: css({
|
|
26
|
+
display: "flex",
|
|
27
|
+
flexDir: "column",
|
|
28
|
+
h: "full",
|
|
29
|
+
minH: "0"
|
|
30
|
+
}),
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
|
|
33
|
+
className: css({
|
|
34
|
+
px: "5",
|
|
35
|
+
pt: "4",
|
|
36
|
+
pb: "3",
|
|
37
|
+
flexShrink: 0
|
|
38
|
+
}),
|
|
39
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
40
|
+
className: css({
|
|
41
|
+
display: "flex",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
gap: "2"
|
|
44
|
+
}),
|
|
45
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
46
|
+
className: css({
|
|
47
|
+
color: "muted",
|
|
48
|
+
display: "inline-flex"
|
|
49
|
+
}),
|
|
50
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconCollections, { size: 18 })
|
|
51
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
52
|
+
className: css({
|
|
53
|
+
fontSize: "18px",
|
|
54
|
+
fontWeight: "600",
|
|
55
|
+
m: "0"
|
|
56
|
+
}),
|
|
57
|
+
children: script.file
|
|
58
|
+
})]
|
|
59
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
60
|
+
className: cx(mono, css({
|
|
61
|
+
color: "muted",
|
|
62
|
+
m: "0",
|
|
63
|
+
mt: "0.5"
|
|
64
|
+
})),
|
|
65
|
+
title: script.entry,
|
|
66
|
+
children: script.rel
|
|
67
|
+
})]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabList, {
|
|
70
|
+
items: [
|
|
71
|
+
{
|
|
72
|
+
id: "runs",
|
|
73
|
+
label: "Runs",
|
|
74
|
+
count: runs.length
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "requests",
|
|
78
|
+
label: "Requests",
|
|
79
|
+
count: endpoints.length
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "checks",
|
|
83
|
+
label: "Checks",
|
|
84
|
+
count: checks.length,
|
|
85
|
+
tone: failedChecks ? "bad" : void 0,
|
|
86
|
+
hidden: checks.length === 0
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
value: tab,
|
|
90
|
+
onSelect: (next) => void navigate({ search: (s) => ({
|
|
91
|
+
...s,
|
|
92
|
+
tab: next === "runs" ? void 0 : next
|
|
93
|
+
}) })
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
96
|
+
className: scrollPane,
|
|
97
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
98
|
+
className: pagePad,
|
|
99
|
+
children: [
|
|
100
|
+
tab === "runs" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RunsTab, {
|
|
101
|
+
runs,
|
|
102
|
+
now
|
|
103
|
+
}) : null,
|
|
104
|
+
tab === "requests" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EndpointsTab, {
|
|
105
|
+
endpoints,
|
|
106
|
+
now
|
|
107
|
+
}) : null,
|
|
108
|
+
tab === "checks" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChecksTab, { checks }) : null
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function RunsTab({ runs, now }) {
|
|
116
|
+
const navigate = useNavigate();
|
|
117
|
+
if (runs.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Empty, { title: "No runs in this environment" });
|
|
118
|
+
const finished = runs.filter((r) => r.finished_at != null);
|
|
119
|
+
const walls = finished.map((r) => r.finished_at - r.started_at).toSorted((a, b) => a - b);
|
|
120
|
+
const median = walls.length ? walls[Math.floor((walls.length - 1) / 2)] : null;
|
|
121
|
+
const failed = runs.filter((r) => runTone(r) === "bad").length;
|
|
122
|
+
const requests = runs.reduce((sum, r) => sum + r.request_count, 0);
|
|
123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StatGrid, { children: [
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stat, {
|
|
126
|
+
label: "Runs",
|
|
127
|
+
value: formatCount(runs.length),
|
|
128
|
+
sub: `last ${formatAgo(now, runs[0].started_at)}`
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stat, {
|
|
131
|
+
label: "Failed runs",
|
|
132
|
+
value: formatCount(failed),
|
|
133
|
+
tone: failed ? "bad" : "ok",
|
|
134
|
+
sub: "threw, or a check failed"
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stat, {
|
|
137
|
+
label: "Median wall time",
|
|
138
|
+
value: formatMs(median),
|
|
139
|
+
sub: `${plural(finished.length, "finished run")}`
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stat, {
|
|
142
|
+
label: "Requests",
|
|
143
|
+
value: formatCount(requests),
|
|
144
|
+
sub: `${formatCount(Math.round(requests / runs.length))} per run`
|
|
145
|
+
})
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "Wall time per run" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WallTimeStrip, { runs })] }),
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "History" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
|
|
149
|
+
className: table,
|
|
150
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Run" }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Result" }),
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Env" }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
155
|
+
className: "num",
|
|
156
|
+
children: "Requests"
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
159
|
+
className: "num",
|
|
160
|
+
children: "Checks"
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
163
|
+
className: "num",
|
|
164
|
+
children: "Data"
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
167
|
+
className: "num",
|
|
168
|
+
children: "Wall"
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
171
|
+
className: "num",
|
|
172
|
+
children: "Started"
|
|
173
|
+
})
|
|
174
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: runs.map((run) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
175
|
+
"data-link": true,
|
|
176
|
+
onClick: () => void navigate({
|
|
177
|
+
to: "/runs/$runId",
|
|
178
|
+
params: { runId: String(run.id) }
|
|
179
|
+
}),
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
182
|
+
className: css({
|
|
183
|
+
display: "flex",
|
|
184
|
+
alignItems: "center",
|
|
185
|
+
gap: "2"
|
|
186
|
+
}),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Dot, { tone: runTone(run) }),
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
190
|
+
className: mono,
|
|
191
|
+
children: ["#", run.id]
|
|
192
|
+
}),
|
|
193
|
+
run.label && run.label !== run.entry.split("/").pop() ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
194
|
+
className: cx(truncate, css({ color: "muted" })),
|
|
195
|
+
children: run.label
|
|
196
|
+
}) : null
|
|
197
|
+
]
|
|
198
|
+
}) }),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
200
|
+
className: css({
|
|
201
|
+
color: "muted",
|
|
202
|
+
whiteSpace: "nowrap"
|
|
203
|
+
}),
|
|
204
|
+
children: runVerdict(run)
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: run.env ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, { children: run.env }) : null }),
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", {
|
|
208
|
+
className: "num",
|
|
209
|
+
children: [formatCount(run.request_count), run.error_count ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
210
|
+
className: css({ color: "warn" }),
|
|
211
|
+
children: [
|
|
212
|
+
" · ",
|
|
213
|
+
run.error_count,
|
|
214
|
+
"✕"
|
|
215
|
+
]
|
|
216
|
+
}) : null]
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
219
|
+
className: cx("num", run.failed_check_count ? css({ color: "bad" }) : void 0),
|
|
220
|
+
children: run.check_count ? `${run.check_count - run.failed_check_count}/${run.check_count}` : "—"
|
|
221
|
+
}),
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
223
|
+
className: cx("num", mono),
|
|
224
|
+
children: formatBytes(run.total_bytes)
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
227
|
+
className: cx("num", mono),
|
|
228
|
+
children: run.finished_at ? formatMs(run.finished_at - run.started_at) : "—"
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
231
|
+
className: cx("num", css({ color: "muted" })),
|
|
232
|
+
children: formatDateTime(now, run.started_at)
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
}, run.id)) })]
|
|
236
|
+
}) })] })
|
|
237
|
+
] });
|
|
238
|
+
}
|
|
239
|
+
var BAR_TONE = {
|
|
240
|
+
ok: css({ bg: "ok" }),
|
|
241
|
+
warn: css({ bg: "warn" }),
|
|
242
|
+
bad: css({ bg: "bad" }),
|
|
243
|
+
info: css({ bg: "info" }),
|
|
244
|
+
neutral: css({ bg: "faint" })
|
|
245
|
+
};
|
|
246
|
+
/** Most recent {@link STRIP_RUNS} runs as bars, oldest on the left. */
|
|
247
|
+
var STRIP_RUNS = 60;
|
|
248
|
+
function WallTimeStrip({ runs }) {
|
|
249
|
+
const navigate = useNavigate();
|
|
250
|
+
const shown = runs.slice(0, STRIP_RUNS).toReversed();
|
|
251
|
+
const walls = shown.map((r) => r.finished_at ? r.finished_at - r.started_at : 0);
|
|
252
|
+
const max = Math.max(...walls, 1);
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, {
|
|
254
|
+
className: css({ p: "3" }),
|
|
255
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
256
|
+
className: css({
|
|
257
|
+
display: "flex",
|
|
258
|
+
alignItems: "flex-end",
|
|
259
|
+
gap: "2px",
|
|
260
|
+
h: "88px"
|
|
261
|
+
}),
|
|
262
|
+
children: shown.map((run, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
263
|
+
type: "button",
|
|
264
|
+
title: `#${run.id} · ${formatMs(walls[i])} · ${runVerdict(run)}`,
|
|
265
|
+
onClick: () => void navigate({
|
|
266
|
+
to: "/runs/$runId",
|
|
267
|
+
params: { runId: String(run.id) }
|
|
268
|
+
}),
|
|
269
|
+
className: css({
|
|
270
|
+
flex: "1",
|
|
271
|
+
maxW: "22px",
|
|
272
|
+
minW: "4px",
|
|
273
|
+
h: "full",
|
|
274
|
+
display: "flex",
|
|
275
|
+
alignItems: "flex-end",
|
|
276
|
+
border: "none",
|
|
277
|
+
bg: "transparent",
|
|
278
|
+
p: "0",
|
|
279
|
+
cursor: "pointer",
|
|
280
|
+
rounded: "xs",
|
|
281
|
+
_hover: { bg: "hover" }
|
|
282
|
+
}),
|
|
283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
284
|
+
className: cx(css({
|
|
285
|
+
display: "block",
|
|
286
|
+
w: "full",
|
|
287
|
+
roundedTop: "sm"
|
|
288
|
+
}), BAR_TONE[runTone(run)]),
|
|
289
|
+
style: { height: `${Math.max(walls[i] / max * 100, 3)}%` }
|
|
290
|
+
})
|
|
291
|
+
}, run.id))
|
|
292
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
293
|
+
className: css({
|
|
294
|
+
display: "flex",
|
|
295
|
+
gap: "4",
|
|
296
|
+
mt: "2",
|
|
297
|
+
fontSize: "11px",
|
|
298
|
+
color: "muted",
|
|
299
|
+
flexWrap: "wrap"
|
|
300
|
+
}),
|
|
301
|
+
children: [
|
|
302
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: ["max ", formatMs(max)] }),
|
|
303
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Legend, {
|
|
304
|
+
tone: "ok",
|
|
305
|
+
label: "Passed"
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Legend, {
|
|
308
|
+
tone: "warn",
|
|
309
|
+
label: "Failed requests"
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Legend, {
|
|
312
|
+
tone: "bad",
|
|
313
|
+
label: "Threw or failed a check"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Legend, {
|
|
316
|
+
tone: "info",
|
|
317
|
+
label: "Unfinished"
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
})]
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function Legend({ tone, label }) {
|
|
324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
325
|
+
className: css({
|
|
326
|
+
display: "inline-flex",
|
|
327
|
+
alignItems: "center",
|
|
328
|
+
gap: "1"
|
|
329
|
+
}),
|
|
330
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cx(css({
|
|
331
|
+
w: "8px",
|
|
332
|
+
h: "8px",
|
|
333
|
+
rounded: "xs"
|
|
334
|
+
}), BAR_TONE[tone]) }), label]
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function EndpointsTab({ endpoints, now }) {
|
|
338
|
+
const navigate = useNavigate();
|
|
339
|
+
if (endpoints.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Empty, { title: "No requests in this environment" });
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
|
|
341
|
+
className: table,
|
|
342
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Request" }),
|
|
344
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Last" }),
|
|
345
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
346
|
+
className: "num",
|
|
347
|
+
children: "Calls"
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
350
|
+
className: "num",
|
|
351
|
+
children: "Errors"
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
354
|
+
className: "num",
|
|
355
|
+
children: "Avg"
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
358
|
+
className: "num",
|
|
359
|
+
children: "Last seen"
|
|
360
|
+
})
|
|
361
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: endpoints.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
362
|
+
"data-link": true,
|
|
363
|
+
onClick: () => void navigate({
|
|
364
|
+
to: "/requests/$requestId",
|
|
365
|
+
params: { requestId: String(row.last_request_id) }
|
|
366
|
+
}),
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
369
|
+
className: css({
|
|
370
|
+
maxW: "0",
|
|
371
|
+
w: "full"
|
|
372
|
+
}),
|
|
373
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
374
|
+
className: css({
|
|
375
|
+
display: "flex",
|
|
376
|
+
alignItems: "center",
|
|
377
|
+
gap: "2",
|
|
378
|
+
minW: "0"
|
|
379
|
+
}),
|
|
380
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MethodBadge, {
|
|
381
|
+
method: row.method,
|
|
382
|
+
kind: row.kind,
|
|
383
|
+
width: "list"
|
|
384
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
385
|
+
className: cx(truncate, mono),
|
|
386
|
+
title: `${row.host}${row.path}`,
|
|
387
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
388
|
+
className: css({ color: "faint" }),
|
|
389
|
+
children: row.host
|
|
390
|
+
}), row.path]
|
|
391
|
+
})]
|
|
392
|
+
})
|
|
393
|
+
}),
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusBadge, {
|
|
395
|
+
status: row.last_status,
|
|
396
|
+
error: row.last_error_name
|
|
397
|
+
}) }),
|
|
398
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
399
|
+
className: "num",
|
|
400
|
+
children: formatCount(row.count)
|
|
401
|
+
}),
|
|
402
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
403
|
+
className: cx("num", row.errors ? css({ color: "warn" }) : void 0),
|
|
404
|
+
children: formatCount(row.errors)
|
|
405
|
+
}),
|
|
406
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
407
|
+
className: cx("num", mono),
|
|
408
|
+
children: row.kind === "http" ? formatMs(row.avg_ms) : "—"
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
411
|
+
className: cx("num", css({ color: "muted" })),
|
|
412
|
+
children: formatAgo(now, row.last_ts)
|
|
413
|
+
})
|
|
414
|
+
]
|
|
415
|
+
}, `${row.kind} ${row.method} ${row.host}${row.path}`)) })]
|
|
416
|
+
}) });
|
|
417
|
+
}
|
|
418
|
+
function ChecksTab({ checks }) {
|
|
419
|
+
const navigate = useNavigate();
|
|
420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", {
|
|
421
|
+
className: table,
|
|
422
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Check" }),
|
|
424
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: "Latest" }),
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
426
|
+
className: "num",
|
|
427
|
+
children: "Pass rate"
|
|
428
|
+
}),
|
|
429
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
430
|
+
className: "num",
|
|
431
|
+
children: "Failures"
|
|
432
|
+
})
|
|
433
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: checks.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
434
|
+
"data-link": true,
|
|
435
|
+
onClick: () => void navigate({
|
|
436
|
+
to: "/runs/$runId",
|
|
437
|
+
params: { runId: String(row.last_run_id) },
|
|
438
|
+
search: { tab: "checks" }
|
|
439
|
+
}),
|
|
440
|
+
children: [
|
|
441
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
442
|
+
className: css({
|
|
443
|
+
maxW: "0",
|
|
444
|
+
w: "full"
|
|
445
|
+
}),
|
|
446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
447
|
+
className: css({
|
|
448
|
+
display: "flex",
|
|
449
|
+
gap: "2",
|
|
450
|
+
alignItems: "flex-start"
|
|
451
|
+
}),
|
|
452
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
453
|
+
className: row.last_status === "pass" ? css({ color: "ok" }) : css({ color: "bad" }),
|
|
454
|
+
children: row.last_status === "pass" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconCheckCircle, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconXCircle, { size: 15 })
|
|
455
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
456
|
+
className: css({ minW: "0" }),
|
|
457
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
458
|
+
className: cx(truncate, css({ display: "block" })),
|
|
459
|
+
children: row.name
|
|
460
|
+
}), row.last_status === "fail" && row.last_message ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
461
|
+
className: cx(truncate, css({
|
|
462
|
+
display: "block",
|
|
463
|
+
color: "bad",
|
|
464
|
+
fontSize: "12px"
|
|
465
|
+
})),
|
|
466
|
+
children: row.last_message
|
|
467
|
+
}) : null]
|
|
468
|
+
})]
|
|
469
|
+
})
|
|
470
|
+
}),
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: row.last_status === "pass" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, {
|
|
472
|
+
tone: "ok",
|
|
473
|
+
children: "pass"
|
|
474
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, {
|
|
475
|
+
tone: "bad",
|
|
476
|
+
children: "fail"
|
|
477
|
+
}) }),
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", {
|
|
479
|
+
className: "num",
|
|
480
|
+
children: [Math.round((row.total - row.failures) / row.total * 100), "%"]
|
|
481
|
+
}),
|
|
482
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", {
|
|
483
|
+
className: cx("num", row.failures ? css({ color: "bad" }) : void 0),
|
|
484
|
+
children: [
|
|
485
|
+
row.failures,
|
|
486
|
+
"/",
|
|
487
|
+
row.total
|
|
488
|
+
]
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
}, row.name)) })]
|
|
492
|
+
}) });
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
495
|
+
export { CollectionPage as component };
|