misc: add util page for photon instance

This commit is contained in:
Xylight committed 2024-09-05 17:33:31 -07:00
1 parent f0134dbbcf
commit 683523d32c
3 files changed
+54 -23

No files matched your search

@@ -27,7 +27,7 @@
on:click={() => invalidate(route.href)} on:click={() => invalidate(route.href)}
href={route.href} href={route.href}
class="font-medium rounded-full px-4 py-1 hover:bg-slate-200/40 hover:dark:bg-zinc-700/40 class="font-medium rounded-full px-4 py-1 hover:bg-slate-200/40 hover:dark:bg-zinc-700/40
transition-colors duration-100 relative z-0" transition-colors duration-100 relative z-0 flex-shrink-0"
> >
{route.name} {route.name}
{#if isSelected($page.url, currentRoute, route.href)} {#if isSelected($page.url, currentRoute, route.href)}
+38 -22
View File
@@ -2,29 +2,45 @@
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import MultiSelect from '$lib/components/input/Switch.svelte' import MultiSelect from '$lib/components/input/Switch.svelte'
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
</script> </script>
<MultiSelect <div class="flex flex-col gap-2">
headless <div
options={[ class="sticky mx-auto z-50 max-w-full min-w-0 flex items-center gap-2"
'/util', style="top: max(1.5rem, {$contentPadding.top}px);"
'/util/photonify', >
'/util/placeholder', <Tabs
'/util/constants', routes={[
'/util/functions', {
]} href: '/util',
optionNames={[ name: 'Home',
'Home', },
'Photonify links', {
'Placeholders', href: '/util/instance',
'Constants', name: 'Photon instance',
'Functions', },
]} {
selected={$page.url.pathname} href: '/util/photonify',
on:select={(e) => { name: 'Photonify Links',
goto(e.detail) },
}} {
/> href: '/util/placeholder',
<div class="mt-4 flex flex-col gap-2"> name: 'Placeholders',
},
{
href: '/util/constants',
name: 'Constants',
},
{
href: '/functions',
name: 'Functions',
},
]}
class="overflow-auto"
currentRoute={$page.url.toString()}
/>
</div>
<slot /> <slot />
</div> </div>
+15
View File
@@ -0,0 +1,15 @@
<script>
import { env } from '$env/dynamic/public'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance'
</script>
<Header pageHeader>Photon instance</Header>
<pre>
photon version: {__VERSION__}
linked instance: {LINKED_INSTANCE_URL ?? 'none'}
default instance: {DEFAULT_INSTANCE_URL}
SSR enabled: {env.PUBLIC_SSR_ENABLED ?? 'false'}
default theme: {env.PUBLIC_THEME ?? "mr xylight's very awesome colors"}
</pre>