Dependency updates and frontlight settings

This commit is contained in:
Djuri 2024-06-08 00:39:44 +02:00
parent 6ecb482600
commit e859adac86
8 changed files with 922 additions and 668 deletions

View file

@ -59,6 +59,10 @@
fetch(`${PUBLIC_BASE_URL}/api/frontlight/on`).catch(() => {});
};
const flashFrontlight = () => {
fetch(`${PUBLIC_BASE_URL}/api/frontlight/flash`).catch(() => {});
};
const turnOffFrontlight = () => {
fetch(`${PUBLIC_BASE_URL}/api/frontlight/off`).catch(() => {});
};
@ -160,6 +164,9 @@
>{$_('section.control.turnOff')}</Button
>
<Button color="primary" on:click={turnOnFrontlight}>{$_('section.control.turnOn')}</Button>
<Button color="success" id="flashFrontlight" on:click={flashFrontlight}
>{$_('section.control.flashFrontlight')}</Button
>
<hr />
{/if}
<h3>{$_('section.control.systemInfo')}</h3>

View file

@ -70,6 +70,15 @@
});
});
};
const onFlBrightnessChange = async () => {
await fetch(`${PUBLIC_BASE_URL}/api/frontlight/brightness/${$settings.flMaxBrightness}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
};
</script>
<Col>
@ -204,12 +213,29 @@
name="flMaxBrightness"
id="flMaxBrightness"
bind:value={$settings.flMaxBrightness}
on:change={onFlBrightnessChange}
min={0}
max={4095}
step={1}
/>
</Col>
</Row>
<Row>
<Label md={6} for="flEffectDelay" size="sm"
>{$_('section.settings.flEffectDelay')}</Label
>
<Col md="6">
<Input
type="range"
name="flEffectDelay"
id="flEffectDelay"
bind:value={$settings.flEffectDelay}
min={5}
max={300}
step={1}
/>
</Col>
</Row>
{/if}
<Row>
<Label md={6} for="hostnamePrefix" size="sm"
@ -364,6 +390,15 @@
label={$_('section.settings.flAlwaysOn')}
/>
</Col>
<Col md="6">
<Input
id="flFlashOnUpd"
bind:checked={$settings.flFlashOnUpd}
type="switch"
bsSize="sm"
label={$_('section.settings.flFlashOnUpd')}
/>
</Col>
{/if}
</Row>