Added WiFi signal status and settings
This commit is contained in:
parent
d25284e3a4
commit
ffd681b076
8 changed files with 93 additions and 15 deletions
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"i18n-ally.localesPaths": [
|
"i18n-ally.localesPaths": ["src/lib/locales"],
|
||||||
"src/lib/locales"
|
"i18n-ally.keystyle": "nested",
|
||||||
],
|
"i18n-ally.sourceLanguage": "en"
|
||||||
"i18n-ally.keystyle": "nested"
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
"fetchEuroPrice": "Fetch € price",
|
"fetchEuroPrice": "Fetch € price",
|
||||||
"shortAmountsWarning": "Short amounts might shorten lifespan.",
|
"shortAmountsWarning": "Short amounts might shorten lifespan.",
|
||||||
"tzOffsetHelpText": "A restart is required to apply TZ offset.",
|
"tzOffsetHelpText": "A restart is required to apply TZ offset.",
|
||||||
"screens": "Screens"
|
"screens": "Screens",
|
||||||
|
"wifiTxPowerText": "In most cases this does not need to be set.",
|
||||||
|
"wifiTxPower": "WiFi TX power"
|
||||||
},
|
},
|
||||||
"control": {
|
"control": {
|
||||||
"systemInfo": "System info",
|
"systemInfo": "System info",
|
||||||
|
@ -41,7 +43,8 @@
|
||||||
"wsPriceConnection": "WS Price connection",
|
"wsPriceConnection": "WS Price connection",
|
||||||
"wsMempoolConnection": "WS Mempool.space connection",
|
"wsMempoolConnection": "WS Mempool.space connection",
|
||||||
"fetchEuroNote": "If you use \"Fetch € price\" the WS Price connection will show ❌ since it uses another data source.",
|
"fetchEuroNote": "If you use \"Fetch € price\" the WS Price connection will show ❌ since it uses another data source.",
|
||||||
"uptime": "Uptime"
|
"uptime": "Uptime",
|
||||||
|
"wifiSignalStrength": "WiFi Signal strength"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"colors": {
|
"colors": {
|
||||||
|
@ -67,5 +70,8 @@
|
||||||
"control": {
|
"control": {
|
||||||
"keepSameColor": "Keep same color"
|
"keepSameColor": "Keep same color"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rssiBar": {
|
||||||
|
"tooltip": "Values > -67 dBm are considered good. > -30 dBm is amazing"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
"enableMdns": "mDNS",
|
"enableMdns": "mDNS",
|
||||||
"hostnamePrefix": "Prefijo de nombre de host",
|
"hostnamePrefix": "Prefijo de nombre de host",
|
||||||
"mempoolnstance": "Instancia de Mempool",
|
"mempoolnstance": "Instancia de Mempool",
|
||||||
"otaUpdates": "Actualización por aire"
|
"otaUpdates": "Actualización por aire",
|
||||||
|
"wifiTxPowerText": "En la mayoría de los casos no es necesario configurar esto."
|
||||||
},
|
},
|
||||||
"control": {
|
"control": {
|
||||||
"turnOff": "Apagar",
|
"turnOff": "Apagar",
|
||||||
|
@ -41,7 +42,8 @@
|
||||||
"screenCycle": "Ciclo de pantalla",
|
"screenCycle": "Ciclo de pantalla",
|
||||||
"uptime": "Tiempo de funcionamiento",
|
"uptime": "Tiempo de funcionamiento",
|
||||||
"fetchEuroNote": "Si utiliza \"Obtener precio en €\", la conexión de Precio WS mostrará ❌ ya que utiliza otra fuente de datos.",
|
"fetchEuroNote": "Si utiliza \"Obtener precio en €\", la conexión de Precio WS mostrará ❌ ya que utiliza otra fuente de datos.",
|
||||||
"title": "Estado"
|
"title": "Estado",
|
||||||
|
"wifiSignalStrength": "Fuerza de la señal WiFi"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"button": {
|
"button": {
|
||||||
|
@ -67,5 +69,8 @@
|
||||||
"control": {
|
"control": {
|
||||||
"keepSameColor": "Mantén el mismo color"
|
"keepSameColor": "Mantén el mismo color"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rssiBar": {
|
||||||
|
"tooltip": "Se consideran buenos valores > -67 dBm. > -30 dBm es increíble"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
"screens": "Schermen",
|
"screens": "Schermen",
|
||||||
"hostnamePrefix": "Hostnaam voorvoegsel",
|
"hostnamePrefix": "Hostnaam voorvoegsel",
|
||||||
"mempoolnstance": "Mempool instantie",
|
"mempoolnstance": "Mempool instantie",
|
||||||
"otaUpdates": "OTA updates"
|
"otaUpdates": "OTA updates",
|
||||||
|
"wifiTxPower": "WiFi TX power",
|
||||||
|
"wifiTxPowerText": "Meestal hoeft dit niet aangepast te worden."
|
||||||
},
|
},
|
||||||
"control": {
|
"control": {
|
||||||
"systemInfo": "Systeeminformatie",
|
"systemInfo": "Systeeminformatie",
|
||||||
|
@ -40,7 +42,8 @@
|
||||||
"wsPriceConnection": "WS Prijs verbinding",
|
"wsPriceConnection": "WS Prijs verbinding",
|
||||||
"wsMempoolConnection": "WS Mempool.space verbinding",
|
"wsMempoolConnection": "WS Mempool.space verbinding",
|
||||||
"fetchEuroNote": "Wanneer je \"Toon € prijs\" aanzet, zal de prijsverbinding als ❌ verbroken getoond worden vanwege het gebruik van een andere bron.",
|
"fetchEuroNote": "Wanneer je \"Toon € prijs\" aanzet, zal de prijsverbinding als ❌ verbroken getoond worden vanwege het gebruik van een andere bron.",
|
||||||
"uptime": "Uptime"
|
"uptime": "Uptime",
|
||||||
|
"wifiSignalStrength": "WiFi signaalsterkte"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"colors": {
|
"colors": {
|
||||||
|
@ -66,5 +69,8 @@
|
||||||
"control": {
|
"control": {
|
||||||
"keepSameColor": "Behoud zelfde kleur"
|
"keepSameColor": "Behoud zelfde kleur"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rssiBar": {
|
||||||
|
"tooltip": "Waarden > -67 dBm zijn goed. > -30 dBm is verbazingwekkend"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ $input-font-size-sm: $font-size-base * 0.875;
|
||||||
@import '../node_modules/bootstrap/scss/nav';
|
@import '../node_modules/bootstrap/scss/nav';
|
||||||
@import '../node_modules/bootstrap/scss/card';
|
@import '../node_modules/bootstrap/scss/card';
|
||||||
@import '../node_modules/bootstrap/scss/progress';
|
@import '../node_modules/bootstrap/scss/progress';
|
||||||
|
@import '../node_modules/bootstrap/scss/tooltip';
|
||||||
|
|
||||||
@import '../node_modules/bootstrap/scss/helpers';
|
@import '../node_modules/bootstrap/scss/helpers';
|
||||||
@import '../node_modules/bootstrap/scss/utilities/api';
|
@import '../node_modules/bootstrap/scss/utilities/api';
|
||||||
|
|
|
@ -83,8 +83,8 @@
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Form>
|
<Form>
|
||||||
<Row>
|
<Row>
|
||||||
<Label md={6} for="customText">{$_('section.control.text')}</Label>
|
<Label md={4} for="customText">{$_('section.control.text')}</Label>
|
||||||
<Col md="6">
|
<Col md="8">
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
id="customText"
|
id="customText"
|
||||||
|
@ -100,8 +100,8 @@
|
||||||
<h3>LEDs</h3>
|
<h3>LEDs</h3>
|
||||||
<Form>
|
<Form>
|
||||||
<Row>
|
<Row>
|
||||||
<Label md={6} for="ledColorPicker" size="sm">{$_('section.control.ledColor')}</Label>
|
<Label md={4} for="ledColorPicker" size="sm">{$_('section.control.ledColor')}</Label>
|
||||||
<Col md="6">
|
<Col md="8">
|
||||||
<Row class="justify-content-between">
|
<Row class="justify-content-between">
|
||||||
{#if ledStatus}
|
{#if ledStatus}
|
||||||
{#each ledStatus as led, i}
|
{#each ledStatus as led, i}
|
||||||
|
@ -116,6 +116,8 @@
|
||||||
</Col>
|
</Col>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
</Row>
|
||||||
|
<Row class="justify-content-between">
|
||||||
<Col>
|
<Col>
|
||||||
<Input
|
<Input
|
||||||
bind:checked={keepLedsSameColor}
|
bind:checked={keepLedsSameColor}
|
||||||
|
|
|
@ -20,6 +20,20 @@
|
||||||
|
|
||||||
export let settings;
|
export let settings;
|
||||||
|
|
||||||
|
const wifiTxPowerMap = new Map<string, number>([
|
||||||
|
['Default', 80],
|
||||||
|
['19.5dBm', 78], // 19.5dBm
|
||||||
|
['19dBm', 76], // 19dBm
|
||||||
|
['18.5dBm', 74], // 18.5dBm
|
||||||
|
['17dBm', 68], // 17dBm
|
||||||
|
['15dBm', 60], // 15dBm
|
||||||
|
['13dBm', 52], // 13dBm
|
||||||
|
['11dBm', 44], // 11dBm
|
||||||
|
['8.5dBm', 34], // 8.5dBm
|
||||||
|
['7dBm', 28], // 7dBm
|
||||||
|
['5dBm', 20] // 5dBm
|
||||||
|
]);
|
||||||
|
|
||||||
const onSave = async (e: Event) => {
|
const onSave = async (e: Event) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let formSettings = $settings;
|
let formSettings = $settings;
|
||||||
|
@ -170,6 +184,26 @@
|
||||||
></Input>
|
></Input>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Label md={6} for="wifiTxPower" size="sm"
|
||||||
|
>{$_('section.settings.wifiTxPower', { default: 'WiFi Tx Power' })}</Label
|
||||||
|
>
|
||||||
|
<Col md="6">
|
||||||
|
<Input
|
||||||
|
type="select"
|
||||||
|
bind:value={$settings.txPower}
|
||||||
|
name="select"
|
||||||
|
id="fgColor"
|
||||||
|
bsSize="sm"
|
||||||
|
class="form-select-sm"
|
||||||
|
>
|
||||||
|
{#each wifiTxPowerMap as [key, value]}
|
||||||
|
<option {value}>{key}</option>
|
||||||
|
{/each}
|
||||||
|
</Input>
|
||||||
|
<FormText>{$_('section.settings.wifiTxPowerText')}</FormText>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col md="6">
|
<Col md="6">
|
||||||
<Input
|
<Input
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
Col,
|
Col,
|
||||||
Input,
|
Input,
|
||||||
Progress,
|
Progress,
|
||||||
|
Tooltip,
|
||||||
Row
|
Row
|
||||||
} from 'sveltestrap';
|
} from 'sveltestrap';
|
||||||
import Rendered from './Rendered.svelte';
|
import Rendered from './Rendered.svelte';
|
||||||
|
@ -44,10 +45,22 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
let memoryFreePercent: number = 50;
|
let memoryFreePercent: number = 50;
|
||||||
|
let rssiPercent: number = 50;
|
||||||
|
let wifiStrengthColor: string = 'info';
|
||||||
let lightMode: boolean = false;
|
let lightMode: boolean = false;
|
||||||
|
|
||||||
status.subscribe((value: object) => {
|
status.subscribe((value: object) => {
|
||||||
memoryFreePercent = Math.round((value.espFreeHeap / value.espHeapSize) * 100);
|
memoryFreePercent = Math.round((value.espFreeHeap / value.espHeapSize) * 100);
|
||||||
|
|
||||||
|
rssiPercent = Math.round(((value.rssi + 120) / (-30 + 120)) * 100);
|
||||||
|
|
||||||
|
if (value.rssi > -55) {
|
||||||
|
wifiStrengthColor = 'success';
|
||||||
|
} else if (value.rssi < -87) {
|
||||||
|
wifiStrengthColor = 'warning';
|
||||||
|
} else {
|
||||||
|
wifiStrengthColor = 'info';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
settings.subscribe((value: object) => {
|
settings.subscribe((value: object) => {
|
||||||
|
@ -130,6 +143,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
<Progress striped id="rssiBar" color={wifiStrengthColor} value={rssiPercent}
|
||||||
|
>{rssiPercent}%</Progress
|
||||||
|
>
|
||||||
|
<Tooltip target="rssiBar" placement="bottom">{$_('rssiBar.tooltip')}</Tooltip>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<div>{$_('section.status.wifiSignalStrength')}</div>
|
||||||
|
<div>
|
||||||
|
{$status.rssi} dBm
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
{$_('section.status.uptime')}: {toUptimestring($status.espUptime)}
|
{$_('section.status.uptime')}: {toUptimestring($status.espUptime)}
|
||||||
<br />
|
<br />
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in a new issue