Add settings for new functionality

This commit is contained in:
Djuri 2024-03-11 21:09:15 +01:00
parent 1b8ab93da6
commit dcdf98964a
6 changed files with 82 additions and 55 deletions

View file

@ -106,45 +106,46 @@
<Button color="primary" on:click={setCustomText}>{$_('section.control.showText')}</Button>
</Form>
<hr />
<h3>LEDs</h3>
<Form>
<Row>
<Label md={4} for="ledColorPicker" size="sm">{$_('section.control.ledColor')}</Label>
<Col md="8">
<Row class="justify-content-between">
{#if ledStatus}
{#each ledStatus as led, i}
<Col>
<Input
type="color"
id="ledColorPicker[{i}]"
bind:value={led.hex}
class="mx-auto"
on:change={checkSyncLeds}
/>
</Col>
{/each}
{/if}
</Row>
<Row class="justify-content-between">
<Col>
<Input
bind:checked={keepLedsSameColor}
type="switch"
class="mx-auto"
label={$_('sections.control.keepSameColor')}
/>
</Col>
</Row>
</Col>
</Row>
<Button color="secondary" id="turnOffLedsBtn" on:click={turnOffLeds}
>{$_('section.control.turnOff')}</Button
>
<Button color="primary" on:click={setLEDcolor}>{$_('section.control.setColor')}</Button>
</Form>
<hr />
{#if !$settings.disableLeds}
<h3>LEDs</h3>
<Form>
<Row>
<Label md={4} for="ledColorPicker" size="sm">{$_('section.control.ledColor')}</Label>
<Col md="8">
<Row class="justify-content-between">
{#if ledStatus}
{#each ledStatus as led, i}
<Col>
<Input
type="color"
id="ledColorPicker[{i}]"
bind:value={led.hex}
class="mx-auto"
on:change={checkSyncLeds}
/>
</Col>
{/each}
{/if}
</Row>
<Row class="justify-content-between">
<Col>
<Input
bind:checked={keepLedsSameColor}
type="switch"
class="mx-auto"
label={$_('sections.control.keepSameColor')}
/>
</Col>
</Row>
</Col>
</Row>
<Button color="secondary" id="turnOffLedsBtn" on:click={turnOffLeds}
>{$_('section.control.turnOff')}</Button
>
<Button color="primary" on:click={setLEDcolor}>{$_('section.control.setColor')}</Button>
</Form>
<hr />
{/if}
<h3>{$_('section.control.systemInfo')}</h3>
<ul class="small system_info">
<li>{$_('section.control.version')}: {$settings.gitRev}</li>

View file

@ -323,6 +323,24 @@
label={$_('section.settings.useSatsSymbol')}
/>
</Col>
<Col md="6">
<Input
id="suffixPrice"
bind:checked={$settings.suffixPrice}
type="switch"
bsSize="sm"
label={$_('section.settings.suffixPrice')}
/>
</Col>
<Col md="6">
<Input
id="disableLeds"
bind:checked={$settings.disableLeds}
type="switch"
bsSize="sm"
label={$_('section.settings.disableLeds')}
/>
</Col>
</Row>
<Row>

View file

@ -120,22 +120,24 @@
{/if}
{/if}
<hr />
<Row class="justify-content-evenly">
{#if $status.leds}
{#each $status.leds as led}
<Col>
<Input
type="color"
id="ledColorPicker"
bind:value={led.hex}
class="mx-auto"
disabled
/>
</Col>
{/each}
{/if}
</Row>
<hr />
{#if !$settings.disableLeds}
<Row class="justify-content-evenly">
{#if $status.leds}
{#each $status.leds as led}
<Col>
<Input
type="color"
id="ledColorPicker"
bind:value={led.hex}
class="mx-auto"
disabled
/>
</Col>
{/each}
{/if}
</Row>
<hr />
{/if}
<Progress striped value={memoryFreePercent}>{memoryFreePercent}%</Progress>
<div class="d-flex justify-content-between">
<div>{$_('section.status.memoryFree')}</div>