Skip to content

Commit

Permalink
updates to firmware check UI
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Nov 9, 2024
1 parent 0927a2b commit 00beb2a
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 36 deletions.
4 changes: 2 additions & 2 deletions interface/src/app/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ const Settings = () => {
<ListMenuItem
icon={BuildIcon}
bgcolor="#72caf9"
label={LL.EMS_ESP_VER()}
text={data.emsesp_version}
label="EMS-ESP Firmware"
text={'v'+data.emsesp_version}
to="version"
/>

Expand Down
55 changes: 37 additions & 18 deletions interface/src/app/settings/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ const Version = () => {

useEffect(() => {
if (latestVersion && latestDevVersion) {
console.log("Latest versions, stable: " + latestVersion + " dev: " + latestDevVersion);
sendCheckUpgrade(latestDevVersion + "," + latestVersion).catch((error: Error) => {
console.error("Failed to check upgrade:", error);
});
// console.log("Latest versions, stable: " + latestVersion + " dev: " + latestDevVersion);
sendCheckUpgrade(latestDevVersion + ',' + latestVersion).catch(
(error: Error) => {
toast.error('Failed to check upgrade: ' + error.message);
}
);
}
}, [latestVersion, latestDevVersion]);

Expand Down Expand Up @@ -104,7 +106,7 @@ const Version = () => {
setRestarting(true);
};

useLayoutTitle(LL.EMS_ESP_VER());
useLayoutTitle('EMS-ESP Firmware');

const internet_live =
latestDevVersion !== undefined && latestVersion !== undefined;
Expand Down Expand Up @@ -191,8 +193,18 @@ const Version = () => {
Platform
</Typography>
<Typography mb={1} fontWeight={'fontWeightBold'}>
Release
Release Type
</Typography>
{internet_live && (
<>
<Typography mb={1} fontWeight={'fontWeightBold'}>
Latest Stable Release
</Typography>
<Typography fontWeight={'fontWeightBold'}>
Latest Development Release
</Typography>
</>
)}
</Grid>
<Grid>
<Typography mb={1}>
Expand All @@ -213,24 +225,31 @@ const Version = () => {
>
(changelog)
</Link>
{!isDev && internet_live && (
<Button
sx={{ ml: 2 }}
variant="outlined"
color="primary"
size="small"
onClick={() => showFirmwareDialog(true)}
>
{LL.SWITCH_DEV()}
</Button>
)}
</Typography>
{internet_live && (
<>
<Typography mt={0.3}>{latestVersion}</Typography>
<Typography mt={1} mb={1}>
{latestDevVersion}
</Typography>
</>
)}
</Grid>
</Grid>

<Divider />

{!isDev && (
<Button
sx={{ mt: 2 }}
variant="outlined"
color="primary"
size="small"
onClick={() => showFirmwareDialog(true)}
>
{LL.SWITCH_DEV()}
</Button>
)}

<Typography mt={2} color="warning">
<InfoOutlinedIcon color="warning" sx={{ verticalAlign: 'middle' }} />
&nbsp;&nbsp;
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/cz/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const cz: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Opravdu chcete resetovat zařízení EMS-ESP do továrního nastavení?',
STABLE: 'Stabilní',
DEVELOPMENT: 'Vývojová verze',
EMS_ESP_VER: 'Verze firmwaru',
UPTIME: 'Doba provozu systému',
FREE_MEMORY: 'Volná paměť',
PSRAM: 'PSRAM (Velikost / Volná)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const de: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Sind Sie sicher, alle Einstellungen auf Werkseinstellung zu setzen?',
STABLE: 'Stabil',
DEVELOPMENT: 'Entwicklung',
EMS_ESP_VER: 'Firmware-Version',
UPTIME: 'Systembetriebszeit',
FREE_MEMORY: 'Freier RAM Speicher',
PSRAM: 'PSRAM (Größe / Frei)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const en: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Are you sure you want to reset EMS-ESP to its factory defaults?',
STABLE: 'Stable',
DEVELOPMENT: 'Development',
EMS_ESP_VER: 'Firmware Version',
UPTIME: 'System Uptime',
FREE_MEMORY: 'Free Memory',
PSRAM: 'PSRAM (Size / Free)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const fr: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: "Êtes-vous sûr de vouloir réinitialiser l'appareil à ses paramètres d'usine ?",
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Développement',
EMS_ESP_VER: 'Firmware Version', // TODO translate
UPTIME: 'Durée de fonctionnement du système',
FREE_MEMORY: 'Libre Memory',
PSRAM: 'PSRAM (Taille / Libre)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/it/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const it: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Sei sicuro di voler ripristinare il dispositivo alle impostazioni di fabbrica??',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Sviluppo',
EMS_ESP_VER: 'Versione Firmware',
UPTIME: 'Tempo di attività del sistema',
FREE_MEMORY: 'Free Memory',
PSRAM: 'PSRAM (Size / Free)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/nl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const nl: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Weet je zeker dat je een reset naar fabrieksinstellingen uit wilt voeren?',
STABLE: 'Stable',
DEVELOPMENT: 'Development',
EMS_ESP_VER: 'Firmware Versie',
UPTIME: 'Systeem Uptime',
FREE_MEMORY: 'Free Memory',
PSRAM: 'PSRAM (Size / Free)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/no/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const no: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Er du sikker på at du vil resette enheten til fabrikkinstillinger?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Development',
EMS_ESP_VER: 'Firmware Version', // TODO translate
UPTIME: 'System Oppetid',
FREE_MEMORY: 'Ledig Memory',
PSRAM: 'PSRAM (Størrelse / Ledig)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/pl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const pl: BaseTranslation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Na pewno chcesz przywrócić ustawienia fabryczne interfejsu EMS-ESP?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Testowe',
EMS_ESP_VER: 'Wersja Firmware',
UPTIME: 'Czas działania systemu',
FREE_MEMORY: 'Wolne Memory',
PSRAM: 'PSRAM (rozmiar / wolne)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/sk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const sk: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Naozaj chcete resetovať EMS-ESP na predvolené výrobné nastavenia?',
STABLE: 'Stabilná',
DEVELOPMENT: 'Vývojárska',
EMS_ESP_VER: 'Firmware verzia',
UPTIME: 'Beh systému',
FREE_MEMORY: 'Voľné Memory',
PSRAM: 'PSRAM (Veľkosť / Voľné)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/sv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const sv: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Är du säker att du vill fabriksåterställa enheten?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Utveckling',
EMS_ESP_VER: 'Firmware Version', // TODO translate
UPTIME: 'Systemets Upptid',
FREE_MEMORY: 'Ledigt Memory',
PSRAM: 'PSRAM (Storlek / Ledigt)',
Expand Down
1 change: 0 additions & 1 deletion interface/src/i18n/tr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const tr: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Cihazı fabrika ayarlarına döndürmek istediğinize emin misiniz?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Geliştirme',
EMS_ESP_VER: 'Firmware Sürümü',
UPTIME: 'Sistem Çalışma Süresi',
FREE_MEMORY: 'Yığın Memory',
PSRAM: 'PSRAM (Boyut / Boş)',
Expand Down
13 changes: 8 additions & 5 deletions mock-api/rest_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ const headers = {
};

// Versions - all without the 'v'
const THIS_VERSION = '3.7.0';
// const THIS_VERSION = '3.6.4'; // for testing
const LATEST_STABLE_VERSION = '3.7.0';
const LATEST_DEV_VERSION = '3.7.1-dev.4';
const VERSION_IS_UPGRADEABLE = true;
let THIS_VERSION = '3.7.0';
let LATEST_STABLE_VERSION = '3.7.0';
let LATEST_DEV_VERSION = '3.7.1-dev.4';
let VERSION_IS_UPGRADEABLE = false;

// for testing
// THIS_VERSION = '3.6.5';
// VERSION_IS_UPGRADEABLE = true;

// GLOBAL VARIABLES
let countWifiScanPoll = 0; // wifi network scan
Expand Down

0 comments on commit 00beb2a

Please sign in to comment.