mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 10:44:29 +05:00
refactor: update portal (unit system)
This commit is contained in:
@@ -168,11 +168,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Pressure:</th>
|
<th scope="row">Pressure:</th>
|
||||||
<td><b class="ot-pressure"></b> bar</td>
|
<td><b class="ot-pressure"></b> <span class="pressure-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">DHW flow rate:</th>
|
<th scope="row">DHW flow rate:</th>
|
||||||
<td><b class="ot-dhw-flow-rate"></b> l/min</td>
|
<td><b class="ot-dhw-flow-rate"></b> <span class="volume-unit"></span>/min</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Fault code:</th>
|
<th scope="row">Fault code:</th>
|
||||||
@@ -180,31 +180,31 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Indoor temp:</th>
|
<th scope="row">Indoor temp:</th>
|
||||||
<td><b class="indoor-temp"></b> <span class="unit-system"></span></td>
|
<td><b class="indoor-temp"></b> <span class="temp-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Outdoor temp:</th>
|
<th scope="row">Outdoor temp:</th>
|
||||||
<td><b class="outdoor-temp"></b> <span class="unit-system"></span></td>
|
<td><b class="outdoor-temp"></b> <span class="temp-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Heating temp:</th>
|
<th scope="row">Heating temp:</th>
|
||||||
<td><b class="heating-temp"></b> <span class="unit-system"></span></td>
|
<td><b class="heating-temp"></b> <span class="temp-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Heating setpoint temp:</th>
|
<th scope="row">Heating setpoint temp:</th>
|
||||||
<td><b class="heating-setpoint-temp"></b> <span class="unit-system"></span></td>
|
<td><b class="heating-setpoint-temp"></b> <span class="temp-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Heating return temp:</th>
|
<th scope="row">Heating return temp:</th>
|
||||||
<td><b class="heating-return-temp"></b> <span class="unit-system"></span></td>
|
<td><b class="heating-return-temp"></b> <span class="temp-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">DHW temp:</th>
|
<th scope="row">DHW temp:</th>
|
||||||
<td><b class="dhw-temp"></b> <span class="unit-system"></span></td>
|
<td><b class="dhw-temp"></b> <span class="temp-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Exhaust temp:</th>
|
<th scope="row">Exhaust temp:</th>
|
||||||
<td><b class="exhaust-temp"></b> <span class="unit-system"></span></td>
|
<td><b class="exhaust-temp"></b> <span class="temp-unit"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Binary file not shown.
@@ -537,18 +537,24 @@ async function loadVars() {
|
|||||||
let response = await fetch('/api/vars');
|
let response = await fetch('/api/vars');
|
||||||
let result = await response.json();
|
let result = await response.json();
|
||||||
|
|
||||||
let unitSystemStr;
|
let tempUnitStr, pressureUnitStr, volumeUnitStr;
|
||||||
switch (result.system.unitSystem) {
|
switch (result.system.unitSystem) {
|
||||||
case 0:
|
case 0:
|
||||||
unitSystemStr = 'C';
|
tempUnitStr = 'C';
|
||||||
|
pressureUnitStr = 'bar';
|
||||||
|
volumeUnitStr = 'L';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
unitSystemStr = 'F';
|
tempUnitStr = 'F';
|
||||||
|
pressureUnitStr = 'psi';
|
||||||
|
volumeUnitStr = 'gal';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
unitSystemStr = '?';
|
tempUnitStr = '?';
|
||||||
|
pressureUnitStr = '?';
|
||||||
|
volumeUnitStr = '?';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -576,7 +582,9 @@ async function loadVars() {
|
|||||||
|
|
||||||
setBusy('.ot-busy', '.ot-table', false);
|
setBusy('.ot-busy', '.ot-table', false);
|
||||||
|
|
||||||
setValue('.unit-system', unitSystemStr);
|
setValue('.temp-unit', tempUnitStr);
|
||||||
|
setValue('.pressure-unit', pressureUnitStr);
|
||||||
|
setValue('.volume-unit', volumeUnitStr);
|
||||||
setValue('.version', result.system.version);
|
setValue('.version', result.system.version);
|
||||||
setValue('.build-date', result.system.buildDate);
|
setValue('.build-date', result.system.buildDate);
|
||||||
setValue('.uptime', result.system.uptime);
|
setValue('.uptime', result.system.uptime);
|
||||||
|
|||||||
Reference in New Issue
Block a user