Skip to content

Commit fc2d3b1

Browse files
Merge pull request #26 from JavaScriptSolidServer/issue-25-relays-defaults
Relays page: default to Public tab, sorted by uptime
2 parents 9ddf614 + 3955971 commit fc2d3b1

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)