mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-04-29 12:05:12 +00:00
upgrade message warnings
This commit is contained in:
@@ -78,16 +78,19 @@ const DragNdrop = ({ text, onFileSelected }: DragNdropProps) => {
|
|||||||
useState<number>(0);
|
useState<number>(0);
|
||||||
|
|
||||||
const { send: checkUpgradeImportantMessages } = useRequest(
|
const { send: checkUpgradeImportantMessages } = useRequest(
|
||||||
(type: string) =>
|
(version: string) =>
|
||||||
callAction({ action: 'upgradeImportantMessages', param: type }),
|
callAction({ action: 'upgradeImportantMessages', param: version }),
|
||||||
{
|
{
|
||||||
immediate: false
|
immediate: false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.onSuccess((event: { data: number }) => {
|
.onSuccess((event) => {
|
||||||
setUpgradeImportantMessageType(event.data);
|
setUpgradeImportantMessageType(
|
||||||
|
(event.data as { upgradeImportantMessageType: number })
|
||||||
|
.upgradeImportantMessageType
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.onError((error: { error?: { message?: string } }) => {
|
.onError((error) => {
|
||||||
toast.error(String(error.error?.message || 'An error occurred'));
|
toast.error(String(error.error?.message || 'An error occurred'));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -189,7 +192,7 @@ const DragNdrop = ({ text, onFileSelected }: DragNdropProps) => {
|
|||||||
{LL.UPLOAD()}
|
{LL.UPLOAD()}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
{showUpgradeDialog && (
|
{showUpgradeDialog && upgradeImportantMessageType > 0 && (
|
||||||
<Dialog
|
<Dialog
|
||||||
sx={dialogStyle}
|
sx={dialogStyle}
|
||||||
open={showUpgradeDialog}
|
open={showUpgradeDialog}
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const cz: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Toto vytvoří zálohu vašich nastavení a konfigurace. Všechna hesla budou v zálohovém souboru čitelná. Opravdu chcete pokračovat?',
|
WARNING_SYSTEM_BACKUP: 'Toto vytvoří zálohu vašich nastavení a konfigurace. Všechna hesla budou v zálohovém souboru čitelná. Opravdu chcete pokračovat?',
|
||||||
UPLOAD_TEXT: 'Nahrajte nový soubor firmwaru (.bin) nebo záložní soubor (.json)',
|
UPLOAD_TEXT: 'Nahrajte nový soubor firmwaru (.bin) nebo záložní soubor (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Přetáhněte soubor sem nebo klikněte pro výběr',
|
UPLOAD_DROP_TEXT: 'Přetáhněte soubor sem nebo klikněte pro výběr',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Důležité zprávy pro aktualizaci',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Aktualizujete se z hlavní verze. Vezměte prosím na vědomí, že to může způsobit problémy s vaší konfigurací.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Aktualizujete se z dílčí verze. Vezměte prosím na vědomí, že to může způsobit problémy s vaší konfigurací.',
|
|
||||||
ERROR: 'Neočekávaná chyba, zkuste to prosím znovu',
|
ERROR: 'Neočekávaná chyba, zkuste to prosím znovu',
|
||||||
TIME_SET: 'Čas nastaven',
|
TIME_SET: 'Čas nastaven',
|
||||||
MANAGE_USERS: 'Spravovat uživatele',
|
MANAGE_USERS: 'Spravovat uživatele',
|
||||||
@@ -363,7 +360,11 @@ const cz: Translation = {
|
|||||||
NO_DATA: 'Žádná data',
|
NO_DATA: 'Žádná data',
|
||||||
USER_PROFILE: 'Uživatelský profil',
|
USER_PROFILE: 'Uživatelský profil',
|
||||||
STORED_VERSIONS: 'Uložené verze',
|
STORED_VERSIONS: 'Uložené verze',
|
||||||
ONLINE_HELP: 'online nápověda'
|
ONLINE_HELP: 'online nápověda',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default cz;
|
export default cz;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const de: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Dies wird eine Sicherung Ihrer Konfigurationen und Einstellungen erstellen. Alle Passwörter werden im Sicherungsdatei lesbar. Möchten Sie fortfahren?',
|
WARNING_SYSTEM_BACKUP: 'Dies wird eine Sicherung Ihrer Konfigurationen und Einstellungen erstellen. Alle Passwörter werden im Sicherungsdatei lesbar. Möchten Sie fortfahren?',
|
||||||
UPLOAD_TEXT: 'Laden Sie eine neue Firmware-Datei (.bin) oder eine Sicherungsdatei (.json) hoch',
|
UPLOAD_TEXT: 'Laden Sie eine neue Firmware-Datei (.bin) oder eine Sicherungsdatei (.json) hoch',
|
||||||
UPLOAD_DROP_TEXT: 'Legen Sie eine Firmware-Datei (.bin) ab oder klicken Sie hier',
|
UPLOAD_DROP_TEXT: 'Legen Sie eine Firmware-Datei (.bin) ab oder klicken Sie hier',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Wichtige Nachrichten für das Upgrade',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Sie sind von einer Major-Version auf eine neue Version aktualisiert. Bitte beachten Sie, dass dies zu Problemen mit Ihrer Konfiguration führen kann.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Sie sind von einer Minor-Version auf eine neue Version aktualisiert. Bitte beachten Sie, dass dies zu Problemen mit Ihrer Konfiguration führen kann.',
|
|
||||||
ERROR: 'Unerwarteter Fehler, bitte versuchen Sie es erneut.',
|
ERROR: 'Unerwarteter Fehler, bitte versuchen Sie es erneut.',
|
||||||
TIME_SET: 'Zeit gesetzt',
|
TIME_SET: 'Zeit gesetzt',
|
||||||
MANAGE_USERS: 'Nutzerverwaltung',
|
MANAGE_USERS: 'Nutzerverwaltung',
|
||||||
@@ -363,7 +360,11 @@ const de: Translation = {
|
|||||||
NO_DATA: 'Keine Daten',
|
NO_DATA: 'Keine Daten',
|
||||||
USER_PROFILE: 'Benutzerprofil',
|
USER_PROFILE: 'Benutzerprofil',
|
||||||
STORED_VERSIONS: 'Gespeicherte Versionen',
|
STORED_VERSIONS: 'Gespeicherte Versionen',
|
||||||
ONLINE_HELP: 'Online-Hilfe'
|
ONLINE_HELP: 'Online-Hilfe',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default de;
|
export default de;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const en: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'This will create a backup of your configuration and settings. All passwords will be readable in the backup file. Do you want to continue?',
|
WARNING_SYSTEM_BACKUP: 'This will create a backup of your configuration and settings. All passwords will be readable in the backup file. Do you want to continue?',
|
||||||
UPLOAD_TEXT: 'Upload a new firmware file (.bin) or a backup file (.json)',
|
UPLOAD_TEXT: 'Upload a new firmware file (.bin) or a backup file (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Drop a firmware .bin file or click here',
|
UPLOAD_DROP_TEXT: 'Drop a firmware .bin file or click here',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'You are upgrading from a major version. Please be aware that this may cause issues with your configuration.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading from a minor version. Please be aware that this may cause issues with your configuration.',
|
|
||||||
ERROR: 'Unexpected Error, please try again',
|
ERROR: 'Unexpected Error, please try again',
|
||||||
TIME_SET: 'Time set',
|
TIME_SET: 'Time set',
|
||||||
MANAGE_USERS: 'Manage Users',
|
MANAGE_USERS: 'Manage Users',
|
||||||
@@ -363,7 +360,11 @@ const en: Translation = {
|
|||||||
NO_DATA: 'No data',
|
NO_DATA: 'No data',
|
||||||
USER_PROFILE: 'User Profile',
|
USER_PROFILE: 'User Profile',
|
||||||
STORED_VERSIONS: 'Stored Versions',
|
STORED_VERSIONS: 'Stored Versions',
|
||||||
ONLINE_HELP: 'online help'
|
ONLINE_HELP: 'online help',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default en;
|
export default en;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const fr: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Cela créera une sauvegarde de vos paramètres et configurations. Tous les mots de passe seront lisibles dans le fichier de sauvegarde. Voulez-vous continuer ?',
|
WARNING_SYSTEM_BACKUP: 'Cela créera une sauvegarde de vos paramètres et configurations. Tous les mots de passe seront lisibles dans le fichier de sauvegarde. Voulez-vous continuer ?',
|
||||||
UPLOAD_TEXT: 'Télécharger un nouveau fichier firmware (.bin) ou une sauvegarde (.json)',
|
UPLOAD_TEXT: 'Télécharger un nouveau fichier firmware (.bin) ou une sauvegarde (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Drop a firmware .bin file or click here',
|
UPLOAD_DROP_TEXT: 'Drop a firmware .bin file or click here',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Messages importants pour la mise à jour',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Vous mettez à jour à partir d\'une version majeure. Veuillez prendre en compte que cela peut causer des problèmes avec votre configuration.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Vous mettez à jour à partir d\'une version mineure. Veuillez prendre en compte que cela peut causer des problèmes avec votre configuration.',
|
|
||||||
ERROR: 'Erreur inattendue, veuillez réessayer',
|
ERROR: 'Erreur inattendue, veuillez réessayer',
|
||||||
TIME_SET: 'Time set',
|
TIME_SET: 'Time set',
|
||||||
MANAGE_USERS: 'Gérer les utilisateurs',
|
MANAGE_USERS: 'Gérer les utilisateurs',
|
||||||
@@ -363,7 +360,11 @@ const fr: Translation = {
|
|||||||
NO_DATA: 'Aucune donnée',
|
NO_DATA: 'Aucune donnée',
|
||||||
USER_PROFILE: 'Profil utilisateur',
|
USER_PROFILE: 'Profil utilisateur',
|
||||||
STORED_VERSIONS: 'Versions stockées',
|
STORED_VERSIONS: 'Versions stockées',
|
||||||
ONLINE_HELP: 'aide en ligne'
|
ONLINE_HELP: 'aide en ligne',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default fr;
|
export default fr;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const it: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Questo creerà un backup delle tue configurazioni e impostazioni. Tutte le password saranno leggibili nel file di backup. Vuoi continuare?',
|
WARNING_SYSTEM_BACKUP: 'Questo creerà un backup delle tue configurazioni e impostazioni. Tutte le password saranno leggibili nel file di backup. Vuoi continuare?',
|
||||||
UPLOAD_TEXT: 'Upload a new firmware file (.bin) or a backup file (.json)',
|
UPLOAD_TEXT: 'Upload a new firmware file (.bin) or a backup file (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Drop a firmware .bin file or click here',
|
UPLOAD_DROP_TEXT: 'Drop a firmware .bin file or click here',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Messaggi importanti per l\'aggiornamento',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Stai aggiornando da una versione principale. Si prega di essere consapevoli che questo può causare problemi con la tua configurazione.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Stai aggiornando da una versione secondaria. Si prega di essere consapevoli che questo può causare problemi con la tua configurazione.',
|
|
||||||
ERROR: 'Errore Inaspettato, prego tenta ancora',
|
ERROR: 'Errore Inaspettato, prego tenta ancora',
|
||||||
TIME_SET: 'Imposta Ora',
|
TIME_SET: 'Imposta Ora',
|
||||||
MANAGE_USERS: 'Gestione Utenti',
|
MANAGE_USERS: 'Gestione Utenti',
|
||||||
@@ -363,7 +360,11 @@ const it: Translation = {
|
|||||||
NO_DATA: 'Nessun dato',
|
NO_DATA: 'Nessun dato',
|
||||||
USER_PROFILE: 'Profilo utente',
|
USER_PROFILE: 'Profilo utente',
|
||||||
STORED_VERSIONS: 'Versioni memorizzate',
|
STORED_VERSIONS: 'Versioni memorizzate',
|
||||||
ONLINE_HELP: 'aiuto online'
|
ONLINE_HELP: 'aiuto online',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default it;
|
export default it;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const nl: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Dit zal een backup maken van uw configuratie en instellingen. Alle wachtwoorden zullen leesbaar zijn in het backup bestand. Weet je zeker dat je wilt doorgaan?',
|
WARNING_SYSTEM_BACKUP: 'Dit zal een backup maken van uw configuratie en instellingen. Alle wachtwoorden zullen leesbaar zijn in het backup bestand. Weet je zeker dat je wilt doorgaan?',
|
||||||
UPLOAD_TEXT: 'Upload een nieuw firmwarebestand (.bin) of een back-upbestand (.json)',
|
UPLOAD_TEXT: 'Upload een nieuw firmwarebestand (.bin) of een back-upbestand (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Sleep en firmware .bin bestand hierheen of klik hier',
|
UPLOAD_DROP_TEXT: 'Sleep en firmware .bin bestand hierheen of klik hier',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Belangrijke berichten voor upgrade',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'U updatet van een grote versie. Wees bewust dat dit problemen met uw configuratie kan veroorzaken.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'U updatet van een kleine versie. Wees bewust dat dit problemen met uw configuratie kan veroorzaken.',
|
|
||||||
ERROR: 'Onverwachte fout, probeer opnieuw',
|
ERROR: 'Onverwachte fout, probeer opnieuw',
|
||||||
TIME_SET: 'Tijd ingesteld',
|
TIME_SET: 'Tijd ingesteld',
|
||||||
MANAGE_USERS: 'Gebruikersbeheer',
|
MANAGE_USERS: 'Gebruikersbeheer',
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const no: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Dette vil lage en sikkerhetskopi av dine konfigurasjon og innstillinger. Alle passord vil være lesbare i sikkerhetskopien. Er du sikker på at du vil fortsette?',
|
WARNING_SYSTEM_BACKUP: 'Dette vil lage en sikkerhetskopi av dine konfigurasjon og innstillinger. Alle passord vil være lesbare i sikkerhetskopien. Er du sikker på at du vil fortsette?',
|
||||||
UPLOAD_TEXT: 'Last opp en ny firmware fil (.bin) eller en sikkerhetskopi fil (.json)',
|
UPLOAD_TEXT: 'Last opp en ny firmware fil (.bin) eller en sikkerhetskopi fil (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Dropp en firmware fil (.bin) eller klikk her',
|
UPLOAD_DROP_TEXT: 'Dropp en firmware fil (.bin) eller klikk her',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Viktige meldinger for oppgradering',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Du oppgraderer fra en stor versjon. Vær oppmerksom på at dette kan føre til problemer med din konfigurasjon.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Du oppgraderer fra en liten versjon. Vær oppmerksom på at dette kan føre til problemer med din konfigurasjon.',
|
|
||||||
ERROR: 'Ukjent feil, prøv igjen',
|
ERROR: 'Ukjent feil, prøv igjen',
|
||||||
TIME_SET: 'Still in tid',
|
TIME_SET: 'Still in tid',
|
||||||
MANAGE_USERS: 'Administrer Brukere',
|
MANAGE_USERS: 'Administrer Brukere',
|
||||||
@@ -363,7 +360,11 @@ const no: Translation = {
|
|||||||
NO_DATA: 'Ingen data',
|
NO_DATA: 'Ingen data',
|
||||||
USER_PROFILE: 'Brukerprofil',
|
USER_PROFILE: 'Brukerprofil',
|
||||||
STORED_VERSIONS: 'Lagret versjoner',
|
STORED_VERSIONS: 'Lagret versjoner',
|
||||||
ONLINE_HELP: 'online hjelp'
|
ONLINE_HELP: 'online hjelp',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default no;
|
export default no;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const pl: BaseTranslation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'To utworzy kopię swoich ustawień i konfiguracji. Wszystkie hasła będą widoczne w kopii zapasowej. Czy na pewno chcesz kontynuować?',
|
WARNING_SYSTEM_BACKUP: 'To utworzy kopię swoich ustawień i konfiguracji. Wszystkie hasła będą widoczne w kopii zapasowej. Czy na pewno chcesz kontynuować?',
|
||||||
UPLOAD_TEXT: 'Wgraj nowy plik firmware (.bin) lub kopię ustawień (.json)',
|
UPLOAD_TEXT: 'Wgraj nowy plik firmware (.bin) lub kopię ustawień (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Upuść plik firmware .bin lub kliknij tutaj',
|
UPLOAD_DROP_TEXT: 'Upuść plik firmware .bin lub kliknij tutaj',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Ważne informacje dotyczące aktualizacji',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Aktualizujesz się z głównej wersji. Proszę mieć świadomość, że to może spowodować problemy z konfiguracją.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Aktualizujesz się z drugorzędnej wersji. Proszę mieć świadomość, że to może spowodować problemy z konfiguracją.',
|
|
||||||
ERROR: 'Nieoczekiwany błąd, spróbuj ponownie!',
|
ERROR: 'Nieoczekiwany błąd, spróbuj ponownie!',
|
||||||
TIME_SET: 'Zegar został ustawiony.',
|
TIME_SET: 'Zegar został ustawiony.',
|
||||||
MANAGE_USERS: 'Zarządzanie użytkownikami',
|
MANAGE_USERS: 'Zarządzanie użytkownikami',
|
||||||
@@ -363,7 +360,11 @@ const pl: BaseTranslation = {
|
|||||||
NO_DATA: 'Brak danych',
|
NO_DATA: 'Brak danych',
|
||||||
USER_PROFILE: 'Profil użytkownika',
|
USER_PROFILE: 'Profil użytkownika',
|
||||||
STORED_VERSIONS: 'Zapisane wersje',
|
STORED_VERSIONS: 'Zapisane wersje',
|
||||||
ONLINE_HELP: 'pomoc online'
|
ONLINE_HELP: 'pomoc online',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pl;
|
export default pl;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const sk: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Toto vytvorí zálohu vašich nastavení a konfigurácií. Všetky hesla budú v zálohovom súbore čitateľné. Naozaj chcete pokračovať?',
|
WARNING_SYSTEM_BACKUP: 'Toto vytvorí zálohu vašich nastavení a konfigurácií. Všetky hesla budú v zálohovom súbore čitateľné. Naozaj chcete pokračovať?',
|
||||||
UPLOAD_TEXT: 'Nahrajte nový súbor firmvéru (.bin) alebo súbor zálohy (.json)',
|
UPLOAD_TEXT: 'Nahrajte nový súbor firmvéru (.bin) alebo súbor zálohy (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Presuňte súbor .bin firmvéru alebo kliknite sem',
|
UPLOAD_DROP_TEXT: 'Presuňte súbor .bin firmvéru alebo kliknite sem',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Dôležité informácie pre aktualizáciu',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Aktualizujete sa z hlavného verzie. Prosím, buďte si vedomí, že to môže spôsobiť problémy s vašou konfiguráciou.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Aktualizujete sa z menšieho verzie. Prosím, buďte si vedomí, že to môže spôsobiť problémy s vašou konfiguráciou.',
|
|
||||||
ERROR: 'Neočakávaná chyba, prosím skúste to znova',
|
ERROR: 'Neočakávaná chyba, prosím skúste to znova',
|
||||||
TIME_SET: 'Nastavený čas',
|
TIME_SET: 'Nastavený čas',
|
||||||
MANAGE_USERS: 'Správa používateľov',
|
MANAGE_USERS: 'Správa používateľov',
|
||||||
@@ -363,7 +360,11 @@ const sk: Translation = {
|
|||||||
NO_DATA: 'Žiadne dáta',
|
NO_DATA: 'Žiadne dáta',
|
||||||
USER_PROFILE: 'Profil používateľa',
|
USER_PROFILE: 'Profil používateľa',
|
||||||
STORED_VERSIONS: 'Uložené verzie',
|
STORED_VERSIONS: 'Uložené verzie',
|
||||||
ONLINE_HELP: 'online pomoc'
|
ONLINE_HELP: 'online pomoc',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sk;
|
export default sk;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const sv: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Detta kommer att skapa en säkerhetskopia av dina inställningar och konfiguration. Alla lösenord kommer att vara läsbara i säkerhetskopian. Är du säker på att du vill fortsätta?',
|
WARNING_SYSTEM_BACKUP: 'Detta kommer att skapa en säkerhetskopia av dina inställningar och konfiguration. Alla lösenord kommer att vara läsbara i säkerhetskopian. Är du säker på att du vill fortsätta?',
|
||||||
UPLOAD_TEXT: 'Ladda upp en ny firmwarefil (.bin) eller en säkerhetskopiafil (.json)',
|
UPLOAD_TEXT: 'Ladda upp en ny firmwarefil (.bin) eller en säkerhetskopiafil (.json)',
|
||||||
UPLOAD_DROP_TEXT: 'Droppa en firmware .bin fil eller klicka här',
|
UPLOAD_DROP_TEXT: 'Droppa en firmware .bin fil eller klicka här',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Viktiga meddelanden för uppgradering',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Du uppgraderar från en major version. Vänligen var medveten om att detta kan orsaka problem med din konfiguration.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Du uppgraderar från en minor version. Vänligen var medveten om att detta kan orsaka problem med din konfiguration.',
|
|
||||||
ERROR: 'Okänt fel, var god försök igen',
|
ERROR: 'Okänt fel, var god försök igen',
|
||||||
TIME_SET: 'Ställ in tid',
|
TIME_SET: 'Ställ in tid',
|
||||||
MANAGE_USERS: 'Användare',
|
MANAGE_USERS: 'Användare',
|
||||||
@@ -363,7 +360,11 @@ const sv: Translation = {
|
|||||||
NO_DATA: 'Ingen data',
|
NO_DATA: 'Ingen data',
|
||||||
USER_PROFILE: 'Användarprofil',
|
USER_PROFILE: 'Användarprofil',
|
||||||
STORED_VERSIONS: 'Lagrad versioner',
|
STORED_VERSIONS: 'Lagrad versioner',
|
||||||
ONLINE_HELP: 'online hjälp'
|
ONLINE_HELP: 'online hjälp',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sv;
|
export default sv;
|
||||||
|
|||||||
@@ -191,9 +191,6 @@ const tr: Translation = {
|
|||||||
WARNING_SYSTEM_BACKUP: 'Bu, yapılandırma ve ayarlarınızın bir yedeklemesi oluşturacaktır. Tüm şifreler yedekleme dosyasında okunabilir olacaktır. Devam etmek istediğinize emin misiniz?',
|
WARNING_SYSTEM_BACKUP: 'Bu, yapılandırma ve ayarlarınızın bir yedeklemesi oluşturacaktır. Tüm şifreler yedekleme dosyasında okunabilir olacaktır. Devam etmek istediğinize emin misiniz?',
|
||||||
UPLOAD_TEXT: 'Yeni bir firmware dosyası (.bin) veya yedek dosyası (.json) yükle',
|
UPLOAD_TEXT: 'Yeni bir firmware dosyası (.bin) veya yedek dosyası (.json) yükle',
|
||||||
UPLOAD_DROP_TEXT: 'Bir firmware .bin dosyası veya buraya tıklayın',
|
UPLOAD_DROP_TEXT: 'Bir firmware .bin dosyası veya buraya tıklayın',
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Yükseltme Önemli Mesajları',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Bir ana sürümden yükselteysiniz. Lütfen bu, yapılandırmanızın sorunlarına neden olabileceğini unutmayın.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Bir küçük sürümden yükselteysiniz. Lütfen bu, yapılandırmanızın sorunlarına neden olabileceğini unutmayın.',
|
|
||||||
ERROR: 'Beklenemedik hata, lütfen tekrar deneyin.',
|
ERROR: 'Beklenemedik hata, lütfen tekrar deneyin.',
|
||||||
TIME_SET: 'Zaman ayarı',
|
TIME_SET: 'Zaman ayarı',
|
||||||
MANAGE_USERS: 'Kullanıcıları yönet',
|
MANAGE_USERS: 'Kullanıcıları yönet',
|
||||||
@@ -363,7 +360,11 @@ const tr: Translation = {
|
|||||||
NO_DATA: 'Hiçbir veri yok',
|
NO_DATA: 'Hiçbir veri yok',
|
||||||
USER_PROFILE: 'Kullanıcı Profili',
|
USER_PROFILE: 'Kullanıcı Profili',
|
||||||
STORED_VERSIONS: 'Kaydedilmiş Sürümler',
|
STORED_VERSIONS: 'Kaydedilmiş Sürümler',
|
||||||
ONLINE_HELP: 'online yardım'
|
ONLINE_HELP: 'online yardım',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you have made a backup of your configuration and settings, and upload after the new version is installed.',
|
||||||
|
UPGRADE_IMPORTANT_MESSAGES_2: 'You are upgrading to a new major version. Make sure you have read the ChangeLog for any breakijng changes.',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default tr;
|
export default tr;
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ function custom_support() {
|
|||||||
'',
|
'',
|
||||||
"For help and questions please <a target='_blank' href='https://emsesp.org'>contact</a> your installer."
|
"For help and questions please <a target='_blank' href='https://emsesp.org'>contact</a> your installer."
|
||||||
],
|
],
|
||||||
img_url: 'https://emsesp.org/_media/images/designer.png'
|
img_url: 'https://emsesp.org/media/images/designer.png'
|
||||||
// img_url: 'https://picsum.photos/200/300'
|
// img_url: 'https://picsum.photos/200/300'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -5173,29 +5173,16 @@ router
|
|||||||
} else if (action === 'upgradeImportantMessages') {
|
} else if (action === 'upgradeImportantMessages') {
|
||||||
// check upgrade important messages
|
// check upgrade important messages
|
||||||
console.log(
|
console.log(
|
||||||
'checking upgrade important messages for version ',
|
'checking upgrade important messages for version',
|
||||||
content.param
|
content.param
|
||||||
);
|
);
|
||||||
// determine message based on if we're upgrading a minor or major version
|
// determine message based on if we're upgrading a minor or major version
|
||||||
// TODO finish this
|
// TODO finish this
|
||||||
let message = 0;
|
|
||||||
const version = content.param;
|
const version = content.param;
|
||||||
const majorVersion = version.split('.')[0];
|
const data = {
|
||||||
const minorVersion = version.split('.')[1];
|
upgradeImportantMessageType: 1
|
||||||
const currentMajorVersion = THIS_VERSION.split('.')[0];
|
};
|
||||||
const currentMinorVersion = THIS_VERSION.split('.')[1];
|
return data;
|
||||||
if (majorVersion > currentMajorVersion) {
|
|
||||||
message = 1;
|
|
||||||
} else if (majorVersion < currentMajorVersion) {
|
|
||||||
message = 2;
|
|
||||||
} else if (minorVersion > currentMinorVersion) {
|
|
||||||
message = 1;
|
|
||||||
} else if (minorVersion < currentMinorVersion) {
|
|
||||||
message = 2;
|
|
||||||
} else {
|
|
||||||
message = 0;
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status(404); // cmd not found
|
return status(404); // cmd not found
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json)
|
|||||||
EMSESP::mqtt_.reset_mqtt();
|
EMSESP::mqtt_.reset_mqtt();
|
||||||
ok = true;
|
ok = true;
|
||||||
} else if (action == "upgradeImportantMessages") {
|
} else if (action == "upgradeImportantMessages") {
|
||||||
ok = upgradeImportantMessages(param.c_str());
|
ok = upgradeImportantMessages(root, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(EMSESP_STANDALONE) && !defined(EMSESP_UNITY)
|
#if defined(EMSESP_STANDALONE) && !defined(EMSESP_UNITY)
|
||||||
@@ -240,26 +240,76 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// action = upgradeImportantMessages
|
// action = upgradeImportantMessages
|
||||||
// returns the type of upgrade important message to show\
|
// returns the type of upgrade important message to display in the UI
|
||||||
// 0 = no message
|
// 0 = no message (if just a minor version upgrade)
|
||||||
// 1 = major version upgrade
|
// 1 = going from <= 3.8 to 3.9 (new partition layout)
|
||||||
// 2 = minor version upgrade
|
// 2 = major version upgrade
|
||||||
// TODO finish this
|
// version can be like 3.8.2 or a filename like EMS-ESP-3_8_2-dev_13-ESP32-16MB+.bin
|
||||||
bool WebStatusService::upgradeImportantMessages(const char * version) {
|
bool WebStatusService::upgradeImportantMessages(JsonObject root, std::string & version) {
|
||||||
version::Semver200_version current_version(current_version_s);
|
if (version.empty()) {
|
||||||
version::Semver200_version latest_version(version);
|
return false;
|
||||||
if (latest_version > current_version) {
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t upgradeImportantMessageType = 0;
|
||||||
|
|
||||||
|
// it's a filename with a .bin extension, try and extract the version from it
|
||||||
|
version::Semver200_version latest_version;
|
||||||
|
if (version.find(".bin") != std::string::npos) {
|
||||||
|
// e.g. EMS-ESP-3_8_2-dev_13-ESP32-16MB+.bin -> major=3 minor=8 patch=2
|
||||||
|
std::string filename = version;
|
||||||
|
auto pos = filename.find("EMS-ESP-");
|
||||||
|
if (pos == std::string::npos) {
|
||||||
|
EMSESP::logger().err("Invalid version string: %s", version.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pos += 8; // skip past "EMS-ESP-"
|
||||||
|
auto underscore1 = filename.find('_', pos);
|
||||||
|
auto underscore2 = filename.find('_', underscore1 + 1);
|
||||||
|
auto dash = filename.find('-', underscore2 + 1);
|
||||||
|
if (underscore1 == std::string::npos || underscore2 == std::string::npos || dash == std::string::npos) {
|
||||||
|
EMSESP::logger().err("Invalid version string: %s", version.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
std::string major_version = filename.substr(pos, underscore1 - pos);
|
||||||
|
std::string minor_version = filename.substr(underscore1 + 1, underscore2 - underscore1 - 1);
|
||||||
|
std::string patch_version = filename.substr(underscore2 + 1, dash - underscore2 - 1);
|
||||||
|
latest_version = version::Semver200_version(major_version + "." + minor_version + "." + patch_version);
|
||||||
|
} else {
|
||||||
|
latest_version = version::Semver200_version(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if it's a valid version string
|
||||||
|
if (!latest_version.major()) {
|
||||||
|
EMSESP::logger().err("Invalid version string: %s", version.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
version::Semver200_version current_version(current_version_s); // get current version
|
||||||
|
|
||||||
|
if (current_version.major() <= 3 && current_version.minor() <= 8) {
|
||||||
|
upgradeImportantMessageType = 1; // if moving from below 3.8.x to 3.9.x return 1
|
||||||
|
} else if (latest_version > current_version && current_version.minor() < latest_version.minor()) {
|
||||||
|
upgradeImportantMessageType = 0; // if it's just a minor version upgrade return 0
|
||||||
|
} else if (latest_version > current_version && current_version.major() < latest_version.major()) {
|
||||||
|
upgradeImportantMessageType = 2; // if it's a major version upgrade return 2
|
||||||
|
}
|
||||||
|
|
||||||
|
// #if defined(EMSESP_DEBUG)
|
||||||
|
// EMSESP::logger().debug("upgradeImportantMessageType: %s %d", version.c_str(), upgradeImportantMessageType);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
root["upgradeImportantMessageType"] = upgradeImportantMessageType;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// action = checkUpgrade
|
// action = checkUpgrade
|
||||||
// versions holds the latest development version and stable version in one string, comma separated
|
// versions holds the latest development version and stable version in one string, comma separated
|
||||||
bool WebStatusService::checkUpgrade(JsonObject root, std::string & versions) {
|
bool WebStatusService::checkUpgrade(JsonObject root, std::string & version) {
|
||||||
if (!versions.empty()) {
|
if (!version.empty()) {
|
||||||
version::Semver200_version current_version(current_version_s);
|
version::Semver200_version current_version(current_version_s);
|
||||||
version::Semver200_version latest_dev_version(versions.substr(0, versions.find(',')));
|
version::Semver200_version latest_dev_version(version.substr(0, version.find(',')));
|
||||||
version::Semver200_version latest_stable_version(versions.substr(versions.find(',') + 1));
|
version::Semver200_version latest_stable_version(version.substr(version.find(',') + 1));
|
||||||
|
|
||||||
bool dev_upgradeable = latest_dev_version > current_version;
|
bool dev_upgradeable = latest_dev_version > current_version;
|
||||||
bool stable_upgradeable = latest_stable_version > current_version;
|
bool stable_upgradeable = latest_stable_version > current_version;
|
||||||
@@ -358,7 +408,7 @@ bool WebStatusService::getCustomSupport(JsonObject root) {
|
|||||||
|
|
||||||
#if defined(EMSESP_STANDALONE)
|
#if defined(EMSESP_STANDALONE)
|
||||||
// dummy test data for "test api3"
|
// dummy test data for "test api3"
|
||||||
deserializeJson(doc, "{\"type\":\"customSupport\",\"Support\":{\"html\":[\"html code\",\"here\"], \"img_url\": \"https://emsesp.org/_media/images/designer.png\"}");
|
deserializeJson(doc, "{\"type\":\"customSupport\",\"Support\":{\"html\":[\"html code\",\"here\"], \"img_url\": \"https://emsesp.org/media/images/designer.png\"}");
|
||||||
#else
|
#else
|
||||||
// check if we have custom support file uploaded
|
// check if we have custom support file uploaded
|
||||||
File file = LittleFS.open(EMSESP_CUSTOMSUPPORT_FILE, "r");
|
File file = LittleFS.open(EMSESP_CUSTOMSUPPORT_FILE, "r");
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class WebStatusService {
|
|||||||
bool uploadURL(const char * url);
|
bool uploadURL(const char * url);
|
||||||
bool setSystemStatus(const char * status);
|
bool setSystemStatus(const char * status);
|
||||||
void allvalues(JsonObject output);
|
void allvalues(JsonObject output);
|
||||||
bool upgradeImportantMessages(const char * version);
|
bool upgradeImportantMessages(JsonObject root, std::string & version);
|
||||||
|
|
||||||
std::string current_version_s = EMSESP_APP_VERSION;
|
std::string current_version_s = EMSESP_APP_VERSION;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user