fix version links for dev #2497

This commit is contained in:
MichaelDvP
2025-03-28 16:46:49 +01:00
parent d405478a13
commit 1bcd453e3f

View File

@@ -44,6 +44,7 @@ const Version = () => {
const [restarting, setRestarting] = useState<boolean>(false); const [restarting, setRestarting] = useState<boolean>(false);
const [openInstallDialog, setOpenInstallDialog] = useState<boolean>(false); const [openInstallDialog, setOpenInstallDialog] = useState<boolean>(false);
const [usingDevVersion, setUsingDevVersion] = useState<boolean>(false); const [usingDevVersion, setUsingDevVersion] = useState<boolean>(false);
const [fetchDevVersion, setFetchDevVersion] = useState<boolean>(false);
const [upgradeAvailable, setUpgradeAvailable] = useState<boolean>(false); const [upgradeAvailable, setUpgradeAvailable] = useState<boolean>(false);
const [internetLive, setInternetLive] = useState<boolean>(false); const [internetLive, setInternetLive] = useState<boolean>(false);
const [downloadOnly, setDownloadOnly] = useState<boolean>(false); const [downloadOnly, setDownloadOnly] = useState<boolean>(false);
@@ -144,14 +145,14 @@ const Version = () => {
} }
const filename = const filename =
'EMS-ESP-' + 'EMS-ESP-' +
(usingDevVersion ? latestDevVersion.name : latestVersion.name).replaceAll( (fetchDevVersion ? latestDevVersion.name : latestVersion.name).replaceAll(
'.', '.',
'_' '_'
) + ) +
'-' + '-' +
getPlatform() + getPlatform() +
'.bin'; '.bin';
return usingDevVersion return fetchDevVersion
? DEV_URL + filename ? DEV_URL + filename
: STABLE_URL + 'v' + latestVersion.name + '/' + filename; : STABLE_URL + 'v' + latestVersion.name + '/' + filename;
}; };
@@ -181,13 +182,13 @@ const Version = () => {
<DialogTitle> <DialogTitle>
{LL.INSTALL() + {LL.INSTALL() +
' ' + ' ' +
(usingDevVersion ? LL.DEVELOPMENT() : LL.STABLE()) + (fetchDevVersion ? LL.DEVELOPMENT() : LL.STABLE()) +
' Firmware'} ' Firmware'}
</DialogTitle> </DialogTitle>
<DialogContent dividers> <DialogContent dividers>
<Typography mb={2}> <Typography mb={2}>
{LL.INSTALL_VERSION( {LL.INSTALL_VERSION(
usingDevVersion ? latestDevVersion?.name : latestVersion?.name fetchDevVersion ? latestDevVersion?.name : latestVersion?.name
)} )}
</Typography> </Typography>
</DialogContent> </DialogContent>
@@ -223,13 +224,12 @@ const Version = () => {
); );
const showFirmwareDialog = (useDevVersion?: boolean) => { const showFirmwareDialog = (useDevVersion?: boolean) => {
setUsingDevVersion(useDevVersion || usingDevVersion); setFetchDevVersion(useDevVersion || usingDevVersion);
setOpenInstallDialog(true); setOpenInstallDialog(true);
}; };
const closeInstallDialog = () => { const closeInstallDialog = () => {
setOpenInstallDialog(false); setOpenInstallDialog(false);
setUsingDevVersion(data.emsesp_version.includes('dev'));
}; };
const showButtons = (showDev?: boolean) => { const showButtons = (showDev?: boolean) => {
@@ -260,7 +260,9 @@ const Version = () => {
variant="outlined" variant="outlined"
color="warning" color="warning"
size="small" size="small"
onClick={() => showFirmwareDialog()} onClick={() =>
showFirmwareDialog(upgradeAvailable || (!usingDevVersion && showDev))
}
> >
{upgradeAvailable || (!usingDevVersion && showDev) {upgradeAvailable || (!usingDevVersion && showDev)
? LL.UPGRADE() ? LL.UPGRADE()