+64
index.html
+64
index.html
···
78
did: null,
79
handle: null,
80
81
async diagnose() {
82
this.identifierLoading = true;
83
this.identifierError = null;
···
139
loadingDesc: false,
140
error: null,
141
description: null,
142
143
async init() {
144
await this.update(pds);
···
148
this.loadingDesc = true;
149
this.error = null;
150
this.description = null;
151
let query = window.SimpleQuery(pds);
152
try {
153
this.description = await query('com.atproto.server.describeServer');
154
} catch (e) {
155
if (window.isXrpcErr(e)) {
156
this.error = e.error;
···
328
x-text="!description.inviteCodeRequired"
329
></td>
330
</tr>
331
</tbody>
332
</table>
333
</div>
···
78
did: null,
79
handle: null,
80
81
+
async goto(identifier) {
82
+
this.identifier = identifier;
83
+
await this.diagnose();
84
+
},
85
+
86
async diagnose() {
87
this.identifierLoading = true;
88
this.identifierError = null;
···
144
loadingDesc: false,
145
error: null,
146
description: null,
147
+
accounts: [],
148
+
accountsComplete: false,
149
150
async init() {
151
await this.update(pds);
···
155
this.loadingDesc = true;
156
this.error = null;
157
this.description = null;
158
+
this.accounts = [];
159
let query = window.SimpleQuery(pds);
160
try {
161
this.description = await query('com.atproto.server.describeServer');
162
+
} catch (e) {
163
+
if (window.isXrpcErr(e)) {
164
+
this.error = e.error;
165
+
} else {
166
+
this.error = 'Failed to reach (see console)';
167
+
console.error(e);
168
+
}
169
+
}
170
+
let accountsRes;
171
+
try {
172
+
accountsRes = await query('com.atproto.sync.listRepos', {
173
+
params: { limit: 7 },
174
+
});
175
+
this.accounts = accountsRes.repos;
176
+
this.accountsComplete == !accountsRes.cursor;
177
} catch (e) {
178
if (window.isXrpcErr(e)) {
179
this.error = e.error;
···
351
x-text="!description.inviteCodeRequired"
352
></td>
353
</tr>
354
+
</tbody>
355
+
</table>
356
+
<h4 class="font-bold">
357
+
Accounts
358
+
</h4>
359
+
<table class="table table-xs">
360
+
<tbody>
361
+
<template x-for="account in accounts">
362
+
<tr>
363
+
<td>
364
+
<code>
365
+
<a
366
+
href="#"
367
+
class="link"
368
+
x-text="account.did"
369
+
@click.prevent="goto(account.did)"
370
+
></a>
371
+
</code>
372
+
</td>
373
+
<td>
374
+
<span
375
+
x-show="account.active"
376
+
class="badge badge-sm badge-soft badge-success"
377
+
>
378
+
active
379
+
</span>
380
+
<span
381
+
x-show="!account.active"
382
+
x-text="account.status"
383
+
class="badge badge-sm badge-soft badge-warning"
384
+
></span>
385
+
</td>
386
+
</tr>
387
+
</template>
388
+
<template x-if="!accountsComplete">
389
+
<tr>
390
+
<td colspan="2" class="text-sm text-warning-content">
391
+
(account list clipped)
392
+
</td>
393
+
</tr>
394
+
</template>
395
</tbody>
396
</table>
397
</div>