tangled
alpha
login
or
join now
bas.sh
/
pdsls
forked from
pds.ls/pdsls
0
fork
atom
atmosphere explorer
0
fork
atom
overview
issues
pulls
pipelines
conditionally show event types for jetstream
handle.invalid
2 months ago
f0a74a26
f51150e3
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+14
-2
2 changed files
expand all
collapse all
unified
split
src
views
stream
index.tsx
stats.tsx
+6
-1
src/views/stream/index.tsx
···
402
402
)}
403
403
</For>
404
404
</div>
405
405
-
<StreamStatsPanel stats={stats()} currentTime={currentTime()} streamType={streamType} />
405
405
+
<StreamStatsPanel
406
406
+
stats={stats()}
407
407
+
currentTime={currentTime()}
408
408
+
streamType={streamType}
409
409
+
showAllEvents={searchParams.allEvents === "on"}
410
410
+
/>
406
411
<div class="flex justify-end gap-2">
407
412
<button
408
413
type="button"
+8
-1
src/views/stream/stats.tsx
···
27
27
stats: StreamStats;
28
28
currentTime: number;
29
29
streamType: StreamType;
30
30
+
showAllEvents?: boolean;
30
31
}) => {
31
32
const config = () => STREAM_CONFIGS[props.streamType];
32
33
const uptime = () => (props.stats.connectedAt ? props.currentTime - props.stats.connectedAt : 0);
34
34
+
35
35
+
const shouldShowEventTypes = () => {
36
36
+
if (!config().showEventTypes) return false;
37
37
+
if (props.streamType === "jetstream") return props.showAllEvents === true;
38
38
+
return true;
39
39
+
};
33
40
34
41
const topCollections = () =>
35
42
Object.entries(props.stats.collections)
···
66
73
</div>
67
74
</div>
68
75
69
69
-
<Show when={topEventTypes().length > 0 && config().showEventTypes}>
76
76
+
<Show when={topEventTypes().length > 0 && shouldShowEventTypes()}>
70
77
<div class="mt-2">
71
78
<div class="mb-1 text-xs text-neutral-500 dark:text-neutral-400">Event Types</div>
72
79
<div class="grid grid-cols-[1fr_5rem_3rem] gap-x-1 gap-y-0.5 font-mono text-xs sm:gap-x-4">