Skip to content

Commit 3955971

Browse files
beacon: relays page defaults to Public tab, sorted by uptime
- ui: relaysState default filter 'public', sortKey 'uptime' (desc). - db: relaysDirectory defaults filter='public', sort='quality' so direct API hits match. npm test 62/62. Closes #25
1 parent 9ddf614 commit 3955971

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ <h2>${esc(c.name || short(pk))}</h2>
355355
}
356356

357357
// ---- relay directory (firehose health data) ----
358-
const relaysState = { filter: 'online', sortKey: 'lastChecked', dir: -1, rows: [], meta: {} };
358+
const relaysState = { filter: 'public', sortKey: 'uptime', dir: -1, rows: [], meta: {} };
359359
const RTABS = [
360360
{ key: 'all', label: 'All' },
361361
{ key: 'online', label: 'Online' },

src/db.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ const RELAY_FILTERS = {
130130
* Read the relay-health directory in one round-trip ($facet): per-tab `counts`
131131
* (all/online/writable/paid/auth), the freshest `lastChecked` (freshness
132132
* caveat), and the filtered+sorted page. `filter` is a tab key (default
133-
* 'online'); `sort` is 'recent' (default), 'quality', or 'latency'.
133+
* 'public'); `sort` is 'quality' (default, uptime desc), 'recent', or 'latency'.
134134
*/
135-
export async function relaysDirectory({ filter = 'online', sort = 'recent', limit = 1000 } = {}) {
135+
export async function relaysDirectory({ filter = 'public', sort = 'quality', limit = 1000 } = {}) {
136136
const col = (await connect()).collection(RELAY_DIRECTORY);
137137
const match = RELAY_FILTERS[filter] || RELAY_FILTERS.online;
138138
const sortSpec = sort === 'quality' ? { uptime: -1, responseTime: 1 }

0 commit comments

Comments
 (0)