feat: add deubg menu to users
This commit is contained in:
1 parent
6516e99fe0
commit
8aa62b046e
4 files changed
+40
-8
No files matched your search
@@ -40,7 +40,11 @@ flex flex-col items-center justify-center bg-black/50 backdrop-blur-sm box-borde
|
||||
<h1 class="font-bold text-2xl w-max max-w-full">
|
||||
<slot name="title" />
|
||||
</h1>
|
||||
<Button class="!p-2 ml-auto" on:click={() => (open = false)}>
|
||||
<Button
|
||||
size="square-md"
|
||||
class="ml-auto"
|
||||
on:click={() => (open = false)}
|
||||
>
|
||||
<Icon src={XMark} mini size="16" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
</script>
|
||||
|
||||
<Modal bind:open>
|
||||
<span slot="title">Debug</span>
|
||||
<span slot="title"><slot name="title">Debug</slot></span>
|
||||
<DebugTree {object} isParent={true} />
|
||||
</Modal>
|
||||
@@ -12,13 +12,8 @@
|
||||
{#if typeof object[key] === 'object'}
|
||||
<svelte:self object={object[key]} isParent={false} />
|
||||
{:else}
|
||||
<pre>{object[key]}</pre>
|
||||
<pre class="break-words">{object[key]}</pre>
|
||||
{/if}
|
||||
</details>
|
||||
{/each}
|
||||
</ul>
|
||||
|
||||
<style>
|
||||
details {
|
||||
}
|
||||
</style>
|
||||
@@ -6,6 +6,8 @@
|
||||
resetProfile,
|
||||
deleteProfile,
|
||||
moveProfile,
|
||||
type Profile,
|
||||
profile,
|
||||
} from '$lib/auth.js'
|
||||
import Button from '$lib/components/input/Button.svelte'
|
||||
import TextInput from '$lib/components/input/TextInput.svelte'
|
||||
@@ -13,6 +15,7 @@
|
||||
import Menu from '$lib/components/ui/menu/Menu.svelte'
|
||||
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
|
||||
import { toast } from '$lib/components/ui/toasts/toasts.js'
|
||||
import DebugObject from '$lib/components/util/debug/DebugObject.svelte'
|
||||
import {
|
||||
DEFAULT_INSTANCE_URL,
|
||||
LINKED_INSTANCE_URL,
|
||||
@@ -20,9 +23,11 @@
|
||||
} from '$lib/instance.js'
|
||||
import { validateInstance } from '$lib/lemmy.js'
|
||||
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import {
|
||||
ArrowLeftOnRectangle,
|
||||
ArrowUturnLeft,
|
||||
BugAnt,
|
||||
ChevronDown,
|
||||
ChevronUp,
|
||||
EllipsisHorizontal,
|
||||
@@ -67,12 +72,29 @@
|
||||
}
|
||||
loading = false
|
||||
}
|
||||
|
||||
let debugging = false
|
||||
let debugProfile: Profile | undefined = undefined
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Accounts</title>
|
||||
</svelte:head>
|
||||
|
||||
{#if debugging}
|
||||
<DebugObject
|
||||
object={debugProfile?.id == $profile?.id ? $profile : debugProfile}
|
||||
bind:open={debugging}
|
||||
>
|
||||
<span slot="title" class="flex flex-col">
|
||||
<h1 class="font-bold text-2xl">Debug</h1>
|
||||
<span class="text-slate-600 dark:text-zinc-400 text-base font-normal">
|
||||
Do NOT share anything from this menu.
|
||||
</span>
|
||||
</span>
|
||||
</DebugObject>
|
||||
{/if}
|
||||
|
||||
{#if $profileData.profiles.length == 0}
|
||||
<div class="h-full flex items-center justify-center">
|
||||
<div
|
||||
@@ -171,6 +193,17 @@
|
||||
<Icon src={ArrowUturnLeft} size="16" mini slot="icon" />
|
||||
Reset Color
|
||||
</MenuButton>
|
||||
{#if $userSettings.debugInfo}
|
||||
<MenuButton
|
||||
on:click={() => {
|
||||
debugProfile = profile
|
||||
debugging = !debugging
|
||||
}}
|
||||
>
|
||||
<Icon src={BugAnt} size="16" mini slot="icon" />
|
||||
Debug Info
|
||||
</MenuButton>
|
||||
{/if}
|
||||
</Menu>
|
||||
<Button
|
||||
on:click={() => {
|
||||
|
||||
Reference in new issue
Block a user