This commit is contained in:
MichaelDvP
2024-06-25 15:28:43 +02:00
22 changed files with 199 additions and 167 deletions

View File

@@ -163,9 +163,9 @@ const de: Translation = {
SUPPORT_INFORMATION: 'Unterstützende Informationen',
HELP_INFORMATION_1: 'EMS-ESP Konfigurationsanweisungen und mehr finden Sie im Online-Wiki',
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_3: 'Um neue Funktionen anzufragen oder Fehler zu melden, eröffnen Sie ein Issue auf GitHub',
HELP_INFORMATION_4: 'Bitte laden Sie die System-Details 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 "Star" auf Github!',
HELP_INFORMATION_5: 'EMS-ESP ist ein freies Open-Source Projekt. Bitte unterstützen Sie die zukünftige Entwicklung mit einem "Star" auf GitHub!',
UPLOAD: 'Hochladen',
DOWNLOAD: '{{H|h|h}}erunterladen',
ABORTED: 'abgebrochen',

View File

@@ -23,7 +23,7 @@ const en: Translation = {
ONOFF: 'on/off',
TYPE: 'Type',
DESCRIPTION: 'Description',
ENTITIES: 'Entities',
ENTITIES: 'entities',
REFRESH: 'Refresh',
EXPORT: 'Export',
DEVICE_DETAILS: 'Device Details',
@@ -165,7 +165,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: 'EMS-ESP is a free and open-source project. Please support its future development by giving it a star on GitHub!',
UPLOAD: 'Upload',
DOWNLOAD: '{{D|d|d}}ownload',
ABORTED: 'aborted',

View File

@@ -23,7 +23,7 @@ const fr: Translation = {
ONOFF: 'on/off',
TYPE: 'Type',
DESCRIPTION: 'Description',
ENTITIES: 'Entités',
ENTITIES: 'entités',
REFRESH: 'Rafraîchir',
EXPORT: 'Exporter',
DEVICE_DETAILS: "Détails de l'appareil",
@@ -165,7 +165,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: 'EMS-ESP est un projet libre et open-source. Merci de soutenir son développement futur en lui donnant une étoile sur GitHub !',
UPLOAD: 'Upload',
DOWNLOAD: '{{D|d|d}}ownload',
ABORTED: 'annulé',

View File

@@ -23,7 +23,7 @@ const it: Translation = {
ONOFF: 'on/off',
TYPE: 'Tipo',
DESCRIPTION: 'Descrizione',
ENTITIES: 'Entità',
ENTITIES: 'entità',
REFRESH: 'Ricaricare',
EXPORT: 'Esporta',
DEVICE_DETAILS: 'Dettagli dispositivo',
@@ -165,7 +165,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: 'EMS-ESP è un progetto gratuito e open-source. Supporta il suo sviluppo futuro assegnandogli una stella su GitHub!',
UPLOAD: 'Carica',
DOWNLOAD: 'Scarica',
ABORTED: 'Annullato',

View File

@@ -23,7 +23,7 @@ const nl: Translation = {
ONOFF: 'aan/uit',
TYPE: 'Type',
DESCRIPTION: 'Beschrijving',
ENTITIES: 'Entiteiten',
ENTITIES: 'entiteiten',
REFRESH: 'Ververs',
EXPORT: 'Export',
DEVICE_DETAILS: 'Device Gegevens',
@@ -165,7 +165,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: 'EMS-ESP is een gratis en open source project. Steun ons met een Star op GitHub!',
UPLOAD: 'Upload',
DOWNLOAD: '{{D|d|d}}ownload',
ABORTED: 'afgebroken',

View File

@@ -165,7 +165,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: 'EMS-ESP jest darmowym projektem typu open-source. Aby go wesprzeć, rozważ przyznanie nam gwiazdki na GitHub!',
UPLOAD: 'Wysyłanie',
DOWNLOAD: '{{P|p||P}}obier{{anie|z||z}}',
ABORTED: 'zostało przerwane!',

View File

@@ -23,7 +23,7 @@ const sk: Translation = {
ONOFF: 'zap/vyp',
TYPE: 'Typ',
DESCRIPTION: 'Popis',
ENTITIES: 'Entity',
ENTITIES: 'entity',
REFRESH: 'Obnoviť',
EXPORT: 'Export',
DEVICE_DETAILS: 'Detaily zariadenia',
@@ -165,7 +165,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: 'EMS-ESP je bezplatný a open source projekt. Podporte jeho budúci vývoj tým, že mu dáte hviezdičku na GitHub!',
UPLOAD: 'Nahrať',
DOWNLOAD: '{{S|s|s}}tiahnuť',
ABORTED: 'zrušené',

View File

@@ -23,7 +23,7 @@ const sv: Translation = {
ONOFF: 'på/av',
TYPE: 'Typ',
DESCRIPTION: 'Beskrivning',
ENTITIES: 'Entiteter',
ENTITIES: 'entiteter',
REFRESH: 'Uppdatera',
EXPORT: 'Exportera',
DEVICE_DETAILS: 'Enhetsdetaljer',

View File

@@ -23,7 +23,7 @@ const tr: Translation = {
ONOFF: 'açık/kapalı',
TYPE: 'Tür',
DESCRIPTION: 'Açıklama',
ENTITIES: 'Varlıklar',
ENTITIES: 'varlıklar',
REFRESH: 'Yenile',
EXPORT: 'Dışarı al',
DEVICE_DETAILS: 'Cihaz Ayrıntıları',
@@ -165,7 +165,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: 'EMS-ESP ücretsiz ve açık kaynaklı bir projedir. Lütfen geliştirmeyi desteklemek için GitHubda projeye yıldız verin!',
UPLOAD: 'Yükleme',
DOWNLOAD: '{{İ|i|i}}İndirme',
ABORTED: 'iptal edildi',

View File

@@ -36,7 +36,11 @@ import {
List,
ListItem,
ListItemText,
Typography
Tooltip,
type TooltipProps,
Typography,
styled,
tooltipClasses
} from '@mui/material';
import { useRowSelect } from '@table-library/react-table-library/select';
@@ -234,6 +238,20 @@ const Devices: FC = () => {
}
]);
const ButtonTooltip = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} arrow classes={{ popper: className }} />
))(({ theme }) => ({
[`& .${tooltipClasses.arrow}`]: {
color: theme.palette.success.main
},
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: theme.palette.success.main,
color: 'rgba(0, 0, 0, 0.87)',
boxShadow: theme.shadows[1],
fontSize: 10
}
}));
const getSortIcon = (state: State, sortKey: unknown) => {
if (state.sortKey === sortKey && state.reverse) {
return <KeyboardArrowDownOutlinedIcon />;
@@ -399,13 +417,23 @@ const Devices: FC = () => {
'\r\n'
);
const csvFile = new Blob([csvData], { type: 'text/csv;charset:utf-8' });
const downloadLink = document.createElement('a');
downloadLink.download = filename;
downloadLink.href = window.URL.createObjectURL(csvFile);
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
const downloadBlob = (blob: Blob) => {
const downloadLink = document.createElement('a');
downloadLink.download = filename;
downloadLink.href = window.URL.createObjectURL(blob);
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
};
const device = { ...{ device: coreData.devices[deviceIndex] }, ...deviceData };
downloadBlob(
new Blob([JSON.stringify(device, null, 2)], {
type: 'text;charset:utf-8'
})
);
downloadBlob(new Blob([csvData], { type: 'text/csv;charset:utf-8' }));
};
useEffect(() => {
@@ -608,11 +636,11 @@ const Devices: FC = () => {
backgroundColor: 'black',
position: 'absolute',
left: () => leftOffset(),
right: 16,
right: 0,
bottom: 0,
top: 128,
top: 64,
zIndex: 'modal',
maxHeight: () => size[1] - 189,
maxHeight: () => size[1] - 126,
border: '1px solid #177ac9'
}}
>
@@ -623,7 +651,7 @@ const Devices: FC = () => {
</Typography>
<Grid container justifyContent="space-between">
<Typography sx={{ ml: 1 }} variant="subtitle2" color="primary">
<Typography sx={{ ml: 1 }} variant="subtitle2" color="grey">
{LL.SHOWING() +
' ' +
shown_data.length +
@@ -631,53 +659,44 @@ const Devices: FC = () => {
coreData.devices[deviceIndex].e +
' ' +
LL.ENTITIES(shown_data.length)}
<IconButton onClick={() => setShowDeviceInfo(true)}>
<InfoOutlinedIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton>
{me.admin && (
<IconButton onClick={customize}>
<FormatListNumberedIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
<ButtonTooltip title="Info">
<IconButton onClick={() => setShowDeviceInfo(true)}>
<InfoOutlinedIcon color="primary" sx={{ fontSize: 18 }} />
</IconButton>
</ButtonTooltip>
{me.admin && (
<ButtonTooltip title={LL.CUSTOMIZATIONS()}>
<IconButton onClick={customize}>
<FormatListNumberedIcon color="primary" sx={{ fontSize: 18 }} />
</IconButton>
</ButtonTooltip>
)}
<IconButton onClick={handleDownloadCsv}>
<DownloadIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton>
<IconButton onClick={() => setOnlyFav(!onlyFav)}>
{onlyFav ? (
<StarIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
) : (
<StarBorderOutlinedIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
)}
</IconButton>
<IconButton onClick={refreshData}>
<RefreshIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton>
<ButtonTooltip title={LL.EXPORT()}>
<IconButton onClick={handleDownloadCsv}>
<DownloadIcon color="primary" sx={{ fontSize: 18 }} />
</IconButton>
</ButtonTooltip>
<ButtonTooltip title="Favorites">
<IconButton onClick={() => setOnlyFav(!onlyFav)}>
{onlyFav ? (
<StarIcon color="primary" sx={{ fontSize: 18 }} />
) : (
<StarBorderOutlinedIcon color="primary" sx={{ fontSize: 18 }} />
)}
</IconButton>
</ButtonTooltip>
<ButtonTooltip title={LL.REFRESH()}>
<IconButton onClick={refreshData}>
<RefreshIcon color="primary" sx={{ fontSize: 18 }} />
</IconButton>
</ButtonTooltip>
</Typography>
<Grid item zeroMinWidth justifyContent="flex-end">
<IconButton onClick={resetDeviceSelect}>
<HighlightOffIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton>
<ButtonTooltip title={LL.CANCEL()}>
<IconButton onClick={resetDeviceSelect}>
<HighlightOffIcon color="primary" sx={{ fontSize: 18 }} />
</IconButton>
</ButtonTooltip>
</Grid>
</Grid>
</Box>

View File

@@ -297,7 +297,7 @@ const SchedulerDialog = ({
name="time"
label={isCondition ? 'Condition' : 'On Change Value'}
fullWidth
value={editItem.time == "00:00" ? editItem.time = "" : editItem.time}
value={editItem.time == '00:00' ? (editItem.time = '') : editItem.time}
margin="normal"
onChange={updateFormValue}
/>
@@ -307,7 +307,9 @@ const SchedulerDialog = ({
name="time"
type="time"
label={isTimer ? LL.TIMER(1) : LL.TIME(1)}
value={editItem.time == "" ? editItem.time = "00:00" : editItem.time}
value={
editItem.time == '' ? (editItem.time = '00:00') : editItem.time
}
margin="normal"
onChange={updateFormValue}
/>