Skip to content

Commit

Permalink
Merge pull request #2055 from proddy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy authored Sep 26, 2024
2 parents bf46efd + 6814f54 commit 64fbc1e
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 73 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"formidable": "^3.5.1",
"prettier": "^3.3.3",
"rollup-plugin-visualizer": "^5.12.0",
"terser": "^5.33.0",
"terser": "^5.34.0",
"typescript-eslint": "8.7.0",
"vite": "^5.4.8",
"vite-plugin-imagemin": "^0.6.1",
Expand Down
136 changes: 81 additions & 55 deletions interface/src/app/main/Help.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useContext } from 'react';
import { toast } from 'react-toastify';

import CommentIcon from '@mui/icons-material/CommentTwoTone';
Expand All @@ -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';
Expand All @@ -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) => {
Expand All @@ -54,43 +62,70 @@ const Help = () => {
return (
<>
<SectionContent>
<List sx={{ borderRadius: 3, border: '2px solid grey' }}>
<ListItem>
<ListItemButton component="a" href="https://emsesp.org">
<ListItemAvatar>
<Avatar sx={{ bgcolor: '#72caf9' }}>
<MenuBookIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary={LL.HELP_INFORMATION_1()} />
</ListItemButton>
</ListItem>

<ListItem>
<ListItemButton component="a" href="https://discord.gg/3J3GgnzpyT">
<ListItemAvatar>
<Avatar sx={{ bgcolor: '#72caf9' }}>
<CommentIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary={LL.HELP_INFORMATION_2()} />
</ListItemButton>
</ListItem>

<ListItem>
<ListItemButton
component="a"
href="https://github.com/emsesp/EMS-ESP32/issues/new/choose"
>
<ListItemAvatar>
<Avatar sx={{ bgcolor: '#72caf9' }}>
<GitHubIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary={LL.HELP_INFORMATION_3()} />
</ListItemButton>
</ListItem>
</List>
{me.admin ? (
<List sx={{ borderRadius: 3, border: '2px solid grey' }}>
<ListItem>
<ListItemButton component="a" href="https://emsesp.org">
<ListItemAvatar>
<Avatar sx={{ bgcolor: '#72caf9' }}>
<MenuBookIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary={LL.HELP_INFORMATION_1()} />
</ListItemButton>
</ListItem>

<ListItem>
<ListItemButton component="a" href="https://discord.gg/3J3GgnzpyT">
<ListItemAvatar>
<Avatar sx={{ bgcolor: '#72caf9' }}>
<CommentIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary={LL.HELP_INFORMATION_2()} />
</ListItemButton>
</ListItem>

<ListItem>
<ListItemButton
component="a"
href="https://github.com/emsesp/EMS-ESP32/issues/new/choose"
>
<ListItemAvatar>
<Avatar sx={{ bgcolor: '#72caf9' }}>
<GitHubIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary={LL.HELP_INFORMATION_3()} />
</ListItemButton>
</ListItem>
</List>
) : (
<Stack
spacing={1}
padding={1}
direction="row"
divider={<Divider orientation="vertical" flexItem />}
sx={{
borderRadius: 3,
border: '2px solid grey',
justifyContent: 'space-around',
alignItems: 'center'
}}
>
<Typography border="red" variant="subtitle1">
{LL.HELP_INFORMATION_5()}
</Typography>
<Box
padding={1}
component="img"
sx={{
maxHeight: { xs: 100, md: 250 }
}}
src="https://emsesp.org/_media/images/installer.jpeg"
/>
</Stack>
)}

<Box p={2} color="warning.main">
<Typography mb={1} variant="body2">
Expand All @@ -116,23 +151,14 @@ const Help = () => {
{LL.DOWNLOAD(1)}&nbsp;{LL.ALLVALUES()}
</Button>

<Box sx={{ p: 2, mt: 4, border: '1px dashed orange' }}>
<Typography align="center" variant="subtitle1">
{LL.HELP_INFORMATION_5()}
</Typography>
<Typography align="center" mt={1}>
<Link
target="_blank"
href="https://github.com/emsesp/EMS-ESP32"
color="primary"
>
{'https://github.com/emsesp/EMS-ESP32'}
</Link>
</Typography>
<Typography color="white" variant="subtitle1" align="center">
&copy;&nbsp;emsesp.org
</Typography>
</Box>
<Divider sx={{ mt: 4 }} />

<Typography color="white" variant="subtitle1" align="center" mt={1}>
&copy;&nbsp;
<Link target="_blank" href="https://emsesp.org" color="primary">
{'emsesp.org'}
</Link>
</Typography>
</SectionContent>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/it/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/nl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/no/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/pl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/sk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/sv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/tr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
10 changes: 5 additions & 5 deletions interface/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,7 @@ __metadata:
react-router-dom: "npm:^6.26.2"
react-toastify: "npm:^10.0.5"
rollup-plugin-visualizer: "npm:^5.12.0"
terser: "npm:^5.33.0"
terser: "npm:^5.34.0"
typesafe-i18n: "npm:^5.26.2"
typescript: "npm:^5.6.2"
typescript-eslint: "npm:8.7.0"
Expand Down Expand Up @@ -6654,17 +6654,17 @@ __metadata:
languageName: node
linkType: hard

"terser@npm:^5.33.0":
version: 5.33.0
resolution: "terser@npm:5.33.0"
"terser@npm:^5.34.0":
version: 5.34.0
resolution: "terser@npm:5.34.0"
dependencies:
"@jridgewell/source-map": "npm:^0.3.3"
acorn: "npm:^8.8.2"
commander: "npm:^2.20.0"
source-map-support: "npm:~0.5.20"
bin:
terser: bin/terser
checksum: 10c0/18a1cd33366dcd8fee7d6eef78c9c417cbe688e5153841e6a574f9d4937066dc40f67b1e96305f73f25bc6f2c458dbe442a056092c99619d4dbee8ad9fae4a3e
checksum: 10c0/74e8ef4e565e5600415cd9377a90eed419b8076465d453c0c76aef4053c45371512d2de76c34d01e004cdd49ea5a749d77eeb343f7e665b2d172158ca08ba23e
languageName: node
linkType: hard

Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.0-dev.39"
#define EMSESP_APP_VERSION "3.7.0-dev.40"
2 changes: 1 addition & 1 deletion src/web/WebLogService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void WebLogService::show(Shell & shell) {
}

shell.println();
shell.printfln("Last Log (filtered by WebLog's level %s & buffer %d):", format_level_uppercase(log_level()), maximum_log_messages());
shell.printfln("Recent Log (level %s, max %d messages):", format_level_uppercase(log_level()), maximum_log_messages());
shell.println();

for (const auto & message : log_messages_) {
Expand Down

0 comments on commit 64fbc1e

Please sign in to comment.