move monero settings to dedicated /monero/settings page

- Create /monero/settings route with Restart Server and Save password with Touch ID
- Remove inline Settings card from monero dashboard
- Add Settings icon button (same as EVM) to monero wallet card
- Remove unused moneroSettingsPw state from dashboard
This commit is contained in:
2026-05-19 03:36:26 +08:00
parent 462b96f109
commit 79f8a26eb3
2 changed files with 75 additions and 26 deletions
+3 -26
View File
@@ -13,6 +13,7 @@
import ArrowDown from '@lucide/svelte/icons/arrow-down' import ArrowDown from '@lucide/svelte/icons/arrow-down'
import ArrowUp from '@lucide/svelte/icons/arrow-up' import ArrowUp from '@lucide/svelte/icons/arrow-up'
import Fingerprint from '@lucide/svelte/icons/fingerprint' import Fingerprint from '@lucide/svelte/icons/fingerprint'
import SettingsIcon from '@lucide/svelte/icons/settings'
import Loader from '$lib/components/loader.svelte' import Loader from '$lib/components/loader.svelte'
import { navigate } from 'sv-router/generated' import { navigate } from 'sv-router/generated'
@@ -25,7 +26,6 @@
let moneroSelectedWallet = $state('') let moneroSelectedWallet = $state('')
let moneroSelectedWalletPass = $state('') let moneroSelectedWalletPass = $state('')
let moneroUseBiometric = $state(false) let moneroUseBiometric = $state(false)
let moneroSettingsPw = $state('')
let initStarted = false let initStarted = false
$effect(() => { $effect(() => {
@@ -237,8 +237,8 @@
{/if} {/if}
Refresh Refresh
</Button> </Button>
<Button variant="outline" onclick={() => w.moneroStop()}> <Button variant="outline" onclick={() => navigate('/monero/settings')}>
Stop <SettingsIcon size={16} />
</Button> </Button>
<Button variant="outline" onclick={async () => { await w.logout(); window.location.href = '/' }}> <Button variant="outline" onclick={async () => { await w.logout(); window.location.href = '/' }}>
Logout Logout
@@ -247,29 +247,6 @@
</CardContent> </CardContent>
</Card> </Card>
<!-- Monero settings -->
<Card>
<CardHeader>
<CardTitle>Settings</CardTitle>
</CardHeader>
<CardContent>
{#if w.biometricAvailable}
<p class="text-xs font-medium mb-2">Save wallet password with Touch ID</p>
<p class="text-xs text-muted-foreground mb-3">Enter your wallet password to enable biometric unlock</p>
<div class="flex gap-2 items-end">
<Input type="password" placeholder="Wallet password" bind:value={moneroSettingsPw} />
<Button size="sm" onclick={async () => {
await w.moneroStorePassword(w.moneroWalletName, moneroSettingsPw)
moneroSettingsPw = ''
w.error = ''
}} disabled={!moneroSettingsPw || w.loading}>Save</Button>
</div>
{:else}
<p class="text-xs text-muted-foreground">Biometric authentication not available on this device</p>
{/if}
</CardContent>
</Card>
<!-- Monero transactions --> <!-- Monero transactions -->
<Card> <Card>
<CardHeader> <CardHeader>
@@ -0,0 +1,72 @@
<script lang="ts">
import { wallet } from '$lib/states/wallet.svelte.js'
import { Button } from '$lib/components/ui/button/index.js'
import { Input } from '$lib/components/ui/input/index.js'
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from '$lib/components/ui/card/index.js'
import { navigate } from 'sv-router/generated'
import Loader from '$lib/components/loader.svelte'
const w = wallet
let moneroSettingsPw = $state('')
$effect(() => {
w.init()
})
</script>
<div class="mx-auto mt-16 max-w-md">
<div class="flex flex-col gap-4">
<Card>
<CardHeader>
<CardTitle>Monero Settings</CardTitle>
<CardDescription>Server and wallet preferences</CardDescription>
</CardHeader>
<CardContent>
<div class="flex flex-col gap-4">
<div>
<p class="text-xs font-medium mb-2">Server</p>
<Button
variant="outline"
size="sm"
onclick={async () => { await w.moneroStop(); await w.moneroStart() }}
disabled={w.loading}>
{#if w.loading}
<Loader />
{/if}
Restart Server
</Button>
</div>
{#if w.biometricAvailable}
<div>
<p class="text-xs font-medium mb-2">Save wallet password with Touch ID</p>
<p class="text-xs text-muted-foreground mb-3">Enter your wallet password to enable biometric unlock</p>
<div class="flex gap-2 items-end">
<Input type="password" placeholder="Wallet password" bind:value={moneroSettingsPw} />
<Button size="sm" onclick={async () => {
await w.moneroStorePassword(w.moneroWalletName, moneroSettingsPw)
moneroSettingsPw = ''
w.error = ''
}} disabled={!moneroSettingsPw || w.loading}>Save</Button>
</div>
</div>
{:else}
<p class="text-xs text-muted-foreground">Biometric authentication not available on this device</p>
{/if}
<div class="pt-2 border-t border-border">
<Button variant="outline" size="sm" onclick={() => navigate('/monero')}>
Back
</Button>
</div>
</div>
</CardContent>
</Card>
</div>
</div>