diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9e07267..31131f2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -41,7 +41,7 @@ jobs: node-version: lts/* cache: yarn cache-dependency-path: '**/yarn.lock' - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | ~/.cache/pip @@ -80,6 +80,8 @@ jobs: run: mkdir -p output && echo "$BLOCK_HEIGHT" > output/version.txt - name: gzip build for LittleFS run: find dist -type f ! -name ".*" -exec sh -c 'mkdir -p "build_gz/$(dirname "${1#dist/}")" && gzip -k "$1" -c > "build_gz/${1#dist/}".gz' _ {} \; + - name: Write git rev to file + run: echo "$GITHUB_SHA" > build_gz/fs_hash.txt - name: Check GZipped directory size run: | # Set the threshold size in bytes diff --git a/src/lib/locales/de.json b/src/lib/locales/de.json index f137526..45a1078 100644 --- a/src/lib/locales/de.json +++ b/src/lib/locales/de.json @@ -60,6 +60,12 @@ "uptime": "Betriebszeit", "wifiSignalStrength": "WiFi-Signalstärke", "wsDataConnection": "BTClock-Datenquelle verbindung" + }, + "firmwareUpdater": { + "fileUploadSuccess": "Datei erfolgreich hochgeladen, Gerät neu gestartet. WebUI in {countdown} Sekunden neu geladen", + "fileUploadFailed": "Das Hochladen der Datei ist fehlgeschlagen. \nStellen Sie sicher, dass Sie die richtige Datei ausgewählt haben, und versuchen Sie es erneut.", + "uploading": "Hochladen", + "firmwareUpdateText": "Wenn Sie die Firmware-Upload-Funktion verwenden, stellen Sie sicher, dass Sie die richtigen Dateien verwenden. \nDas Hochladen der falschen Dateien kann dazu führen, dass das Gerät nicht mehr funktioniert. \nWenn es schief geht, können Sie die Firmware wiederherstellen, indem Sie das vollständige Image hochladen, nachdem Sie das Gerät in den BOOT-Modus versetzt haben." } }, "colors": { @@ -88,5 +94,6 @@ }, "rssiBar": { "tooltip": "Werte > -67 dBm gelten als gut. > -30 dBm ist erstaunlich" - } + }, + "warning": "Achtung" } diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json index 2fda44f..ea38dbb 100644 --- a/src/lib/locales/en.json +++ b/src/lib/locales/en.json @@ -48,7 +48,9 @@ "hostname": "Hostname", "frontlight": "Frontlight", "turnOn": "Turn on", - "flashFrontlight": "Flash" + "flashFrontlight": "Flash", + "firmwareUpdate": "Firmware update", + "fwCommit": "Firmware commit" }, "status": { "title": "Status", @@ -60,6 +62,12 @@ "uptime": "Uptime", "wifiSignalStrength": "WiFi Signal strength", "wsDataConnection": "BTClock data-source connection" + }, + "firmwareUpdater": { + "fileUploadFailed": "File upload failed. Make sure you have selected the correct file and try again.", + "fileUploadSuccess": "File uploaded successfully, restarting device and reloading WebUI in {countdown} seconds", + "uploading": "Uploading", + "firmwareUpdateText": "When you use the firmware upload functionality, make sure you use the correct files. Uploading the wrong files can result in a non-working device. If it goes wrong, you can restore firmware by uploading the full image after setting the device in BOOT-mode." } }, "colors": { @@ -88,5 +96,6 @@ }, "rssiBar": { "tooltip": "Values > -67 dBm are considered good. > -30 dBm is amazing" - } + }, + "warning": "Warning" } diff --git a/src/lib/locales/es.json b/src/lib/locales/es.json index 9987730..91e1b5d 100644 --- a/src/lib/locales/es.json +++ b/src/lib/locales/es.json @@ -59,6 +59,12 @@ "title": "Estado", "wifiSignalStrength": "Fuerza de la señal WiFi", "wsDataConnection": "Conexión de fuente de datos BTClock" + }, + "firmwareUpdater": { + "fileUploadSuccess": "Archivo cargado exitosamente, reiniciando el dispositivo. Recargando WebUI en {countdown} segundos", + "fileUploadFailed": "Error al cargar el archivo. \nAsegúrese de haber seleccionado el archivo correcto e inténtelo nuevamente.", + "uploading": "Subiendo", + "firmwareUpdateText": "Cuando utilice la función de carga de firmware, asegúrese de utilizar los archivos correctos. \nCargar archivos incorrectos puede provocar que el dispositivo no funcione. \nSi sale mal, puede restaurar el firmware cargando la imagen completa después de configurar el dispositivo en modo BOOT." } }, "button": { @@ -87,5 +93,6 @@ }, "rssiBar": { "tooltip": "Se consideran buenos valores > -67 dBm. > -30 dBm es increíble" - } + }, + "warning": "Aviso" } diff --git a/src/lib/locales/nl.json b/src/lib/locales/nl.json index 3e7c78c..472708a 100644 --- a/src/lib/locales/nl.json +++ b/src/lib/locales/nl.json @@ -59,6 +59,12 @@ "uptime": "Uptime", "wifiSignalStrength": "WiFi signaalsterkte", "wsDataConnection": "BTClock-gegevensbron verbinding" + }, + "firmwareUpdater": { + "fileUploadSuccess": "Bestand geüpload, apparaat herstart. WebUI opnieuw geladen over {countdown} seconden", + "fileUploadFailed": "Bestandsupload mislukt. \nZorg ervoor dat het juiste bestand is geselecteerd en probeer het opnieuw.", + "uploading": "Uploaden", + "firmwareUpdateText": "Zorg bij het gebruiken van de firmware upload dat de juiste bestanden gebruikt worden. \nHet uploaden van de verkeerde bestanden kan resulteren in een niet-werkend apparaat. \nAls het misgaat, kunt u de firmware herstellen door de volledige afbeelding te uploaden nadat u het apparaat in de BOOT-modus hebt gezet." } }, "colors": { @@ -87,5 +93,6 @@ }, "rssiBar": { "tooltip": "Waarden > -67 dBm zijn goed. > -30 dBm is verbazingwekkend" - } + }, + "warning": "Waarschuwing" } diff --git a/src/lib/screen.ts b/src/lib/screen.ts new file mode 100644 index 0000000..4eadfa7 --- /dev/null +++ b/src/lib/screen.ts @@ -0,0 +1,9 @@ +import { writable } from 'svelte/store'; + +// Create a writable store to track screen size +export const screenSize = writable(window.innerWidth); + +// Function to update the screen size +export const updateScreenSize = () => { + screenSize.set(window.innerWidth); +}; diff --git a/src/lib/style/app.scss b/src/lib/style/app.scss index b4aa8a9..3143ec0 100644 --- a/src/lib/style/app.scss +++ b/src/lib/style/app.scss @@ -36,33 +36,34 @@ $input-font-size-sm: $font-size-base * 0.875; @import '../node_modules/bootstrap/scss/progress'; @import '../node_modules/bootstrap/scss/tooltip'; @import '../node_modules/bootstrap/scss/toasts'; +@import '../node_modules/bootstrap/scss/alert'; @import '../node_modules/bootstrap/scss/helpers'; @import '../node_modules/bootstrap/scss/utilities/api'; -@include media-breakpoint-down(xl) { - html { - font-size: 85%; - } +// @include media-breakpoint-down(xl) { +// html { +// // font-size: 85%; +// } - button.btn, - input[type='button'].btn, - input[type='submit'].btn, - input[type='reset'].btn { - @include button-size( - $btn-padding-y-sm, - $btn-padding-x-sm, - $font-size-sm, - $btn-border-radius-sm - ); - } -} +// button.btn, +// input[type='button'].btn, +// input[type='submit'].btn, +// input[type='reset'].btn { +// @include button-size( +// $btn-padding-y-sm, +// $btn-padding-x-sm, +// $font-size-sm, +// $btn-border-radius-sm +// ); +// } +// } -@include media-breakpoint-down(lg) { - html { - font-size: 75%; - } -} +// @include media-breakpoint-down(lg) { +// html { +// font-size: 75%; +// } +// } nav { margin-bottom: 15px; @@ -208,3 +209,8 @@ nav { font-style: italic; font-weight: 600; } + +.firmwareUploadStatusAlert, +#firmwareUploadProgress { + @extend .my-2; +} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 307c19c..76cd8c5 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,6 @@ + +
+
+ + handleFileChange(e, (file) => (firmwareUploadFile = file))} + name="update" + class="form-control" + accept=".bin" + /> +
+
+ +
+
+ + handleFileChange(e, (file) => (firmwareWebUiFile = file))} + accept=".bin" + /> +
+
+ +
+
+{#if firmwareUploadProgress > 0} + {$_('section.firmwareUpdater.uploading')}... {firmwareUploadProgress}% +{/if} +{#if firmwareUploadSuccess} + {$_('section.firmwareUpdater.fileUploadSuccess', { values: { countdown: $countdown } })} + +{/if} + +{#if firmwareUploadError} + {$_('section.firmwareUpdater.fileUploadFailed')} +{/if} +⚠️ {$_('warning')}: {$_('section.firmwareUpdater.firmwareUpdateText')} diff --git a/src/routes/Settings.svelte b/src/routes/Settings.svelte index 693fafa..c1489d0 100644 --- a/src/routes/Settings.svelte +++ b/src/routes/Settings.svelte @@ -20,6 +20,7 @@ } from 'sveltestrap'; export let settings; + export let uiSettings; const wifiTxPowerMap = new Map([ ['Default', 80], @@ -89,7 +90,7 @@
- @@ -98,8 +99,8 @@ bind:value={$settings.fgColor} name="select" id="fgColor" - bsSize="sm" - class="form-select-sm" + bsSize={$uiSettings.inputSize} + class={$uiSettings.selectClass} > @@ -107,15 +108,17 @@ - + @@ -123,9 +126,11 @@ - + - + - - + - - + - + - + - + {#if $settings.hasFrontlight} - @@ -221,7 +230,7 @@ - @@ -238,7 +247,7 @@ {/if} - @@ -247,12 +256,12 @@ bind:value={$settings.hostnamePrefix} name="hostnamePrefix" id="hostnamePrefix" - bsSize="sm" + bsSize={$uiSettings.inputSize} > - @@ -261,8 +270,8 @@ bind:value={$settings.txPower} name="select" id="fgColor" - bsSize="sm" - class="form-select-sm" + bsSize={$uiSettings.inputSize} + class={$uiSettings.selectClass} > {#each wifiTxPowerMap as [key, value]} @@ -277,7 +286,7 @@ id="ledTestOnPower" bind:checked={$settings.ledTestOnPower} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.ledPowerOnTest')} /> @@ -286,7 +295,7 @@ id="ledFlashOnUpd" bind:checked={$settings.ledFlashOnUpd} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.ledFlashOnBlock')} /> @@ -295,7 +304,7 @@ id="stealFocus" bind:checked={$settings.stealFocus} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.StealFocusOnNewBlock')} /> @@ -304,7 +313,7 @@ id="mcapBigChar" bind:checked={$settings.mcapBigChar} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.useBigCharsMcap')} /> @@ -313,7 +322,7 @@ id="otaEnabled" bind:checked={$settings.otaEnabled} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label="{$_('section.settings.otaUpdates')} ({$_('restartRequired')})" /> @@ -322,7 +331,7 @@ id="mdnsEnabled" bind:checked={$settings.mdnsEnabled} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label="{$_('section.settings.enableMdns')} ({$_('restartRequired')})" /> @@ -331,7 +340,7 @@ id="fetchEurPrice" bind:checked={$settings.fetchEurPrice} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label="{$_('section.settings.fetchEuroPrice')} ({$_('restartRequired')})" /> @@ -340,7 +349,7 @@ id="useBlkCountdown" bind:checked={$settings.useBlkCountdown} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.useBlkCountdown')} /> @@ -349,7 +358,7 @@ id="useSatsSymbol" bind:checked={$settings.useSatsSymbol} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.useSatsSymbol')} /> @@ -358,7 +367,7 @@ id="suffixPrice" bind:checked={$settings.suffixPrice} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.suffixPrice')} /> @@ -367,7 +376,7 @@ id="disableLeds" bind:checked={$settings.disableLeds} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.disableLeds')} /> @@ -376,7 +385,7 @@ id="ownDataSource" bind:checked={$settings.ownDataSource} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label="{$_('section.settings.ownDataSource')} ({$_('restartRequired')})" /> @@ -386,7 +395,7 @@ id="flAlwaysOn" bind:checked={$settings.flAlwaysOn} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.flAlwaysOn')} /> @@ -395,7 +404,7 @@ id="flFlashOnUpd" bind:checked={$settings.flFlashOnUpd} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={$_('section.settings.flFlashOnUpd')} /> @@ -411,15 +420,20 @@ id="screens_{s.id}" bind:checked={s.enabled} type="switch" - bsSize="sm" + bsSize={$uiSettings.inputSize} label={s.name} /> {/each} {/if} - - + + + +
+ + +