From ccfbdfbd0fffbe47de0ff08fece820c1c68bb9a0 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 26 Sep 2024 17:43:55 +0200 Subject: [PATCH] Gues mode in help #2054 --- CHANGELOG_LATEST.md | 1 + interface/src/app/main/Help.tsx | 132 +++++++++++++++++++------------- interface/src/i18n/de/index.ts | 2 +- interface/src/i18n/en/index.ts | 2 +- interface/src/i18n/fr/index.ts | 2 +- interface/src/i18n/it/index.ts | 2 +- interface/src/i18n/nl/index.ts | 2 +- interface/src/i18n/no/index.ts | 2 +- interface/src/i18n/pl/index.ts | 2 +- interface/src/i18n/sk/index.ts | 2 +- interface/src/i18n/sv/index.ts | 2 +- interface/src/i18n/tr/index.ts | 2 +- src/version.h | 2 +- 13 files changed, 91 insertions(+), 64 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 59238d799..6285bbc06 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -69,3 +69,4 @@ For more details go to [www.emsesp.org](https://www.emsesp.org/). - Don't start Serial console if not connected to a Serial port. Will initiate manually after a CTRL-C - WebLog UI matches color schema of the terminal console correctly - Updated Web libraries, ArduinoJson +- Help page doesn't show detailed tech info if the user is not 'admin' role [#2054](https://github.com/emsesp/EMS-ESP32/issues/2054) diff --git a/interface/src/app/main/Help.tsx b/interface/src/app/main/Help.tsx index 3518a892a..ef1dcd284 100644 --- a/interface/src/app/main/Help.tsx +++ b/interface/src/app/main/Help.tsx @@ -1,3 +1,4 @@ +import { useContext } from 'react'; import { toast } from 'react-toastify'; import CommentIcon from '@mui/icons-material/CommentTwoTone'; @@ -8,17 +9,22 @@ import { Avatar, Box, Button, + Divider, Link, List, ListItem, ListItemAvatar, ListItemButton, ListItemText, - Typography + Paper, + Stack, + Typography, + styled } from '@mui/material'; import { useRequest } from 'alova/client'; import { SectionContent, useLayoutTitle } from 'components'; +import { AuthenticatedContext } from 'contexts/authentication'; import { useI18nContext } from 'i18n/i18n-react'; import { API } from '../../api/app'; @@ -28,6 +34,8 @@ const Help = () => { const { LL } = useI18nContext(); useLayoutTitle(LL.HELP()); + const { me } = useContext(AuthenticatedContext); + const { send: sendAPI } = useRequest((data: APIcall) => API(data), { immediate: false }).onSuccess((event) => { @@ -54,43 +62,70 @@ const Help = () => { return ( <> - - - - - - - - - - - + {me.admin ? ( + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + ) : ( + } + sx={{ + borderRadius: 3, + border: '2px solid grey', + justifyContent: 'space-around', + alignItems: 'center' + }} + > + + {LL.HELP_INFORMATION_5()} + + + + )} @@ -116,23 +151,14 @@ const Help = () => { {LL.DOWNLOAD(1)} {LL.ALLVALUES()} - - - {LL.HELP_INFORMATION_5()} - - - - {'https://github.com/emsesp/EMS-ESP32'} - - - - © emsesp.org - - + + + + ©  + + {'emsesp.org'} + + ); diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index ec44fac62..d0a91c3f9 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -159,7 +159,7 @@ const de: Translation = { HELP_INFORMATION_2: 'Für einen Live-Community-Chat besuchen Sie unseren Discord-Server.', HELP_INFORMATION_3: 'Um neue Funktionen anzufragen oder Fehler zu melden, eröffnen Sie ein Issue auf GitHub.', HELP_INFORMATION_4: 'Bitte laden Sie die Systemdetails und hängen Sie sie an das Support-Issue an.', - HELP_INFORMATION_5: 'EMS-ESP ist ein freies Open-Source Projekt. Bitte unterstützen Sie die zukünftige Entwicklung mit einem Stern "star" auf GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Hochladen', DOWNLOAD: '{{H|h|h}}erunterladen', INSTALL: 'Installieren {0}', diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index 51e484b13..b9f48abd2 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -159,7 +159,7 @@ const en: Translation = { HELP_INFORMATION_2: 'For live community chat join our Discord server', HELP_INFORMATION_3: 'To request a feature or report a bug', HELP_INFORMATION_4: 'Download and attach your support information for a faster response when reporting an issue', - HELP_INFORMATION_5: 'EMS-ESP is a free and open-source project. Please support its future development by giving it a star on GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', UPLOAD: 'Upload', DOWNLOAD: '{{D|d|d}}ownload', INSTALL: 'Install {0}', diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index 824c3f7be..d9ceff889 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -159,7 +159,7 @@ const fr: Translation = { HELP_INFORMATION_2: 'Pour une discussion en direct avec la communauté, rejoignez notre serveur Discord', HELP_INFORMATION_3: 'Pour demander une fonctionnalité ou signaler un problème', HELP_INFORMATION_4: "N'oubliez pas de télécharger et de joindre les informations relatives à votre système pour obtenir une réponse plus rapide lorsque vous signalez un problème", - HELP_INFORMATION_5: 'EMS-ESP est un projet libre et open-source. Merci de soutenir son développement futur en lui donnant une étoile sur GitHub !', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Upload', DOWNLOAD: '{{D|d|d}}ownload', INSTALL: 'Installer {0}', diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts index 2e9cc9cab..4dbc4b5a1 100644 --- a/interface/src/i18n/it/index.ts +++ b/interface/src/i18n/it/index.ts @@ -159,7 +159,7 @@ const it: Translation = { HELP_INFORMATION_2: 'Per la chat della community dal vivo unisciti al nostro server Discord', HELP_INFORMATION_3: 'Per richiedere una funzionalità o segnalare un errore', HELP_INFORMATION_4: 'Ricordati di scaricare e allegare le informazioni del tuo sistema per una risposta più rapida quando segnali un problema', - HELP_INFORMATION_5: 'EMS-ESP è un progetto gratuito e open-source. Supporta il suo sviluppo futuro assegnandogli una stella su GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Carica', DOWNLOAD: 'Scarica', INSTALL: 'Installare {0}', diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index d35099bee..688b83c43 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -159,7 +159,7 @@ const nl: Translation = { HELP_INFORMATION_2: 'Voor de live community ga naar de Discord server', HELP_INFORMATION_3: 'Om een nieuwe feature te vragen of een bug te rapporteren', HELP_INFORMATION_4: 'Zorg dat je ook je systeem details zijn toevoeged voor een sneller antwoord', - HELP_INFORMATION_5: 'EMS-ESP is een gratis en open source project. Steun ons met een Star op GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Upload', DOWNLOAD: '{{D|d|d}}ownload', INSTALL: 'Installeren {0}', diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index ef2778ce2..a019130d5 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -159,7 +159,7 @@ const no: Translation = { HELP_INFORMATION_2: 'For community-support besøk vår Discord-server', HELP_INFORMATION_3: 'For å be om en ny funksjon eller melde feil', HELP_INFORMATION_4: 'Husk å laste ned og legg ved din systeminformasjon for en raskere respons når du rapporterer et problem', - HELP_INFORMATION_5: 'EMS-ESP er gratis og åpen kildekode. Bidra til utviklingen ved å gi oss en stjerne på GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Opplasning', DOWNLOAD: '{{N|n|n}}edlasting', INSTALL: 'Installer {0}', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 389917b6c..09d12cff7 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -159,7 +159,7 @@ const pl: BaseTranslation = { HELP_INFORMATION_2: 'Dołącz do naszego serwera Discord by komunikować się na żywo ze społecznością.', HELP_INFORMATION_3: 'Zaproponuj nową funkcjonalność lub zgłoś problem.', HELP_INFORMATION_4: 'Zgłaszając problem, nie zapomnij pobrać i dołączyć informacji o swoim systemie!', - HELP_INFORMATION_5: 'EMS-ESP jest darmowym projektem typu open-source. Aby go wesprzeć, rozważ przyznanie nam gwiazdki na GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Wysyłanie', DOWNLOAD: '{{P|p||P}}obier{{anie|z||z}}', INSTALL: 'Zainstalować {0}', diff --git a/interface/src/i18n/sk/index.ts b/interface/src/i18n/sk/index.ts index 9c95c03f2..e4e68da93 100644 --- a/interface/src/i18n/sk/index.ts +++ b/interface/src/i18n/sk/index.ts @@ -159,7 +159,7 @@ const sk: Translation = { HELP_INFORMATION_2: 'Pre živý komunitný chat sa pripojte na náš Discord server', HELP_INFORMATION_3: 'Ak chcete požiadať o funkciu alebo nahlásiť chybu', HELP_INFORMATION_4: 'nezabudnite si stiahnuť a pripojiť informácie o vašom systéme, aby ste mohli rýchlejšie reagovať pri nahlasovaní problému', - HELP_INFORMATION_5: 'EMS-ESP je bezplatný a open source projekt. Podporte jeho budúci vývoj tým, že mu dáte hviezdičku na GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Nahrať', DOWNLOAD: '{{S|s|s}}tiahnuť', INSTALL: 'Inštalovať {0}', diff --git a/interface/src/i18n/sv/index.ts b/interface/src/i18n/sv/index.ts index a8cbbd862..0a7be5378 100644 --- a/interface/src/i18n/sv/index.ts +++ b/interface/src/i18n/sv/index.ts @@ -159,7 +159,7 @@ const sv: Translation = { HELP_INFORMATION_2: 'För community-support besök vår Discord-server', HELP_INFORMATION_3: 'Önska en ny funktion eller rapportera en bugg', HELP_INFORMATION_4: 'Bifoga din systeminformation för snabbare hantering när du rapporterar ett problem', - HELP_INFORMATION_5: 'EMS-ESP är gratis och är öppen källkod. Bidra till utvecklingen genom att ge oss en stjärna på GitHub!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Uppladdning', DOWNLOAD: '{{N|n|n}}edladdning', INSTALL: 'Installera {0}', diff --git a/interface/src/i18n/tr/index.ts b/interface/src/i18n/tr/index.ts index 0c5f41ff6..a94ef0031 100644 --- a/interface/src/i18n/tr/index.ts +++ b/interface/src/i18n/tr/index.ts @@ -159,7 +159,7 @@ const tr: Translation = { HELP_INFORMATION_2: 'Canlı topluluk sohbeti için Discord sunucumuza katılın', HELP_INFORMATION_3: 'Yeni bir özellik talep etmek yada hata bildirmek için', HELP_INFORMATION_4: 'Bir sorun bildirirken daha hızlı bir dönüş için sistem bilginizi indirip eklemeyi unutmayın', - HELP_INFORMATION_5: 'EMS-ESP ücretsiz ve açık kaynaklı bir projedir. Lütfen geliştirmeyi desteklemek için GitHubda projeye yıldız verin!', + HELP_INFORMATION_5: 'For help and questions please contact your installer.', // TODO translate UPLOAD: 'Yükleme', DOWNLOAD: '{{İ|i|i}}İndirme', INSTALL: 'Düzenlemek {0}', diff --git a/src/version.h b/src/version.h index b8067488c..f18b9395f 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.0-dev.39" +#define EMSESP_APP_VERSION "3.7.0-dev.40"