Skip to content

Commit

Permalink
Update loader, framework 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Jan 25, 2023
1 parent a4d5a67 commit 87de982
Show file tree
Hide file tree
Showing 24 changed files with 1,449 additions and 13,585 deletions.
Binary file added esp32_partition_4M.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions interface/.typesafe-i18n.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"adapter": "react",
"baseLocale": "en",
"$schema": "https://unpkg.com/typesafe-i18n@5.16.3/schema/typesafe-i18n.json"
"baseLocale": "pl",
"$schema": "https://unpkg.com/typesafe-i18n@5.20.0/schema/typesafe-i18n.json"
}
14,110 changes: 1,055 additions & 13,055 deletions interface/package-lock.json

Large diffs are not rendered by default.

23 changes: 10 additions & 13 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,29 @@
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.10.14",
"@mui/material": "^5.10.14",
"@mui/icons-material": "^5.11.0",
"@mui/material": "^5.11.6",
"@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.189",
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
"@types/lodash": "^4.14.191",
"@types/node": "^18.11.18",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/react-router-dom": "^5.3.3",
"async-validator": "^4.2.5",
"axios": "^1.1.3",
"axios": "^1.2.4",
"http-proxy-middleware": "^2.0.6",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
"notistack": "^2.0.8",
"parse-ms": "^3.0.0",
"react": "^18.2.0",
"react-app-rewired": "^2.2.1",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-icons": "^4.6.0",
"react-router-dom": "^6.4.3",
"react-router-dom": "^6.7.0",
"react-scripts": "5.0.1",
"sockette": "^2.0.6",
"typesafe-i18n": "^5.16.3",
"typescript": "^4.9.3"
"typesafe-i18n": "^5.20.0",
"typescript": "^4.9.4"
},
"scripts": {
"start": "react-app-rewired start",
Expand Down
2 changes: 1 addition & 1 deletion interface/src/AppRouting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const AppRouting: FC = () => {
<RemoveTrailingSlashes />
<Routes>
<Route path="/unauthorized" element={<RootRedirect message={LL.PLEASE_SIGNIN()} signOut />} />
<Route path="/fileUpdated" element={<RootRedirect message={LL.UPLOAD_SUCCESSFUL()} variant="success" />} />
<Route path="/fileUpdated" element={<Navigate to="/" />} />
<Route
path="/"
element={
Expand Down
8 changes: 4 additions & 4 deletions interface/src/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { loadLocaleAsync } from './i18n/i18n-util.async';
import { ReactComponent as NLflag } from './i18n/NL.svg';
import { ReactComponent as DEflag } from './i18n/DE.svg';
import { ReactComponent as GBflag } from './i18n/GB.svg';
import { ReactComponent as SEflag } from './i18n/SE.svg';
import { ReactComponent as SVflag } from './i18n/SV.svg';
import { ReactComponent as PLflag } from './i18n/PL.svg';
import { ReactComponent as NOflag } from './i18n/NO.svg';

Expand Down Expand Up @@ -121,9 +121,9 @@ const SignIn: FC = () => {
<NLflag style={{ width: 24 }} />
&nbsp;NL
</Button>
<Button size="small" variant={locale === 'se' ? 'contained' : 'outlined'} onClick={() => selectLocale('se')}>
<SEflag style={{ width: 24 }} />
&nbsp;SE
<Button size="small" variant={locale === 'sv' ? 'contained' : 'outlined'} onClick={() => selectLocale('sv')}>
<SVflag style={{ width: 24 }} />
&nbsp;SV
</Button>
<Button size="small" variant={locale === 'pl' ? 'contained' : 'outlined'} onClick={() => selectLocale('pl')}>
<PLflag style={{ width: 24 }} />
Expand Down
48 changes: 0 additions & 48 deletions interface/src/api/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import axios, { AxiosPromise, CancelToken, AxiosProgressEvent } from 'axios';

import { decode } from '@msgpack/msgpack';

export const WS_BASE_URL = '/ws/';
export const API_BASE_URL = '/rest/';
export const ES_BASE_URL = '/es/';
Expand Down Expand Up @@ -30,52 +28,6 @@ export const AXIOS = axios.create({
]
});

export const AXIOS_API = axios.create({
baseURL: EMSESP_API_BASE_URL,
headers: {
'Content-Type': 'application/json'
},
transformRequest: [
(data, headers) => {
if (headers) {
if (localStorage.getItem(ACCESS_TOKEN)) {
headers.Authorization = 'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
}
if (headers['Content-Type'] !== 'application/json') {
return data;
}
}
return JSON.stringify(data);
}
]
});

export const AXIOS_BIN = axios.create({
baseURL: API_BASE_URL,
headers: {
'Content-Type': 'application/json'
},
responseType: 'arraybuffer',
transformRequest: [
(data, headers) => {
if (headers) {
if (localStorage.getItem(ACCESS_TOKEN)) {
headers.Authorization = 'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
}
if (headers['Content-Type'] !== 'application/json') {
return data;
}
}
return JSON.stringify(data);
}
],
transformResponse: [
(data) => {
return decode(data);
}
]
});

function calculateWebSocketRoot(webSocketPath: string) {
const location = window.location;
const webProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
Expand Down
8 changes: 4 additions & 4 deletions interface/src/components/layout/LayoutAuthMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { loadLocaleAsync } from '../../i18n/i18n-util.async';
import { ReactComponent as NLflag } from '../../i18n/NL.svg';
import { ReactComponent as DEflag } from '../../i18n/DE.svg';
import { ReactComponent as GBflag } from '../../i18n/GB.svg';
import { ReactComponent as SEflag } from '../../i18n/SE.svg';
import { ReactComponent as SVflag } from '../../i18n/SV.svg';
import { ReactComponent as PLflag } from '../../i18n/PL.svg';
import { ReactComponent as NOflag } from '../../i18n/NO.svg';

Expand Down Expand Up @@ -85,9 +85,9 @@ const LayoutAuthMenu: FC = () => {
<NLflag style={{ width: 16, verticalAlign: 'middle' }} />
&nbsp;NL
</MenuItem>
<MenuItem key="se" value="se">
<SEflag style={{ width: 16, verticalAlign: 'middle' }} />
&nbsp;SE
<MenuItem key="sv" value="sv">
<SVflag style={{ width: 16, verticalAlign: 'middle' }} />
&nbsp;SV
</MenuItem>
<MenuItem key="pl" value="pl">
<PLflag style={{ width: 16, verticalAlign: 'middle' }} />
Expand Down
File renamed without changes
14 changes: 0 additions & 14 deletions interface/src/i18n/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,26 @@ const de: Translation = {
INVALID_LOGIN: 'Ungültige Login Daten',
NETWORK: 'Netzwerk',
SECURITY: 'Sicherheit',
DESCRIPTION: 'Bezeichnung',
REFRESH: 'Aktualisieren',
CANCEL: 'Abbrechen',
RESET: 'Zurücksetzen',
SEND: 'Senden',
SAVE: 'Speichern',
PROBLEM_UPDATING: 'Problem beim Aktualisieren',
PROBLEM_LOADING: 'Problem beim Laden',
ACCESS_DENIED: 'Zugriff abgelehnt',
CONNECTED: 'Verbunden',
DISCONNECTED: 'Getrennt',
SUCCESS: 'ERFOLG',
FAIL: 'FEHLER',
SCAN: 'Suche',
APPLICATION_RESTARTING: 'EMS-ESP startet neu',
DISABLED: 'deaktiviert',
GENERAL_OPTIONS: 'Allgemeine Optionen',
SECONDS: 'Sekunden',
MINUTES: 'Minuten',
HOURS: 'Stunden',
RESTART: 'Neu starten',
RESTART_TEXT: 'EMS-ESP muss neu gestartet werden, um geänderte Systemeinstellungen zu übernehmen',
RESTART_CONFIRM: 'EMS-ESP wirklich neu starten?',
UPLOAD_OF: '{0} Hochladen',
UPLOAD: 'Hochladen',
DOWNLOAD: 'Herunterladen',
ABORTED: 'abgebrochen',
FAILED: 'gescheitert',
SUCCESSFUL: 'erfolgreich',
SYSTEM: 'System',
LOG_OF: '{0} Log',
STATUS_OF: '{0} Status',
UPLOAD_DOWNLOAD: 'Hoch-/Herunterladen',
SYSTEM_VERSION_RUNNING: 'Sie verwenden die Version',
Expand All @@ -75,9 +64,6 @@ const de: Translation = {
APPSIZE: 'Programm (Genutzt / Frei)',
FILESYSTEM: 'Dateisystem (Genutzt / Frei)',
ENABLE_OTA: 'OTA Updates verwenden',
DOWNLOAD_CUSTOMIZATION_TEXT: 'Herunterladen der individuellen Entitätsanpassungen',
DOWNLOAD_SETTINGS_TEXT:
'Herunterladen der Anwendungseinstellungen. Vorsicht beim Teilen der Einstellungen, da sie Passwörter und andere sensitive Einstellungen enthalten',
UPLOAD_TEXT: 'Hochladen von neuer Firmware (.bin), Geräte- oder Entitätseinstellungen (.json), zur optionalen Validitätsprüfung zuerst die (.md5) Datei hochladen',
UPLOADING: 'Hochladen',
UPLOAD_DROP_TEXT: 'Klicken Sie hier, oder ziehen eine Datei hierher',
Expand Down
14 changes: 0 additions & 14 deletions interface/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,26 @@ const en: BaseTranslation = {
INVALID_LOGIN: 'Invalid login details',
NETWORK: 'Networ{{k|k}}',
SECURITY: 'Securit{{y|y}}',
DESCRIPTION: 'Description',
REFRESH: 'Refresh',
CANCEL: 'Cancel',
RESET: 'Rese{{t|t}}',
SEND: 'Send',
SAVE: 'Save',
PROBLEM_UPDATING: 'Problem updating',
PROBLEM_LOADING: 'Problem loading',
ACCESS_DENIED: 'Access Denied',
CONNECTED: 'Connecte{{d|d}}',
DISCONNECTED: 'Disconnected',
SUCCESS: 'SUCCESS',
FAIL: 'FAIL',
SCAN: 'Scan',
APPLICATION_RESTARTING: 'EMS-ESP is restarting',
DISABLED: 'disabled',
GENERAL_OPTIONS: 'General Options',
SECONDS: 'seconds',
MINUTES: 'minutes',
HOURS: 'hours',
RESTART: 'Restart',
RESTART_TEXT: 'EMS-ESP needs to be restarted to apply changed system settings',
RESTART_CONFIRM: 'Are you sure you want to restart EMS-ESP?',
UPLOAD_OF: '{0} Upload',
UPLOAD: 'Upload',
DOWNLOAD: '{{D|d}}ownload',
ABORTED: 'aborted',
FAILED: 'failed',
SUCCESSFUL: 'successful',
SYSTEM: 'Syste{{m|m|m}}',
LOG_OF: '{0} Log',
STATUS_OF: '{0} Status',
UPLOAD_DOWNLOAD: 'Upload/Download',
SYSTEM_VERSION_RUNNING: 'You are currently running version',
Expand All @@ -75,9 +64,6 @@ const en: BaseTranslation = {
APPSIZE: 'Application (Used / Free)',
FILESYSTEM: 'File System (Used / Free)',
ENABLE_OTA: 'Enable OTA Updates',
DOWNLOAD_CUSTOMIZATION_TEXT: 'Download the entity customizations',
DOWNLOAD_SETTINGS_TEXT:
'Download the application settings. Be careful when sharing your settings as this file contains passwords and other sensitive system information',
UPLOAD_TEXT: 'Upload a new firmware (.bin) file, settings or customizations (.json) file below, for optional validation upload (.md5) first',
UPLOADING: 'Uploading',
UPLOAD_DROP_TEXT: 'Drop file or click here',
Expand Down
Loading

0 comments on commit 87de982

Please sign in to comment.