gijl/lv-storage / llama.cpp /tools /ui /src /lib /components /app /settings /SettingsResetButton.svelte
gijl's picture
download
raw
1.4 kB
<script lang="ts">
import { RotateCcw } from '@lucide/svelte';
import * as AlertDialog from '$lib/components/ui/alert-dialog';
import { Button } from '$lib/components/ui/button';
import { settingsStore } from '$lib/stores';
interface Props {
onReset?: () => void;
}
let { onReset }: Props = $props();
let showResetDialog = $state(false);
function handleResetClick() {
showResetDialog = true;
}
function handleConfirmReset() {
settingsStore.forceSyncWithServerDefaults();
onReset?.();
showResetDialog = false;
}
</script>
{#if settingsStore.hasCustomSettings}
<Button onclick={handleResetClick} variant="outline">
<RotateCcw class="h-3 w-3" />
Reset to default
</Button>
{/if}
<AlertDialog.Root bind:open={showResetDialog}>
<AlertDialog.Content>
<AlertDialog.Header>
<AlertDialog.Title>Reset Settings to Default</AlertDialog.Title>
<AlertDialog.Description>
Are you sure you want to reset all settings to their default values? This will reset all
parameters to the values provided by the server's /props endpoint and remove all your custom
configurations.
</AlertDialog.Description>
</AlertDialog.Header>
<AlertDialog.Footer>
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
<AlertDialog.Action onclick={handleConfirmReset}>Reset to Default</AlertDialog.Action>
</AlertDialog.Footer>
</AlertDialog.Content>
</AlertDialog.Root>

Xet Storage Details

Size:
1.4 kB
·
Xet hash:
a89d951f2e58377bed6285e2c593eedc01e118c914368a2ff6f82cb1554b105d

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.