diff --git a/index.html b/index.html index 7e03301..fb74acb 100644 --- a/index.html +++ b/index.html @@ -37,10 +37,6 @@ window.slingshot = window.SimpleQuery('https://slingshot.microcosm.blue'); window.relays = [ - { - name: 'Bluesky production', - hostname: 'bsky.network', - }, { name: 'Bluesky sync1.1 East', hostname: 'relay1.us-east.bsky.network', @@ -49,10 +45,6 @@ name: 'Bluesky sync1.1 West', hostname: 'relay1.us-west.bsky.network', }, - { - name: 'Blacksky', - hostname: 'atproto.africa', - }, { name: 'Microcosm Montreal', hostname: 'relay.fire.hose.cam', @@ -61,6 +53,18 @@ name: 'Microcosm France', hostname: 'relay3.fr.hose.cam', }, + { + name: 'Bluesky prod (old)', + hostname: 'bsky.network', + }, + { + name: 'Blacksky (partial xrpc)', + hostname: 'atproto.africa', + }, + { + name: 'Upcloud (no CORS)', + hostname: 'relay.upcloud.world', + }, ]; @@ -319,7 +323,73 @@ } loading = false; } - })) + })); + + Alpine.data('didRepoState', (did, pds) => ({ + loading: false, + error: null, + state: null, + + async init() { + await this.checkRepoState(did, pds); + }, + async checkRepoState(did, pds) { + this.loading = true; + this.error = null; + this.state = null; + + if (!did || !pds) { + this.loading = false; + return; + } + const query = window.SimpleQuery(pds); + try { + this.state = await query('com.atproto.sync.getRepoStatus', { + params: { did }, + }); + } catch (e) { + if (window.isXrpcErr(e)) { + this.error = e.error; + } else { + this.error = 'failed (see console)'; + console.error(e); + } + } + this.loading = false; + }, + })); + + Alpine.data('relayCheckRepo', (did, relay) => ({ + loading: false, + error: null, + status: null, + + async init() { + await this.check(did, relay); + }, + + async check(did, relay) { + this.loading = true; + this.error = null; + this.status = null; + + const query = window.SimpleQuery(`https://${relay.hostname}`); + try { + this.status = await query('com.atproto.sync.getRepoStatus', { + params: { did }, + }); + } catch(e) { + if (window.isXrpcErr(e)) { + this.error = e.error; + } else { + this.error = 'Failed to check (see console)'; + console.error(e); + } + } + + this.loading = false; + }, + })); }) @@ -475,7 +545,7 @@