mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-03-11 22:15:35 +00:00
This commit is contained in:
parent
b985a265b0
commit
4486212fa9
2 changed files with 39 additions and 38 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ui",
|
||||
"version": "6.3.51",
|
||||
"version": "6.3.52",
|
||||
"license": "BUSL-1.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.14.4",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang='ts'>
|
||||
// @ts-nocheck i give up with dynamic keys
|
||||
import Settings from 'lucide-svelte/icons/settings'
|
||||
|
||||
import type { ExtensionConfig } from 'hayase-extensions'
|
||||
|
|
@ -18,43 +19,43 @@
|
|||
</script>
|
||||
|
||||
<div class='flex justify-between flex-col items-end pb-1.5'>
|
||||
<Dialog.Root portal='#root'>
|
||||
<Dialog.Trigger let:builder asChild>
|
||||
<Button builders={[builder]} variant='ghost' size='icon-sm'><Settings size={18} /></Button>
|
||||
</Dialog.Trigger>
|
||||
<Dialog.Content>
|
||||
<Dialog.Header>
|
||||
<div class='space-y-4 px-4 sm:px-6'>
|
||||
<div class='font-weight-bold text-xl font-bold'>{config.name} Settings</div>
|
||||
{#each Object.entries(config.options ?? {}) as [id, options] (id)}
|
||||
{#if options.type === 'string'}
|
||||
<div class='space-y-2'>
|
||||
<Label for={id} class='leading-[unset] grow font-bold'>{options.description}</Label>
|
||||
<Input type='text' {id} placeholder={options.default} bind:value={$exopts[config.id]?.options[id]} />
|
||||
</div>
|
||||
{:else if options.type === 'number'}
|
||||
<div class='space-y-2'>
|
||||
<Label for={id} class='leading-[unset] grow font-bold'>{options.description}</Label>
|
||||
<Input type='number' {id} placeholder={options.default} bind:value={$exopts[config.id]?.options[id]} />
|
||||
</div>
|
||||
{:else if options.type === 'boolean'}
|
||||
<div class='flex items-center space-x-2'>
|
||||
<Label for={id} class='leading-[unset] grow font-bold'>{options.description}</Label>
|
||||
<Switch {id} bind:checked={$exopts[config.id]?.options[id]} />
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
<div class='py-3 gap-3 mt-auto flex flex-col sm:flex-row-reverse'>
|
||||
<Dialog.Close let:builder asChild>
|
||||
<Button variant='secondary' builders={[builder]}>Cancel</Button>
|
||||
<Button variant='destructive' on:click={deleteExtension} builders={[builder]}>Delete Extension</Button>
|
||||
</Dialog.Close>
|
||||
{#if $exopts[config.id] !== undefined}
|
||||
<Dialog.Root portal='#root'>
|
||||
<Dialog.Trigger let:builder asChild>
|
||||
<Button builders={[builder]} variant='ghost' size='icon-sm'><Settings size={18} /></Button>
|
||||
</Dialog.Trigger>
|
||||
<Dialog.Content>
|
||||
<Dialog.Header>
|
||||
<div class='space-y-4 px-4 sm:px-6'>
|
||||
<div class='font-weight-bold text-xl font-bold'>{config.name} Settings</div>
|
||||
{#each Object.entries(config.options ?? {}) as [id, options] (id)}
|
||||
{#if options.type === 'string'}
|
||||
<div class='space-y-2'>
|
||||
<Label for={id} class='leading-[unset] grow font-bold'>{options.description}</Label>
|
||||
<Input type='text' {id} placeholder={options.default} bind:value={$exopts[config.id].options[id]} />
|
||||
</div>
|
||||
{:else if options.type === 'number'}
|
||||
<div class='space-y-2'>
|
||||
<Label for={id} class='leading-[unset] grow font-bold'>{options.description}</Label>
|
||||
<Input type='number' {id} placeholder={options.default} bind:value={$exopts[config.id].options[id]} />
|
||||
</div>
|
||||
{:else if options.type === 'boolean'}
|
||||
<div class='flex items-center space-x-2'>
|
||||
<Label for={id} class='leading-[unset] grow font-bold'>{options.description}</Label>
|
||||
<Switch {id} bind:checked={$exopts[config.id].options[id]} />
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
<div class='py-3 gap-3 mt-auto flex flex-col sm:flex-row-reverse'>
|
||||
<Dialog.Close let:builder asChild>
|
||||
<Button variant='secondary' builders={[builder]}>Cancel</Button>
|
||||
<Button variant='destructive' on:click={deleteExtension} builders={[builder]}>Delete Extension</Button>
|
||||
</Dialog.Close>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Dialog.Header>
|
||||
</Dialog.Content>
|
||||
</Dialog.Root>
|
||||
{#if $exopts[config.id]}
|
||||
<Switch bind:checked={$exopts[config.id]?.enabled} hideState={true} />
|
||||
</Dialog.Header>
|
||||
</Dialog.Content>
|
||||
</Dialog.Root>
|
||||
<Switch bind:checked={$exopts[config.id].enabled} hideState={true} />
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue