forked from btclock/webui
Dependency updates and frontlight settings
This commit is contained in:
parent
6ecb482600
commit
e859adac86
8 changed files with 922 additions and 668 deletions
|
@ -31,7 +31,9 @@
|
|||
"settingsSaved": "Einstellungen gespeichert",
|
||||
"errorSavingSettings": "Fehler beim Speichern der Einstellungen",
|
||||
"ownDataSource": "BTClock-Datenquelle verwenden",
|
||||
"flAlwaysOn": "Displaybeleuchtung immer an"
|
||||
"flAlwaysOn": "Displaybeleuchtung immer an",
|
||||
"flEffectDelay": "Displaybeleuchtungeffekt Geschwindigkeit",
|
||||
"flFlashOnUpd": "Displaybeleuchting bei neuem Block"
|
||||
},
|
||||
"control": {
|
||||
"systemInfo": "Systeminfo",
|
||||
|
@ -45,7 +47,8 @@
|
|||
"title": "Kontrolle",
|
||||
"hostname": "Hostname",
|
||||
"frontlight": "Displaybeleuchtung",
|
||||
"turnOn": "Einschalten"
|
||||
"turnOn": "Einschalten",
|
||||
"flashFrontlight": "Blinken"
|
||||
},
|
||||
"status": {
|
||||
"title": "Status",
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
"errorSavingSettings": "Error saving settings",
|
||||
"ownDataSource": "Use BTClock data source",
|
||||
"flMaxBrightness": "Frontlight brightness",
|
||||
"flAlwaysOn": "Frontlight always on"
|
||||
"flAlwaysOn": "Frontlight always on",
|
||||
"flEffectDelay": "Frontlight effect speed",
|
||||
"flFlashOnUpd": "Frontlight flash on new block"
|
||||
},
|
||||
"control": {
|
||||
"systemInfo": "System info",
|
||||
|
@ -45,7 +47,8 @@
|
|||
"title": "Control",
|
||||
"hostname": "Hostname",
|
||||
"frontlight": "Frontlight",
|
||||
"turnOn": "Turn on"
|
||||
"turnOn": "Turn on",
|
||||
"flashFrontlight": "Flash"
|
||||
},
|
||||
"status": {
|
||||
"title": "Status",
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
"errorSavingSettings": "Error al guardar la configuración",
|
||||
"ownDataSource": "Utilice la fuente de datos BTClock",
|
||||
"flMaxBrightness": "Brillo de luz de la pantalla",
|
||||
"flAlwaysOn": "Luz de la pantalla siempre encendida"
|
||||
"flAlwaysOn": "Luz de la pantalla siempre encendida",
|
||||
"flEffectDelay": "Velocidad del efecto de luz de la pantalla",
|
||||
"flFlashOnUpd": "Luz de la pantalla parpadea con un nuevo bloque"
|
||||
},
|
||||
"control": {
|
||||
"turnOff": "Apagar",
|
||||
|
@ -44,7 +46,8 @@
|
|||
"buildTime": "Tiempo de compilación",
|
||||
"hostname": "Nombre del host",
|
||||
"turnOn": "Encender",
|
||||
"frontlight": "Luz de la pantalla"
|
||||
"frontlight": "Luz de la pantalla",
|
||||
"flashFrontlight": "Luz intermitente"
|
||||
},
|
||||
"status": {
|
||||
"memoryFree": "Memoria RAM libre",
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
"errorSavingSettings": "Fout bij opslaan instellingen",
|
||||
"ownDataSource": "BTClock-gegevensbron gebruiken",
|
||||
"flMaxBrightness": "Displaylicht helderheid",
|
||||
"flAlwaysOn": "Displaylicht altijd aan"
|
||||
"flAlwaysOn": "Displaylicht altijd aan",
|
||||
"flEffectDelay": "Displaylicht effect snelheid",
|
||||
"flFlashOnUpd": "Knipper displaylicht bij nieuw blok"
|
||||
},
|
||||
"control": {
|
||||
"systemInfo": "Systeeminformatie",
|
||||
|
@ -44,7 +46,8 @@
|
|||
"text": "Tekst",
|
||||
"title": "Besturing",
|
||||
"frontlight": "Displaylicht",
|
||||
"turnOn": "Aanzetten"
|
||||
"turnOn": "Aanzetten",
|
||||
"flashFrontlight": "Knipper"
|
||||
},
|
||||
"status": {
|
||||
"title": "Status",
|
||||
|
|
|
@ -7,14 +7,9 @@
|
|||
@import '@fontsource/oswald/latin-400.css';
|
||||
@import './satsymbol.scss';
|
||||
|
||||
$form-range-track-bg: #fff;
|
||||
$color-mode-type: media-query;
|
||||
$font-family-base: 'Ubuntu';
|
||||
$font-size-base: 0.9rem;
|
||||
//$font-size-sm: $font-size-base * .875 !default;
|
||||
//$form-label-font-size: $font-size-base * .575 !default;
|
||||
//$input-btn-font-size-sm: 0.4rem;
|
||||
//$form-label-font-size: 0.4rem;
|
||||
$input-font-size-sm: $font-size-base * 0.875;
|
||||
|
||||
// $border-radius: .675rem;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue