simple list of pds servers with open registration
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add trust score hover/tap breakdown showing signal details

+23 -9
+23 -9
backend/routes/pages.ts
··· 30 30 totalCount: number; 31 31 }; 32 32 33 - function trustScore(s: PdsServer, latestVersion: string | null): number { 33 + type TrustResult = { score: number; breakdown: string }; 34 + 35 + function trustScore(s: PdsServer, latestVersion: string | null): TrustResult { 36 + const signals: string[] = []; 34 37 let score = 0; 35 - if (s.contact_email) score += 20; 36 - if (s.terms_of_service) score += 20; 37 - if (s.privacy_policy) score += 20; 38 - if (s.user_count != null && s.user_count > 5) score += 20; 39 - if (s.version && s.version === latestVersion) score += 20; 40 - return score; 38 + 39 + const check = (pass: boolean, label: string) => { 40 + signals.push(`${pass ? "\u2713" : "\u2717"} ${label}`); 41 + if (pass) score += 20; 42 + }; 43 + 44 + check(!!s.contact_email, "Contact email"); 45 + check(!!s.terms_of_service, "Terms of Service"); 46 + check(!!s.privacy_policy, "Privacy Policy"); 47 + check(s.user_count != null && s.user_count > 5, "Active users (>5)"); 48 + check(s.version === latestVersion, "Latest version"); 49 + 50 + return { score, breakdown: signals.join("\n") }; 41 51 } 42 52 43 53 function renderPage(servers: PdsServer[], opts: PageOpts): string { ··· 134 144 border-radius: 3px; 135 145 font-size: 0.75rem; 136 146 font-weight: 600; 147 + cursor: help; 137 148 } 138 149 .trust-high { background: #dcfce7; color: var(--green); } 139 150 .trust-mid { background: #fef3c7; color: var(--amber); } ··· 238 249 function renderRow( 239 250 s: PdsServer, 240 251 latestVersion: string | null, 241 - score: number, 252 + trust: TrustResult, 242 253 ): string { 254 + const { score, breakdown } = trust; 243 255 const hostname = new URL(s.url).hostname; 244 256 const flag = s.country_code ? countryFlag(s.country_code) + " " : ""; 245 257 const country = s.country_name || ""; ··· 267 279 : "trust-low"; 268 280 269 281 return `<tr> 270 - <td><span class="trust-score ${trustClass}">${score}%</span></td> 282 + <td><span class="trust-score ${trustClass}" title="${ 283 + esc(breakdown) 284 + }">${score}%</span></td> 271 285 <td class="hostname"><a href="${ 272 286 esc(s.url) 273 287 }" target="_blank" rel="noopener">${esc(hostname)}</a></td>