fixes to install

This commit is contained in:
proddy
2024-08-30 14:54:30 +02:00
parent c0305ddf38
commit 7c3c5917db
11 changed files with 28 additions and 21 deletions

View File

@@ -137,14 +137,14 @@ const DownloadUpload = () => {
const DEV_RELNOTES_URL =
'https://github.com/emsesp/EMS-ESP32/blob/dev/CHANGELOG_LATEST.md';
const getBinURL = (useDev: boolean) => {
const getBinURL = (useDevVersion: boolean) => {
const filename =
'EMS-ESP-' +
(useDev ? latestDevVersion : latestVersion).replaceAll('.', '_') +
(useDevVersion ? latestDevVersion : latestVersion).replaceAll('.', '_') +
'-' +
getPlatform() +
'.bin';
return useDev
return useDevVersion
? DEV_URL + filename
: STABLE_URL + 'v' + latestVersion + '/' + filename;
};
@@ -262,8 +262,11 @@ const DownloadUpload = () => {
);
};
const showFirmwareDialog = (useDev: boolean) => {
setUseDev(useDev);
// useDev = true to force using the dev version
const showFirmwareDialog = (useDevVersion: boolean) => {
if (useDevVersion || data.emsesp_version.includes('dev')) {
setUseDev(true);
}
setOpenDialog(true);
};
@@ -393,13 +396,15 @@ const DownloadUpload = () => {
{upgradeAvailable ? LL.UPGRADE_AVAILABLE() : LL.LATEST_VERSION()}
{upgradeAvailable && (
<Button
sx={{ ml: 2 }}
sx={{ ml: 2, textTransform: 'none' }}
size="small"
variant="outlined"
color="primary"
onClick={() => showFirmwareDialog(true)}
onClick={() => showFirmwareDialog(false)}
>
{LL.INSTALL('v' + isDev ? latestDevVersion : latestVersion)}
{isDev
? LL.INSTALL('v' + latestDevVersion)
: LL.INSTALL('v' + latestVersion)}
</Button>
)}
</Typography>

View File

@@ -335,7 +335,7 @@ const en: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions',
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};

View File

@@ -335,7 +335,7 @@ const fr: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions',
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate // TODO translate
};

View File

@@ -335,7 +335,7 @@ const it: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};

View File

@@ -335,7 +335,7 @@ const nl: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};

View File

@@ -335,7 +335,7 @@ const no: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};

View File

@@ -335,7 +335,7 @@ const pl: BaseTranslation = {
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};

View File

@@ -335,7 +335,7 @@ const sk: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};

View File

@@ -335,7 +335,7 @@ const sv: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};

View File

@@ -335,7 +335,7 @@ const tr: Translation = {
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Please wait while the firmware is being uploaded. The device will restart automatically.', // TODO translate
INSTALL_VERSION: 'This will install vesion {0}. Are you sure?', // TODO translate
SWITCH_DEV: 'Switch to development version', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest version.' // TODO translate
};