Configuration options

This commit is contained in:
Astra 2025-04-20 15:04:51 +09:00
parent fe96164f4e
commit 164571ec19
Signed by: astra
SSH key fingerprint: SHA256:jQDNS75/33T59Ey4yAzrUPP/5YQaXEetsW8hwUae+ag
2 changed files with 20 additions and 3 deletions

16
config.ts Normal file
View file

@ -0,0 +1,16 @@
/**
* 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 frontend service for linking to replies
* @default "https://deer.social"
*/
static readonly FRONTEND_URL: string = "https://deer.social";
}

View file

@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Post } from "./pdsfetch"; import { Post } from "./pdsfetch";
import { Config } from "../../config"
let { post }: { post: Post } = $props(); let { post }: { post: Post } = $props();
</script> </script>
@ -8,8 +9,8 @@
{#if post.authorAvatarCid} {#if post.authorAvatarCid}
<img <img
id="avatar" id="avatar"
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.authorAvatarCid}"
alt="avatar of {post.displayName}" alt="avatar of {post.displayName}"
src="https://pds.witchcraft.systems/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.authorAvatarCid}"
/> />
{/if} {/if}
<p>{post.displayName} | {post.timenotstamp}</p> <p>{post.displayName} | {post.timenotstamp}</p>
@ -25,7 +26,7 @@
<img <img
id="embedImages" id="embedImages"
alt="Post Image" alt="Post Image"
src="https://pds.witchcraft.systems/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={imageLink}" src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={imageLink}"
/> />
{/each} {/each}
</div> </div>
@ -33,7 +34,7 @@
{#if post.videosLinkCid} {#if post.videosLinkCid}
<video <video
id="embedVideo" id="embedVideo"
src="https://pds.witchcraft.systems/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.videosLinkCid}" src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.videosLinkCid}"
/> />
{/if} {/if}
</div> </div>