diff --git a/interface/src/app/status/Version.tsx b/interface/src/app/status/Version.tsx index d8fb7f2d2..0d27ec461 100644 --- a/interface/src/app/status/Version.tsx +++ b/interface/src/app/status/Version.tsx @@ -86,8 +86,9 @@ const VersionInfoDialog = memo( showVersionInfo, latestVersion, latestDevVersion, - previousVersion, + partitionVersion, partition, + currentPartition, size, locale, LL, @@ -96,8 +97,9 @@ const VersionInfoDialog = memo( showVersionInfo: number; latestVersion?: VersionInfo; latestDevVersion?: VersionInfo; - previousVersion?: VersionInfo | undefined; + partitionVersion?: VersionInfo | undefined; partition: string; + currentPartition: string; size: number; locale: string; LL: TranslationFunctions; @@ -107,13 +109,13 @@ const VersionInfoDialog = memo( const isStable = showVersionInfo === 1; const isDev = showVersionInfo === 2; - const isPrevious = showVersionInfo === 3; + const isPartition = showVersionInfo === 3; const version = isStable ? latestVersion : isDev ? latestDevVersion - : previousVersion; + : partitionVersion; const relNotesUrl = isStable ? STABLE_RELNOTES_URL : isDev @@ -135,18 +137,17 @@ const VersionInfoDialog = memo( borderBottom: 'none', pr: 1, py: 0.5, - fontSize: 13, - width: 140 + fontSize: 13 }} > - {isPrevious ? LL.TYPE(0) : LL.RELEASE_TYPE()} + {LL.VERSION()} - {isStable - ? LL.STABLE() - : isDev - ? LL.DEVELOPMENT() - : 'Partition ' + LL.VERSION()} + {isPartition + ? typeof version === 'string' + ? version + : version?.name + : version?.name} @@ -158,20 +159,22 @@ const VersionInfoDialog = memo( borderBottom: 'none', pr: 1, py: 0.5, - fontSize: 13 + fontSize: 13, + width: 140 }} > - {LL.VERSION()} + {isPartition ? LL.TYPE(0) : LL.RELEASE_TYPE()} - {isPrevious - ? typeof version === 'string' - ? version - : version?.name - : version?.name} + {partition === currentPartition && LL.ACTIVE() + ' '} + {isStable + ? LL.STABLE() + : isDev + ? LL.DEVELOPMENT() + : 'Partition ' + LL.VERSION()} - {isPrevious && ( + {isPartition && ( )} - {isPrevious && ( + {isPartition && ( - {isPrevious ? 'Install Date' : 'Build Date'} + {isPartition ? 'Install Date' : 'Build Date'} {prettyDateTime(locale, new Date(version.published_at))} @@ -235,7 +238,7 @@ const VersionInfoDialog = memo( - {!isPrevious && ( + {!isPartition && ( - - ))} + {data.partitions + .filter( + (partition) => partition.partition !== data.partition + ) + .map((partition) => ( + + {partition.version} + + setPartitionVersionInfo(partition.partition) + } + aria-label={LL.FIRMWARE_VERSION_INFO()} + > + + + + + ))} )} @@ -783,9 +792,10 @@ const Version = () => { showVersionInfo={showVersionInfo} latestVersion={latestVersion} latestDevVersion={latestDevVersion} - previousVersion={previousVersion} + partitionVersion={partitionVersion} locale={locale} - partition={previousPartition} + partition={partition} + currentPartition={data?.partition ?? ''} size={firmwareSize} LL={LL} onClose={handleVersionInfoClose} @@ -801,13 +811,13 @@ const Version = () => { onClose={closeInstallDialog} onInstall={installFirmwareURL} /> - {LL.UPLOAD()} diff --git a/interface/src/i18n/cz/index.ts b/interface/src/i18n/cz/index.ts index 3e7e28c41..efc1c6887 100644 --- a/interface/src/i18n/cz/index.ts +++ b/interface/src/i18n/cz/index.ts @@ -356,7 +356,7 @@ const cz: Translation = { FIRMWARE_VERSION_INFO: 'Informace o verzi firmwaru', NO_DATA: 'Žádná data', USER_PROFILE: 'Uživatelský profil', - PREVIOUS_VERSIONS: 'Předchozí verze' + STORED_VERSIONS: 'Uložené verze' }; export default cz; diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index 8cbed793f..8aa4e1dc8 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -356,7 +356,7 @@ const de: Translation = { FIRMWARE_VERSION_INFO: 'Firmware-Versionsinformation', NO_DATA: 'Keine Daten', USER_PROFILE: 'Benutzerprofil', - PREVIOUS_VERSIONS: 'Vorherige Versionen' + STORED_VERSIONS: 'Gespeicherte Versionen' }; export default de; diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index de2419099..bdb05a480 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -356,7 +356,7 @@ const en: Translation = { FIRMWARE_VERSION_INFO: 'Firmware Version Information', NO_DATA: 'No data', USER_PROFILE: 'User Profile', - PREVIOUS_VERSIONS: 'Previous Versions' + STORED_VERSIONS: 'Stored Versions' }; export default en; diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index 9c69ff857..008df1fcd 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -356,7 +356,7 @@ const fr: Translation = { FIRMWARE_VERSION_INFO: 'Informations sur la version du firmware', NO_DATA: 'Aucune donnée', USER_PROFILE: 'Profil utilisateur', - PREVIOUS_VERSIONS: 'Versions précédentes' + STORED_VERSIONS: 'Versions stockées' }; export default fr; diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts index 04b6072c2..cd38ed18a 100644 --- a/interface/src/i18n/it/index.ts +++ b/interface/src/i18n/it/index.ts @@ -356,7 +356,7 @@ const it: Translation = { FIRMWARE_VERSION_INFO: 'Informazioni sulla versione del firmware', NO_DATA: 'Nessun dato', USER_PROFILE: 'Profilo utente', - PREVIOUS_VERSIONS: 'Versioni precedenti' + STORED_VERSIONS: 'Versioni memorizzate' }; export default it; diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index 1ec6d8d07..3f23c42db 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -356,7 +356,7 @@ const nl: Translation = { FIRMWARE_VERSION_INFO: 'Informatie over firmwareversie', NO_DATA: 'Geen data', USER_PROFILE: 'Gebruikersprofiel', - PREVIOUS_VERSIONS: 'Vorige versies' + STORED_VERSIONS: 'Opgeslagen versies' }; export default nl; \ No newline at end of file diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index 4cd78a5bf..88af2bc43 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -356,7 +356,7 @@ const no: Translation = { FIRMWARE_VERSION_INFO: 'Informasjon om firmwareversjon', NO_DATA: 'Ingen data', USER_PROFILE: 'Brukerprofil', - PREVIOUS_VERSIONS: 'Tidligere versjoner' + STORED_VERSIONS: 'Lagret versjoner' }; export default no; diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 9895ec0de..07b003447 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -356,7 +356,7 @@ const pl: BaseTranslation = { FIRMWARE_VERSION_INFO: 'Informacje o wersji firmware', NO_DATA: 'Brak danych', USER_PROFILE: 'Profil użytkownika', - PREVIOUS_VERSIONS: 'Poprzednie wersje' + STORED_VERSIONS: 'Zapisane wersje' }; export default pl; diff --git a/interface/src/i18n/sk/index.ts b/interface/src/i18n/sk/index.ts index df5359000..7950f2e05 100644 --- a/interface/src/i18n/sk/index.ts +++ b/interface/src/i18n/sk/index.ts @@ -356,7 +356,7 @@ const sk: Translation = { FIRMWARE_VERSION_INFO: 'Informácie o verzii firmware', NO_DATA: 'Žiadne dáta', USER_PROFILE: 'Profil používateľa', - PREVIOUS_VERSIONS: 'Predchádzajúce verzie' + STORED_VERSIONS: 'Uložené verzie' }; export default sk; diff --git a/interface/src/i18n/sv/index.ts b/interface/src/i18n/sv/index.ts index 001a8d0b6..a8fd58d23 100644 --- a/interface/src/i18n/sv/index.ts +++ b/interface/src/i18n/sv/index.ts @@ -356,7 +356,7 @@ const sv: Translation = { FIRMWARE_VERSION_INFO: 'Information om firmwareversion', NO_DATA: 'Ingen data', USER_PROFILE: 'Användarprofil', - PREVIOUS_VERSIONS: 'Tidigare versioner' + STORED_VERSIONS: 'Lagrad versioner' }; export default sv; diff --git a/interface/src/i18n/tr/index.ts b/interface/src/i18n/tr/index.ts index 3933401b8..d931077f1 100644 --- a/interface/src/i18n/tr/index.ts +++ b/interface/src/i18n/tr/index.ts @@ -356,7 +356,7 @@ const tr: Translation = { FIRMWARE_VERSION_INFO: 'Firmware Sürüm Bilgisi', NO_DATA: 'Hiçbir veri yok', USER_PROFILE: 'Kullanıcı Profili', - PREVIOUS_VERSIONS: 'Önceki Sürümler' + STORED_VERSIONS: 'Kaydedilmiş Sürümler' }; export default tr; diff --git a/mock-api/restServer.ts b/mock-api/restServer.ts index 2ae6c39d5..209f7e3c2 100644 --- a/mock-api/restServer.ts +++ b/mock-api/restServer.ts @@ -108,6 +108,12 @@ let system_status = { has_loader: true, has_partition: true, partitions: [ + { + partition: 'app0', // this one is active + version: 'XX.XX.XX', // defined later + install_date: '2025-03-01T13:29:13.999Z', + size: 4672 + }, { partition: 'app1', version: '3.7.3-dev.41', @@ -179,6 +185,7 @@ switch (version_test as number) { // set the version system_status.emsesp_version = THIS_VERSION; +system_status.partitions[0].version = THIS_VERSION; // app0 // set the ESP platform - using ESP32 will disable OTA and automatic version downloading let emulate_esp: string; diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index fa29a91c0..bc93d0dc0 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -146,12 +146,12 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) { root["has_partition"] = false; } - // get the partition info + // get the partition info for each partition, including the running one EMSESP::system_.get_partition_info(); JsonArray partitions = root["partitions"].to(); for (const auto & partition : EMSESP::system_.partition_info_) { - // Skip partition if it's the running one, version is empty, or size is 0 - if (partition.first == (const char *)esp_ota_get_running_partition()->label || partition.second.version.empty() || partition.second.size == 0) { + // Skip partition if it has no version, or it's size is 0 + if (partition.second.version.empty() || partition.second.size == 0) { continue; } JsonObject part = partitions.add();