Add Nostr relay connection status

This commit is contained in:
Djuri Baars 2024-07-15 15:11:44 +02:00
parent ee4d6d88c7
commit f08e977b61
6 changed files with 338 additions and 325 deletions

View file

@ -64,7 +64,8 @@
"uptime": "Betriebszeit", "uptime": "Betriebszeit",
"wifiSignalStrength": "WiFi-Signalstärke", "wifiSignalStrength": "WiFi-Signalstärke",
"wsDataConnection": "BTClock-Datenquelle verbindung", "wsDataConnection": "BTClock-Datenquelle verbindung",
"lightSensor": "Lichtsensor" "lightSensor": "Lichtsensor",
"nostrConnection": "Nostr Relay-Verbindung"
}, },
"firmwareUpdater": { "firmwareUpdater": {
"fileUploadSuccess": "Datei erfolgreich hochgeladen, Gerät neu gestartet. WebUI in {countdown} Sekunden neu geladen", "fileUploadSuccess": "Datei erfolgreich hochgeladen, Gerät neu gestartet. WebUI in {countdown} Sekunden neu geladen",

View file

@ -68,7 +68,8 @@
"uptime": "Uptime", "uptime": "Uptime",
"wifiSignalStrength": "WiFi Signal strength", "wifiSignalStrength": "WiFi Signal strength",
"wsDataConnection": "BTClock data-source connection", "wsDataConnection": "BTClock data-source connection",
"lightSensor": "Light sensor" "lightSensor": "Light sensor",
"nostrConnection": "Nostr Relay connection"
}, },
"firmwareUpdater": { "firmwareUpdater": {
"fileUploadFailed": "File upload failed. Make sure you have selected the correct file and try again.", "fileUploadFailed": "File upload failed. Make sure you have selected the correct file and try again.",

View file

@ -63,7 +63,8 @@
"title": "Estado", "title": "Estado",
"wifiSignalStrength": "Fuerza de la señal WiFi", "wifiSignalStrength": "Fuerza de la señal WiFi",
"wsDataConnection": "Conexión de fuente de datos BTClock", "wsDataConnection": "Conexión de fuente de datos BTClock",
"lightSensor": "Sensor de luz" "lightSensor": "Sensor de luz",
"nostrConnection": "Conexión de relé Nostr"
}, },
"firmwareUpdater": { "firmwareUpdater": {
"fileUploadSuccess": "Archivo cargado exitosamente, reiniciando el dispositivo. Recargando WebUI en {countdown} segundos", "fileUploadSuccess": "Archivo cargado exitosamente, reiniciando el dispositivo. Recargando WebUI en {countdown} segundos",

View file

@ -63,7 +63,8 @@
"uptime": "Uptime", "uptime": "Uptime",
"wifiSignalStrength": "WiFi signaalsterkte", "wifiSignalStrength": "WiFi signaalsterkte",
"wsDataConnection": "BTClock-gegevensbron verbinding", "wsDataConnection": "BTClock-gegevensbron verbinding",
"lightSensor": "Licht sensor" "lightSensor": "Licht sensor",
"nostrConnection": "Nostr Relay-verbinding"
}, },
"firmwareUpdater": { "firmwareUpdater": {
"fileUploadSuccess": "Bestand geüpload, apparaat herstart. WebUI opnieuw geladen over {countdown} seconden", "fileUploadSuccess": "Bestand geüpload, apparaat herstart. WebUI opnieuw geladen over {countdown} seconden",

View file

@ -124,6 +124,8 @@
}); });
function compareVersions(version1: string, version2: string): number { function compareVersions(version1: string, version2: string): number {
if (!version2) return 0;
const parts1 = version1.split('.').map((part) => parseInt(part, 10)); const parts1 = version1.split('.').map((part) => parseInt(part, 10));
const parts2 = version2.split('.').map((part) => parseInt(part, 10)); const parts2 = version2.split('.').map((part) => parseInt(part, 10));

View file

@ -166,11 +166,18 @@
<br /> <br />
<p> <p>
{#if $settings.useNostr} {#if $settings.useNostr}
<span>Nostr connection status not available yet.</span> {$_('section.status.nostrConnection')}:
<span>
{#if $status.connectionStatus && $status.connectionStatus.nostr}
&#9989;
{:else}
&#10060;
{/if}
</span>
{:else if !$settings.ownDataSource} {:else if !$settings.ownDataSource}
{$_('section.status.wsPriceConnection')}: {$_('section.status.wsPriceConnection')}:
<span> <span>
{#if $status.connectionStatus && $status.connectionStatus.price} {#if $status.connectionStatus && $status.connectionStatus.nostr}
&#9989; &#9989;
{:else} {:else}
&#10060; &#10060;