From 2db2ca4a05f3a940f04a7660021f691e51946660 Mon Sep 17 00:00:00 2001 From: Astra Date: Mon, 21 Apr 2025 16:20:43 +0900 Subject: [PATCH] Formatting, cleanup, misc style changes, more config options --- config.ts | 49 +++++++++++-------- index.html | 2 +- src/App.svelte | 55 +++++++++++---------- src/app.css | 6 +-- src/lib/PostComponent.svelte | 2 +- src/lib/pdsfetch.ts | 92 ++++++++++++++++++++---------------- src/main.ts | 12 ++--- svelte.config.js | 4 +- vite.config.ts | 6 +-- 9 files changed, 122 insertions(+), 106 deletions(-) diff --git a/config.ts b/config.ts index fe28a5a..2b1b511 100644 --- a/config.ts +++ b/config.ts @@ -2,27 +2,34 @@ * Configuration module for the PDS Dashboard */ export class Config { - /** - * The base URL of the PDS (Personal Data Server) - * @default "https://pds.witchcraft.systems" - */ - static readonly PDS_URL: string = "https://pds.witchcraft.systems"; + /** + * The base URL of the PDS (Personal Data Server) + * @default "https://pds.witchcraft.systems" + */ + static readonly PDS_URL: string = "https://pds.witchcraft.systems"; + + /** + * The base URL of the frontend service for linking to replies + * @default "https://deer.social" + */ + static readonly FRONTEND_URL: string = "https://deer.social"; + + /** + * Maximum number of posts to show in the feed (across all users) + * @default 100 + */ + static readonly MAX_POSTS: number = 100; + + /** + * Footer text for the dashboard + * @default "Astrally projected from witchcraft.systems" + */ + static readonly FOOTER_TEXT: string = + "Astrally projected from witchcraft.systems"; /** - * The base URL of the frontend service for linking to replies - * @default "https://deer.social" + * Whether to show the posts that are in the future + * @default false */ - static readonly FRONTEND_URL: string = "https://deer.social"; - - /** - * Maximum number of posts to show in the feed (across all users) - * @default 100 - */ - static readonly MAX_POSTS: number = 100; - - /** - * Footer text for the dashboard - * @default "Astrally projected from witchcraft.systems" - */ - static readonly FOOTER_TEXT: string = "Astrally projected from witchcraft.systems"; -} \ No newline at end of file + static readonly SHOW_FUTURE_POSTS: boolean = false; +} diff --git a/index.html b/index.html index f71d006..adcfab3 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + diff --git a/src/App.svelte b/src/App.svelte index 95912e2..fa5a5c1 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -9,39 +9,38 @@
- {#await accountsPromise} -

Loading...

- {:then accountsData} -
-

ATProto PDS

-

Home to {accountsData.length} accounts

-
- {#each accountsData as accountObject} - - {/each} + {#await accountsPromise} +

Loading...

+ {:then accountsData} +
+

ATProto PDS

+

Home to {accountsData.length} accounts

+
+ {#each accountsData as accountObject} + + {/each} +
+

{@html Config.FOOTER_TEXT}

-

{@html Config.FOOTER_TEXT}

-
- {:catch error} -

Error: {error.message}

- {/await} + {:catch error} +

Error: {error.message}

+ {/await} - {#await postsPromise} -

Loading...

- {:then postsData} -
-
- {#each postsData as postObject} - - {/each} -
-
- {/await} + {#await postsPromise} +

Loading...

+ {:then postsData} +
+
+ {#each postsData as postObject} + + {/each} +
+
+ {/await}