Diagnostics for atproto PDS hosts, DIDs, and handles: https://debug.hose.cam

add server status

Changed files
+35 -2
+35 -2
index.html
··· 98 98 }, 99 99 })); 100 100 101 + Alpine.data('pdsCheck', pds => ({ 102 + loading: false, 103 + error: null, 104 + status: null, 105 + 106 + async init() { 107 + this.loading = true; 108 + this.error = null; 109 + this.status = null; 110 + let query = window.SimpleQuery(pds); 111 + try { 112 + await query('com.atproto.server.describeServer'); 113 + this.status = 'online'; 114 + } catch (e) { 115 + if (window.isXrpcErr(e)) { 116 + this.error = e.error; 117 + } else { 118 + this.error = 'Failed to reach (see console)'; 119 + console.error(e); 120 + } 121 + } 122 + this.loading = false; 123 + } 124 + })) 125 + 101 126 Alpine.data('relayCheckHost', (pds, relay) => ({ 102 127 loading: false, 103 128 error: null, ··· 113 138 this.loading = true; 114 139 this.error = null; 115 140 this.status = null; 116 - let query = window.SimpleQuery(`https://${relay.hostname}`); 141 + const query = window.SimpleQuery(`https://${relay.hostname}`); 117 142 const hostname = pds.split('://')[1]; 118 143 let data; 119 144 try { ··· 207 232 <h2 class="card-title"> 208 233 <span class="badge badge-secondary">PDS</span> 209 234 <span x-text="pds"></span> 210 - </h2> 235 + </h2> 236 + 237 + <h3 class="text-lg">Server</h3> 238 + <div x-data="pdsCheck(pds)"> 239 + <div 240 + x-show="status !== null" 241 + x-text="`status: ${status}`" 242 + ></div> 243 + </div> 211 244 212 245 <h3 class="text-lg">Relay host status</h3> 213 246 <div class="overflow-x-auto">