Add settings for new functionality

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

View file

@ -17,6 +17,8 @@
"useBigCharsMcap": "Use big characters for market cap",
"useBlkCountdown": "Blocks countdown for halving",
"useSatsSymbol": "Use sats symbol",
"suffixPrice": "Suffix price format",
"disableLeds": "Disable all LEDs effects",
"otaUpdates": "OTA updates",
"enableMdns": "mDNS",
"fetchEuroPrice": "Fetch € price",

View file

@ -22,6 +22,8 @@
"enableMdns": "mDNS",
"hostnamePrefix": "Prefijo de nombre de host",
"mempoolnstance": "Instancia de Mempool",
"suffixPrice": "Precio con sufijos",
"disableLeds": "Desactivar efectos de LED",
"otaUpdates": "Actualización por aire",
"wifiTxPowerText": "En la mayoría de los casos no es necesario configurar esto.",
"settingsSaved": "Configuración guardada",

View file

@ -22,6 +22,8 @@
"screens": "Schermen",
"hostnamePrefix": "Hostnaam voorvoegsel",
"mempoolnstance": "Mempool instantie",
"suffixPrice": "Achtervoegsel prijs formaat",
"disableLeds": "Alle LEDs effecten uit",
"otaUpdates": "OTA updates",
"wifiTxPower": "WiFi TX power",
"wifiTxPowerText": "Meestal hoeft dit niet aangepast te worden.",

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>