mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-05-09 15:35:51 +00:00
Compare commits
69 Commits
0e08334132
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8f57b6343 | ||
|
|
a1ab81de66 | ||
|
|
28135c225b | ||
|
|
eaa277fef0 | ||
|
|
e418b7d8e7 | ||
|
|
a4e3be6a69 | ||
|
|
a1bc5bb055 | ||
|
|
f444ca31e0 | ||
|
|
1b70b55989 | ||
|
|
1487f30c43 | ||
|
|
e00eb8e64f | ||
|
|
f41bb3671c | ||
|
|
22c75e6df3 | ||
|
|
5ab10b7aa6 | ||
|
|
ee5fd4d0eb | ||
|
|
46f35bc67c | ||
|
|
ec85a7ec24 | ||
|
|
02f2389587 | ||
|
|
7f140021aa | ||
|
|
6796962c1e | ||
|
|
df6de21cf4 | ||
|
|
df9f75a5c9 | ||
|
|
7bd8710eb6 | ||
|
|
32f2c6d341 | ||
|
|
86919c1684 | ||
|
|
86e29515e7 | ||
|
|
46eb4185d7 | ||
|
|
8da6761a48 | ||
|
|
9233f0dfcc | ||
|
|
292f743b14 | ||
|
|
dd6dfffd57 | ||
|
|
ec705a5307 | ||
|
|
f45f071710 | ||
|
|
f3858546de | ||
|
|
d0ac0b7804 | ||
|
|
d8284ec09f | ||
|
|
6e982acde8 | ||
|
|
8c94ce99b2 | ||
|
|
fc057d18c9 | ||
|
|
18e9b99413 | ||
|
|
a47e0e8266 | ||
|
|
f412ddc716 | ||
|
|
29110e96e5 | ||
|
|
b65866217a | ||
|
|
611e3b1243 | ||
|
|
2ca0a0c634 | ||
|
|
7eb1f061b7 | ||
|
|
50459a23fe | ||
|
|
5bf53c3389 | ||
|
|
4b7aa95be3 | ||
|
|
70943f5758 | ||
|
|
3bc280b817 | ||
|
|
62b15a5319 | ||
|
|
8dd18802d6 | ||
|
|
57a516a83a | ||
|
|
a57fdaa4b3 | ||
|
|
4841e42286 | ||
|
|
8c2d2b06ed | ||
|
|
38c8b1b7f0 | ||
|
|
6fb5933a02 | ||
|
|
c0944433be | ||
|
|
478e6362c9 | ||
|
|
4d6354db78 | ||
|
|
beab0f0c77 | ||
|
|
c17749bd22 | ||
|
|
2bad769c5c | ||
|
|
8ad89ca64b | ||
|
|
9244d8daec | ||
|
|
02d01334b2 |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -22,7 +22,7 @@ _Make sure your have performed every step and checked the applicable boxes befor
|
|||||||
- [ ] Searched the issue in [issues](https://github.com/emsesp/EMS-ESP32/issues)
|
- [ ] Searched the issue in [issues](https://github.com/emsesp/EMS-ESP32/issues)
|
||||||
- [ ] Searched the issue in [discussions](https://github.com/emsesp/EMS-ESP32/discussions)
|
- [ ] Searched the issue in [discussions](https://github.com/emsesp/EMS-ESP32/discussions)
|
||||||
- [ ] Searched the issue in the [docs](https://emsesp.org/Troubleshooting/)
|
- [ ] Searched the issue in the [docs](https://emsesp.org/Troubleshooting/)
|
||||||
- [ ] Searched the issue in the [chat](https://discord.gg/GP9DPSgeJq)
|
- [ ] Searched the issue in the [chat](https://discord.gg/3J3GgnzpyT)
|
||||||
- [ ] Provide the System information in the area below, taken from `http://<IP>/api/system`
|
- [ ] Provide the System information in the area below, taken from `http://<IP>/api/system`
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -7,5 +7,5 @@ contact_links:
|
|||||||
url: https://github.com/emsesp/EMS-ESP32/discussions
|
url: https://github.com/emsesp/EMS-ESP32/discussions
|
||||||
about: EMS-ESP usage Questions, Feature Requests and Projects.
|
about: EMS-ESP usage Questions, Feature Requests and Projects.
|
||||||
- name: EMS-ESP Users Chat
|
- name: EMS-ESP Users Chat
|
||||||
url: https://discord.gg/GP9DPSgeJq
|
url: https://discord.gg/3J3GgnzpyT
|
||||||
about: Chat for feedback, questions and troubleshooting.
|
about: Chat for feedback, questions and troubleshooting.
|
||||||
|
|||||||
8
.github/workflows/dev_release.yml
vendored
8
.github/workflows/dev_release.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
node-version: 24
|
node-version: 24
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Enable Corepack
|
- name: Enable Corepack
|
||||||
run: corepack enable pnpm
|
run: corepack enable pnpm
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build webUI
|
- name: Build webUI
|
||||||
run: |
|
run: |
|
||||||
platformio run -e build-webUI
|
platformio run -e build_webUI
|
||||||
|
|
||||||
- name: Build modbus
|
- name: Build modbus
|
||||||
run: |
|
run: |
|
||||||
@@ -62,13 +62,13 @@ jobs:
|
|||||||
platformio run
|
platformio run
|
||||||
|
|
||||||
- name: Commit the generated files
|
- name: Commit the generated files
|
||||||
uses: stefanzweifel/git-auto-commit-action@v7
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: "chore: update generated files for v${{steps.build_info.outputs.VERSION}}"
|
commit_message: "chore: update generated files for v${{steps.build_info.outputs.VERSION}}"
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
id: 'automatic_releases'
|
id: 'automatic_releases'
|
||||||
uses: emsesp/action-automatic-releases@v1.0.1
|
uses: emsesp/action-automatic-releases@v1.0.0
|
||||||
with:
|
with:
|
||||||
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
title: Development Build v${{steps.build_info.outputs.VERSION}}
|
title: Development Build v${{steps.build_info.outputs.VERSION}}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: GitHub Releases To Discord
|
- name: GitHub Releases To Discord
|
||||||
uses: SethCohen/github-releases-to-discord@v1.13.1
|
uses: SethCohen/github-releases-to-discord@v1.13.1
|
||||||
|
|||||||
2
.github/workflows/pr_check.yml
vendored
2
.github/workflows/pr_check.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install python 3.13
|
- name: Install python 3.13
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
|
|||||||
2
.github/workflows/sonar_check.yml
vendored
2
.github/workflows/sonar_check.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
BUILD_WRAPPER_OUT_DIR: bw-output
|
BUILD_WRAPPER_OUT_DIR: bw-output
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install Build Wrapper
|
- name: Install Build Wrapper
|
||||||
|
|||||||
6
.github/workflows/stable_release.yml
vendored
6
.github/workflows/stable_release.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
node-version: 24
|
node-version: 24
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Enable Corepack
|
- name: Enable Corepack
|
||||||
run: corepack enable pnpm
|
run: corepack enable pnpm
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build webUI
|
- name: Build webUI
|
||||||
run: |
|
run: |
|
||||||
platformio run -e build-webUI
|
platformio run -e build_webUI
|
||||||
|
|
||||||
- name: Build modbus
|
- name: Build modbus
|
||||||
run: |
|
run: |
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
platformio run
|
platformio run
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: emsesp/action-automatic-releases@v1.0.1
|
uses: emsesp/action-automatic-releases@v1.0.0
|
||||||
with:
|
with:
|
||||||
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|||||||
6
.github/workflows/test_release.yml
vendored
6
.github/workflows/test_release.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
node-version: 24
|
node-version: 24
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Enable Corepack
|
- name: Enable Corepack
|
||||||
run: corepack enable pnpm
|
run: corepack enable pnpm
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build webUI
|
- name: Build webUI
|
||||||
run: |
|
run: |
|
||||||
platformio run -e build-webUI
|
platformio run -e build_webUI
|
||||||
|
|
||||||
- name: Build modbus
|
- name: Build modbus
|
||||||
run: |
|
run: |
|
||||||
@@ -63,7 +63,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
id: 'automatic_releases'
|
id: 'automatic_releases'
|
||||||
uses: emsesp/action-automatic-releases@v1.0.1
|
uses: emsesp/action-automatic-releases@v1.0.0
|
||||||
with:
|
with:
|
||||||
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
title: Test Build v${{steps.build_info.outputs.VERSION}}
|
title: Test Build v${{steps.build_info.outputs.VERSION}}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- board profile `CUSTOM` can only be selected in developer mode
|
- board profile `CUSTOM` can only be selected in developer mode
|
||||||
- mqtt sends round values without decimals (`28` instead of `28.0`)
|
- mqtt sends round values without decimals (`28` instead of `28.0`)
|
||||||
|
|
||||||
|
|
||||||
## [3.8.0] 31 December 2025
|
## [3.8.0] 31 December 2025
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|||||||
@@ -6,34 +6,6 @@ For more details go to [emsesp.org](https://emsesp.org/).
|
|||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- comfortpoint for BC400 [#2935](https://github.com/emsesp/EMS-ESP32/issues/2935)
|
|
||||||
- customize device brand [#2784](https://github.com/emsesp/EMS-ESP32/issues/2784)
|
|
||||||
- set model for ems-esp devices temperature, analog, etc. [#2958](https://github.com/emsesp/EMS-ESP32/discussions/2958)
|
|
||||||
- prometheus metrics for temperature/analog/scheduler/custom [#2962](https://github.com/emsesp/EMS-ESP32/issues/2962)
|
|
||||||
- boiler pumpkick [#2965](https://github.com/emsesp/EMS-ESP32/discussions/2965)
|
|
||||||
- heatpump reset [#2933](https://github.com/emsesp/EMS-ESP32/issues/2933)
|
|
||||||
- e-mail notification using ReadyMail Client
|
|
||||||
- 2.nd freshwater module (dhw4, dhw5) [#2991](https://github.com/emsesp/EMS-ESP32/issues/2991)
|
|
||||||
- full system backup and restore
|
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- SRC climate creation [#2936](https://github.com/emsesp/EMS-ESP32/issues/2936) and [#2960](https://github.com/emsesp/EMS-ESP32/issues/2960)
|
|
||||||
- missing translations [#3015](https://github.com/emsesp/EMS-ESP32/issues/3015)
|
|
||||||
- custom entities check fetch length
|
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
- weblogbuffer up to 1000 messages with PSRAM, mentioned in [#2933](https://github.com/emsesp/EMS-ESP32/issues/2933)
|
|
||||||
- validate custom entity writes, [#2931](https://github.com/emsesp/EMS-ESP32/issues/2931)
|
|
||||||
- remove wrong burnMinPower [#2918](https://github.com/emsesp/EMS-ESP32/issues/2918)
|
|
||||||
- store scheduler active state to nvs [#2946](https://github.com/emsesp/EMS-ESP32/discussions/2946)
|
|
||||||
- translated modes `heat` and `eco` for HA-climate mode-str-tpl
|
|
||||||
- support `minflowtemp` and `baseflowtemp` [#2969](https://github.com/emsesp/EMS-ESP32/discussions/2969)
|
|
||||||
- update version if it is 00.00 in first read [#2981](https://github.com/emsesp/EMS-ESP32/issues/2981)
|
|
||||||
- device class for % values [#2980](https://github.com/emsesp/EMS-ESP32/issues/2980)
|
|
||||||
- use tasmota core 2026.03.30
|
|
||||||
- secure mqtt uses ESP_SSLClient
|
|
||||||
- fetch telegrams: set length to fetch [#3017](https://github.com/emsesp/EMS-ESP32/issues/3017)
|
|
||||||
- move http client from stack to heap
|
|
||||||
- heap optimizations [#3021](https://github.com/emsesp/EMS-ESP32/discussions/3021)
|
|
||||||
|
|||||||
15
Makefile
15
Makefile
@@ -47,25 +47,24 @@ MAKEFLAGS += -j$(JOBS) -l$(shell echo $$(($(JOBS) * 2)))
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
TARGET := emsesp
|
TARGET := emsesp
|
||||||
BUILD := build
|
BUILD := build
|
||||||
SOURCES := src/core src/devices src/web src/test lib_standalone lib/espMqttClient/src lib/espMqttClient/src/* lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/PButton
|
SOURCES := src/core src/devices src/web src/test lib_standalone lib/semver lib/espMqttClient/src lib/espMqttClient/src/* lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/PButton
|
||||||
INCLUDES := src/core src/devices src/web src/test lib_standalone lib/* lib/espMqttClient/src lib/espMqttClient/src/Transport lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src
|
INCLUDES := src/core src/devices src/web src/test lib_standalone lib/* lib/semver lib/espMqttClient/src lib/espMqttClient/src/Transport lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src
|
||||||
LIBRARIES :=
|
LIBRARIES :=
|
||||||
|
|
||||||
CPPCHECK = cppcheck
|
CPPCHECK = cppcheck
|
||||||
CHECKFLAGS = -q --force --std=gnu++20
|
CHECKFLAGS = -q --force --std=gnu++17
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Languages Standard
|
# Languages Standard
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
C_STANDARD := -std=c20
|
C_STANDARD := -std=c17
|
||||||
CXX_STANDARD := -std=gnu++20
|
CXX_STANDARD := -std=gnu++17
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Defined Symbols
|
# Defined Symbols
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
DEFINES += -DARDUINOJSON_ENABLE -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0
|
DEFINES += -DARDUINOJSON_ENABLE -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0
|
||||||
DEFINES += -DEMSESP_STANDALONE -DEMSESP_TEST -DEMSESP_DEBUG -DEMC_RX_BUFFER_SIZE=1500
|
DEFINES += -DEMSESP_STANDALONE -DEMSESP_TEST -DEMSESP_DEBUG -DEMC_RX_BUFFER_SIZE=1500
|
||||||
DEFINES += -DNO_TLS_SUPPORT
|
|
||||||
DEFINES += $(ARGS)
|
DEFINES += $(ARGS)
|
||||||
|
|
||||||
DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32S3\"
|
DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32S3\"
|
||||||
@@ -80,10 +79,6 @@ SYMBOLS := $(CURDIR)/$(BUILD)/$(TARGET).out
|
|||||||
CSOURCES := $(shell find $(SOURCES) -name "*.c" 2>/dev/null)
|
CSOURCES := $(shell find $(SOURCES) -name "*.c" 2>/dev/null)
|
||||||
CXXSOURCES := $(shell find $(SOURCES) -name "*.cpp" 2>/dev/null)
|
CXXSOURCES := $(shell find $(SOURCES) -name "*.cpp" 2>/dev/null)
|
||||||
|
|
||||||
# Exclude files not needed for standalone build, if they exist
|
|
||||||
CSOURCES := $(filter-out src/core/ModuleLibrary.c,$(CSOURCES))
|
|
||||||
CXXSOURCES := $(filter-out src/core/ModuleLibrary.cpp,$(CXXSOURCES))
|
|
||||||
|
|
||||||
OBJS := $(patsubst %,$(BUILD)/%.o,$(basename $(CSOURCES)) $(basename $(CXXSOURCES)))
|
OBJS := $(patsubst %,$(BUILD)/%.o,$(basename $(CSOURCES)) $(basename $(CXXSOURCES)))
|
||||||
DEPS := $(patsubst %,$(BUILD)/%.d,$(basename $(CSOURCES)) $(basename $(CXXSOURCES)))
|
DEPS := $(patsubst %,$(BUILD)/%.d,$(basename $(CSOURCES)) $(basename $(CXXSOURCES)))
|
||||||
|
|
||||||
|
|||||||
18
README.md
18
README.md
@@ -18,7 +18,7 @@
|
|||||||
<a href="https://emsesp.org">
|
<a href="https://emsesp.org">
|
||||||
<img src="https://img.shields.io/badge/Documentation-0077b5?style=for-the-badge&logo=googledocs&logoColor=white" alt="Guides" />
|
<img src="https://img.shields.io/badge/Documentation-0077b5?style=for-the-badge&logo=googledocs&logoColor=white" alt="Guides" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://discord.gg/GP9DPSgeJq">
|
<a href="https://discord.gg/3J3GgnzpyT">
|
||||||
<img src="https://img.shields.io/badge/Discord-7289da?style=for-the-badge&logo=discord&logoColor=white" alt="Discord" />
|
<img src="https://img.shields.io/badge/Discord-7289da?style=for-the-badge&logo=discord&logoColor=white" alt="Discord" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/emsesp/EMS-ESP32/blob/main/CHANGELOG.md">
|
<a href="https://github.com/emsesp/EMS-ESP32/blob/main/CHANGELOG.md">
|
||||||
@@ -32,8 +32,7 @@
|
|||||||
[](https://sonarcloud.io/summary/new_code?id=emsesp_EMS-ESP32)
|
[](https://sonarcloud.io/summary/new_code?id=emsesp_EMS-ESP32)
|
||||||
[](https://app.codacy.com/gh/emsesp/EMS-ESP32/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
[](https://app.codacy.com/gh/emsesp/EMS-ESP32/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
||||||
[](https://github.com/emsesp/EMS-ESP32/releases)
|
[](https://github.com/emsesp/EMS-ESP32/releases)
|
||||||
[](https://discord.gg/GP9DPSgeJq)
|
[](https://discord.gg/3J3GgnzpyT)
|
||||||
[](https://deepwiki.com/emsesp/EMS-ESP32)
|
|
||||||
|
|
||||||
[](https://github.com/emsesp/EMS-ESP32/stargazers)
|
[](https://github.com/emsesp/EMS-ESP32/stargazers)
|
||||||
[](https://github.com/emsesp/EMS-ESP32/network)
|
[](https://github.com/emsesp/EMS-ESP32/network)
|
||||||
@@ -41,8 +40,7 @@
|
|||||||
|
|
||||||
**EMS-ESP** is an open-source firmware for the Espressif ESP32 microcontroller to communicate with **EMS** (Energy Management System) compatible equipment from manufacturers such as Bosch, Buderus, Nefit, Junkers, Worcester, Sieger, elm.leblanc and iVT.
|
**EMS-ESP** is an open-source firmware for the Espressif ESP32 microcontroller to communicate with **EMS** (Energy Management System) compatible equipment from manufacturers such as Bosch, Buderus, Nefit, Junkers, Worcester, Sieger, elm.leblanc and iVT.
|
||||||
|
|
||||||
It requires a small circuit to interface with the EMS bus which can be purchased from <https://bbqkees-electronics.nl>. These gateways are tested thoroughly and certified to work with EMS-ESP.
|
It requires a small circuit to interface with the EMS bus which can be purchased from <https://bbqkees-electronics.nl> or custom built.
|
||||||
|
|
||||||
|
|
||||||
## 📦 **Key Features**
|
## 📦 **Key Features**
|
||||||
|
|
||||||
@@ -66,17 +64,17 @@ Head over to the [Installation Guide](https://emsesp.org/Installing) section of
|
|||||||
|
|
||||||
## 📋 **Documentation**
|
## 📋 **Documentation**
|
||||||
|
|
||||||
Visit [emsesp.org](https://emsesp.org) for more details on how to setup and configure EMS-ESP. You'll also find more a collection of example configuarations, Frequently Asked Questions and Troubleshooting tips.
|
Visit [emsesp.org](https://emsesp.org) for more details on how to install and configure EMS-ESP. There is also a collection of Frequently Asked Questions and Troubleshooting tips with example customizations from the community.
|
||||||
|
|
||||||
## 💬 **Getting Support**
|
## 💬 **Getting Support**
|
||||||
|
|
||||||
To chat with the community reach out on our [Discord Server](https://discord.gg/GP9DPSgeJq).
|
To chat with the community reach out on our [Discord Server](https://discord.gg/3J3GgnzpyT).
|
||||||
|
|
||||||
If you find an issue or have a request, see the [Getting Support](https://emsesp.org/Support/) section of the documentation. Note if you are using a non-BBQKees EMS gateway, you may need to contact the manufacturer for support.
|
If you find an issue or have a request, see [how to request support](https://emsesp.org/Support/) on how to submit a bug report or feature request.
|
||||||
|
|
||||||
## 🎥 **Live Demo**
|
## 🎥 **Live Demo**
|
||||||
|
|
||||||
To see a live demo go to [demo.emsesp.org](https://demo.emsesp.org). Pick a language and use any username and password to log in. Note whast you're seeing is static example data so not all features are operational.
|
For a live demo go to [demo.emsesp.org](https://demo.emsesp.org). Pick a language from the sign on page and log in with any username or password. Note not all features are operational as it's based on static data.
|
||||||
|
|
||||||
## 💖 **Contributors**
|
## 💖 **Contributors**
|
||||||
|
|
||||||
@@ -86,7 +84,7 @@ If you like **EMS-ESP**, please give it a ✨ on GitHub, or even better fork it
|
|||||||
|
|
||||||
## 📦 **Building**
|
## 📦 **Building**
|
||||||
|
|
||||||
See the [Building the firmware](https://emsesp.org/Building) guide in the documentation for instructions on how to build EMS-ESP from this source code.
|
See the [Building Guide](https://emsesp.org/Building) section of the documentation for instructions on how to build EMS-ESP.
|
||||||
|
|
||||||
## 📢 **Libraries used**
|
## 📢 **Libraries used**
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
},
|
},
|
||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
"extra_flags": [
|
"extra_flags": [
|
||||||
"-DNO_TLS_SUPPORT",
|
"-DTASMOTA_SDK",
|
||||||
"-DARDUINO_LOLIN_C3_MINI",
|
"-DARDUINO_LOLIN_C3_MINI",
|
||||||
"-DARDUINO_USB_MODE=1",
|
"-DARDUINO_USB_MODE=1",
|
||||||
"-DARDUINO_USB_CDC_ON_BOOT=1"
|
"-DARDUINO_USB_CDC_ON_BOOT=1"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
"extra_flags": [
|
"extra_flags": [
|
||||||
"-DBOARD_HAS_PSRAM",
|
"-DBOARD_HAS_PSRAM",
|
||||||
"-DNO_TLS_SUPPORT",
|
"-DTASMOTA_SDK",
|
||||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
"-DARDUINO_USB_MODE=0"
|
"-DARDUINO_USB_MODE=0"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
"arduino",
|
"arduino",
|
||||||
"espidf"
|
"espidf"
|
||||||
],
|
],
|
||||||
"name": "Tasmota ESP32-S3 32M Flash OPI PSRAM, 4608KB Code/OTA, 2MB FS",
|
"name": "Espressif ESP32-S3 32M Flash OPI PSRAM, 4608KB Code/OTA, 2MB FS",
|
||||||
"upload": {
|
"upload": {
|
||||||
"flash_size": "32MB",
|
"flash_size": "32MB",
|
||||||
"maximum_ram_size": 327680,
|
"maximum_ram_size": 327680,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
"extra_flags": "-DNO_TLS_SUPPORT",
|
"extra_flags": "-DTASMOTA_SDK",
|
||||||
"f_cpu": "240000000L",
|
"f_cpu": "240000000L",
|
||||||
"f_flash": "40000000L",
|
"f_flash": "40000000L",
|
||||||
"flash_mode": "dio",
|
"flash_mode": "dio",
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"arduino",
|
"arduino",
|
||||||
"espidf"
|
"espidf"
|
||||||
],
|
],
|
||||||
"name": "Tasmota ESP32 16M Flash, 4608KB Code/OTA, 2MB FS",
|
"name": "Espressif ESP32 16M Flash, 4608KB Code/OTA, 2MB FS",
|
||||||
"upload": {
|
"upload": {
|
||||||
"flash_size": "16MB",
|
"flash_size": "16MB",
|
||||||
"maximum_ram_size": 327680,
|
"maximum_ram_size": 327680,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"arduino",
|
"arduino",
|
||||||
"espidf"
|
"espidf"
|
||||||
],
|
],
|
||||||
"name": "Tasmota ESP32 16M Flash DIO PSRAM, 4608KB Code/OTA, 2MB FS",
|
"name": "Espressif ESP32 16M Flash DIO PSRAM, 4608KB Code/OTA, 2MB FS",
|
||||||
"upload": {
|
"upload": {
|
||||||
"flash_size": "16MB",
|
"flash_size": "16MB",
|
||||||
"maximum_ram_size": 327680,
|
"maximum_ram_size": 327680,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
"extra_flags": "-DNO_TLS_SUPPORT",
|
"extra_flags": "-DTASMOTA_SDK",
|
||||||
"f_cpu": "240000000L",
|
"f_cpu": "240000000L",
|
||||||
"f_flash": "40000000L",
|
"f_flash": "40000000L",
|
||||||
"flash_mode": "dio",
|
"flash_mode": "dio",
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
"extra_flags": [
|
"extra_flags": [
|
||||||
"-DNO_TLS_SUPPORT",
|
|
||||||
"-DARDUINO_XIAO_ESP32C6",
|
"-DARDUINO_XIAO_ESP32C6",
|
||||||
"-DARDUINO_USB_MODE=1",
|
"-DARDUINO_USB_MODE=1",
|
||||||
"-DARDUINO_USB_CDC_ON_BOOT=1"
|
"-DARDUINO_USB_CDC_ON_BOOT=1"
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dictionaries": ["project-words"],
|
"dictionaries": ["project-words"],
|
||||||
"caseSensitive": false,
|
|
||||||
"ignorePaths": [
|
"ignorePaths": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"compile_commands.json",
|
"compile_commands.json",
|
||||||
@@ -37,8 +36,6 @@
|
|||||||
"pnpm-*.yaml",
|
"pnpm-*.yaml",
|
||||||
"vite.config.ts",
|
"vite.config.ts",
|
||||||
"lib/esp32-psram/**",
|
"lib/esp32-psram/**",
|
||||||
"test/test_api/test_api.h",
|
"test/test_api/test_api.h"
|
||||||
"lib_standalone/**",
|
|
||||||
"**/*.js"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,10 @@
|
|||||||
{
|
|
||||||
"type": "systembackup",
|
|
||||||
"version": "3.8.2",
|
|
||||||
"date": "2026-03-29T13:28:15",
|
|
||||||
"systembackup": [
|
|
||||||
{
|
{
|
||||||
"type": "settings",
|
"type": "settings",
|
||||||
"Network": {
|
"Network": {
|
||||||
"ssid": "",
|
"ssid": "my_wifi_ssid",
|
||||||
"bssid": "",
|
"bssid": "",
|
||||||
"password": "",
|
"password": "my_wifi_password",
|
||||||
"hostname": "ems-esp",
|
"hostname": "ems-esp"
|
||||||
"static_ip_config": false,
|
|
||||||
"bandwidth20": false,
|
|
||||||
"nosleep": true,
|
|
||||||
"enableMDNS": true,
|
|
||||||
"enableCORS": false,
|
|
||||||
"CORSOrigin": "*",
|
|
||||||
"tx_power": 0
|
|
||||||
},
|
},
|
||||||
"AP": {
|
"AP": {
|
||||||
"provision_mode": 2,
|
"provision_mode": 2,
|
||||||
@@ -33,14 +21,12 @@
|
|||||||
"enableTLS": false,
|
"enableTLS": false,
|
||||||
"rootCA": "",
|
"rootCA": "",
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"host": "",
|
"host": "127.0.0.1",
|
||||||
"port": 1883,
|
"port": 1883,
|
||||||
"base": "ems-esp",
|
"base": "ems-esp",
|
||||||
"username": "",
|
"username": "username",
|
||||||
"password": "",
|
"password": "password",
|
||||||
"client_id": "esp32-b8ffc9ec",
|
"client_id": "ems-esp",
|
||||||
"keep_alive": 60,
|
|
||||||
"clean_session": false,
|
|
||||||
"entity_format": 1,
|
"entity_format": 1,
|
||||||
"publish_time_boiler": 10,
|
"publish_time_boiler": 10,
|
||||||
"publish_time_thermostat": 10,
|
"publish_time_thermostat": 10,
|
||||||
@@ -56,7 +42,6 @@
|
|||||||
"nested_format": 1,
|
"nested_format": 1,
|
||||||
"discovery_prefix": "homeassistant",
|
"discovery_prefix": "homeassistant",
|
||||||
"discovery_type": 0,
|
"discovery_type": 0,
|
||||||
"ha_number_mode": 0,
|
|
||||||
"publish_single": false,
|
"publish_single": false,
|
||||||
"publish_single2cmd": false,
|
"publish_single2cmd": false,
|
||||||
"send_response": false
|
"send_response": false
|
||||||
@@ -83,146 +68,18 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Settings": {
|
"Settings": {
|
||||||
"version": "3.8.2",
|
"board_profile": "S3",
|
||||||
"board_profile": "E32V2_2",
|
|
||||||
"platform": "ESP32",
|
|
||||||
"locale": "en",
|
"locale": "en",
|
||||||
"tx_mode": 1,
|
"tx_mode": 1,
|
||||||
"ems_bus_id": 11,
|
"ems_bus_id": 11,
|
||||||
"syslog_enabled": false,
|
|
||||||
"syslog_level": 3,
|
|
||||||
"trace_raw": false,
|
|
||||||
"syslog_mark_interval": 0,
|
|
||||||
"syslog_host": "",
|
|
||||||
"syslog_port": 514,
|
|
||||||
"boiler_heatingoff": false,
|
"boiler_heatingoff": false,
|
||||||
"remote_timeout": 24,
|
"hide_led": true,
|
||||||
"remote_timeout_en": false,
|
|
||||||
"shower_timer": false,
|
|
||||||
"shower_alert": false,
|
|
||||||
"shower_alert_coldshot": 10,
|
|
||||||
"shower_alert_trigger": 7,
|
|
||||||
"shower_min_duration": 180,
|
|
||||||
"rx_gpio": 4,
|
|
||||||
"tx_gpio": 5,
|
|
||||||
"dallas_gpio": 14,
|
|
||||||
"dallas_parasite": false,
|
|
||||||
"led_gpio": 32,
|
|
||||||
"hide_led": false,
|
|
||||||
"led_type": 1,
|
|
||||||
"low_clock": false,
|
|
||||||
"telnet_enabled": true,
|
"telnet_enabled": true,
|
||||||
"notoken_api": false,
|
"notoken_api": false,
|
||||||
"readonly_mode": false,
|
|
||||||
"analog_enabled": true,
|
"analog_enabled": true,
|
||||||
"pbutton_gpio": 34,
|
|
||||||
"solar_maxflow": 30,
|
|
||||||
"fahrenheit": false,
|
"fahrenheit": false,
|
||||||
"bool_format": 1,
|
"bool_format": 1,
|
||||||
"bool_dashboard": 1,
|
"bool_dashboard": 1,
|
||||||
"enum_format": 1,
|
"enum_format": 1
|
||||||
"weblog_level": 6,
|
|
||||||
"weblog_buffer": 50,
|
|
||||||
"weblog_compact": true,
|
|
||||||
"phy_type": 1,
|
|
||||||
"eth_power": 15,
|
|
||||||
"eth_phy_addr": 0,
|
|
||||||
"eth_clock_mode": 1,
|
|
||||||
"modbus_enabled": false,
|
|
||||||
"modbus_port": 502,
|
|
||||||
"modbus_max_clients": 10,
|
|
||||||
"modbus_timeout": 300,
|
|
||||||
"developer_mode": true,
|
|
||||||
"email_enabled": false,
|
|
||||||
"email_ssl": false,
|
|
||||||
"email_starttls": true,
|
|
||||||
"email_server": "smtp.example.net",
|
|
||||||
"email_port": 587,
|
|
||||||
"email_login": "",
|
|
||||||
"email_pass": "",
|
|
||||||
"email_sender": "ems-esp@example.net",
|
|
||||||
"email_recp": "",
|
|
||||||
"email_subject": "ems-esp notification"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "schedule",
|
|
||||||
"Schedule": {
|
|
||||||
"schedule": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "customizations",
|
|
||||||
"Customizations": {
|
|
||||||
"ts": [
|
|
||||||
{
|
|
||||||
"id": "28_1767_7B13_2502",
|
|
||||||
"name": "gateway_temperature",
|
|
||||||
"offset": 0,
|
|
||||||
"is_system": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"as": [
|
|
||||||
{
|
|
||||||
"gpio": 39,
|
|
||||||
"name": "core_voltage",
|
|
||||||
"offset": 0,
|
|
||||||
"factor": 0.003771,
|
|
||||||
"uom": 23,
|
|
||||||
"type": 3,
|
|
||||||
"is_system": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gpio": 36,
|
|
||||||
"name": "supply_voltage",
|
|
||||||
"offset": 0,
|
|
||||||
"factor": 0.017,
|
|
||||||
"uom": 23,
|
|
||||||
"type": 3,
|
|
||||||
"is_system": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gpio": 2,
|
|
||||||
"name": "led",
|
|
||||||
"offset": 0,
|
|
||||||
"factor": 1,
|
|
||||||
"uom": 0,
|
|
||||||
"type": 6,
|
|
||||||
"is_system": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"masked_entities": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "entities",
|
|
||||||
"Entities": {
|
|
||||||
"entities": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "modules",
|
|
||||||
"Modules": {
|
|
||||||
"modules": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "customSupport",
|
|
||||||
"Support": {
|
|
||||||
"html": [
|
|
||||||
"This product is installed and managed by:",
|
|
||||||
"",
|
|
||||||
"<b>Bosch Installer Example</b>",
|
|
||||||
"",
|
|
||||||
"Nefit Road 12",
|
|
||||||
"1234 AB Amsterdam",
|
|
||||||
"Phone: +31 123 456 789",
|
|
||||||
"email: support@boschinstaller.nl",
|
|
||||||
"",
|
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@ telegram_type_id,name,is_fetched
|
|||||||
0x19,UBAMonitorSlow,
|
0x19,UBAMonitorSlow,
|
||||||
0x1A,UBASetPoints,
|
0x1A,UBASetPoints,
|
||||||
0x1C,UBAMaintenanceStatus,
|
0x1C,UBAMaintenanceStatus,
|
||||||
0x1E,HydrTemp,
|
0x1E,WM10TempMessage,
|
||||||
0x23,JunkersSetMixer,fetched
|
0x23,JunkersSetMixer,fetched
|
||||||
0x27,UBASettingsWW,fetched
|
0x27,UBASettingsWW,fetched
|
||||||
0x28,WeatherComp,fetched
|
0x28,WeatherComp,fetched
|
||||||
@@ -72,12 +72,11 @@ telegram_type_id,name,is_fetched
|
|||||||
0xE6,UBAParametersPlus,fetched
|
0xE6,UBAParametersPlus,fetched
|
||||||
0xE9,UBAMonitorWWPlus,
|
0xE9,UBAMonitorWWPlus,
|
||||||
0xEA,UBAParameterWWPlus,fetched
|
0xEA,UBAParameterWWPlus,fetched
|
||||||
0xEB,PumpKick,fetched
|
|
||||||
0x0101,ISM1Set,fetched
|
0x0101,ISM1Set,fetched
|
||||||
0x0103,ISM1StatusMessage,fetched
|
0x0103,ISM1StatusMessage,fetched
|
||||||
0x0104,ISM2StatusMessage,
|
0x0104,ISM2StatusMessage,
|
||||||
0x010C,IPMStatusMessage,
|
0x010C,IPMStatusMessage,
|
||||||
0x011E,IPMTempMessage,
|
0x011E,JunkersDisp,fetched
|
||||||
0x012E,HPEnergy1,
|
0x012E,HPEnergy1,
|
||||||
0x013B,HPEnergy2,
|
0x013B,HPEnergy2,
|
||||||
0x0165,JunkersSet,
|
0x0165,JunkersSet,
|
||||||
@@ -112,8 +111,8 @@ telegram_type_id,name,is_fetched
|
|||||||
0x02A0,RC300Curves,
|
0x02A0,RC300Curves,
|
||||||
0x02A1,RC300Curves,
|
0x02A1,RC300Curves,
|
||||||
0x02A2,RC300Curves,
|
0x02A2,RC300Curves,
|
||||||
0x02A5,RC300Monitor,fetched
|
0x02A5,RC300Monitor,
|
||||||
0x02A6,CRFMonitor,
|
0x02A6,RC300Monitor,
|
||||||
0x02A7,RC300Monitor,
|
0x02A7,RC300Monitor,
|
||||||
0x02A8,CRFMonitor,
|
0x02A8,CRFMonitor,
|
||||||
0x02A9,RC300Monitor,
|
0x02A9,RC300Monitor,
|
||||||
@@ -171,7 +170,6 @@ telegram_type_id,name,is_fetched
|
|||||||
0x0468,HPSet,
|
0x0468,HPSet,
|
||||||
0x0469,HPSet,
|
0x0469,HPSet,
|
||||||
0x046A,HPSet,
|
0x046A,HPSet,
|
||||||
0x0470,RC300Summer2,
|
|
||||||
0x0471,RC300Summer2,
|
0x0471,RC300Summer2,
|
||||||
0x0472,RC300Summer2,
|
0x0472,RC300Summer2,
|
||||||
0x0473,RC300Summer2,
|
0x0473,RC300Summer2,
|
||||||
@@ -179,6 +177,7 @@ telegram_type_id,name,is_fetched
|
|||||||
0x0475,RC300Summer2,
|
0x0475,RC300Summer2,
|
||||||
0x0476,RC300Summer2,
|
0x0476,RC300Summer2,
|
||||||
0x0477,RC300Summer2,
|
0x0477,RC300Summer2,
|
||||||
|
0x0478,RC300Summer2,
|
||||||
0x047B,HP2,
|
0x047B,HP2,
|
||||||
0x0484,HPSilentMode,fetched
|
0x0484,HPSilentMode,fetched
|
||||||
0x0485,HpCooling,fetched
|
0x0485,HpCooling,fetched
|
||||||
@@ -198,7 +197,7 @@ telegram_type_id,name,is_fetched
|
|||||||
0x04A2,HpInput,fetched
|
0x04A2,HpInput,fetched
|
||||||
0x04A5,HPFan,fetched
|
0x04A5,HPFan,fetched
|
||||||
0x04A7,HPPowerLimit,fetched
|
0x04A7,HPPowerLimit,fetched
|
||||||
0x04AA,HPPower,
|
0x04AA,HPPower2,fetched
|
||||||
0x04AE,HPEnergy,fetched
|
0x04AE,HPEnergy,fetched
|
||||||
0x04AF,HPMeters,fetched
|
0x04AF,HPMeters,fetched
|
||||||
0x055C,VentilationSet,fetched
|
0x055C,VentilationSet,fetched
|
||||||
|
|||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"adapter": "react",
|
"adapter": "react",
|
||||||
"baseLocale": "pl",
|
"baseLocale": "pl",
|
||||||
"$schema": "https://unpkg.com/typesafe-i18n@5.27.1/schema/typesafe-i18n.json"
|
"$schema": "https://unpkg.com/typesafe-i18n@5.26.2/schema/typesafe-i18n.json"
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import eslint from '@eslint/js';
|
import eslint from '@eslint/js';
|
||||||
import prettierConfig from 'eslint-config-prettier';
|
import prettierConfig from 'eslint-config-prettier';
|
||||||
import { defineConfig } from 'eslint/config';
|
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
export default defineConfig(
|
export default tseslint.config(
|
||||||
eslint.configs.recommended,
|
eslint.configs.recommended,
|
||||||
...tseslint.configs.recommendedTypeChecked,
|
...tseslint.configs.recommendedTypeChecked,
|
||||||
prettierConfig,
|
prettierConfig,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "EMS-ESP",
|
"name": "EMS-ESP",
|
||||||
"version": "3.8.2",
|
"version": "3.8.0",
|
||||||
"description": "EMS-ESP WebUI",
|
"description": "EMS-ESP WebUI",
|
||||||
"homepage": "https://emsesp.org",
|
"homepage": "https://emsesp.org",
|
||||||
"author": "proddy, emsesp.org",
|
"author": "proddy, emsesp.org",
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"preview-standalone": "typesafe-i18n --no-watch && vite build && concurrently -c \"auto\" \"pnpm:mock-rest\" \"vite preview\"",
|
"preview-standalone": "typesafe-i18n --no-watch && vite build && concurrently -c \"auto\" \"pnpm:mock-rest\" \"vite preview\"",
|
||||||
"standalone": "concurrently -c \"auto\" \"typesafe-i18n\" \"pnpm:mock-rest\" \"vite dev\"",
|
"standalone": "concurrently -c \"auto\" \"typesafe-i18n\" \"pnpm:mock-rest\" \"vite dev\"",
|
||||||
"typesafe-i18n": "typesafe-i18n --no-watch",
|
"typesafe-i18n": "typesafe-i18n --no-watch",
|
||||||
"build-webUI": "typesafe-i18n --no-watch && vite build && node progmem-generator.js",
|
"build_webUI": "typesafe-i18n --no-watch && vite build && node progmem-generator.js",
|
||||||
"format": "prettier -l -w '**/*.{ts,tsx,js,css,json,md}'",
|
"format": "prettier -l -w '**/*.{ts,tsx,js,css,json,md}'",
|
||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"standalone-devcontainer": "concurrently -c \"auto\" \"typesafe-i18n\" \"pnpm:mock-rest\" \"vite --host\""
|
"standalone-devcontainer": "concurrently -c \"auto\" \"typesafe-i18n\" \"pnpm:mock-rest\" \"vite --host\""
|
||||||
@@ -26,45 +26,46 @@
|
|||||||
"@alova/adapter-xhr": "2.3.1",
|
"@alova/adapter-xhr": "2.3.1",
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
"@emotion/styled": "^11.14.1",
|
"@emotion/styled": "^11.14.1",
|
||||||
"@mui/icons-material": "^9.0.0",
|
"@mui/icons-material": "^7.3.7",
|
||||||
"@mui/material": "^9.0.0",
|
"@mui/material": "^7.3.7",
|
||||||
"@preact/compat": "^18.3.2",
|
"@preact/compat": "^18.3.1",
|
||||||
"@table-library/react-table-library": "4.1.15",
|
"@table-library/react-table-library": "4.1.15",
|
||||||
"alova": "^3.5.1",
|
"alova": "3.4.1",
|
||||||
"async-validator": "^4.2.5",
|
"async-validator": "^4.2.5",
|
||||||
"etag": "^1.8.1",
|
"etag": "^1.8.1",
|
||||||
"formidable": "^3.5.4",
|
"formidable": "^3.5.4",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"magic-string": "^0.30.21",
|
"magic-string": "^0.30.21",
|
||||||
"mime-types": "^3.0.2",
|
"mime-types": "^3.0.2",
|
||||||
"preact": "^10.29.1",
|
"preact": "^10.28.2",
|
||||||
"react": "^19.2.5",
|
"react": "^19.2.3",
|
||||||
"react-dom": "^19.2.5",
|
"react-dom": "^19.2.3",
|
||||||
"react-icons": "^5.6.0",
|
"react-icons": "^5.5.0",
|
||||||
"react-router": "^7.14.2",
|
"react-router": "^7.12.0",
|
||||||
"react-toastify": "^11.1.0",
|
"react-toastify": "^11.0.5",
|
||||||
"typesafe-i18n": "^5.27.1",
|
"typesafe-i18n": "^5.26.2",
|
||||||
"typescript": "^6.0.3"
|
"typescript": "^5.9.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.29.0",
|
"@babel/core": "^7.28.5",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^9.39.2",
|
||||||
"@preact/compat": "^18.3.2",
|
"@preact/compat": "^18.3.1",
|
||||||
"@preact/preset-vite": "^2.10.5",
|
"@preact/preset-vite": "^2.10.2",
|
||||||
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
||||||
"@types/node": "^25.6.0",
|
"@types/node": "^25.0.6",
|
||||||
"@types/react": "^19.2.14",
|
"@types/react": "^19.2.8",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"axe-core": "^4.11.3",
|
"axe-core": "^4.11.1",
|
||||||
"concurrently": "^9.2.1",
|
"concurrently": "^9.2.1",
|
||||||
"eslint": "^10.2.1",
|
"eslint": "^9.39.2",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"prettier": "^3.8.3",
|
"prettier": "^3.7.4",
|
||||||
"rollup-plugin-visualizer": "^7.0.1",
|
"rollup-plugin-visualizer": "^6.0.5",
|
||||||
"terser": "^5.46.1",
|
"terser": "^5.44.1",
|
||||||
"typescript-eslint": "^8.59.0",
|
"typescript-eslint": "^8.52.0",
|
||||||
"vite": "^8.0.9",
|
"vite": "^7.3.1",
|
||||||
"vite-plugin-imagemin": "^0.6.1"
|
"vite-plugin-imagemin": "^0.6.1",
|
||||||
|
"vite-tsconfig-paths": "^6.0.4"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.33.1+sha512.05ba3c1d5d1c18f68df06470d74055e62d41fc110a0c660db1b2dfb2785327f04cf0f68345d4609bc52089e7fa0343c31593b2f9594e2c5d5da426230acc9820"
|
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48"
|
||||||
}
|
}
|
||||||
|
|||||||
2515
interface/pnpm-lock.yaml
generated
2515
interface/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -24,26 +24,20 @@ let bundleStats = {
|
|||||||
other: { count: 0, uncompressed: 0, compressed: 0 }
|
other: { count: 0, uncompressed: 0, compressed: 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
// AsyncWebHandler that performs the lookup.
|
const generateWWWClass =
|
||||||
const generateWWWClass = () => `// Bundle Statistics:
|
() => `typedef std::function<void(const char * uri, const String & contentType, const uint8_t * content, size_t len, const String & hash)> RouteRegistrationHandler;
|
||||||
|
// Bundle Statistics:
|
||||||
// - Total compressed size: ${(totalSize / 1000).toFixed(1)} KB
|
// - Total compressed size: ${(totalSize / 1000).toFixed(1)} KB
|
||||||
// - Total uncompressed size: ${(Object.values(bundleStats).reduce((sum, stat) => sum + stat.uncompressed, 0) / 1000).toFixed(1)} KB
|
// - Total uncompressed size: ${(Object.values(bundleStats).reduce((sum, stat) => sum + stat.uncompressed, 0) / 1000).toFixed(1)} KB
|
||||||
// - Compression ratio: ${(((Object.values(bundleStats).reduce((sum, stat) => sum + stat.uncompressed, 0) - totalSize) / Object.values(bundleStats).reduce((sum, stat) => sum + stat.uncompressed, 0)) * 100).toFixed(1)}%
|
// - Compression ratio: ${(((Object.values(bundleStats).reduce((sum, stat) => sum + stat.uncompressed, 0) - totalSize) / Object.values(bundleStats).reduce((sum, stat) => sum + stat.uncompressed, 0)) * 100).toFixed(1)}%
|
||||||
// - Generated on: ${new Date().toISOString()}
|
// - Generated on: ${new Date().toISOString()}
|
||||||
|
|
||||||
struct WWWAsset {
|
class WWWData {
|
||||||
${INDENT}const char * uri;
|
${INDENT}public:
|
||||||
${INDENT}const char * contentType;
|
${INDENT.repeat(2)}static void registerRoutes(RouteRegistrationHandler handler) {
|
||||||
${INDENT}const uint8_t * content;
|
${fileInfo.map((f) => `${INDENT.repeat(3)}handler("${f.uri}", "${f.mimeType}", ${f.variable}, ${f.size}, ${f.hash});`).join('\n')}
|
||||||
${INDENT}size_t len;
|
${INDENT.repeat(2)}}
|
||||||
${INDENT}const char * etag; // already includes enclosing double quotes
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const WWWAsset WWW_ASSETS[] = {
|
|
||||||
${fileInfo.map((f) => `${INDENT}{"${f.uri}", "${f.mimeType}", ${f.variable}, ${f.size}, "\\"${f.rawHash}\\""},`).join('\n')}
|
|
||||||
};
|
|
||||||
|
|
||||||
static constexpr size_t WWW_ASSETS_COUNT = sizeof(WWW_ASSETS) / sizeof(WWW_ASSETS[0]);
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const getFilesSync = (dir, files = []) => {
|
const getFilesSync = (dir, files = []) => {
|
||||||
@@ -78,7 +72,6 @@ const writeFile = (relativeFilePath, buffer) => {
|
|||||||
const zipBuffer = zlib.gzipSync(buffer, { level: 9 });
|
const zipBuffer = zlib.gzipSync(buffer, { level: 9 });
|
||||||
// const hash = crypto.createHash('sha256').update(zipBuffer).digest('hex');
|
// const hash = crypto.createHash('sha256').update(zipBuffer).digest('hex');
|
||||||
const hash = etag(zipBuffer); // use smaller md5 instead of sha256
|
const hash = etag(zipBuffer); // use smaller md5 instead of sha256
|
||||||
const rawHash = hash.replace(/^"|"$/g, '');
|
|
||||||
|
|
||||||
zipBuffer.forEach((b) => {
|
zipBuffer.forEach((b) => {
|
||||||
if (!(size % bytesPerLine)) {
|
if (!(size % bytesPerLine)) {
|
||||||
@@ -101,8 +94,7 @@ const writeFile = (relativeFilePath, buffer) => {
|
|||||||
mimeType,
|
mimeType,
|
||||||
variable,
|
variable,
|
||||||
size,
|
size,
|
||||||
hash,
|
hash
|
||||||
rawHash
|
|
||||||
});
|
});
|
||||||
|
|
||||||
totalSize += size;
|
totalSize += size;
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
import { type FC, memo, useContext, useEffect, useRef } from 'react';
|
import { type FC, Suspense, lazy, memo, useContext, useEffect, useRef } from 'react';
|
||||||
import { Navigate, Route, Routes } from 'react-router';
|
import { Navigate, Route, Routes } from 'react-router';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import AuthenticatedRouting from 'AuthenticatedRouting';
|
import {
|
||||||
import SignIn from 'SignIn';
|
LoadingSpinner,
|
||||||
import { RequireAuthenticated, RequireUnauthenticated } from 'components';
|
RequireAuthenticated,
|
||||||
|
RequireUnauthenticated
|
||||||
|
} from 'components';
|
||||||
import { Authentication, AuthenticationContext } from 'contexts/authentication';
|
import { Authentication, AuthenticationContext } from 'contexts/authentication';
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
|
|
||||||
|
// Lazy load route components for better code splitting
|
||||||
|
const SignIn = lazy(() => import('SignIn'));
|
||||||
|
const AuthenticatedRouting = lazy(() => import('AuthenticatedRouting'));
|
||||||
|
|
||||||
interface SecurityRedirectProps {
|
interface SecurityRedirectProps {
|
||||||
readonly message: string;
|
readonly message: string;
|
||||||
readonly signOut?: boolean;
|
readonly signOut?: boolean;
|
||||||
@@ -39,6 +45,7 @@ const AppRouting: FC = memo(() => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Authentication>
|
<Authentication>
|
||||||
|
<Suspense fallback={<LoadingSpinner />}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route
|
<Route
|
||||||
path="/unauthorized"
|
path="/unauthorized"
|
||||||
@@ -65,6 +72,7 @@ const AppRouting: FC = memo(() => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Routes>
|
</Routes>
|
||||||
|
</Suspense>
|
||||||
</Authentication>
|
</Authentication>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,39 +1,44 @@
|
|||||||
import { memo, useContext } from 'react';
|
import { Suspense, lazy, memo, useContext } from 'react';
|
||||||
import { Navigate, Route, Routes } from 'react-router';
|
import { Navigate, Route, Routes } from 'react-router';
|
||||||
|
|
||||||
import CustomEntities from 'app/main/CustomEntities';
|
import { Layout, LoadingSpinner } from 'components';
|
||||||
import Customizations from 'app/main/Customizations';
|
|
||||||
import Dashboard from 'app/main/Dashboard';
|
|
||||||
import Devices from 'app/main/Devices';
|
|
||||||
import Help from 'app/main/Help';
|
|
||||||
import Modules from 'app/main/Modules';
|
|
||||||
import Scheduler from 'app/main/Scheduler';
|
|
||||||
import Sensors from 'app/main/Sensors';
|
|
||||||
import UserProfile from 'app/main/UserProfile';
|
|
||||||
import APSettings from 'app/settings/APSettings';
|
|
||||||
import ApplicationSettings from 'app/settings/ApplicationSettings';
|
|
||||||
import DownloadUpload from 'app/settings/DownloadUpload';
|
|
||||||
import MqttSettings from 'app/settings/MqttSettings';
|
|
||||||
import NTPSettings from 'app/settings/NTPSettings';
|
|
||||||
import Settings from 'app/settings/Settings';
|
|
||||||
import Network from 'app/settings/network/Network';
|
|
||||||
import Security from 'app/settings/security/Security';
|
|
||||||
import APStatus from 'app/status/APStatus';
|
|
||||||
import Activity from 'app/status/Activity';
|
|
||||||
import HardwareStatus from 'app/status/HardwareStatus';
|
|
||||||
import MqttStatus from 'app/status/MqttStatus';
|
|
||||||
import NTPStatus from 'app/status/NTPStatus';
|
|
||||||
import NetworkStatus from 'app/status/NetworkStatus';
|
|
||||||
import Status from 'app/status/Status';
|
|
||||||
import SystemLog from 'app/status/SystemLog';
|
|
||||||
import Version from 'app/status/Version';
|
|
||||||
import { Layout } from 'components';
|
|
||||||
import { AuthenticatedContext } from 'contexts/authentication';
|
import { AuthenticatedContext } from 'contexts/authentication';
|
||||||
|
|
||||||
|
// Lazy load all route components for better code splitting
|
||||||
|
const Dashboard = lazy(() => import('app/main/Dashboard'));
|
||||||
|
const Devices = lazy(() => import('app/main/Devices'));
|
||||||
|
const Sensors = lazy(() => import('app/main/Sensors'));
|
||||||
|
const Help = lazy(() => import('app/main/Help'));
|
||||||
|
const Customizations = lazy(() => import('app/main/Customizations'));
|
||||||
|
const Scheduler = lazy(() => import('app/main/Scheduler'));
|
||||||
|
const CustomEntities = lazy(() => import('app/main/CustomEntities'));
|
||||||
|
const Modules = lazy(() => import('app/main/Modules'));
|
||||||
|
const UserProfile = lazy(() => import('app/main/UserProfile'));
|
||||||
|
|
||||||
|
const Status = lazy(() => import('app/status/Status'));
|
||||||
|
const HardwareStatus = lazy(() => import('app/status/HardwareStatus'));
|
||||||
|
const Activity = lazy(() => import('app/status/Activity'));
|
||||||
|
const SystemLog = lazy(() => import('app/status/SystemLog'));
|
||||||
|
const MqttStatus = lazy(() => import('app/status/MqttStatus'));
|
||||||
|
const NTPStatus = lazy(() => import('app/status/NTPStatus'));
|
||||||
|
const APStatus = lazy(() => import('app/status/APStatus'));
|
||||||
|
const NetworkStatus = lazy(() => import('app/status/NetworkStatus'));
|
||||||
|
const Version = lazy(() => import('app/status/Version'));
|
||||||
|
|
||||||
|
const Settings = lazy(() => import('app/settings/Settings'));
|
||||||
|
const ApplicationSettings = lazy(() => import('app/settings/ApplicationSettings'));
|
||||||
|
const MqttSettings = lazy(() => import('app/settings/MqttSettings'));
|
||||||
|
const NTPSettings = lazy(() => import('app/settings/NTPSettings'));
|
||||||
|
const APSettings = lazy(() => import('app/settings/APSettings'));
|
||||||
|
const DownloadUpload = lazy(() => import('app/settings/DownloadUpload'));
|
||||||
|
const Network = lazy(() => import('app/settings/network/Network'));
|
||||||
|
const Security = lazy(() => import('app/settings/security/Security'));
|
||||||
|
|
||||||
const AuthenticatedRouting = memo(() => {
|
const AuthenticatedRouting = memo(() => {
|
||||||
const { me } = useContext(AuthenticatedContext);
|
const { me } = useContext(AuthenticatedContext);
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
|
<Suspense fallback={<LoadingSpinner />}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/dashboard/*" element={<Dashboard />} />
|
<Route path="/dashboard/*" element={<Dashboard />} />
|
||||||
<Route path="/devices/*" element={<Devices />} />
|
<Route path="/devices/*" element={<Devices />} />
|
||||||
@@ -54,7 +59,10 @@ const AuthenticatedRouting = memo(() => {
|
|||||||
{me.admin && (
|
{me.admin && (
|
||||||
<>
|
<>
|
||||||
<Route path="/settings" element={<Settings />} />
|
<Route path="/settings" element={<Settings />} />
|
||||||
<Route path="/settings/application" element={<ApplicationSettings />} />
|
<Route
|
||||||
|
path="/settings/application"
|
||||||
|
element={<ApplicationSettings />}
|
||||||
|
/>
|
||||||
<Route path="/settings/mqtt" element={<MqttSettings />} />
|
<Route path="/settings/mqtt" element={<MqttSettings />} />
|
||||||
<Route path="/settings/ntp" element={<NTPSettings />} />
|
<Route path="/settings/ntp" element={<NTPSettings />} />
|
||||||
<Route path="/settings/ap" element={<APSettings />} />
|
<Route path="/settings/ap" element={<APSettings />} />
|
||||||
@@ -72,6 +80,7 @@ const AuthenticatedRouting = memo(() => {
|
|||||||
|
|
||||||
<Route path="/*" element={<Navigate to="/" />} />
|
<Route path="/*" element={<Navigate to="/" />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
</Suspense>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { toast } from 'react-toastify';
|
|||||||
|
|
||||||
import ForwardIcon from '@mui/icons-material/Forward';
|
import ForwardIcon from '@mui/icons-material/Forward';
|
||||||
import { Box, Button, Paper, Typography } from '@mui/material';
|
import { Box, Button, Paper, Typography } from '@mui/material';
|
||||||
import type { Theme } from '@mui/material/styles';
|
|
||||||
|
|
||||||
import * as AuthenticationApi from 'components/routing/authentication';
|
import * as AuthenticationApi from 'components/routing/authentication';
|
||||||
import { useRequest } from 'alova/client';
|
import { useRequest } from 'alova/client';
|
||||||
@@ -18,7 +17,7 @@ import { PROJECT_NAME } from 'env';
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import type { SignInRequest } from 'types';
|
import type { SignInRequest } from 'types';
|
||||||
import { onEnterCallback, updateValue } from 'utils';
|
import { onEnterCallback, updateValue } from 'utils';
|
||||||
import { SIGN_IN_REQUEST_VALIDATOR, ValidationError, validate } from 'validators';
|
import { SIGN_IN_REQUEST_VALIDATOR, validate } from 'validators';
|
||||||
|
|
||||||
const SignIn = memo(() => {
|
const SignIn = memo(() => {
|
||||||
const authenticationContext = useContext(AuthenticationContext);
|
const authenticationContext = useContext(AuthenticationContext);
|
||||||
@@ -37,7 +36,7 @@ const SignIn = memo(() => {
|
|||||||
{
|
{
|
||||||
immediate: false
|
immediate: false
|
||||||
}
|
}
|
||||||
).onSuccess((response: { data: { access_token: string } }) => {
|
).onSuccess((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
authenticationContext.signIn(response.data.access_token);
|
authenticationContext.signIn(response.data.access_token);
|
||||||
}
|
}
|
||||||
@@ -74,11 +73,12 @@ const SignIn = memo(() => {
|
|||||||
await validate(SIGN_IN_REQUEST_VALIDATOR, signInRequest);
|
await validate(SIGN_IN_REQUEST_VALIDATOR, signInRequest);
|
||||||
await signIn();
|
await signIn();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
}
|
}
|
||||||
}, [signInRequest, signIn, LL]);
|
}, [signInRequest, signIn, LL]);
|
||||||
|
|
||||||
|
// Memoize callback to prevent recreation on every render
|
||||||
const submitOnEnter = useMemo(() => onEnterCallback(signIn), [signIn]);
|
const submitOnEnter = useMemo(() => onEnterCallback(signIn), [signIn]);
|
||||||
|
|
||||||
// get rid of scrollbar
|
// get rid of scrollbar
|
||||||
@@ -92,15 +92,13 @@ const SignIn = memo(() => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={(theme: Theme) => ({
|
display="flex"
|
||||||
display: 'flex',
|
height="100vh"
|
||||||
height: '100vh',
|
margin="auto"
|
||||||
margin: 'auto',
|
padding={2}
|
||||||
padding: 2,
|
justifyContent="center"
|
||||||
justifyContent: 'center',
|
flexDirection="column"
|
||||||
flexDirection: 'column',
|
maxWidth={(theme) => theme.breakpoints.values.sm}
|
||||||
maxWidth: theme.breakpoints.values.sm
|
|
||||||
})}
|
|
||||||
>
|
>
|
||||||
<Paper
|
<Paper
|
||||||
sx={(theme) => ({
|
sx={(theme) => ({
|
||||||
@@ -113,18 +111,16 @@ const SignIn = memo(() => {
|
|||||||
width: '100%'
|
width: '100%'
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Typography sx={{ mb: 1 }} variant="h4">
|
<Typography mb={1} variant="h4">
|
||||||
{PROJECT_NAME}
|
{PROJECT_NAME}
|
||||||
</Typography>
|
</Typography>
|
||||||
<LanguageSelector />
|
<LanguageSelector />
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
mt={1}
|
||||||
mt: 1,
|
display="flex"
|
||||||
display: 'flex',
|
flexDirection="column"
|
||||||
flexDirection: 'column',
|
gap={1}
|
||||||
gap: 1,
|
alignItems="center"
|
||||||
alignItems: 'center'
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors || {}}
|
fieldErrors={fieldErrors || {}}
|
||||||
|
|||||||
@@ -310,15 +310,13 @@ const CustomEntities = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell>{ei.ram > 0 ? '' : showHex(ei.device_id as number, 2)}</Cell>
|
|
||||||
<Cell>{ei.ram > 0 ? '' : showHex(ei.type_id as number, 3)}</Cell>
|
|
||||||
<Cell>{ei.ram > 0 ? '' : ei.offset}</Cell>
|
|
||||||
<Cell>
|
<Cell>
|
||||||
{ei.ram === 1
|
{ei.ram === 1 ? '' : showHex(ei.device_id as number, 2)}
|
||||||
? 'RAM'
|
</Cell>
|
||||||
: ei.ram === 2
|
<Cell>{ei.ram === 1 ? '' : showHex(ei.type_id as number, 3)}</Cell>
|
||||||
? 'NVS'
|
<Cell>{ei.ram === 1 ? '' : ei.offset}</Cell>
|
||||||
: DeviceValueTypeNames[ei.value_type]}
|
<Cell>
|
||||||
|
{ei.ram === 1 ? 'RAM' : DeviceValueTypeNames[ei.value_type]}
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell>{formatValue(ei.value, ei.uom)}</Cell>
|
<Cell>{formatValue(ei.value, ei.uom)}</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
@@ -343,9 +341,9 @@ const CustomEntities = () => {
|
|||||||
return (
|
return (
|
||||||
<SectionContent>
|
<SectionContent>
|
||||||
{blocker ? <BlockNavigation blocker={blocker} /> : null}
|
{blocker ? <BlockNavigation blocker={blocker} /> : null}
|
||||||
<Typography sx={{ mb: 2 }} color="warning" variant="body1">
|
<Box mb={2} color="warning.main">
|
||||||
{LL.ENTITIES_HELP_1()}.
|
<Typography variant="body1">{LL.ENTITIES_HELP_1()}.</Typography>
|
||||||
</Typography>
|
</Box>
|
||||||
|
|
||||||
{renderEntity()}
|
{renderEntity()}
|
||||||
|
|
||||||
@@ -361,8 +359,8 @@ const CustomEntities = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Box sx={{ mt: 2, display: 'flex', flexWrap: 'wrap' }}>
|
<Box mt={2} display="flex" flexWrap="wrap">
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box flexGrow={1}>
|
||||||
{numChanges > 0 && (
|
{numChanges > 0 && (
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
@@ -384,7 +382,7 @@ const CustomEntities = () => {
|
|||||||
</ButtonRow>
|
</ButtonRow>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Box sx={{ flexWrap: 'nowrap', whiteSpace: 'nowrap' }}>
|
<Box flexWrap="nowrap" whiteSpace="nowrap">
|
||||||
<Button
|
<Button
|
||||||
startIcon={<AddIcon />}
|
startIcon={<AddIcon />}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import DoneIcon from '@mui/icons-material/Done';
|
|||||||
import EditOffOutlinedIcon from '@mui/icons-material/EditOffOutlined';
|
import EditOffOutlinedIcon from '@mui/icons-material/EditOffOutlined';
|
||||||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
||||||
import InsertCommentOutlinedIcon from '@mui/icons-material/InsertCommentOutlined';
|
import InsertCommentOutlinedIcon from '@mui/icons-material/InsertCommentOutlined';
|
||||||
import RemoveIcon from '@mui/icons-material/RemoveCircleOutlined';
|
import RemoveIcon from '@mui/icons-material/RemoveCircleOutline';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
@@ -28,7 +28,7 @@ import type { ValidateFieldsError } from 'async-validator';
|
|||||||
import { BlockFormControlLabel, ValidatedTextField } from 'components';
|
import { BlockFormControlLabel, ValidatedTextField } from 'components';
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import { numberValue, updateValue } from 'utils';
|
import { numberValue, updateValue } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
|
|
||||||
import { DeviceValueType, DeviceValueTypeNames, DeviceValueUOM_s } from './types';
|
import { DeviceValueType, DeviceValueTypeNames, DeviceValueUOM_s } from './types';
|
||||||
import type { EntityItem } from './types';
|
import type { EntityItem } from './types';
|
||||||
@@ -136,7 +136,7 @@ const CustomEntitiesDialog = ({
|
|||||||
}
|
}
|
||||||
onSave(processedItem);
|
onSave(processedItem);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [validator, editItem, onSave]);
|
}, [validator, editItem, onSave]);
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ const CustomEntitiesDialog = ({
|
|||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid sx={{ mt: 3 }}>
|
<Grid mt={3}>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -205,17 +205,16 @@ const CustomEntitiesDialog = ({
|
|||||||
>
|
>
|
||||||
<MenuItem value={0}>EMS-{LL.VALUE(1)}</MenuItem>
|
<MenuItem value={0}>EMS-{LL.VALUE(1)}</MenuItem>
|
||||||
<MenuItem value={1}>RAM-{LL.VALUE(1)}</MenuItem>
|
<MenuItem value={1}>RAM-{LL.VALUE(1)}</MenuItem>
|
||||||
<MenuItem value={2}>NVS-{LL.VALUE(1)}</MenuItem>
|
|
||||||
</TextField>
|
</TextField>
|
||||||
</Grid>
|
</Grid>
|
||||||
{editItem.ram > 0 && (
|
{editItem.ram === 1 && (
|
||||||
<>
|
<>
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextField
|
<TextField
|
||||||
name="value"
|
name="value"
|
||||||
label={LL.DEFAULT(0) + ' ' + LL.VALUE(0)}
|
label={LL.DEFAULT(0) + ' ' + LL.VALUE(0)}
|
||||||
type="string"
|
type="string"
|
||||||
value={editItem.value}
|
value={editItem.value as string}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
fullWidth
|
fullWidth
|
||||||
@@ -238,7 +237,7 @@ const CustomEntitiesDialog = ({
|
|||||||
)}
|
)}
|
||||||
{editItem.ram === 0 && (
|
{editItem.ram === 0 && (
|
||||||
<>
|
<>
|
||||||
<Grid sx={{ mt: 3 }}>
|
<Grid mt={3}>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -260,7 +259,7 @@ const CustomEntitiesDialog = ({
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
sx={{ width: '11ch' }}
|
sx={{ width: '11ch' }}
|
||||||
type="string"
|
type="string"
|
||||||
value={editItem.device_id}
|
value={editItem.device_id as string}
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
slotProps={{
|
slotProps={{
|
||||||
input: {
|
input: {
|
||||||
@@ -280,7 +279,7 @@ const CustomEntitiesDialog = ({
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
sx={{ width: '11ch' }}
|
sx={{ width: '11ch' }}
|
||||||
type="string"
|
type="string"
|
||||||
value={editItem.type_id}
|
value={editItem.type_id as string}
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
slotProps={{
|
slotProps={{
|
||||||
input: {
|
input: {
|
||||||
@@ -381,7 +380,7 @@ const CustomEntitiesDialog = ({
|
|||||||
fieldErrors={fieldErrors || {}}
|
fieldErrors={fieldErrors || {}}
|
||||||
name="factor"
|
name="factor"
|
||||||
label={LL.BITMASK()}
|
label={LL.BITMASK()}
|
||||||
value={editItem.factor}
|
value={editItem.factor as string}
|
||||||
sx={{ width: '11ch' }}
|
sx={{ width: '11ch' }}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
@@ -404,7 +403,7 @@ const CustomEntitiesDialog = ({
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
{!creating && (
|
{!creating && (
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box flexGrow={1}>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<RemoveIcon />}
|
startIcon={<RemoveIcon />}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
|||||||
@@ -111,14 +111,13 @@ const Customizations = () => {
|
|||||||
const [selectedDeviceTypeNameURL, setSelectedDeviceTypeNameURL] =
|
const [selectedDeviceTypeNameURL, setSelectedDeviceTypeNameURL] =
|
||||||
useState<string>(''); // needed for API URL
|
useState<string>(''); // needed for API URL
|
||||||
const [selectedDeviceName, setSelectedDeviceName] = useState<string>('');
|
const [selectedDeviceName, setSelectedDeviceName] = useState<string>('');
|
||||||
const [selectedDeviceBrand, setSelectedDeviceBrand] = useState<string>('');
|
|
||||||
|
|
||||||
const { send: sendResetCustomizations } = useRequest(resetCustomizations(), {
|
const { send: sendResetCustomizations } = useRequest(resetCustomizations(), {
|
||||||
immediate: false
|
immediate: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const { send: sendDeviceName } = useRequest(
|
const { send: sendDeviceName } = useRequest(
|
||||||
(data: { id: number; name: string; brand: string }) => writeDeviceName(data),
|
(data: { id: number; name: string }) => writeDeviceName(data),
|
||||||
{
|
{
|
||||||
immediate: false
|
immediate: false
|
||||||
}
|
}
|
||||||
@@ -268,7 +267,6 @@ const Customizations = () => {
|
|||||||
if (device) {
|
if (device) {
|
||||||
setSelectedDeviceTypeNameURL(device.url || '');
|
setSelectedDeviceTypeNameURL(device.url || '');
|
||||||
setSelectedDeviceName(device.n);
|
setSelectedDeviceName(device.n);
|
||||||
setSelectedDeviceBrand(device.b);
|
|
||||||
}
|
}
|
||||||
setNumChanges(0);
|
setNumChanges(0);
|
||||||
setRestartNeeded(false);
|
setRestartNeeded(false);
|
||||||
@@ -444,11 +442,7 @@ const Customizations = () => {
|
|||||||
}, [devices, deviceEntities, selectedDevice, sendCustomizationEntities, LL]);
|
}, [devices, deviceEntities, selectedDevice, sendCustomizationEntities, LL]);
|
||||||
|
|
||||||
const renameDevice = useCallback(async () => {
|
const renameDevice = useCallback(async () => {
|
||||||
await sendDeviceName({
|
await sendDeviceName({ id: selectedDevice, name: selectedDeviceName })
|
||||||
id: selectedDevice,
|
|
||||||
name: selectedDeviceName,
|
|
||||||
brand: selectedDeviceBrand
|
|
||||||
})
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
toast.success(LL.UPDATED_OF(LL.NAME(1)));
|
toast.success(LL.UPDATED_OF(LL.NAME(1)));
|
||||||
})
|
})
|
||||||
@@ -459,42 +453,24 @@ const Customizations = () => {
|
|||||||
setRename(false);
|
setRename(false);
|
||||||
await fetchCoreData();
|
await fetchCoreData();
|
||||||
});
|
});
|
||||||
}, [
|
}, [selectedDevice, selectedDeviceName, sendDeviceName, LL, fetchCoreData]);
|
||||||
selectedDevice,
|
|
||||||
selectedDeviceName,
|
|
||||||
selectedDeviceBrand,
|
|
||||||
sendDeviceName,
|
|
||||||
LL,
|
|
||||||
fetchCoreData
|
|
||||||
]);
|
|
||||||
|
|
||||||
const renderDeviceList = () => (
|
const renderDeviceList = () => (
|
||||||
<>
|
<>
|
||||||
<Typography sx={{ mb: 1 }} color="warning" variant="body1">
|
<Box mb={1} color="warning.main">
|
||||||
{LL.CUSTOMIZATIONS_HELP_1()}.
|
<Typography variant="body1">{LL.CUSTOMIZATIONS_HELP_1()}.</Typography>
|
||||||
</Typography>
|
</Box>
|
||||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: 2 }}>
|
<Box display="flex" flexWrap="wrap" alignItems="center" gap={2}>
|
||||||
{rename ? (
|
{rename ? (
|
||||||
<>
|
|
||||||
<TextField
|
<TextField
|
||||||
name="device"
|
name="device"
|
||||||
label={LL.EMS_DEVICE()}
|
label={LL.EMS_DEVICE()}
|
||||||
style={{ minWidth: '48%' }}
|
fullWidth
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={selectedDeviceName}
|
value={selectedDeviceName}
|
||||||
onChange={(e) => setSelectedDeviceName(e.target.value)}
|
onChange={(e) => setSelectedDeviceName(e.target.value)}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
<TextField
|
|
||||||
name="brand"
|
|
||||||
label={LL.BRAND()}
|
|
||||||
style={{ minWidth: '48%' }}
|
|
||||||
variant="outlined"
|
|
||||||
value={selectedDeviceBrand}
|
|
||||||
onChange={(e) => setSelectedDeviceBrand(e.target.value)}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
) : (
|
||||||
<TextField
|
<TextField
|
||||||
name="device"
|
name="device"
|
||||||
@@ -570,22 +546,27 @@ const Customizations = () => {
|
|||||||
const renderDeviceData = () => {
|
const renderDeviceData = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Typography sx={{ mt: 1, mb: 1 }} color="warning" variant="body2">
|
<Box color="warning.main">
|
||||||
|
<Typography variant="body2" mt={1} mb={1}>
|
||||||
<OptionIcon type="favorite" isSet={true} />={LL.CUSTOMIZATIONS_HELP_2()}
|
<OptionIcon type="favorite" isSet={true} />={LL.CUSTOMIZATIONS_HELP_2()}
|
||||||
|
|
||||||
<OptionIcon type="readonly" isSet={true} />={LL.CUSTOMIZATIONS_HELP_3()}
|
<OptionIcon type="readonly" isSet={true} />={LL.CUSTOMIZATIONS_HELP_3()}
|
||||||
|
|
||||||
<OptionIcon type="api_mqtt_exclude" isSet={true} />=
|
<OptionIcon type="api_mqtt_exclude" isSet={true} />=
|
||||||
{LL.CUSTOMIZATIONS_HELP_4()}
|
{LL.CUSTOMIZATIONS_HELP_4()}
|
||||||
<OptionIcon type="web_exclude" isSet={true} />={LL.CUSTOMIZATIONS_HELP_5()}
|
<OptionIcon type="web_exclude" isSet={true} />=
|
||||||
|
{LL.CUSTOMIZATIONS_HELP_5()}
|
||||||
<OptionIcon type="deleted" isSet={true} />={LL.CUSTOMIZATIONS_HELP_6()}
|
<OptionIcon type="deleted" isSet={true} />={LL.CUSTOMIZATIONS_HELP_6()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
</Box>
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
|
mb={1}
|
||||||
|
mt={0}
|
||||||
spacing={2}
|
spacing={2}
|
||||||
direction="row"
|
direction="row"
|
||||||
sx={{ mb: 1, mt: 0, justifyContent: 'flex-start', alignItems: 'center' }}
|
justifyContent="flex-start"
|
||||||
|
alignItems="center"
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextField
|
<TextField
|
||||||
@@ -774,8 +755,8 @@ const Customizations = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</MessageBox>
|
</MessageBox>
|
||||||
) : (
|
) : (
|
||||||
<Box sx={{ display: 'flex', flexWrap: 'wrap' }}>
|
<Box display="flex" flexWrap="wrap">
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box flexGrow={1}>
|
||||||
{numChanges !== 0 && (
|
{numChanges !== 0 && (
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ interface LabelValueProps {
|
|||||||
|
|
||||||
const LabelValue = memo(({ label, value }: LabelValueProps) => (
|
const LabelValue = memo(({ label, value }: LabelValueProps) => (
|
||||||
<Grid container direction="row">
|
<Grid container direction="row">
|
||||||
<Typography variant="body2" color="warning">
|
<Typography variant="body2" color="warning.main">
|
||||||
{label}:
|
{label}:
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2">{value}</Typography>
|
<Typography variant="body2">{value}</Typography>
|
||||||
@@ -131,7 +131,7 @@ const CustomizationsDialog = ({
|
|||||||
/>
|
/>
|
||||||
<LabelValue label={LL.WRITEABLE()} value={writeableIcon} />
|
<LabelValue label={LL.WRITEABLE()} value={writeableIcon} />
|
||||||
|
|
||||||
<Box sx={{ mt: 1, mb: 2 }}>
|
<Box mt={1} mb={2}>
|
||||||
<EntityMaskToggle onUpdate={updateDeviceEntity} de={editItem} />
|
<EntityMaskToggle onUpdate={updateDeviceEntity} de={editItem} />
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ const CustomizationsDialog = ({
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<Typography sx={{ mt: 2 }} variant="body2" color="error">
|
<Typography variant="body2" color="error" mt={2}>
|
||||||
Error: Check min and max values
|
Error: Check min and max values
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { toast } from 'react-toastify';
|
|||||||
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
||||||
import EditIcon from '@mui/icons-material/Edit';
|
import EditIcon from '@mui/icons-material/Edit';
|
||||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||||
import HelpOutlineIcon from '@mui/icons-material/HelpOutlined';
|
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
|
||||||
import UnfoldLessIcon from '@mui/icons-material/UnfoldLess';
|
import UnfoldLessIcon from '@mui/icons-material/UnfoldLess';
|
||||||
import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore';
|
import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore';
|
||||||
import {
|
import {
|
||||||
@@ -262,8 +262,12 @@ const Dashboard = memo(() => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{!data.connected && (
|
||||||
|
<MessageBox level="error" message={LL.EMS_BUS_WARNING()} />
|
||||||
|
)}
|
||||||
|
|
||||||
{data.connected && data.nodes.length > 0 && !hasFavEntities && (
|
{data.connected && data.nodes.length > 0 && !hasFavEntities && (
|
||||||
<MessageBox sx={{ mb: 2 }} level="warning">
|
<MessageBox mb={2} level="warning">
|
||||||
<Typography>
|
<Typography>
|
||||||
{LL.NO_DATA_1()}
|
{LL.NO_DATA_1()}
|
||||||
<Link to="/customizations" style={{ color: 'white' }}>
|
<Link to="/customizations" style={{ color: 'white' }}>
|
||||||
@@ -280,12 +284,10 @@ const Dashboard = memo(() => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
display="flex"
|
||||||
display: 'flex',
|
justifyContent="flex-end"
|
||||||
justifyContent: 'flex-end',
|
flexWrap="nowrap"
|
||||||
flexWrap: 'nowrap',
|
whiteSpace="nowrap"
|
||||||
whiteSpace: 'nowrap'
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<ToggleButtonGroup
|
<ToggleButtonGroup
|
||||||
size="small"
|
size="small"
|
||||||
@@ -308,7 +310,7 @@ const Dashboard = memo(() => {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{data.nodes.length > 0 ? (
|
{data.nodes.length > 0 ? (
|
||||||
<Box sx={{ mt: 1, justifyContent: 'center', flexDirection: 'column' }}>
|
<Box mt={1} justifyContent="center" flexDirection="column">
|
||||||
<IconContext.Provider
|
<IconContext.Provider
|
||||||
value={{
|
value={{
|
||||||
color: 'lightblue',
|
color: 'lightblue',
|
||||||
@@ -375,8 +377,13 @@ const Dashboard = memo(() => {
|
|||||||
</IconContext.Provider>
|
</IconContext.Provider>
|
||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<Box sx={{ display: 'flex' }}>
|
<Box
|
||||||
<Typography sx={{ mt: 1 }} color="warning" variant="body1">
|
display="flex"
|
||||||
|
// justifyContent="flex-end"
|
||||||
|
// flexWrap="nowrap"
|
||||||
|
// whiteSpace="nowrap"
|
||||||
|
>
|
||||||
|
<Typography mt={1} color="warning.main" variant="body1">
|
||||||
no data
|
no data
|
||||||
</Typography>
|
</Typography>
|
||||||
<Tooltip title={LL.DASHBOARD_1()}>
|
<Tooltip title={LL.DASHBOARD_1()}>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import type { IconType } from 'react-icons';
|
|
||||||
import { AiOutlineAlert, AiOutlineControl, AiOutlineGateway } from 'react-icons/ai';
|
import { AiOutlineAlert, AiOutlineControl, AiOutlineGateway } from 'react-icons/ai';
|
||||||
import { CgSmartHomeBoiler } from 'react-icons/cg';
|
import { CgSmartHomeBoiler } from 'react-icons/cg';
|
||||||
import { FaSolarPanel } from 'react-icons/fa';
|
import { FaSolarPanel } from 'react-icons/fa';
|
||||||
@@ -16,9 +15,14 @@ import { PiFan, PiGauge } from 'react-icons/pi';
|
|||||||
import { TiFlowSwitch, TiThermometer } from 'react-icons/ti';
|
import { TiFlowSwitch, TiThermometer } from 'react-icons/ti';
|
||||||
import { VscVmConnect } from 'react-icons/vsc';
|
import { VscVmConnect } from 'react-icons/vsc';
|
||||||
|
|
||||||
|
import type { SvgIconProps } from '@mui/material';
|
||||||
|
|
||||||
import { DeviceType } from './types';
|
import { DeviceType } from './types';
|
||||||
|
|
||||||
const deviceIconLookup: Record<DeviceType, IconType | null> = {
|
const deviceIconLookup: Record<
|
||||||
|
DeviceType,
|
||||||
|
React.ComponentType<SvgIconProps> | null
|
||||||
|
> = {
|
||||||
[DeviceType.TEMPERATURESENSOR]: TiThermometer,
|
[DeviceType.TEMPERATURESENSOR]: TiThermometer,
|
||||||
[DeviceType.ANALOGSENSOR]: PiGauge,
|
[DeviceType.ANALOGSENSOR]: PiGauge,
|
||||||
[DeviceType.BOILER]: CgSmartHomeBoiler,
|
[DeviceType.BOILER]: CgSmartHomeBoiler,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
useState
|
useState
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { IconContext } from 'react-icons';
|
import { IconContext } from 'react-icons';
|
||||||
import { Link, useNavigate } from 'react-router';
|
import { useNavigate } from 'react-router';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined';
|
import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined';
|
||||||
@@ -534,19 +534,9 @@ const Devices = memo(() => {
|
|||||||
const renderCoreData = () => (
|
const renderCoreData = () => (
|
||||||
<>
|
<>
|
||||||
{!coreData.connected ? (
|
{!coreData.connected ? (
|
||||||
<MessageBox level="error" message={LL.EMS_BUS_WARNING() + '.'}>
|
<MessageBox level="error" message={LL.EMS_BUS_WARNING()} />
|
||||||
(
|
|
||||||
<Link
|
|
||||||
target="_blank"
|
|
||||||
to="https://docs.emsesp.org/Troubleshooting#ems-bus-is-not-connecting"
|
|
||||||
style={{ color: 'white' }}
|
|
||||||
>
|
|
||||||
{LL.ONLINE_HELP()}
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
</MessageBox>
|
|
||||||
) : (
|
) : (
|
||||||
<Box sx={{ justifyContent: 'center', flexDirection: 'column' }}>
|
<Box justifyContent="center" flexDirection="column">
|
||||||
<IconContext.Provider
|
<IconContext.Provider
|
||||||
value={{
|
value={{
|
||||||
color: 'lightblue',
|
color: 'lightblue',
|
||||||
@@ -670,12 +660,12 @@ const Devices = memo(() => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={{ p: 1 }}>
|
<Box sx={{ p: 1 }}>
|
||||||
<Grid container sx={{ justifyContent: 'space-between' }}>
|
<Grid container justifyContent="space-between">
|
||||||
<Typography noWrap variant="subtitle1" color="warning">
|
<Typography noWrap variant="subtitle1" color="warning.main">
|
||||||
{deviceInfo.n} (
|
{deviceInfo.n} (
|
||||||
{deviceInfo.tn})
|
{deviceInfo.tn})
|
||||||
</Typography>
|
</Typography>
|
||||||
<Grid sx={{ justifyContent: 'flex-end' }}>
|
<Grid justifyContent="flex-end">
|
||||||
<ButtonTooltip title={LL.CLOSE()}>
|
<ButtonTooltip title={LL.CLOSE()}>
|
||||||
<IconButton onClick={resetDeviceSelect} aria-label={LL.CLOSE()}>
|
<IconButton onClick={resetDeviceSelect} aria-label={LL.CLOSE()}>
|
||||||
<HighlightOffIcon color="primary" sx={{ fontSize: 18 }} />
|
<HighlightOffIcon color="primary" sx={{ fontSize: 18 }} />
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import type { ValidateFieldsError } from 'async-validator';
|
|||||||
import { ValidatedTextField } from 'components';
|
import { ValidatedTextField } from 'components';
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import { numberValue, updateValue } from 'utils';
|
import { numberValue, updateValue } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
|
|
||||||
import { DeviceValueUOM, DeviceValueUOM_s } from './types';
|
import { DeviceValueUOM, DeviceValueUOM_s } from './types';
|
||||||
import type { DeviceValue } from './types';
|
import type { DeviceValue } from './types';
|
||||||
@@ -67,7 +67,7 @@ const DevicesDialog = ({
|
|||||||
await validate(validator, editItem);
|
await validate(validator, editItem);
|
||||||
onSave(editItem);
|
onSave(editItem);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [validator, editItem, onSave]);
|
}, [validator, editItem, onSave]);
|
||||||
|
|
||||||
@@ -128,9 +128,9 @@ const DevicesDialog = ({
|
|||||||
<Dialog sx={dialogStyle} open={open} onClose={onClose}>
|
<Dialog sx={dialogStyle} open={open} onClose={onClose}>
|
||||||
<DialogTitle>{dialogTitle}</DialogTitle>
|
<DialogTitle>{dialogTitle}</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Typography sx={{ mb: 2 }} color="warning" variant="body2">
|
<Box color="warning.main" mb={2}>
|
||||||
{editItem.id.slice(2)}
|
<Typography variant="body2">{editItem.id.slice(2)}</Typography>
|
||||||
</Typography>
|
</Box>
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid size={12}>
|
<Grid size={12}>
|
||||||
{editItem.l ? (
|
{editItem.l ? (
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Divider,
|
Divider,
|
||||||
Grid,
|
|
||||||
Link,
|
Link,
|
||||||
List,
|
List,
|
||||||
ListItem,
|
ListItem,
|
||||||
@@ -43,7 +42,7 @@ interface CustomSupport {
|
|||||||
html: string | null;
|
html: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_IMAGE_URL = 'https://emsesp.org/media/images/installer.jpeg';
|
const DEFAULT_IMAGE_URL = 'https://emsesp.org/_media/images/installer.jpeg';
|
||||||
|
|
||||||
const SUPPORT_BOX_STYLES: SxProps<Theme> = {
|
const SUPPORT_BOX_STYLES: SxProps<Theme> = {
|
||||||
borderRadius: 3,
|
borderRadius: 3,
|
||||||
@@ -72,6 +71,7 @@ const HelpComponent = () => {
|
|||||||
});
|
});
|
||||||
const [imgError, setImgError] = useState<boolean>(false);
|
const [imgError, setImgError] = useState<boolean>(false);
|
||||||
|
|
||||||
|
// Memoize the request method to prevent re-creation on every render
|
||||||
const getCustomSupportMethod = useMemo(
|
const getCustomSupportMethod = useMemo(
|
||||||
() => callAction({ action: 'getCustomSupport' }),
|
() => callAction({ action: 'getCustomSupport' }),
|
||||||
[]
|
[]
|
||||||
@@ -120,7 +120,7 @@ const HelpComponent = () => {
|
|||||||
label: () => LL.HELP_INFORMATION_1()
|
label: () => LL.HELP_INFORMATION_1()
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: 'https://discord.gg/GP9DPSgeJq',
|
href: 'https://discord.gg/3J3GgnzpyT',
|
||||||
icon: <CommentIcon />,
|
icon: <CommentIcon />,
|
||||||
label: () => LL.HELP_INFORMATION_2()
|
label: () => LL.HELP_INFORMATION_2()
|
||||||
},
|
},
|
||||||
@@ -146,9 +146,11 @@ const HelpComponent = () => {
|
|||||||
<SectionContent>
|
<SectionContent>
|
||||||
{customSupport.html && (
|
{customSupport.html && (
|
||||||
<Stack
|
<Stack
|
||||||
|
padding={1}
|
||||||
|
mb={2}
|
||||||
direction="row"
|
direction="row"
|
||||||
divider={<Divider orientation="vertical" flexItem />}
|
divider={<Divider orientation="vertical" flexItem />}
|
||||||
sx={{ padding: 1, mb: 2, ...SUPPORT_BOX_STYLES }}
|
sx={SUPPORT_BOX_STYLES}
|
||||||
>
|
>
|
||||||
<Typography variant="subtitle1">
|
<Typography variant="subtitle1">
|
||||||
<div dangerouslySetInnerHTML={{ __html: customSupport.html }} />
|
<div dangerouslySetInnerHTML={{ __html: customSupport.html }} />
|
||||||
@@ -183,9 +185,9 @@ const HelpComponent = () => {
|
|||||||
</List>
|
</List>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Grid container spacing={2} sx={{ mt: 2, alignItems: 'center' }}>
|
<Box p={2} color="warning.main">
|
||||||
<Typography sx={{ mb: 1 }} color="warning" variant="body1">
|
<Typography mb={1} variant="body1">
|
||||||
{LL.HELP_INFORMATION_4()}:
|
{LL.HELP_INFORMATION_4()}.
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<DownloadIcon />}
|
startIcon={<DownloadIcon />}
|
||||||
@@ -195,11 +197,11 @@ const HelpComponent = () => {
|
|||||||
>
|
>
|
||||||
{LL.SUPPORT_INFORMATION(0)}
|
{LL.SUPPORT_INFORMATION(0)}
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Box>
|
||||||
|
|
||||||
<Divider sx={{ mt: 4 }} />
|
<Divider sx={{ mt: 4 }} />
|
||||||
|
|
||||||
<Typography color="white" variant="subtitle1" align="center" sx={{ mt: 1 }}>
|
<Typography color="white" variant="subtitle1" align="center" mt={1}>
|
||||||
©
|
©
|
||||||
<Link
|
<Link
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
@@ -186,9 +186,9 @@ const Modules = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Typography sx={{ mb: 2 }} color="warning" variant="body1">
|
<Box mb={2} color="warning.main">
|
||||||
{LL.MODULES_DESCRIPTION()}.
|
<Typography variant="body1">{LL.MODULES_DESCRIPTION()}.</Typography>
|
||||||
</Typography>
|
</Box>
|
||||||
<Table
|
<Table
|
||||||
data={{ nodes: modules }}
|
data={{ nodes: modules }}
|
||||||
theme={modules_theme}
|
theme={modules_theme}
|
||||||
@@ -236,8 +236,8 @@ const Modules = () => {
|
|||||||
)}
|
)}
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
<Box sx={{ mt: 1, display: 'flex', flexWrap: 'wrap' }}>
|
<Box mt={1} display="flex" flexWrap="wrap">
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box flexGrow={1}>
|
||||||
{numChanges !== 0 && (
|
{numChanges !== 0 && (
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const ModulesDialog = ({
|
|||||||
label="Enabled"
|
label="Enabled"
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Box sx={{ mt: 2, mb: 1 }}>
|
<Box mt={2} mb={1}>
|
||||||
<TextField
|
<TextField
|
||||||
name="license"
|
name="license"
|
||||||
label="License Key"
|
label="License Key"
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import { memo } from 'react';
|
|||||||
|
|
||||||
import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined';
|
import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined';
|
||||||
import DeleteForeverIcon from '@mui/icons-material/DeleteForever';
|
import DeleteForeverIcon from '@mui/icons-material/DeleteForever';
|
||||||
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutlined';
|
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
||||||
import EditOffOutlinedIcon from '@mui/icons-material/EditOffOutlined';
|
import EditOffOutlinedIcon from '@mui/icons-material/EditOffOutlined';
|
||||||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
||||||
import InsertCommentOutlinedIcon from '@mui/icons-material/InsertCommentOutlined';
|
import InsertCommentOutlinedIcon from '@mui/icons-material/InsertCommentOutlined';
|
||||||
import StarIcon from '@mui/icons-material/Star';
|
import StarIcon from '@mui/icons-material/Star';
|
||||||
import StarOutlineIcon from '@mui/icons-material/StarOutlined';
|
import StarOutlineIcon from '@mui/icons-material/StarOutline';
|
||||||
import VisibilityOffOutlinedIcon from '@mui/icons-material/VisibilityOffOutlined';
|
import VisibilityOffOutlinedIcon from '@mui/icons-material/VisibilityOffOutlined';
|
||||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||||
import type { SvgIconProps } from '@mui/material';
|
import type { SvgIconProps } from '@mui/material';
|
||||||
|
|||||||
@@ -358,9 +358,9 @@ const Scheduler = () => {
|
|||||||
return (
|
return (
|
||||||
<SectionContent>
|
<SectionContent>
|
||||||
{blocker ? <BlockNavigation blocker={blocker} /> : null}
|
{blocker ? <BlockNavigation blocker={blocker} /> : null}
|
||||||
<Typography sx={{ mb: 2 }} color="warning" variant="body1">
|
<Box mb={2} color="warning.main">
|
||||||
{LL.SCHEDULER_HELP_1()}.
|
<Typography variant="body1">{LL.SCHEDULER_HELP_1()}.</Typography>
|
||||||
</Typography>
|
</Box>
|
||||||
{renderSchedule()}
|
{renderSchedule()}
|
||||||
|
|
||||||
{selectedScheduleItem && (
|
{selectedScheduleItem && (
|
||||||
@@ -375,8 +375,8 @@ const Scheduler = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Box sx={{ display: 'flex', flexWrap: 'wrap' }}>
|
<Box display="flex" flexWrap="wrap">
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box flexGrow={1}>
|
||||||
{numChanges !== 0 && (
|
{numChanges !== 0 && (
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
@@ -398,7 +398,7 @@ const Scheduler = () => {
|
|||||||
</ButtonRow>
|
</ButtonRow>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Box sx={{ flexWrap: 'nowrap', whiteSpace: 'nowrap' }}>
|
<Box flexWrap="nowrap" whiteSpace="nowrap">
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<AddIcon />}
|
startIcon={<AddIcon />}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import AddIcon from '@mui/icons-material/Add';
|
|||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
import DoneIcon from '@mui/icons-material/Done';
|
import DoneIcon from '@mui/icons-material/Done';
|
||||||
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
||||||
import RemoveIcon from '@mui/icons-material/RemoveCircleOutlined';
|
import RemoveIcon from '@mui/icons-material/RemoveCircleOutline';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
@@ -26,7 +26,7 @@ import type { ValidateFieldsError } from 'async-validator';
|
|||||||
import { BlockFormControlLabel, ValidatedTextField } from 'components';
|
import { BlockFormControlLabel, ValidatedTextField } from 'components';
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import { updateValue } from 'utils';
|
import { updateValue } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
|
|
||||||
import { ScheduleFlag } from './types';
|
import { ScheduleFlag } from './types';
|
||||||
import type { ScheduleItem } from './types';
|
import type { ScheduleItem } from './types';
|
||||||
@@ -120,7 +120,7 @@ const SchedulerDialog = ({
|
|||||||
await validate(validator, itemToSave);
|
await validate(validator, itemToSave);
|
||||||
onSave(itemToSave);
|
onSave(itemToSave);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[validator, onSave]
|
[validator, onSave]
|
||||||
@@ -338,13 +338,11 @@ const SchedulerDialog = ({
|
|||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
/>
|
/>
|
||||||
{isTimerSchedule && (
|
{isTimerSchedule && (
|
||||||
<Typography
|
<Box color="warning.main" ml={2} mt={4}>
|
||||||
sx={{ ml: 2, mt: 4 }}
|
<Typography variant="body2">
|
||||||
color="warning"
|
|
||||||
variant="body2"
|
|
||||||
>
|
|
||||||
{LL.SCHEDULER_HELP_2()}
|
{LL.SCHEDULER_HELP_2()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
</Box>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
@@ -393,7 +391,7 @@ const SchedulerDialog = ({
|
|||||||
|
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
{!creating && (
|
{!creating && (
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box flexGrow={1}>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<RemoveIcon />}
|
startIcon={<RemoveIcon />}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ const Sensors = () => {
|
|||||||
|
|
||||||
const addAnalogSensor = useCallback(() => {
|
const addAnalogSensor = useCallback(() => {
|
||||||
if (firstAvailableGPIO.current === undefined) {
|
if (firstAvailableGPIO.current === undefined) {
|
||||||
toast.error(LL.NO_GPIO());
|
toast.error('No available GPIO found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setCreating(true);
|
setCreating(true);
|
||||||
@@ -591,14 +591,7 @@ const Sensors = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{sensorData?.analog_enabled === true && me.admin && (
|
{sensorData?.analog_enabled === true && me.admin && (
|
||||||
<Box
|
<Box mt={2} display="flex" flexWrap="wrap" justifyContent="flex-end">
|
||||||
sx={{
|
|
||||||
mt: 2,
|
|
||||||
display: 'flex',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
justifyContent: 'flex-end'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|||||||
|
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
import DoneIcon from '@mui/icons-material/Done';
|
import DoneIcon from '@mui/icons-material/Done';
|
||||||
import RemoveIcon from '@mui/icons-material/RemoveCircleOutlined';
|
import RemoveIcon from '@mui/icons-material/RemoveCircleOutline';
|
||||||
import WarningIcon from '@mui/icons-material/Warning';
|
import WarningIcon from '@mui/icons-material/Warning';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
@@ -23,7 +23,7 @@ import type { ValidateFieldsError } from 'async-validator';
|
|||||||
import { ValidatedTextField } from 'components';
|
import { ValidatedTextField } from 'components';
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import { numberValue, updateValue } from 'utils';
|
import { numberValue, updateValue } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
|
|
||||||
import { AnalogType, AnalogTypeNames, DeviceValueUOM_s } from './types';
|
import { AnalogType, AnalogTypeNames, DeviceValueUOM_s } from './types';
|
||||||
import type { AnalogSensor } from './types';
|
import type { AnalogSensor } from './types';
|
||||||
@@ -172,7 +172,7 @@ const SensorsAnalogDialog = ({
|
|||||||
await validate(validator, editItem);
|
await validate(validator, editItem);
|
||||||
onSave(editItem);
|
onSave(editItem);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [validator, editItem, onSave]);
|
}, [validator, editItem, onSave]);
|
||||||
|
|
||||||
@@ -479,7 +479,7 @@ const SensorsAnalogDialog = ({
|
|||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
{fieldErrors && Object.keys(fieldErrors).length > 0 && (
|
{fieldErrors && Object.keys(fieldErrors).length > 0 && (
|
||||||
<Box sx={{ mt: 1 }}>
|
<Box mt={1}>
|
||||||
{Object.values(fieldErrors).map((errArr, idx) =>
|
{Object.values(fieldErrors).map((errArr, idx) =>
|
||||||
Array.isArray(errArr)
|
Array.isArray(errArr)
|
||||||
? errArr.map((err, j) => (
|
? errArr.map((err, j) => (
|
||||||
@@ -487,7 +487,7 @@ const SensorsAnalogDialog = ({
|
|||||||
key={`${idx}-${j}`}
|
key={`${idx}-${j}`}
|
||||||
color="error"
|
color="error"
|
||||||
variant="caption"
|
variant="caption"
|
||||||
sx={{ display: 'block' }}
|
display="block"
|
||||||
>
|
>
|
||||||
{err.message}
|
{err.message}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -498,7 +498,7 @@ const SensorsAnalogDialog = ({
|
|||||||
)}
|
)}
|
||||||
{editItem.s && (
|
{editItem.s && (
|
||||||
<Grid>
|
<Grid>
|
||||||
<Typography sx={{ mt: 1 }} color="warning" variant="body2">
|
<Typography mt={1} color="warning.main" variant="body2">
|
||||||
<WarningIcon
|
<WarningIcon
|
||||||
fontSize="small"
|
fontSize="small"
|
||||||
sx={{ mr: 1, verticalAlign: 'middle' }}
|
sx={{ mr: 1, verticalAlign: 'middle' }}
|
||||||
@@ -511,7 +511,7 @@ const SensorsAnalogDialog = ({
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
{!creating && (
|
{!creating && (
|
||||||
<Box sx={{ flexGrow: 1, '& button': { mt: 0 } }}>
|
<Box flexGrow={1} sx={{ '& button': { mt: 0 } }}>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<RemoveIcon />}
|
startIcon={<RemoveIcon />}
|
||||||
disabled={editItem.s}
|
disabled={editItem.s}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import CancelIcon from '@mui/icons-material/Cancel';
|
|||||||
import DoneIcon from '@mui/icons-material/Done';
|
import DoneIcon from '@mui/icons-material/Done';
|
||||||
import WarningIcon from '@mui/icons-material/Warning';
|
import WarningIcon from '@mui/icons-material/Warning';
|
||||||
import {
|
import {
|
||||||
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogActions,
|
DialogActions,
|
||||||
@@ -21,7 +22,7 @@ import type { ValidateFieldsError } from 'async-validator';
|
|||||||
import { ValidatedTextField } from 'components';
|
import { ValidatedTextField } from 'components';
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import { numberValue, updateValue } from 'utils';
|
import { numberValue, updateValue } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
|
|
||||||
import type { TemperatureSensor } from './types';
|
import type { TemperatureSensor } from './types';
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ const SensorsTemperatureDialog = ({
|
|||||||
await validate(validator, editItem);
|
await validate(validator, editItem);
|
||||||
onSave(editItem);
|
onSave(editItem);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [validator, editItem, onSave]);
|
}, [validator, editItem, onSave]);
|
||||||
|
|
||||||
@@ -110,9 +111,11 @@ const SensorsTemperatureDialog = ({
|
|||||||
<Dialog sx={dialogStyle} open={open} onClose={handleClose}>
|
<Dialog sx={dialogStyle} open={open} onClose={handleClose}>
|
||||||
<DialogTitle>{dialogTitle}</DialogTitle>
|
<DialogTitle>{dialogTitle}</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Typography sx={{ mb: 2 }} color="warning" variant="body2">
|
<Box color="warning.main" mb={2}>
|
||||||
|
<Typography variant="body2">
|
||||||
{LL.ID_OF(LL.SENSOR(0))}: {editItem.id}
|
{LL.ID_OF(LL.SENSOR(0))}: {editItem.id}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
</Box>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
<Grid>
|
<Grid>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
@@ -139,7 +142,7 @@ const SensorsTemperatureDialog = ({
|
|||||||
</Grid>
|
</Grid>
|
||||||
{editItem.s && (
|
{editItem.s && (
|
||||||
<Grid>
|
<Grid>
|
||||||
<Typography sx={{ mt: 1 }} color="warning" variant="body2">
|
<Typography mt={1} color="warning.main" variant="body2">
|
||||||
<WarningIcon
|
<WarningIcon
|
||||||
fontSize="small"
|
fontSize="small"
|
||||||
sx={{ mr: 1, verticalAlign: 'middle' }}
|
sx={{ mr: 1, verticalAlign: 'middle' }}
|
||||||
|
|||||||
@@ -41,12 +41,8 @@ const UserProfileComponent = () => {
|
|||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
<Box sx={{ mt: 2, mb: 2, display: 'flex', alignItems: 'center' }}>
|
<Box mt={2} mb={2} display="flex" alignItems="center">
|
||||||
<Typography
|
<Typography mr={2} variant="body1" align="center">
|
||||||
sx={{ mr: 2, textAlign: 'center' }}
|
|
||||||
color="warning"
|
|
||||||
variant="body1"
|
|
||||||
>
|
|
||||||
{LL.LANGUAGE()}:
|
{LL.LANGUAGE()}:
|
||||||
</Typography>
|
</Typography>
|
||||||
<LanguageSelector />
|
<LanguageSelector />
|
||||||
|
|||||||
@@ -43,16 +43,6 @@ export interface Settings {
|
|||||||
modbus_port: number;
|
modbus_port: number;
|
||||||
modbus_max_clients: number;
|
modbus_max_clients: number;
|
||||||
modbus_timeout: number;
|
modbus_timeout: number;
|
||||||
email_enabled: boolean;
|
|
||||||
email_ssl?: boolean;
|
|
||||||
email_starttls?: boolean;
|
|
||||||
email_server: string;
|
|
||||||
email_port: number;
|
|
||||||
email_login: string;
|
|
||||||
email_pass: string;
|
|
||||||
email_sender: string;
|
|
||||||
email_recp: string;
|
|
||||||
email_subject: string;
|
|
||||||
developer_mode: boolean;
|
developer_mode: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { useI18nContext } from 'i18n/i18n-react';
|
|||||||
import type { APSettingsType } from 'types';
|
import type { APSettingsType } from 'types';
|
||||||
import { APProvisionMode } from 'types';
|
import { APProvisionMode } from 'types';
|
||||||
import { numberValue, updateValueDirty, useRest } from 'utils';
|
import { numberValue, updateValueDirty, useRest } from 'utils';
|
||||||
import { ValidationError, createAPSettingsValidator, validate } from 'validators';
|
import { createAPSettingsValidator, validate } from 'validators';
|
||||||
|
|
||||||
export const isAPEnabled = ({ provision_mode }: APSettingsType) =>
|
export const isAPEnabled = ({ provision_mode }: APSettingsType) =>
|
||||||
provision_mode === APProvisionMode.AP_MODE_ALWAYS ||
|
provision_mode === APProvisionMode.AP_MODE_ALWAYS ||
|
||||||
@@ -86,7 +86,7 @@ const APSettings = () => {
|
|||||||
await validate(createAPSettingsValidator(data), data);
|
await validate(createAPSettingsValidator(data), data);
|
||||||
await saveData();
|
await saveData();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [data, saveData]);
|
}, [data, saveData]);
|
||||||
|
|
||||||
|
|||||||
@@ -28,13 +28,12 @@ import {
|
|||||||
FormLoader,
|
FormLoader,
|
||||||
MessageBox,
|
MessageBox,
|
||||||
SectionContent,
|
SectionContent,
|
||||||
ValidatedPasswordField,
|
|
||||||
ValidatedTextField,
|
ValidatedTextField,
|
||||||
useLayoutTitle
|
useLayoutTitle
|
||||||
} from 'components';
|
} from 'components';
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import { numberValue, updateValueDirty, useRest } from 'utils';
|
import { numberValue, updateValueDirty, useRest } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
|
|
||||||
import { API, getBoardProfile, readSettings, writeSettings } from '../../api/app';
|
import { API, getBoardProfile, readSettings, writeSettings } from '../../api/app';
|
||||||
import { BOARD_PROFILES } from '../main/types';
|
import { BOARD_PROFILES } from '../main/types';
|
||||||
@@ -154,7 +153,7 @@ const ApplicationSettings = () => {
|
|||||||
setFieldErrors(undefined);
|
setFieldErrors(undefined);
|
||||||
await validate(createSettingsValidator(data), data);
|
await validate(createSettingsValidator(data), data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
} finally {
|
} finally {
|
||||||
await saveData();
|
await saveData();
|
||||||
}
|
}
|
||||||
@@ -352,156 +351,6 @@ const ApplicationSettings = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
<Typography color="secondary">eMail</Typography>
|
|
||||||
<BlockFormControlLabel
|
|
||||||
control={
|
|
||||||
<Checkbox
|
|
||||||
checked={data.email_enabled}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
name="email_enabled"
|
|
||||||
disabled={!hardwareData.psram}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label={
|
|
||||||
<Typography color={!hardwareData.psram ? 'grey' : 'default'}>
|
|
||||||
Enable eMail notification
|
|
||||||
{!hardwareData.psram && (
|
|
||||||
<Typography variant="caption">
|
|
||||||
({LL.IS_REQUIRED('PSRAM')})
|
|
||||||
</Typography>
|
|
||||||
)}
|
|
||||||
</Typography>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
{data.email_enabled && (
|
|
||||||
<>
|
|
||||||
<Grid
|
|
||||||
container
|
|
||||||
spacing={2}
|
|
||||||
direction="row"
|
|
||||||
justifyContent="flex-start"
|
|
||||||
alignItems="flex-start"
|
|
||||||
>
|
|
||||||
<Grid>
|
|
||||||
<ValidatedTextField
|
|
||||||
fieldErrors={fieldErrors || {}}
|
|
||||||
name="email_server"
|
|
||||||
label="SMTP Server"
|
|
||||||
variant="outlined"
|
|
||||||
value={data.email_server}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<ValidatedTextField
|
|
||||||
fieldErrors={fieldErrors || {}}
|
|
||||||
sx={{ width: '12ch' }}
|
|
||||||
name="email_port"
|
|
||||||
variant="outlined"
|
|
||||||
label="Port"
|
|
||||||
value={numberValue(data.email_port)}
|
|
||||||
type="number"
|
|
||||||
onChange={updateFormValue}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid size={4} mt={!data.email_ssl && !data.email_starttls ? 0 : 3}>
|
|
||||||
{!data.email_starttls && (
|
|
||||||
<BlockFormControlLabel
|
|
||||||
sx={{ width: '12ch' }}
|
|
||||||
control={
|
|
||||||
<Checkbox
|
|
||||||
checked={data.email_ssl}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
name="email_ssl"
|
|
||||||
disabled={
|
|
||||||
data.email_starttls || data.email_ssl === undefined
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label="SSL/TLS"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{!data.email_ssl && (
|
|
||||||
<BlockFormControlLabel
|
|
||||||
sx={{ width: '12ch' }}
|
|
||||||
control={
|
|
||||||
<Checkbox
|
|
||||||
checked={data.email_starttls}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
name="email_starttls"
|
|
||||||
disabled={
|
|
||||||
data.email_ssl || data.email_starttls === undefined
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label="STARTTLS"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
<Grid container spacing={2} rowSpacing={0}>
|
|
||||||
<Grid>
|
|
||||||
<ValidatedTextField
|
|
||||||
fieldErrors={fieldErrors || {}}
|
|
||||||
name="email_login"
|
|
||||||
label="Login"
|
|
||||||
variant="outlined"
|
|
||||||
value={data.email_login}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<ValidatedPasswordField
|
|
||||||
fieldErrors={fieldErrors || {}}
|
|
||||||
name="email_pass"
|
|
||||||
label="Password"
|
|
||||||
variant="outlined"
|
|
||||||
value={data.email_pass}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
<Grid container spacing={2} rowSpacing={0}>
|
|
||||||
<Grid>
|
|
||||||
<ValidatedTextField
|
|
||||||
fieldErrors={fieldErrors || {}}
|
|
||||||
name="email_sender"
|
|
||||||
label="From"
|
|
||||||
variant="outlined"
|
|
||||||
value={data.email_sender}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<ValidatedTextField
|
|
||||||
fieldErrors={fieldErrors || {}}
|
|
||||||
name="email_recp"
|
|
||||||
label="To"
|
|
||||||
variant="outlined"
|
|
||||||
value={data.email_recp}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<ValidatedTextField
|
|
||||||
fieldErrors={fieldErrors || {}}
|
|
||||||
name="email_subject"
|
|
||||||
label="Subject"
|
|
||||||
variant="outlined"
|
|
||||||
value={data.email_subject}
|
|
||||||
onChange={updateFormValue}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<Typography sx={{ pb: 1, pt: 2 }} variant="h6" color="primary">
|
<Typography sx={{ pb: 1, pt: 2 }} variant="h6" color="primary">
|
||||||
{LL.SENSORS()}
|
{LL.SENSORS()}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -922,7 +771,7 @@ const ApplicationSettings = () => {
|
|||||||
label={LL.REMOTE_TIMEOUT_EN()}
|
label={LL.REMOTE_TIMEOUT_EN()}
|
||||||
/>
|
/>
|
||||||
{data.remote_timeout_en && (
|
{data.remote_timeout_en && (
|
||||||
<Box sx={{ mt: 2 }}>
|
<Box mt={2}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors || {}}
|
fieldErrors={fieldErrors || {}}
|
||||||
name="remote_timeout"
|
name="remote_timeout"
|
||||||
|
|||||||
@@ -1,23 +1,12 @@
|
|||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
|
||||||
import DownloadIcon from '@mui/icons-material/GetApp';
|
import DownloadIcon from '@mui/icons-material/GetApp';
|
||||||
import WarningIcon from '@mui/icons-material/Warning';
|
import { Box, Button, Grid, Typography } from '@mui/material';
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Dialog,
|
|
||||||
DialogActions,
|
|
||||||
DialogContent,
|
|
||||||
DialogTitle,
|
|
||||||
Grid,
|
|
||||||
Typography
|
|
||||||
} from '@mui/material';
|
|
||||||
|
|
||||||
import * as SystemApi from 'api/system';
|
import * as SystemApi from 'api/system';
|
||||||
import { API, callAction } from 'api/app';
|
import { API, callAction } from 'api/app';
|
||||||
|
|
||||||
import { dialogStyle } from '@/CustomTheme';
|
|
||||||
import { useRequest } from 'alova/client';
|
import { useRequest } from 'alova/client';
|
||||||
import type { APIcall } from 'app/main/types';
|
import type { APIcall } from 'app/main/types';
|
||||||
import SystemMonitor from 'app/status/SystemMonitor';
|
import SystemMonitor from 'app/status/SystemMonitor';
|
||||||
@@ -30,11 +19,16 @@ import {
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import { saveFile } from 'utils';
|
import { saveFile } from 'utils';
|
||||||
|
|
||||||
|
interface DownloadButton {
|
||||||
|
key: string;
|
||||||
|
type: string;
|
||||||
|
label: string | number;
|
||||||
|
isGridButton: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
const DownloadUpload = () => {
|
const DownloadUpload = () => {
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
|
|
||||||
const [confirmBackup, setConfirmBackup] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const [restarting, setRestarting] = useState<boolean>(false);
|
const [restarting, setRestarting] = useState<boolean>(false);
|
||||||
|
|
||||||
const { send: sendExportData } = useRequest(
|
const { send: sendExportData } = useRequest(
|
||||||
@@ -69,50 +63,45 @@ const DownloadUpload = () => {
|
|||||||
|
|
||||||
useLayoutTitle(LL.DOWNLOAD_UPLOAD());
|
useLayoutTitle(LL.DOWNLOAD_UPLOAD());
|
||||||
|
|
||||||
const handleCloseBackupDialog = useCallback(() => {
|
const downloadButtons: DownloadButton[] = useMemo(
|
||||||
setConfirmBackup(false);
|
() => [
|
||||||
}, []);
|
{
|
||||||
|
key: 'settings',
|
||||||
const renderBackupDialog = useMemo(
|
type: 'settings',
|
||||||
() => (
|
label: LL.SETTINGS_OF(LL.APPLICATION()),
|
||||||
<Dialog
|
isGridButton: true
|
||||||
sx={dialogStyle}
|
},
|
||||||
open={confirmBackup}
|
{
|
||||||
onClose={handleCloseBackupDialog}
|
key: 'customizations',
|
||||||
>
|
type: 'customizations',
|
||||||
<DialogTitle>{LL.DOWNLOAD_SYSTEM_BACKUP()}</DialogTitle>
|
label: LL.CUSTOMIZATIONS(),
|
||||||
<DialogContent dividers>
|
isGridButton: true
|
||||||
<WarningIcon color="warning" sx={{ fontSize: 18 }} />
|
},
|
||||||
|
{
|
||||||
{LL.WARNING_SYSTEM_BACKUP()}
|
key: 'entities',
|
||||||
</DialogContent>
|
type: 'entities',
|
||||||
<DialogActions>
|
label: LL.CUSTOM_ENTITIES(0),
|
||||||
<Button
|
isGridButton: true
|
||||||
startIcon={<CancelIcon />}
|
},
|
||||||
variant="outlined"
|
{
|
||||||
onClick={handleCloseBackupDialog}
|
key: 'schedule',
|
||||||
color="secondary"
|
type: 'schedule',
|
||||||
>
|
label: LL.SCHEDULE(0),
|
||||||
{LL.CANCEL()}
|
isGridButton: true
|
||||||
</Button>
|
},
|
||||||
<Button
|
{
|
||||||
startIcon={<DownloadIcon />}
|
key: 'allvalues',
|
||||||
variant="outlined"
|
type: 'allvalues',
|
||||||
onClick={() => handleDownload('systembackup')()}
|
label: LL.ALLVALUES(),
|
||||||
color="primary"
|
isGridButton: false
|
||||||
>
|
}
|
||||||
{LL.DOWNLOAD(0)}
|
],
|
||||||
</Button>
|
[LL]
|
||||||
</DialogActions>
|
|
||||||
</Dialog>
|
|
||||||
),
|
|
||||||
[confirmBackup, handleCloseBackupDialog, LL]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleDownload = useCallback(
|
const handleDownload = useCallback(
|
||||||
(type: string) => () => {
|
(type: string) => () => {
|
||||||
void sendExportData(type);
|
void sendExportData(type);
|
||||||
setConfirmBackup(false);
|
|
||||||
},
|
},
|
||||||
[sendExportData]
|
[sendExportData]
|
||||||
);
|
);
|
||||||
@@ -129,57 +118,58 @@ const DownloadUpload = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gridButtons = downloadButtons.filter((btn) => btn.isGridButton);
|
||||||
|
const standaloneButton = downloadButtons.find((btn) => !btn.isGridButton);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SectionContent>
|
<SectionContent>
|
||||||
{renderBackupDialog}
|
|
||||||
|
|
||||||
<Typography sx={{ pb: 2 }} variant="h6" color="primary">
|
<Typography sx={{ pb: 2 }} variant="h6" color="primary">
|
||||||
{LL.DOWNLOAD(0)}
|
{LL.DOWNLOAD(0)}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Grid
|
<Typography mb={1} variant="body1" color="warning">
|
||||||
container
|
{LL.DOWNLOAD_SETTINGS_TEXT()}.
|
||||||
spacing={2}
|
|
||||||
sx={{
|
|
||||||
alignItems: 'center'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography variant="body1" color="warning">
|
|
||||||
{LL.DOWNLOAD_SETTINGS_TEXT()}:
|
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
|
<Grid container spacing={2}>
|
||||||
|
{gridButtons.map((button) => (
|
||||||
|
<Grid key={button.key}>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<DownloadIcon />}
|
startIcon={<DownloadIcon />}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => setConfirmBackup(true)}
|
onClick={handleDownload(button.type)}
|
||||||
>
|
>
|
||||||
{LL.DOWNLOAD_SYSTEM_BACKUP()}
|
{button.label}
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
))}
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Grid container spacing={2} sx={{ mt: 2, alignItems: 'center' }}>
|
<Typography mt={2} mb={1} variant="body1" color="warning">
|
||||||
<Typography variant="body1" color="warning">
|
{LL.DOWNLOAD_SETTINGS_TEXT2()}.
|
||||||
{LL.DOWNLOAD_SETTINGS_TEXT2()}:
|
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
|
{standaloneButton && (
|
||||||
<Button
|
<Button
|
||||||
startIcon={<DownloadIcon />}
|
startIcon={<DownloadIcon />}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={handleDownload('allvalues')}
|
onClick={handleDownload(standaloneButton.type)}
|
||||||
>
|
>
|
||||||
{LL.ALLVALUES()}
|
{standaloneButton.label}
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
)}
|
||||||
|
|
||||||
<Typography sx={{ pt: 2, pb: 2 }} variant="h6" color="primary">
|
<Typography sx={{ pt: 2, pb: 2 }} variant="h6" color="primary">
|
||||||
{LL.UPLOAD()}
|
{LL.UPLOAD()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Typography sx={{ pb: 2 }} color="warning" variant="body1">
|
<Box color="warning.main" sx={{ pb: 2 }}>
|
||||||
{LL.UPLOAD_TEXT()}:
|
<Typography variant="body1">{LL.UPLOAD_TEXT()}.</Typography>
|
||||||
</Typography>
|
</Box>
|
||||||
|
|
||||||
<SingleUpload doRestart={doRestart} />
|
<SingleUpload text={LL.UPLOAD_DRAG()} doRestart={doRestart} />
|
||||||
</SectionContent>
|
</SectionContent>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import type { MqttSettingsType } from 'types';
|
import type { MqttSettingsType } from 'types';
|
||||||
import { numberValue, updateValueDirty, useRest } from 'utils';
|
import { numberValue, updateValueDirty, useRest } from 'utils';
|
||||||
import { ValidationError, createMqttSettingsValidator, validate } from 'validators';
|
import { createMqttSettingsValidator, validate } from 'validators';
|
||||||
|
|
||||||
import { callAction } from '../../api/app';
|
import { callAction } from '../../api/app';
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ const MqttSettings = () => {
|
|||||||
await validate(createMqttSettingsValidator(data), data);
|
await validate(createMqttSettingsValidator(data), data);
|
||||||
await saveData();
|
await saveData();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [data, saveData]);
|
}, [data, saveData]);
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ const MqttSettings = () => {
|
|||||||
<SectionContent>
|
<SectionContent>
|
||||||
{blocker ? <BlockNavigation blocker={blocker} /> : null}
|
{blocker ? <BlockNavigation blocker={blocker} /> : null}
|
||||||
<>
|
<>
|
||||||
<Box sx={{ display: 'flex', gap: 2, mb: 1 }}>
|
<Box display="flex" gap={2} mb={1}>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import {
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import type { NTPSettingsType, Time } from 'types';
|
import type { NTPSettingsType, Time } from 'types';
|
||||||
import { formatLocalDateTime, updateValueDirty, useRest } from 'utils';
|
import { formatLocalDateTime, updateValueDirty, useRest } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
import { NTP_SETTINGS_VALIDATOR } from 'validators/ntp';
|
import { NTP_SETTINGS_VALIDATOR } from 'validators/ntp';
|
||||||
|
|
||||||
import { TIME_ZONES, selectedTimeZone, useTimeZoneSelectItems } from './TZ';
|
import { TIME_ZONES, selectedTimeZone, useTimeZoneSelectItems } from './TZ';
|
||||||
@@ -133,7 +133,7 @@ const NTPSettings = () => {
|
|||||||
await validate(NTP_SETTINGS_VALIDATOR, data);
|
await validate(NTP_SETTINGS_VALIDATOR, data);
|
||||||
await saveData();
|
await saveData();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [data, saveData]);
|
}, [data, saveData]);
|
||||||
|
|
||||||
@@ -193,9 +193,9 @@ const NTPSettings = () => {
|
|||||||
{timeZoneItems}
|
{timeZoneItems}
|
||||||
</ValidatedTextField>
|
</ValidatedTextField>
|
||||||
|
|
||||||
<Box sx={{ display: 'flex', flexWrap: 'wrap' }}>
|
<Box display="flex" flexWrap="wrap">
|
||||||
{!data.enabled && !dirtyFlags.length && (
|
{!data.enabled && !dirtyFlags.length && (
|
||||||
<Box sx={{ flexWrap: 'nowrap', whiteSpace: 'nowrap' }}>
|
<Box flexWrap="nowrap" whiteSpace="nowrap">
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
onClick={openSetTime}
|
onClick={openSetTime}
|
||||||
@@ -259,9 +259,9 @@ const NTPSettings = () => {
|
|||||||
<Dialog sx={dialogStyle} open={settingTime} onClose={handleCloseSetTime}>
|
<Dialog sx={dialogStyle} open={settingTime} onClose={handleCloseSetTime}>
|
||||||
<DialogTitle>{LL.SET_TIME(1)}</DialogTitle>
|
<DialogTitle>{LL.SET_TIME(1)}</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Typography color="warning" variant="body2">
|
<Box color="warning.main" p={0} pl={0} pr={0} mt={0} mb={2}>
|
||||||
{LL.SET_TIME_TEXT()}
|
<Typography variant="body2">{LL.SET_TIME_TEXT()}</Typography>
|
||||||
</Typography>
|
</Box>
|
||||||
<TextField
|
<TextField
|
||||||
label={LL.LOCAL_TIME(0)}
|
label={LL.LOCAL_TIME(0)}
|
||||||
type="datetime-local"
|
type="datetime-local"
|
||||||
|
|||||||
@@ -156,13 +156,11 @@ const Settings = () => {
|
|||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
mt={2}
|
||||||
mt: 2,
|
display="flex"
|
||||||
display: 'flex',
|
justifyContent="flex-end"
|
||||||
justifyContent: 'flex-end',
|
flexWrap="nowrap"
|
||||||
flexWrap: 'nowrap',
|
whiteSpace="nowrap"
|
||||||
whiteSpace: 'nowrap'
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<SettingsBackupRestoreIcon />}
|
startIcon={<SettingsBackupRestoreIcon />}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import {
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import type { NetworkSettingsType } from 'types';
|
import type { NetworkSettingsType } from 'types';
|
||||||
import { updateValueDirty, useRest } from 'utils';
|
import { updateValueDirty, useRest } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
import { createNetworkSettingsValidator } from 'validators/network';
|
import { createNetworkSettingsValidator } from 'validators/network';
|
||||||
|
|
||||||
import SystemMonitor from '../../status/SystemMonitor';
|
import SystemMonitor from '../../status/SystemMonitor';
|
||||||
@@ -116,7 +116,7 @@ const NetworkSettings = () => {
|
|||||||
await validate(createNetworkSettingsValidator(data), data);
|
await validate(createNetworkSettingsValidator(data), data);
|
||||||
await saveData();
|
await saveData();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
deselectNetwork();
|
deselectNetwork();
|
||||||
}, [data, saveData, deselectNetwork]);
|
}, [data, saveData, deselectNetwork]);
|
||||||
|
|||||||
@@ -54,27 +54,19 @@ const GenerateToken = ({ username, onClose }: GenerateTokenProps) => {
|
|||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
{token ? (
|
{token ? (
|
||||||
<>
|
<>
|
||||||
<MessageBox
|
<MessageBox message={LL.ACCESS_TOKEN_TEXT()} level="info" my={2} />
|
||||||
message={LL.ACCESS_TOKEN_TEXT()}
|
<Box mt={2} mb={2}>
|
||||||
level="info"
|
|
||||||
sx={{ mt: 2, mb: 2 }}
|
|
||||||
/>
|
|
||||||
<Box sx={{ mt: 2, mb: 2 }}>
|
|
||||||
<TextField
|
<TextField
|
||||||
label="Token"
|
label="Token"
|
||||||
multiline
|
multiline
|
||||||
value={token.token}
|
value={token.token}
|
||||||
fullWidth
|
fullWidth
|
||||||
slotProps={{
|
contentEditable={false}
|
||||||
input: {
|
|
||||||
readOnly: true
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Box sx={{ m: 4, textAlign: 'center' }}>
|
<Box m={4} textAlign="center">
|
||||||
<LinearProgress />
|
<LinearProgress />
|
||||||
<Typography variant="h6">{LL.GENERATING_TOKEN()}…</Typography>
|
<Typography variant="h6">{LL.GENERATING_TOKEN()}…</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -240,16 +240,12 @@ const ManageUsers = () => {
|
|||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
{noAdminConfigured() && (
|
{noAdminConfigured() && (
|
||||||
<MessageBox
|
<MessageBox level="warning" message={LL.USER_WARNING()} my={2} />
|
||||||
level="warning"
|
|
||||||
message={LL.USER_WARNING()}
|
|
||||||
sx={{ mt: 2, mb: 2 }}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Box sx={{ display: 'flex', flexWrap: 'wrap' }}>
|
<Box display="flex" flexWrap="wrap">
|
||||||
{changed !== 0 && (
|
{changed !== 0 && (
|
||||||
<Box sx={{ flexGrow: 1, '& button': { mt: 2 } }}>
|
<Box flexGrow={1} sx={{ '& button': { mt: 2 } }}>
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<CancelIcon />}
|
startIcon={<CancelIcon />}
|
||||||
@@ -274,7 +270,7 @@ const ManageUsers = () => {
|
|||||||
</ButtonRow>
|
</ButtonRow>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<Box sx={{ flexWrap: 'nowrap', whiteSpace: 'nowrap' }}>
|
<Box flexWrap="nowrap" whiteSpace="nowrap">
|
||||||
<ButtonRow>
|
<ButtonRow>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<PersonAddIcon />}
|
startIcon={<PersonAddIcon />}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { AuthenticatedContext } from 'contexts/authentication';
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import type { SecuritySettingsType } from 'types';
|
import type { SecuritySettingsType } from 'types';
|
||||||
import { updateValueDirty, useRest } from 'utils';
|
import { updateValueDirty, useRest } from 'utils';
|
||||||
import { SECURITY_SETTINGS_VALIDATOR, ValidationError, validate } from 'validators';
|
import { SECURITY_SETTINGS_VALIDATOR, validate } from 'validators';
|
||||||
|
|
||||||
const SecuritySettings = () => {
|
const SecuritySettings = () => {
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
@@ -58,7 +58,7 @@ const SecuritySettings = () => {
|
|||||||
await saveData();
|
await saveData();
|
||||||
await authenticatedContext.refresh();
|
await authenticatedContext.refresh();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}, [data, saveData, authenticatedContext]);
|
}, [data, saveData, authenticatedContext]);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
import type { UserType } from 'types';
|
import type { UserType } from 'types';
|
||||||
import { updateValue } from 'utils';
|
import { updateValue } from 'utils';
|
||||||
import { ValidationError, validate } from 'validators';
|
import { validate } from 'validators';
|
||||||
|
|
||||||
interface UserFormProps {
|
interface UserFormProps {
|
||||||
creating: boolean;
|
creating: boolean;
|
||||||
@@ -69,7 +69,7 @@ const User: FC<UserFormProps> = ({
|
|||||||
await validate(validator, user);
|
await validate(validator, user);
|
||||||
onDoneEditing();
|
onDoneEditing();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFieldErrors((error as ValidationError).fieldErrors);
|
setFieldErrors(error as ValidateFieldsError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [user, validator, onDoneEditing]);
|
}, [user, validator, onDoneEditing]);
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ import type { LogEntry, LogSettings } from 'types';
|
|||||||
import { LogLevel } from 'types';
|
import { LogLevel } from 'types';
|
||||||
import { updateValueDirty, useRest } from 'utils';
|
import { updateValueDirty, useRest } from 'utils';
|
||||||
|
|
||||||
|
const MAX_LOG_ENTRIES = 1000; // Limit log entries to prevent memory issues
|
||||||
|
|
||||||
const TextColors: Record<LogLevel, string> = {
|
const TextColors: Record<LogLevel, string> = {
|
||||||
[LogLevel.ERROR]: '#ff0000', // red
|
[LogLevel.ERROR]: '#ff0000', // red
|
||||||
[LogLevel.WARNING]: '#ff0000', // red
|
[LogLevel.WARNING]: '#ff0000', // red
|
||||||
@@ -198,6 +200,10 @@ const SystemLog = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newLog = [...log, logentry];
|
const newLog = [...log, logentry];
|
||||||
|
// Limit log entries to prevent memory issues - only slice when necessary
|
||||||
|
if (newLog.length > MAX_LOG_ENTRIES) {
|
||||||
|
return newLog.slice(-MAX_LOG_ENTRIES);
|
||||||
|
}
|
||||||
return newLog;
|
return newLog;
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
@@ -266,7 +272,7 @@ const SystemLog = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Grid container spacing={2} sx={{ alignItems: 'center' }}>
|
<Grid container spacing={2} alignItems="center">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextField
|
<TextField
|
||||||
name="level"
|
name="level"
|
||||||
@@ -302,8 +308,6 @@ const SystemLog = () => {
|
|||||||
<MenuItem value={50}>50</MenuItem>
|
<MenuItem value={50}>50</MenuItem>
|
||||||
<MenuItem value={75}>75</MenuItem>
|
<MenuItem value={75}>75</MenuItem>
|
||||||
<MenuItem value={100}>100</MenuItem>
|
<MenuItem value={100}>100</MenuItem>
|
||||||
<MenuItem value={500}>500</MenuItem>
|
|
||||||
<MenuItem value={1000}>1000</MenuItem>
|
|
||||||
</TextField>
|
</TextField>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -60,16 +60,18 @@ const SystemMonitor = () => {
|
|||||||
const { statusMessage, isUploading, progressValue } = useMemo(() => {
|
const { statusMessage, isUploading, progressValue } = useMemo(() => {
|
||||||
const status = data?.status;
|
const status = data?.status;
|
||||||
|
|
||||||
const message =
|
let message = '';
|
||||||
status && status >= SystemStatusCodes.SYSTEM_STATUS_UPLOADING
|
if (status && status >= SystemStatusCodes.SYSTEM_STATUS_UPLOADING) {
|
||||||
? LL.WAIT_FIRMWARE()
|
message = LL.WAIT_FIRMWARE();
|
||||||
: status === SystemStatusCodes.SYSTEM_STATUS_PENDING_RESTART
|
} else if (status === SystemStatusCodes.SYSTEM_STATUS_PENDING_RESTART) {
|
||||||
? LL.APPLICATION_RESTARTING()
|
message = LL.APPLICATION_RESTARTING();
|
||||||
: status === SystemStatusCodes.SYSTEM_STATUS_NORMAL
|
} else if (status === SystemStatusCodes.SYSTEM_STATUS_NORMAL) {
|
||||||
? LL.RESTARTING_PRE()
|
message = LL.RESTARTING_PRE();
|
||||||
: status === SystemStatusCodes.SYSTEM_STATUS_ERROR_UPLOAD
|
} else if (status === SystemStatusCodes.SYSTEM_STATUS_ERROR_UPLOAD) {
|
||||||
? 'Upload Failed'
|
message = 'Upload Failed';
|
||||||
: LL.RESTARTING_POST();
|
} else {
|
||||||
|
message = LL.RESTARTING_POST();
|
||||||
|
}
|
||||||
|
|
||||||
const uploading =
|
const uploading =
|
||||||
status !== undefined && status >= SystemStatusCodes.SYSTEM_STATUS_UPLOADING;
|
status !== undefined && status >= SystemStatusCodes.SYSTEM_STATUS_UPLOADING;
|
||||||
@@ -118,15 +120,17 @@ const SystemMonitor = () => {
|
|||||||
p: 3
|
p: 3
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', flexDirection: 'column' }}>
|
<Box display="flex" alignItems="center" flexDirection="column">
|
||||||
<img
|
<img
|
||||||
src="/app/icon.png"
|
src="/app/icon.png"
|
||||||
alt="EMS-ESP"
|
alt="EMS-ESP"
|
||||||
style={{ width: '40px', height: '40px', marginBottom: '16px' }}
|
style={{ width: '40px', height: '40px', marginBottom: '16px' }}
|
||||||
/>
|
/>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{ color: 'secondary', fontWeight: 400, textAlign: 'center' }}
|
color="secondary"
|
||||||
variant="h6"
|
variant="h6"
|
||||||
|
fontWeight={400}
|
||||||
|
textAlign="center"
|
||||||
>
|
>
|
||||||
{statusMessage}
|
{statusMessage}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -146,14 +150,11 @@ const SystemMonitor = () => {
|
|||||||
</MessageBox>
|
</MessageBox>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Typography
|
<Typography mt={2} variant="h6" fontWeight={400} textAlign="center">
|
||||||
sx={{ mt: 2, fontWeight: 400, textAlign: 'center' }}
|
|
||||||
variant="h6"
|
|
||||||
>
|
|
||||||
{LL.PLEASE_WAIT()}…
|
{LL.PLEASE_WAIT()}…
|
||||||
</Typography>
|
</Typography>
|
||||||
{isUploading && (
|
{isUploading && (
|
||||||
<Box sx={{ width: '100%', pl: 2, pr: 2, py: 2 }}>
|
<Box width="100%" pl={2} pr={2} py={2}>
|
||||||
<LinearProgressWithLabel value={progressValue} />
|
<LinearProgressWithLabel value={progressValue} />
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState
|
useState
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { Link } from 'react-router';
|
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
@@ -25,6 +24,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
Grid,
|
Grid,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
Link,
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCell,
|
TableCell,
|
||||||
@@ -274,7 +274,6 @@ const InstallDialog = memo(
|
|||||||
fetchDevVersion,
|
fetchDevVersion,
|
||||||
latestVersion,
|
latestVersion,
|
||||||
latestDevVersion,
|
latestDevVersion,
|
||||||
upgradeImportantMessageType,
|
|
||||||
downloadOnly,
|
downloadOnly,
|
||||||
platform,
|
platform,
|
||||||
LL,
|
LL,
|
||||||
@@ -285,7 +284,6 @@ const InstallDialog = memo(
|
|||||||
fetchDevVersion: boolean;
|
fetchDevVersion: boolean;
|
||||||
latestVersion?: VersionInfo;
|
latestVersion?: VersionInfo;
|
||||||
latestDevVersion?: VersionInfo;
|
latestDevVersion?: VersionInfo;
|
||||||
upgradeImportantMessageType: number;
|
|
||||||
downloadOnly: boolean;
|
downloadOnly: boolean;
|
||||||
platform: string;
|
platform: string;
|
||||||
LL: TranslationFunctions;
|
LL: TranslationFunctions;
|
||||||
@@ -309,24 +307,12 @@ const InstallDialog = memo(
|
|||||||
{`${LL.INSTALL()} ${fetchDevVersion ? LL.DEVELOPMENT() : LL.STABLE()} Firmware`}
|
{`${LL.INSTALL()} ${fetchDevVersion ? LL.DEVELOPMENT() : LL.STABLE()} Firmware`}
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Typography sx={{ mb: 2 }}>
|
<Typography mb={2}>
|
||||||
{LL.INSTALL_VERSION(
|
{LL.INSTALL_VERSION(
|
||||||
downloadOnly ? LL.DOWNLOAD(1) : LL.INSTALL(),
|
downloadOnly ? LL.DOWNLOAD(1) : LL.INSTALL(),
|
||||||
fetchDevVersion ? latestDevVersion?.name : latestVersion?.name
|
fetchDevVersion ? latestDevVersion?.name : latestVersion?.name
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{upgradeImportantMessageType === 1 && LL.UPGRADE_IMPORTANT_MESSAGES_1()}
|
|
||||||
{upgradeImportantMessageType === 2 && LL.UPGRADE_IMPORTANT_MESSAGES_2()}
|
|
||||||
<Typography sx={{ mt: 2 }}>
|
|
||||||
<Link
|
|
||||||
target="_blank"
|
|
||||||
to="https://docs.emsesp.org/FAQ#upgrading-the-firmware"
|
|
||||||
style={{ color: 'lightblue' }}
|
|
||||||
>
|
|
||||||
{LL.ONLINE_HELP()}
|
|
||||||
</Link>
|
|
||||||
</Typography>
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button
|
<Button
|
||||||
@@ -343,12 +329,7 @@ const InstallDialog = memo(
|
|||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
<Link
|
<Link underline="none" target="_blank" href={binURL} color="primary">
|
||||||
to={binURL}
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
style={{ color: 'lightblue', textDecoration: 'none' }}
|
|
||||||
>
|
|
||||||
{LL.DOWNLOAD(0)}
|
{LL.DOWNLOAD(0)}
|
||||||
</Link>
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -390,9 +371,7 @@ const InstallPartitionDialog = memo(
|
|||||||
{LL.INSTALL()} {LL.STORED_VERSIONS()}
|
{LL.INSTALL()} {LL.STORED_VERSIONS()}
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Typography sx={{ mb: 2 }}>
|
<Typography mb={2}>{LL.INSTALL_VERSION(LL.INSTALL(), version)}</Typography>
|
||||||
{LL.INSTALL_VERSION(LL.INSTALL(), version)}
|
|
||||||
</Typography>
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button
|
<Button
|
||||||
@@ -488,26 +467,6 @@ const Version = () => {
|
|||||||
immediate: false
|
immediate: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const [upgradeImportantMessageType, setUpgradeImportantMessageType] =
|
|
||||||
useState<number>(0);
|
|
||||||
|
|
||||||
const { send: checkUpgradeImportantMessages } = useRequest(
|
|
||||||
(version: string) =>
|
|
||||||
callAction({ action: 'upgradeImportantMessages', param: version }),
|
|
||||||
{
|
|
||||||
immediate: false
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.onSuccess((event) => {
|
|
||||||
const upgradeImportantMessageType_n = (
|
|
||||||
event.data as { upgradeImportantMessageType: number }
|
|
||||||
).upgradeImportantMessageType;
|
|
||||||
setUpgradeImportantMessageType(upgradeImportantMessageType_n);
|
|
||||||
})
|
|
||||||
.onError((error) => {
|
|
||||||
toast.error(String(error.error?.message || 'An error occurred'));
|
|
||||||
});
|
|
||||||
|
|
||||||
// Memoized values
|
// Memoized values
|
||||||
const platform = useMemo(() => (data ? getPlatform(data) : ''), [data]);
|
const platform = useMemo(() => (data ? getPlatform(data) : ''), [data]);
|
||||||
|
|
||||||
@@ -573,16 +532,10 @@ const Version = () => {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
const showFirmwareDialog = useCallback(
|
const showFirmwareDialog = useCallback((useDevVersion: boolean) => {
|
||||||
(useDevVersion: boolean) => {
|
|
||||||
setFetchDevVersion(useDevVersion);
|
setFetchDevVersion(useDevVersion);
|
||||||
void checkUpgradeImportantMessages(
|
|
||||||
useDevVersion ? latestDevVersion?.name : latestVersion?.name
|
|
||||||
);
|
|
||||||
setOpenInstallDialog(true);
|
setOpenInstallDialog(true);
|
||||||
},
|
}, []);
|
||||||
[latestDevVersion, latestVersion, fetchDevVersion]
|
|
||||||
);
|
|
||||||
|
|
||||||
const closeInstallDialog = useCallback(() => {
|
const closeInstallDialog = useCallback(() => {
|
||||||
setOpenInstallDialog(false);
|
setOpenInstallDialog(false);
|
||||||
@@ -684,8 +637,8 @@ const Version = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box sx={{ p: 2, border: '1px solid #565656', borderRadius: 2 }}>
|
<Box p={2} border="1px solid grey" borderRadius={2}>
|
||||||
<Typography sx={{ mb: 1 }} variant="h6" color="primary">
|
<Typography mb={1} variant="h6" color="primary">
|
||||||
{LL.THIS_VERSION()}
|
{LL.THIS_VERSION()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
@@ -750,7 +703,7 @@ const Version = () => {
|
|||||||
|
|
||||||
{internetLive ? (
|
{internetLive ? (
|
||||||
<>
|
<>
|
||||||
<Typography sx={{ mt: 4, mb: 1 }} variant="h6" color="primary">
|
<Typography mt={4} mb={1} variant="h6" color="primary">
|
||||||
{LL.AVAILABLE_VERSION()}
|
{LL.AVAILABLE_VERSION()}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
@@ -772,7 +725,7 @@ const Version = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={{ xs: 8, md: 10 }}>
|
<Grid size={{ xs: 8, md: 10 }}>
|
||||||
{otherPartitions.map((partition) => (
|
{otherPartitions.map((partition) => (
|
||||||
<Typography key={partition.partition} sx={{ mb: 1 }}>
|
<Typography key={partition.partition} mb={1}>
|
||||||
{partition.version}
|
{partition.version}
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@@ -838,7 +791,7 @@ const Version = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Typography sx={{ mt: 2 }} color="warning">
|
<Typography mt={2} color="warning">
|
||||||
<WarningIcon color="warning" sx={{ verticalAlign: 'middle', mr: 2 }} />
|
<WarningIcon color="warning" sx={{ verticalAlign: 'middle', mr: 2 }} />
|
||||||
{LL.INTERNET_CONNECTION_REQUIRED()}
|
{LL.INTERNET_CONNECTION_REQUIRED()}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -862,7 +815,6 @@ const Version = () => {
|
|||||||
fetchDevVersion={fetchDevVersion}
|
fetchDevVersion={fetchDevVersion}
|
||||||
latestVersion={latestVersion}
|
latestVersion={latestVersion}
|
||||||
latestDevVersion={latestDevVersion}
|
latestDevVersion={latestDevVersion}
|
||||||
upgradeImportantMessageType={upgradeImportantMessageType}
|
|
||||||
downloadOnly={downloadOnly}
|
downloadOnly={downloadOnly}
|
||||||
platform={platform}
|
platform={platform}
|
||||||
LL={LL}
|
LL={LL}
|
||||||
@@ -880,7 +832,7 @@ const Version = () => {
|
|||||||
<Typography sx={{ pt: 2, pb: 2 }} variant="h6" color="primary">
|
<Typography sx={{ pt: 2, pb: 2 }} variant="h6" color="primary">
|
||||||
{LL.UPLOAD()}
|
{LL.UPLOAD()}
|
||||||
</Typography>
|
</Typography>
|
||||||
<SingleUpload doRestart={doRestart} />
|
<SingleUpload text={LL.UPLOAD_DROP_TEXT()} doRestart={doRestart} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -53,16 +53,12 @@ const MessageBox: FC<PropsWithChildren<MessageBoxProps>> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
|
p={2}
|
||||||
|
display="flex"
|
||||||
|
alignItems="center"
|
||||||
|
borderRadius={1}
|
||||||
|
sx={{ backgroundColor, color: 'white', ...sx }}
|
||||||
{...rest}
|
{...rest}
|
||||||
sx={{
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
borderRadius: 1,
|
|
||||||
backgroundColor,
|
|
||||||
color: 'white',
|
|
||||||
p: 2,
|
|
||||||
...sx
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Icon />
|
<Icon />
|
||||||
{(message || children) && (
|
{(message || children) && (
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const LayoutDrawerComponent = ({ mobileOpen, onClose }: LayoutDrawerProps) => {
|
|||||||
() => (
|
() => (
|
||||||
<>
|
<>
|
||||||
<Toolbar disableGutters>
|
<Toolbar disableGutters>
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', p: 2 }}>
|
<Box display="flex" alignItems="center" px={2}>
|
||||||
<LayoutDrawerLogo src="/app/icon.png" alt={PROJECT_NAME} />
|
<LayoutDrawerLogo src="/app/icon.png" alt={PROJECT_NAME} />
|
||||||
<Typography variant="h6">{PROJECT_NAME}</Typography>
|
<Typography variant="h6">{PROJECT_NAME}</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ const LayoutMenuComponent = () => {
|
|||||||
sx={{ my: 0 }}
|
sx={{ my: 0 }}
|
||||||
slotProps={{
|
slotProps={{
|
||||||
primary: {
|
primary: {
|
||||||
sx: { fontWeight: 600, mb: '2px', color: 'lightblue' }
|
fontWeight: '600',
|
||||||
|
mb: '2px',
|
||||||
|
color: 'lightblue'
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -32,16 +32,8 @@ const FormLoaderComponent = ({ errorMessage, onRetry }: FormLoaderProps) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box m={2} py={2} display="flex" alignItems="center" flexDirection="column">
|
||||||
sx={{
|
<Box py={2}>
|
||||||
m: 2,
|
|
||||||
py: 2,
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
flexDirection: 'column'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box sx={{ p: 2 }}>
|
|
||||||
<CircularProgress size={100} />
|
<CircularProgress size={100} />
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -15,14 +15,12 @@ const circularProgressStyles: SxProps<Theme> = (theme: Theme) => ({
|
|||||||
const LoadingSpinner = ({ height = '100%' }: LoadingSpinnerProps) => {
|
const LoadingSpinner = ({ height = '100%' }: LoadingSpinnerProps) => {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
display="flex"
|
||||||
display: 'flex',
|
alignItems="center"
|
||||||
alignItems: 'center',
|
justifyContent="center"
|
||||||
justifyContent: 'center',
|
flexDirection="column"
|
||||||
flexDirection: 'column',
|
padding={2}
|
||||||
padding: 2,
|
height={height}
|
||||||
height
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<CircularProgress sx={circularProgressStyles} size={100} />
|
<CircularProgress sx={circularProgressStyles} size={100} />
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// drag/drop code inspired by Prince Azubuike from https://medium.com/@dprincecoder/creating-a-drag-and-drop-file-upload-component-in-react-a-step-by-step-guide-4d93b6cc21e0
|
// Code inspired by Prince Azubuike from https://medium.com/@dprincecoder/creating-a-drag-and-drop-file-upload-component-in-react-a-step-by-step-guide-4d93b6cc21e0
|
||||||
import {
|
import {
|
||||||
type ChangeEvent,
|
type ChangeEvent,
|
||||||
type DragEvent,
|
type DragEvent,
|
||||||
@@ -6,28 +6,12 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState
|
useState
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { Link } from 'react-router';
|
|
||||||
import { toast } from 'react-toastify';
|
|
||||||
|
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
import CloudUploadIcon from '@mui/icons-material/CloudUpload';
|
import CloudUploadIcon from '@mui/icons-material/CloudUpload';
|
||||||
import UploadIcon from '@mui/icons-material/Upload';
|
import UploadIcon from '@mui/icons-material/Upload';
|
||||||
import WarningIcon from '@mui/icons-material/Warning';
|
import { Box, Button, Typography, styled } from '@mui/material';
|
||||||
import {
|
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Dialog,
|
|
||||||
DialogActions,
|
|
||||||
DialogContent,
|
|
||||||
DialogTitle,
|
|
||||||
Typography,
|
|
||||||
styled
|
|
||||||
} from '@mui/material';
|
|
||||||
|
|
||||||
import { callAction } from 'api/app';
|
|
||||||
|
|
||||||
import { dialogStyle } from '@/CustomTheme';
|
|
||||||
import { useRequest } from 'alova/client';
|
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
|
|
||||||
const DocumentUploader = styled(Box)<{ active?: boolean }>(({ theme, active }) => ({
|
const DocumentUploader = styled(Box)<{ active?: boolean }>(({ theme, active }) => ({
|
||||||
@@ -74,29 +58,6 @@ const DragNdrop = ({ text, onFileSelected }: DragNdropProps) => {
|
|||||||
const [dragged, setDragged] = useState(false);
|
const [dragged, setDragged] = useState(false);
|
||||||
const inputRef = useRef<HTMLInputElement | null>(null);
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
const [showUpgradeDialog, setShowUpgradeDialog] = useState(false);
|
|
||||||
const [upgradeImportantMessageType, setUpgradeImportantMessageType] =
|
|
||||||
useState<number>(0);
|
|
||||||
|
|
||||||
const { send: checkUpgradeImportantMessages } = useRequest(
|
|
||||||
(version: string) =>
|
|
||||||
callAction({ action: 'upgradeImportantMessages', param: version }),
|
|
||||||
{
|
|
||||||
immediate: false
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.onSuccess((event) => {
|
|
||||||
const upgradeImportantMessageType_n = (
|
|
||||||
event.data as { upgradeImportantMessageType: number }
|
|
||||||
).upgradeImportantMessageType;
|
|
||||||
setUpgradeImportantMessageType(upgradeImportantMessageType_n);
|
|
||||||
if (upgradeImportantMessageType_n === 0) {
|
|
||||||
onFileSelected(file);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.onError((error) => {
|
|
||||||
toast.error(String(error.error?.message || 'An error occurred'));
|
|
||||||
});
|
|
||||||
|
|
||||||
const checkFileExtension = (file: File) => {
|
const checkFileExtension = (file: File) => {
|
||||||
const validExtensions = ['.json', '.bin', '.md5'];
|
const validExtensions = ['.json', '.bin', '.md5'];
|
||||||
@@ -136,8 +97,9 @@ const DragNdrop = ({ text, onFileSelected }: DragNdropProps) => {
|
|||||||
|
|
||||||
const handleUploadClick = (event: MouseEvent<HTMLButtonElement>) => {
|
const handleUploadClick = (event: MouseEvent<HTMLButtonElement>) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
void checkUpgradeImportantMessages(file?.name || '');
|
if (file) {
|
||||||
setShowUpgradeDialog(true);
|
onFileSelected(file);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBrowseClick = () => {
|
const handleBrowseClick = () => {
|
||||||
@@ -196,56 +158,6 @@ const DragNdrop = ({ text, onFileSelected }: DragNdropProps) => {
|
|||||||
{LL.UPLOAD()}
|
{LL.UPLOAD()}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
{showUpgradeDialog && upgradeImportantMessageType > 0 && (
|
|
||||||
<Dialog
|
|
||||||
sx={dialogStyle}
|
|
||||||
open={showUpgradeDialog}
|
|
||||||
onClose={() => setShowUpgradeDialog(false)}
|
|
||||||
>
|
|
||||||
<DialogTitle>
|
|
||||||
<WarningIcon
|
|
||||||
color="warning"
|
|
||||||
sx={{ fontSize: 18, verticalAlign: 'middle' }}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{LL.UPGRADE_IMPORTANT_MESSAGES()}
|
|
||||||
</DialogTitle>
|
|
||||||
<DialogContent dividers>
|
|
||||||
{upgradeImportantMessageType === 2 &&
|
|
||||||
LL.UPGRADE_IMPORTANT_MESSAGES_2()}
|
|
||||||
{upgradeImportantMessageType === 1 &&
|
|
||||||
LL.UPGRADE_IMPORTANT_MESSAGES_1()}
|
|
||||||
<Typography sx={{ mt: 2 }}>
|
|
||||||
<Link
|
|
||||||
to="https://docs.emsesp.org/FAQ#upgrading-the-firmware"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
style={{ color: 'lightblue' }}
|
|
||||||
>
|
|
||||||
{LL.ONLINE_HELP()}
|
|
||||||
</Link>
|
|
||||||
</Typography>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button
|
|
||||||
startIcon={<CancelIcon />}
|
|
||||||
variant="outlined"
|
|
||||||
onClick={() => setShowUpgradeDialog(false)}
|
|
||||||
color="secondary"
|
|
||||||
>
|
|
||||||
{LL.CANCEL()}
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
startIcon={<UploadIcon />}
|
|
||||||
variant="outlined"
|
|
||||||
onClick={() => onFileSelected(file)}
|
|
||||||
color="primary"
|
|
||||||
>
|
|
||||||
{LL.UPLOAD()}
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</Dialog>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</DocumentUploader>
|
</DocumentUploader>
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ import DragNdrop from './DragNdrop';
|
|||||||
import { LinearProgressWithLabel } from './LinearProgressWithLabel';
|
import { LinearProgressWithLabel } from './LinearProgressWithLabel';
|
||||||
|
|
||||||
interface SingleUploadProps {
|
interface SingleUploadProps {
|
||||||
|
text: string;
|
||||||
doRestart: () => void;
|
doRestart: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SingleUpload = ({ doRestart }: SingleUploadProps) => {
|
const SingleUpload = ({ text, doRestart }: SingleUploadProps) => {
|
||||||
const [md5, setMd5] = useState<string>();
|
const [md5, setMd5] = useState<string>();
|
||||||
const [file, setFile] = useState<File>();
|
const [file, setFile] = useState<File>();
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
@@ -57,7 +58,7 @@ const SingleUpload = ({ doRestart }: SingleUploadProps) => {
|
|||||||
<>
|
<>
|
||||||
{isUploading ? (
|
{isUploading ? (
|
||||||
<>
|
<>
|
||||||
<Box sx={{ width: '100%', pl: 2, pr: 2 }}>
|
<Box width="100%" pl={2} pr={2}>
|
||||||
<LinearProgressWithLabel
|
<LinearProgressWithLabel
|
||||||
value={
|
value={
|
||||||
progress.total === 0 || progress.loaded === 0
|
progress.total === 0 || progress.loaded === 0
|
||||||
@@ -80,11 +81,11 @@ const SingleUpload = ({ doRestart }: SingleUploadProps) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<DragNdrop text={LL.UPLOAD_DROP_TEXT()} onFileSelected={setFile} />
|
<DragNdrop text={text} onFileSelected={setFile} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{md5 && (
|
{md5 && (
|
||||||
<Box sx={{ mt: 2 }}>
|
<Box mt={2}>
|
||||||
<Typography variant="body2">{'MD5: ' + md5}</Typography>
|
<Typography variant="body2">{'MD5: ' + md5}</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const cz: Translation = {
|
|||||||
BUFFER_SIZE: 'Maximální velikost vyrovnávací paměti',
|
BUFFER_SIZE: 'Maximální velikost vyrovnávací paměti',
|
||||||
COMPACT: 'Kompaktní',
|
COMPACT: 'Kompaktní',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Vytvořte zálohu svého nastavení a konfigurace',
|
DOWNLOAD_SETTINGS_TEXT: 'Vytvořte zálohu svého nastavení a konfigurace',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Exportovat všechny hodnoty',
|
DOWNLOAD_SETTINGS_TEXT2: 'Exportovat všechna data',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Systémová záloha',
|
|
||||||
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',
|
||||||
ERROR: 'Neočekávaná chyba, zkuste to prosím znovu',
|
ERROR: 'Neočekávaná chyba, zkuste to prosím znovu',
|
||||||
@@ -350,22 +349,15 @@ const cz: Translation = {
|
|||||||
NO_DATA_1: 'Nebyly nalezeny žádné oblíbené entity. Použijte modul',
|
NO_DATA_1: 'Nebyly nalezeny žádné oblíbené entity. Použijte modul',
|
||||||
NO_DATA_2: 'pro jejich výběr.',
|
NO_DATA_2: 'pro jejich výběr.',
|
||||||
NO_DATA_3: 'Pro zobrazení všech dostupných entit navštivte stránku',
|
NO_DATA_3: 'Pro zobrazení všech dostupných entit navštivte stránku',
|
||||||
NO_GPIO: 'Nebylo nalezeno žádné volné GPIO',
|
|
||||||
THIS_VERSION: 'Tato verze',
|
THIS_VERSION: 'Tato verze',
|
||||||
PLATFORM: 'Platforma',
|
PLATFORM: 'Platforma',
|
||||||
RELEASE_TYPE: 'Typ sestavení',
|
RELEASE_TYPE: 'Typ sestavení',
|
||||||
INTERNET_CONNECTION_REQUIRED: 'Pro automatickou kontrolu a instalaci aktualizací je třeba internetové připojení',
|
INTERNET_CONNECTION_REQUIRED: 'Pro automatickou kontrolu a instalaci aktualizací je třeba internetové připojení',
|
||||||
SWITCH_RELEASE_TYPE: 'Přepnout na {0} verzi',
|
SWITCH_RELEASE_TYPE: 'Přepnout na {0} verzi',
|
||||||
FIRMWARE_VERSION_INFO: 'Informace o verzi firmwaru',
|
FIRMWARE_VERSION_INFO: 'Informace o verzi firmwaru',
|
||||||
NO_DATA: 'žádné údaje',
|
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Aktualizovat důležité zprávy',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Tato aktualizace vyžaduje obnovení továrního nastavení. Ujistěte se, že nejprve stáhnete systémovou zálohu před pokračováním a poté nahrajte tento soubor po instalaci nové verze.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Aktualizujete se na novou hlavní verzi. Ujistěte se, že jste přečetli ChangeLog pro jakékoliv závažné změny.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Toto vytvoří zálohu vašich celých systémových konfigurací a nastavení. Všechna hesla budou v zálohovém souboru čitelná. Buďte opatrní při sdílení! Opravdu chcete pokračovat?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default cz;
|
export default cz;
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const de: Translation = {
|
|||||||
BUFFER_SIZE: 'Max. Puffergröße',
|
BUFFER_SIZE: 'Max. Puffergröße',
|
||||||
COMPACT: 'Kompakte Darstellung',
|
COMPACT: 'Kompakte Darstellung',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Erstellen Sie eine Sicherung Ihrer Konfigurationen und Einstellungen',
|
DOWNLOAD_SETTINGS_TEXT: 'Erstellen Sie eine Sicherung Ihrer Konfigurationen und Einstellungen',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Exportiere alle Werte',
|
DOWNLOAD_SETTINGS_TEXT2: 'Exportiere alle Daten',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Systemsicherung',
|
|
||||||
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',
|
||||||
ERROR: 'Unerwarteter Fehler, bitte versuchen Sie es erneut.',
|
ERROR: 'Unerwarteter Fehler, bitte versuchen Sie es erneut.',
|
||||||
@@ -350,7 +349,6 @@ const de: Translation = {
|
|||||||
NO_DATA_1: 'Keine favorisierten EMS-Entitäten gefunden! Verwenden Sie das Modul',
|
NO_DATA_1: 'Keine favorisierten EMS-Entitäten gefunden! Verwenden Sie das Modul',
|
||||||
NO_DATA_2: ', um sie zu markieren.',
|
NO_DATA_2: ', um sie zu markieren.',
|
||||||
NO_DATA_3: 'Um alle verfügbaren Entitäten anzuzeigen, gehen Sie zu',
|
NO_DATA_3: 'Um alle verfügbaren Entitäten anzuzeigen, gehen Sie zu',
|
||||||
NO_GPIO: 'Keine freien GPIO gefunden',
|
|
||||||
THIS_VERSION: 'Diese Version',
|
THIS_VERSION: 'Diese Version',
|
||||||
PLATFORM: 'Plattform',
|
PLATFORM: 'Plattform',
|
||||||
RELEASE_TYPE: 'Release Typ',
|
RELEASE_TYPE: 'Release Typ',
|
||||||
@@ -359,13 +357,7 @@ const de: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Firmware-Versionsinformation',
|
FIRMWARE_VERSION_INFO: 'Firmware-Versionsinformation',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Wichtige Nachrichten aktualisieren',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Für diese Aktualisierung ist ein Werksreset erforderlich. Stellen Sie sicher, dass Sie zuerst eine Systemsicherung herunterladen, bevor Sie fortfahren, und laden Sie diese Datei dann nach der Installation der neuen Version hoch.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Sie aktualisieren auf eine neue Hauptversion. Stellen Sie sicher, dass Sie den ChangeLog für alle wichtigen Änderungen gelesen haben.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Dies wird eine Sicherung Ihrer vollständigen Systemkonfiguration und Einstellungen erstellen. Alle Passwörter werden in dieser Sicherungsdatei lesbar sein. Seien Sie vorsichtig beim Teilen! Möchten Sie fortfahren?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default de;
|
export default de;
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const en: Translation = {
|
|||||||
BUFFER_SIZE: 'Max Buffer Size',
|
BUFFER_SIZE: 'Max Buffer Size',
|
||||||
COMPACT: 'Compact',
|
COMPACT: 'Compact',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Create a backup of your configuration and settings',
|
DOWNLOAD_SETTINGS_TEXT: 'Create a backup of your configuration and settings',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Export all values',
|
DOWNLOAD_SETTINGS_TEXT2: 'Export all data',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'System Backup',
|
|
||||||
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',
|
||||||
ERROR: 'Unexpected Error, please try again',
|
ERROR: 'Unexpected Error, please try again',
|
||||||
@@ -350,7 +349,6 @@ const en: Translation = {
|
|||||||
NO_DATA_1: 'No favorite EMS entities found yet. Use the',
|
NO_DATA_1: 'No favorite EMS entities found yet. Use the',
|
||||||
NO_DATA_2: 'module to mark them.',
|
NO_DATA_2: 'module to mark them.',
|
||||||
NO_DATA_3: 'To see all available entities go to',
|
NO_DATA_3: 'To see all available entities go to',
|
||||||
NO_GPIO: 'No available GPIO found',
|
|
||||||
THIS_VERSION: 'This Version',
|
THIS_VERSION: 'This Version',
|
||||||
PLATFORM: 'Platform',
|
PLATFORM: 'Platform',
|
||||||
RELEASE_TYPE: 'Release Type',
|
RELEASE_TYPE: 'Release Type',
|
||||||
@@ -359,13 +357,7 @@ const en: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Firmware Version Information',
|
FIRMWARE_VERSION_INFO: 'Firmware Version Information',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Important Messages',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'This upgrade requires a factory reset. Make sure you first download a System Backup before continuing, and then upload this file 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 breaking changes.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'This will create a backup of your full system configuration and settings. All passwords will be readable in the backup file. Be careful with sharing! Do you want to continue?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default en;
|
export default en;
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const fr: Translation = {
|
|||||||
BUFFER_SIZE: 'Max taille du buffer',
|
BUFFER_SIZE: 'Max taille du buffer',
|
||||||
COMPACT: 'Compact',
|
COMPACT: 'Compact',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Créer une sauvegarde de vos paramètres et configurations',
|
DOWNLOAD_SETTINGS_TEXT: 'Créer une sauvegarde de vos paramètres et configurations',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Exporter toutes les valeurs',
|
DOWNLOAD_SETTINGS_TEXT2: 'Exporter toutes les données',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Sauvegarde système',
|
|
||||||
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',
|
||||||
ERROR: 'Erreur inattendue, veuillez réessayer',
|
ERROR: 'Erreur inattendue, veuillez réessayer',
|
||||||
@@ -350,7 +349,6 @@ const fr: Translation = {
|
|||||||
NO_DATA_1: 'Aucune entité EMS favorite trouvée. Utilisez le',
|
NO_DATA_1: 'Aucune entité EMS favorite trouvée. Utilisez le',
|
||||||
NO_DATA_2: 'module pour les marquer.',
|
NO_DATA_2: 'module pour les marquer.',
|
||||||
NO_DATA_3: 'Pour voir toutes les entités disponibles, aller à',
|
NO_DATA_3: 'Pour voir toutes les entités disponibles, aller à',
|
||||||
NO_GPIO: "Aucun GPIO disponible n'a été détecté",
|
|
||||||
THIS_VERSION: 'Cette version',
|
THIS_VERSION: 'Cette version',
|
||||||
PLATFORM: 'Plateforme',
|
PLATFORM: 'Plateforme',
|
||||||
RELEASE_TYPE: 'Type de version',
|
RELEASE_TYPE: 'Type de version',
|
||||||
@@ -359,13 +357,7 @@ const fr: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Informations sur la version du firmware',
|
FIRMWARE_VERSION_INFO: 'Informations sur la version du firmware',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Mettre à jour les messages importants',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Cette mise à jour nécessite une réinitialisation de fabrique. Assurez-vous de télécharger une sauvegarde système avant de continuer, et de la charger après l\'installation de la nouvelle version.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Vous mettez à jour vers une nouvelle version majeure. Assurez-vous de lire le ChangeLog pour tout changement important.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Cela créera une sauvegarde de votre configuration et paramètres complets. Tous les mots de passe seront lisibles dans le fichier de sauvegarde. Soyez prudent avec le partage ! Voulez-vous continuer ?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default fr;
|
export default fr;
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const it: Translation = {
|
|||||||
BUFFER_SIZE: 'Max Buffer Size',
|
BUFFER_SIZE: 'Max Buffer Size',
|
||||||
COMPACT: 'Compatto',
|
COMPACT: 'Compatto',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Create a backup of your configuration and settings',
|
DOWNLOAD_SETTINGS_TEXT: 'Create a backup of your configuration and settings',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Esporta tutti i valori',
|
DOWNLOAD_SETTINGS_TEXT2: 'Esporta tutti i dati',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Backup sistema',
|
|
||||||
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',
|
||||||
ERROR: 'Errore Inaspettato, prego tenta ancora',
|
ERROR: 'Errore Inaspettato, prego tenta ancora',
|
||||||
@@ -350,7 +349,6 @@ const it: Translation = {
|
|||||||
NO_DATA_1: 'Nessuna entità EMS preferita trovata. Usa il',
|
NO_DATA_1: 'Nessuna entità EMS preferita trovata. Usa il',
|
||||||
NO_DATA_2: 'modulo per marcarle.',
|
NO_DATA_2: 'modulo per marcarle.',
|
||||||
NO_DATA_3: 'Per vedere tutte le entità disponibili vai a',
|
NO_DATA_3: 'Per vedere tutte le entità disponibili vai a',
|
||||||
NO_GPIO: 'Non è stato trovato alcun GPIO disponibile',
|
|
||||||
THIS_VERSION: 'Questa versione',
|
THIS_VERSION: 'Questa versione',
|
||||||
PLATFORM: 'Piattaforma',
|
PLATFORM: 'Piattaforma',
|
||||||
RELEASE_TYPE: 'Tipo di rilascio',
|
RELEASE_TYPE: 'Tipo di rilascio',
|
||||||
@@ -359,13 +357,7 @@ const it: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Informazioni sulla versione del firmware',
|
FIRMWARE_VERSION_INFO: 'Informazioni sulla versione del firmware',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Aggiorna Messaggi Importanti',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Questa aggiornamento richiede un ripristino di fabbrica. Assicurati di prima scaricare un backup del sistema prima di continuare, e poi caricare questo file dopo l\'installazione della nuova versione.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Stai aggiornando a una nuova versione principale. Assicurati di aver letto il ChangeLog per qualsiasi cambiamento importante.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Questo creerà un backup delle tue configurazioni e impostazioni complete. Tutte le password saranno leggibili nel file di backup. Sei sicuro di voler continuare?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default it;
|
export default it;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const nl: Translation = {
|
|||||||
REFRESH: 'Ververs',
|
REFRESH: 'Ververs',
|
||||||
EXPORT: 'Export',
|
EXPORT: 'Export',
|
||||||
FAVORITES: "Favorieten",
|
FAVORITES: "Favorieten",
|
||||||
DEVICE_DETAILS: 'Apparaat Gegevens',
|
DEVICE_DETAILS: 'Device Gegevens',
|
||||||
ID_OF: '{0} ID',
|
ID_OF: '{0} ID',
|
||||||
DEVICE: 'Apparaat',
|
DEVICE: 'Apparaat',
|
||||||
PRODUCT: 'Product',
|
PRODUCT: 'Product',
|
||||||
@@ -65,7 +65,7 @@ const nl: Translation = {
|
|||||||
TEMP_SENSOR: 'Temperatuur sensor',
|
TEMP_SENSOR: 'Temperatuur sensor',
|
||||||
TEMP_SENSORS: 'Temperatuur Sensoren',
|
TEMP_SENSORS: 'Temperatuur Sensoren',
|
||||||
WRITE_CMD_SENT: 'Schrijf commando gestuurd',
|
WRITE_CMD_SENT: 'Schrijf commando gestuurd',
|
||||||
EMS_BUS_WARNING: 'EMS bus niet gevonden. Als deze waarschuwing blijft staan na een paar seconden loop dan de instellingen na en in het bijzonder het apparaat type profiel.',
|
EMS_BUS_WARNING: 'EMS bus niet gevonden. Als deze waarschuwing blijft staan na een paar seconden dan loop de instellingen na en in het bijzonder het apparaat type profiel na.',
|
||||||
EMS_BUS_SCANNING: 'Scannen naar EMS apparaten...',
|
EMS_BUS_SCANNING: 'Scannen naar EMS apparaten...',
|
||||||
CONNECTED: 'Verbonden',
|
CONNECTED: 'Verbonden',
|
||||||
TX_ISSUES: 'Tx bus probleem. Probeer een andere Tx verzendmodus',
|
TX_ISSUES: 'Tx bus probleem. Probeer een andere Tx verzendmodus',
|
||||||
@@ -75,7 +75,7 @@ const nl: Translation = {
|
|||||||
EMS_DEVICE: 'EMS Apparaat',
|
EMS_DEVICE: 'EMS Apparaat',
|
||||||
SUCCESS: 'SUCCESS',
|
SUCCESS: 'SUCCESS',
|
||||||
FAIL: 'MISLUKT',
|
FAIL: 'MISLUKT',
|
||||||
QUALITY: 'KWALITEIT',
|
QUALITY: 'QUALITEIT',
|
||||||
SCAN: 'Scan',
|
SCAN: 'Scan',
|
||||||
STATUS_NAMES: [
|
STATUS_NAMES: [
|
||||||
'EMS Telegrammen ontvangen (Rx)',
|
'EMS Telegrammen ontvangen (Rx)',
|
||||||
@@ -120,7 +120,7 @@ const nl: Translation = {
|
|||||||
ENABLE_SHOWER_TIMER: 'Activeer Douche Timer (tijdmeting)',
|
ENABLE_SHOWER_TIMER: 'Activeer Douche Timer (tijdmeting)',
|
||||||
ENABLE_SHOWER_ALERT: 'Activeer Douchemelding',
|
ENABLE_SHOWER_ALERT: 'Activeer Douchemelding',
|
||||||
TRIGGER_TIME: 'Trigger tijd',
|
TRIGGER_TIME: 'Trigger tijd',
|
||||||
COLD_SHOT_DURATION: 'Lengte koud water puls',
|
COLD_SHOT_DURATION: 'Tijd Shot koud water',
|
||||||
FORMATTING_OPTIONS: 'Formatteringsopties',
|
FORMATTING_OPTIONS: 'Formatteringsopties',
|
||||||
BOOLEAN_FORMAT_DASHBOARD: 'Boolean formaat web',
|
BOOLEAN_FORMAT_DASHBOARD: 'Boolean formaat web',
|
||||||
BOOLEAN_FORMAT_API: 'Boolean formaat API/MQTT',
|
BOOLEAN_FORMAT_API: 'Boolean formaat API/MQTT',
|
||||||
@@ -143,7 +143,7 @@ const nl: Translation = {
|
|||||||
CUSTOMIZATIONS_FULL: 'Te veel entiteiten geselecteerd. Sla op in delen aub',
|
CUSTOMIZATIONS_FULL: 'Te veel entiteiten geselecteerd. Sla op in delen aub',
|
||||||
CUSTOMIZATIONS_SAVED: 'Custom aanpassingen opgeslagen',
|
CUSTOMIZATIONS_SAVED: 'Custom aanpassingen opgeslagen',
|
||||||
CUSTOMIZATIONS_HELP_1: 'Selecteer een apparaat en pas de entiteiten aan door middel van de opties',
|
CUSTOMIZATIONS_HELP_1: 'Selecteer een apparaat en pas de entiteiten aan door middel van de opties',
|
||||||
CUSTOMIZATIONS_HELP_2: 'Markeer als favoriet',
|
CUSTOMIZATIONS_HELP_2: 'Markeer as favoriet',
|
||||||
CUSTOMIZATIONS_HELP_3: 'Zet schrijfacties uit',
|
CUSTOMIZATIONS_HELP_3: 'Zet schrijfacties uit',
|
||||||
CUSTOMIZATIONS_HELP_4: 'Uitsluiten van MQTT en API',
|
CUSTOMIZATIONS_HELP_4: 'Uitsluiten van MQTT en API',
|
||||||
CUSTOMIZATIONS_HELP_5: 'verbergen voor apparaten',
|
CUSTOMIZATIONS_HELP_5: 'verbergen voor apparaten',
|
||||||
@@ -186,13 +186,12 @@ const nl: Translation = {
|
|||||||
BUFFER_SIZE: 'Max buffer grootte',
|
BUFFER_SIZE: 'Max buffer grootte',
|
||||||
COMPACT: 'Compact',
|
COMPACT: 'Compact',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Maak een back-up van uw configuratie en instellingen',
|
DOWNLOAD_SETTINGS_TEXT: 'Maak een back-up van uw configuratie en instellingen',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Exporteer alle waarden',
|
DOWNLOAD_SETTINGS_TEXT2: 'Exporteer alle data',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Systeem Backup',
|
|
||||||
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',
|
||||||
ERROR: 'Onverwachte fout, probeer opnieuw',
|
ERROR: 'Onverwachte fout, probeer opnieuw',
|
||||||
TIME_SET: 'Tijd ingesteld',
|
TIME_SET: 'Tijd ingesteld',
|
||||||
MANAGE_USERS: 'Gebruikersbeheer',
|
MANAGE_USERS: 'Beheer Gebruikers',
|
||||||
IS_ADMIN: 'is Admin',
|
IS_ADMIN: 'is Admin',
|
||||||
USER_WARNING: 'U dient tenminste 1 admin gebruiker te configureren',
|
USER_WARNING: 'U dient tenminste 1 admin gebruiker te configureren',
|
||||||
ADD: 'Toevoegen',
|
ADD: 'Toevoegen',
|
||||||
@@ -201,7 +200,7 @@ const nl: Translation = {
|
|||||||
GENERATING_TOKEN: 'Token aan het genereren',
|
GENERATING_TOKEN: 'Token aan het genereren',
|
||||||
USER: 'Gebruiker',
|
USER: 'Gebruiker',
|
||||||
MODIFY: 'Aanpassen',
|
MODIFY: 'Aanpassen',
|
||||||
SU_TEXT: 'Het su (super user) wachtwoord wordt gebruikt om authorisatie tokens te ondertekenen en ook om admin privileges te activeren in de console.',
|
SU_TEXT: 'Het su (super user) wachtwoord wordt gebruikt om authorisatie tokens te signeren en ook om admin privileges te activeren in de console.',
|
||||||
NOT_ENABLED: 'Niet geactiveerd',
|
NOT_ENABLED: 'Niet geactiveerd',
|
||||||
ERRORS_OF: '{0} Foutmeldingen',
|
ERRORS_OF: '{0} Foutmeldingen',
|
||||||
DISCONNECT_REASON: 'Verbinding verbroken vanwege',
|
DISCONNECT_REASON: 'Verbinding verbroken vanwege',
|
||||||
@@ -350,7 +349,6 @@ const nl: Translation = {
|
|||||||
NO_DATA_1: 'Er zijn nog geen favoriete EMS-entiteiten gevonden. Gebruik de',
|
NO_DATA_1: 'Er zijn nog geen favoriete EMS-entiteiten gevonden. Gebruik de',
|
||||||
NO_DATA_2: 'module om ze te markeren.',
|
NO_DATA_2: 'module om ze te markeren.',
|
||||||
NO_DATA_3: 'Om alle beschikbare entiteiten te zien, ga naar',
|
NO_DATA_3: 'Om alle beschikbare entiteiten te zien, ga naar',
|
||||||
NO_GPIO: 'Er is geen beschikbare GPIO gevonden',
|
|
||||||
THIS_VERSION: 'Deze Versie',
|
THIS_VERSION: 'Deze Versie',
|
||||||
PLATFORM: 'Platform',
|
PLATFORM: 'Platform',
|
||||||
RELEASE_TYPE: 'Release Typ',
|
RELEASE_TYPE: 'Release Typ',
|
||||||
@@ -359,13 +357,7 @@ const nl: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Informatie over firmwareversie',
|
FIRMWARE_VERSION_INFO: 'Informatie over firmwareversie',
|
||||||
NO_DATA: 'Geen data',
|
NO_DATA: 'Geen data',
|
||||||
USER_PROFILE: 'Gebruikersprofiel',
|
USER_PROFILE: 'Gebruikersprofiel',
|
||||||
STORED_VERSIONS: 'Opgeslagen versies',
|
STORED_VERSIONS: 'Opgeslagen versies'
|
||||||
ONLINE_HELP: 'online help',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Upgrade Belangrijke Berichten',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Deze upgrade vereist een fabrieksinstelling. Zorg ervoor dat u eerst een Systeem Backup download voordat u doorgaat, en upload deze file na de installatie van de nieuwe versie.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'U updatet naar een nieuwe grote versie. Zorg ervoor dat u de ChangeLog hebt gelezen voor alle brekende wijzigingen.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Dit zal een back-up van uw volledige systeemconfiguratie en instellingen maken. Alle wachtwoorden zijn leesbaar in het back-upbestand. Wees voorzichtig bij delen! Wilt u doorgaan?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nl;
|
export default nl;
|
||||||
@@ -186,8 +186,7 @@ const no: Translation = {
|
|||||||
BUFFER_SIZE: 'Max Buffer Størrelse',
|
BUFFER_SIZE: 'Max Buffer Størrelse',
|
||||||
COMPACT: 'Komprimere',
|
COMPACT: 'Komprimere',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Lag en sikkerhetskopi av dine konfigurasjon og innstillinger',
|
DOWNLOAD_SETTINGS_TEXT: 'Lag en sikkerhetskopi av dine konfigurasjon og innstillinger',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Eksporter alle verdier',
|
DOWNLOAD_SETTINGS_TEXT2: 'Eksporter alle data',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'System Sikkerhetskopi',
|
|
||||||
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',
|
||||||
ERROR: 'Ukjent feil, prøv igjen',
|
ERROR: 'Ukjent feil, prøv igjen',
|
||||||
@@ -350,7 +349,6 @@ const no: Translation = {
|
|||||||
NO_DATA_1: 'Ingen favoritte EMS enheter funnet enda. Bruk',
|
NO_DATA_1: 'Ingen favoritte EMS enheter funnet enda. Bruk',
|
||||||
NO_DATA_2: 'modul for å markere dem.',
|
NO_DATA_2: 'modul for å markere dem.',
|
||||||
NO_DATA_3: 'For å se alle tilgjengelige enheter, gå til',
|
NO_DATA_3: 'For å se alle tilgjengelige enheter, gå til',
|
||||||
NO_GPIO: 'Det ble ikke funnet noen tilgjengelige GPIO-porter',
|
|
||||||
THIS_VERSION: 'Denne versjonen',
|
THIS_VERSION: 'Denne versjonen',
|
||||||
PLATFORM: 'Plattform',
|
PLATFORM: 'Plattform',
|
||||||
RELEASE_TYPE: 'Utgivelses type',
|
RELEASE_TYPE: 'Utgivelses type',
|
||||||
@@ -359,13 +357,7 @@ const no: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Informasjon om firmwareversjon',
|
FIRMWARE_VERSION_INFO: 'Informasjon om firmwareversjon',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Oppdater viktige meldinger',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Denne oppdateringen krever en fabriksinstilling. Sørg for at du først lastet ned en System Backup før du fortsetter, og last denne filen etter at den nye versjonen er installert.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Du oppdaterer til en ny hovedversjon. Sørg for at du har lest ChangeLog for eventuelle bruddende endringer.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Dette vil lage en sikkerhetskopi av din fullstendige systemkonfigurasjon og innstillinger. Alle passord vil være lesbare i sikkerhetskopien. Vær forsiktig med deling! Vil du fortsette?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default no;
|
export default no;
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const pl: BaseTranslation = {
|
|||||||
BUFFER_SIZE: 'Maksymalna pojemność bufora (ilość wpisów)',
|
BUFFER_SIZE: 'Maksymalna pojemność bufora (ilość wpisów)',
|
||||||
COMPACT: 'Kompaktowy',
|
COMPACT: 'Kompaktowy',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Utwórz kopię swoich ustawień i konfiguracji',
|
DOWNLOAD_SETTINGS_TEXT: 'Utwórz kopię swoich ustawień i konfiguracji',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Eksportuj wszystkie wartości',
|
DOWNLOAD_SETTINGS_TEXT2: 'Eksportuj wszystkie dane',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Kopia zapasowa systemu',
|
|
||||||
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',
|
||||||
ERROR: 'Nieoczekiwany błąd, spróbuj ponownie!',
|
ERROR: 'Nieoczekiwany błąd, spróbuj ponownie!',
|
||||||
@@ -350,7 +349,6 @@ const pl: BaseTranslation = {
|
|||||||
NO_DATA_1: 'Brak ulubionych encji EMS. Użyj',
|
NO_DATA_1: 'Brak ulubionych encji EMS. Użyj',
|
||||||
NO_DATA_2: 'moduł do ich oznaczenia.',
|
NO_DATA_2: 'moduł do ich oznaczenia.',
|
||||||
NO_DATA_3: 'Aby zobaczyć wszystkie dostępne encje przejdź do',
|
NO_DATA_3: 'Aby zobaczyć wszystkie dostępne encje przejdź do',
|
||||||
NO_GPIO: 'Nie znaleziono dostępnych pinów GPIO',
|
|
||||||
THIS_VERSION: 'Ta wersja',
|
THIS_VERSION: 'Ta wersja',
|
||||||
PLATFORM: 'Platforma',
|
PLATFORM: 'Platforma',
|
||||||
RELEASE_TYPE: 'Typ wydania',
|
RELEASE_TYPE: 'Typ wydania',
|
||||||
@@ -359,13 +357,7 @@ const pl: BaseTranslation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Informacje o wersji firmware',
|
FIRMWARE_VERSION_INFO: 'Informacje o wersji firmware',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Aktualizuj ważne wiadomości',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Ta aktualizacja wymaga resetu fabrycznego. Upewnij się, że najpierw pobierzesz kopię zapasową systemu przed kontynuowaniem, a następnie przesuń tę plik po zainstalowaniu nowej wersji.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Aktualizujesz się do nowej głównej wersji. Upewnij się, że przeczytałeś ChangeLog dla wszelkich istotnych zmian.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'To spowoduje utworzenie kopii zapasowej całej konfiguracji i ustawień systemu. Wszystkie hasła będą widoczne w pliku kopii zapasowej. Bądź ostrożny przy udostępnianiu! Chcesz kontynuować?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pl;
|
export default pl;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const sk: Translation = {
|
|||||||
LANGUAGE: 'Jazyk',
|
LANGUAGE: 'Jazyk',
|
||||||
RETRY: 'Opakovať',
|
RETRY: 'Opakovať',
|
||||||
LOADING: 'Načítanie',
|
LOADING: 'Načítanie',
|
||||||
IS_REQUIRED: '{0} je požadovaná',
|
IS_REQUIRED: '{0} je požadovaných',
|
||||||
SIGN_IN: 'Prihlásiť sa',
|
SIGN_IN: 'Prihlásiť sa',
|
||||||
SIGN_OUT: 'Odhlásiť sa',
|
SIGN_OUT: 'Odhlásiť sa',
|
||||||
USERNAME: 'Užívateľské meno',
|
USERNAME: 'Užívateľské meno',
|
||||||
@@ -186,8 +186,7 @@ const sk: Translation = {
|
|||||||
BUFFER_SIZE: 'Buffer-max. veľkosť',
|
BUFFER_SIZE: 'Buffer-max. veľkosť',
|
||||||
COMPACT: 'Kompaktné',
|
COMPACT: 'Kompaktné',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Vytvorte zálohu svojej konfigurácie a nastavení',
|
DOWNLOAD_SETTINGS_TEXT: 'Vytvorte zálohu svojej konfigurácie a nastavení',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Exportovať všetky hodnoty',
|
DOWNLOAD_SETTINGS_TEXT2: 'Exportovať všetky dáta',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Systémová záloha',
|
|
||||||
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',
|
||||||
ERROR: 'Neočakávaná chyba, prosím skúste to znova',
|
ERROR: 'Neočakávaná chyba, prosím skúste to znova',
|
||||||
@@ -276,11 +275,11 @@ const sk: Translation = {
|
|||||||
NETWORK_SUBNET: 'Maska podsiete',
|
NETWORK_SUBNET: 'Maska podsiete',
|
||||||
NETWORK_DNS: 'DNS servery',
|
NETWORK_DNS: 'DNS servery',
|
||||||
ADDRESS_OF: '{0} adresa',
|
ADDRESS_OF: '{0} adresa',
|
||||||
ADMINISTRATOR: 'Administrátor',
|
ADMINISTRATOR: 'Administrator',
|
||||||
GUEST: 'Hosť',
|
GUEST: 'Hosť',
|
||||||
NEW: 'Novú',
|
NEW: 'Nová',
|
||||||
NEW_NAME_OF: 'Nový názov {0}',
|
NEW_NAME_OF: 'Nový názov {0}',
|
||||||
ENTITY: 'entitu',
|
ENTITY: 'entita',
|
||||||
MIN: 'min',
|
MIN: 'min',
|
||||||
MAX: 'max',
|
MAX: 'max',
|
||||||
BLOCK_NAVIGATE_1: 'Máte neuložené zmeny',
|
BLOCK_NAVIGATE_1: 'Máte neuložené zmeny',
|
||||||
@@ -350,7 +349,6 @@ const sk: Translation = {
|
|||||||
NO_DATA_1: 'Nenašli sa žiadne obľúbené entity EMS. Použite',
|
NO_DATA_1: 'Nenašli sa žiadne obľúbené entity EMS. Použite',
|
||||||
NO_DATA_2: 'modul na ich označenie.',
|
NO_DATA_2: 'modul na ich označenie.',
|
||||||
NO_DATA_3: 'Ak chcete zobraziť všetky dostupné entity, prejdite na',
|
NO_DATA_3: 'Ak chcete zobraziť všetky dostupné entity, prejdite na',
|
||||||
NO_GPIO: 'Nebol nájdený žiadny dostupný GPIO',
|
|
||||||
THIS_VERSION: 'Táto verzia',
|
THIS_VERSION: 'Táto verzia',
|
||||||
PLATFORM: 'Platforma',
|
PLATFORM: 'Platforma',
|
||||||
RELEASE_TYPE: 'Typ vydania',
|
RELEASE_TYPE: 'Typ vydania',
|
||||||
@@ -359,13 +357,7 @@ const sk: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Informácie o verzii firmware',
|
FIRMWARE_VERSION_INFO: 'Informácie o verzii firmware',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Aktualizovať dôležité správy',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Táto aktualizácia vyžaduje reštart základných nastavení. Uistite sa, že najprv stiahnete systémovú zálohu pred pokračovaním, a potom nahrajte tento súbor po instalácii novej verzie.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Aktualizujete sa na novú hlavnú verziu. Uistite sa, že ste prečítali ChangeLog pre akékoľvek dôležité zmeny.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Toto vytvorí zálohu všetkých vašich celých systémových konfigurácií a nastavení. Všetky hesla budú čitateľné v zálohovom súbore. Buďte opatrní pri zdieľaní! Chcete pokračovať?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sk;
|
export default sk;
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const sv: Translation = {
|
|||||||
BUFFER_SIZE: 'Max bufferstorlek',
|
BUFFER_SIZE: 'Max bufferstorlek',
|
||||||
COMPACT: 'Komprimerad',
|
COMPACT: 'Komprimerad',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Skapa en säkerhetskopia av din konfiguration och inställningar',
|
DOWNLOAD_SETTINGS_TEXT: 'Skapa en säkerhetskopia av din konfiguration och inställningar',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Exportera alla värden',
|
DOWNLOAD_SETTINGS_TEXT2: 'Exportera alla data',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'System säkerhetskopia',
|
|
||||||
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',
|
||||||
ERROR: 'Okänt fel, var god försök igen',
|
ERROR: 'Okänt fel, var god försök igen',
|
||||||
@@ -350,7 +349,6 @@ const sv: Translation = {
|
|||||||
NO_DATA_1: 'Inga favorit EMS enheter hittade än. Använd',
|
NO_DATA_1: 'Inga favorit EMS enheter hittade än. Använd',
|
||||||
NO_DATA_2: 'modul för att markera dem.',
|
NO_DATA_2: 'modul för att markera dem.',
|
||||||
NO_DATA_3: 'För att se alla tillgängliga enheter, gå till',
|
NO_DATA_3: 'För att se alla tillgängliga enheter, gå till',
|
||||||
NO_GPIO: 'Inga tillgängliga GPIO-portar hittades',
|
|
||||||
THIS_VERSION: 'Denna version',
|
THIS_VERSION: 'Denna version',
|
||||||
PLATFORM: 'Plattform',
|
PLATFORM: 'Plattform',
|
||||||
RELEASE_TYPE: 'Utgivelsestyp',
|
RELEASE_TYPE: 'Utgivelsestyp',
|
||||||
@@ -359,13 +357,7 @@ const sv: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Information om firmwareversion',
|
FIRMWARE_VERSION_INFO: 'Information om firmwareversion',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Uppdatera viktiga meddelanden',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Denna uppdatering kräver en fabriksåterställning. Se till att du först laddar ned en System Backup innan du fortsätter, och ladda upp denna fil efter att den nya versionen är installerad.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Du uppdaterar till en ny huvudversion. Se till att du har läst ChangeLog för eventuella brkande ändringar.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Detta kommer att skapa en säkerhetskopia av din fullständiga systemkonfiguration och inställningar. Alla lösenord kommer att vara läsbara i säkerhetskopien. Var försiktig med att dela! Vill du fortsätta?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sv;
|
export default sv;
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ const tr: Translation = {
|
|||||||
BUFFER_SIZE: 'En fazla bellek boyutu',
|
BUFFER_SIZE: 'En fazla bellek boyutu',
|
||||||
COMPACT: 'Sıkışık',
|
COMPACT: 'Sıkışık',
|
||||||
DOWNLOAD_SETTINGS_TEXT: 'Yapılandırma ve ayarlarınızın yedekleme yapın',
|
DOWNLOAD_SETTINGS_TEXT: 'Yapılandırma ve ayarlarınızın yedekleme yapın',
|
||||||
DOWNLOAD_SETTINGS_TEXT2: 'Tüm değerleri dışarı al',
|
DOWNLOAD_SETTINGS_TEXT2: 'Tüm verileri dışarı al',
|
||||||
DOWNLOAD_SYSTEM_BACKUP: 'Sistem yedekleme',
|
|
||||||
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',
|
||||||
ERROR: 'Beklenemedik hata, lütfen tekrar deneyin.',
|
ERROR: 'Beklenemedik hata, lütfen tekrar deneyin.',
|
||||||
@@ -350,7 +349,6 @@ const tr: Translation = {
|
|||||||
NO_DATA_1: 'Henüz bir favori EMS varlığı bulunamadı. Kullanın',
|
NO_DATA_1: 'Henüz bir favori EMS varlığı bulunamadı. Kullanın',
|
||||||
NO_DATA_2: 'modülünü kullanın.',
|
NO_DATA_2: 'modülünü kullanın.',
|
||||||
NO_DATA_3: 'Tüm kullanılabilir varlıkları görmek için git',
|
NO_DATA_3: 'Tüm kullanılabilir varlıkları görmek için git',
|
||||||
NO_GPIO: 'Kullanılabilir GPIO bulunamadı',
|
|
||||||
THIS_VERSION: 'Bu Sürüm',
|
THIS_VERSION: 'Bu Sürüm',
|
||||||
PLATFORM: 'Platforma',
|
PLATFORM: 'Platforma',
|
||||||
RELEASE_TYPE: 'Sürüm Tipi',
|
RELEASE_TYPE: 'Sürüm Tipi',
|
||||||
@@ -359,13 +357,7 @@ const tr: Translation = {
|
|||||||
FIRMWARE_VERSION_INFO: 'Firmware Sürüm Bilgisi',
|
FIRMWARE_VERSION_INFO: 'Firmware Sürüm Bilgisi',
|
||||||
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',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES: 'Önemli Mesajları Güncelle',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_1: 'Bu güncelleme továrnı ayarlarını gerektirir. Yapılandırmanızı ve ayarlarınızı önce yedekleyin ve ardından yeni sürüm yüklendikten sonra yükleyin.',
|
|
||||||
UPGRADE_IMPORTANT_MESSAGES_2: 'Yeni bir büyük sürüme yükselteceksiniz. Değişiklikleri ChangeLogı okuduğunuzdan emin olun.',
|
|
||||||
WARNING_SYSTEM_BACKUP: 'Bu, sistem yapılandırmanızı ve ayarlarınızın bir yedeklemesi oluşturacaktır. Tüm şifreler yedekleme dosyasında okunabilir olacaktır. Paylaşırken dikkatli olun! Devam etmek istediğinize emin misiniz?'
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default tr;
|
export default tr;
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ export const saveFile = (
|
|||||||
}, 100);
|
}, 100);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to save file:', error);
|
console.error('Failed to save file:', error);
|
||||||
throw new Error(`Unable to save file: ${filename}${extension}`, {
|
throw new Error(`Unable to save file: ${filename}${extension}`);
|
||||||
cause: error
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
const DEFAULT_DELAY = 5000;
|
const DEFAULT_DELAY = 3000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom hook for setting up an interval with proper cleanup
|
* Custom hook for setting up an interval with proper cleanup
|
||||||
|
|||||||
@@ -1,20 +1,6 @@
|
|||||||
import type {
|
import type { InternalRuleItem, ValidateOption } from 'async-validator';
|
||||||
InternalRuleItem,
|
|
||||||
ValidateFieldsError,
|
|
||||||
ValidateOption
|
|
||||||
} from 'async-validator';
|
|
||||||
import type Schema from 'async-validator';
|
import type Schema from 'async-validator';
|
||||||
|
|
||||||
export class ValidationError extends Error {
|
|
||||||
readonly fieldErrors: ValidateFieldsError;
|
|
||||||
|
|
||||||
constructor(fieldErrors: ValidateFieldsError) {
|
|
||||||
super('Validation failed');
|
|
||||||
this.name = 'ValidationError';
|
|
||||||
this.fieldErrors = fieldErrors;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const validate = <T extends object>(
|
export const validate = <T extends object>(
|
||||||
validator: Schema,
|
validator: Schema,
|
||||||
source: Partial<T>,
|
source: Partial<T>,
|
||||||
@@ -22,7 +8,7 @@ export const validate = <T extends object>(
|
|||||||
): Promise<T> =>
|
): Promise<T> =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
void validator.validate(source, options ?? {}, (errors, fieldErrors) => {
|
void validator.validate(source, options ?? {}, (errors, fieldErrors) => {
|
||||||
errors ? reject(new ValidationError(fieldErrors)) : resolve(source as T);
|
errors ? reject(fieldErrors as Error) : resolve(source as T);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ import preact from '@preact/preset-vite';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { visualizer } from 'rollup-plugin-visualizer';
|
import { visualizer } from 'rollup-plugin-visualizer';
|
||||||
import { Plugin, PluginOption, defineConfig } from 'vite';
|
import { Plugin, defineConfig } from 'vite';
|
||||||
import viteImagemin from 'vite-plugin-imagemin';
|
import viteImagemin from 'vite-plugin-imagemin';
|
||||||
|
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
||||||
import zlib from 'zlib';
|
import zlib from 'zlib';
|
||||||
|
|
||||||
// @ts-expect-error - mock server doesn't have type declarations
|
// @ts-expect-error - mock server doesn't have type declarations
|
||||||
@@ -15,7 +16,7 @@ const REPEAT_CHAR = '=';
|
|||||||
const REPEAT_COUNT = 50;
|
const REPEAT_COUNT = 50;
|
||||||
const DEFAULT_OUT_DIR = 'dist';
|
const DEFAULT_OUT_DIR = 'dist';
|
||||||
const ES_TARGET = 'es2020';
|
const ES_TARGET = 'es2020';
|
||||||
const CHUNK_SIZE_WARNING_LIMIT = 1024;
|
const CHUNK_SIZE_WARNING_LIMIT = 512;
|
||||||
const ASSETS_INLINE_LIMIT = 4096;
|
const ASSETS_INLINE_LIMIT = 4096;
|
||||||
|
|
||||||
// Common resolve aliases
|
// Common resolve aliases
|
||||||
@@ -98,31 +99,16 @@ const createPreactPlugin = (devToolsEnabled: boolean) =>
|
|||||||
prefreshEnabled: false
|
prefreshEnabled: false
|
||||||
});
|
});
|
||||||
|
|
||||||
// Patch preact/compat to export stub React 19 APIs (use, useOptimistic) so that
|
|
||||||
// react-router v7 doesn't trigger IMPORT_IS_UNDEFINED warnings from Rolldown.
|
|
||||||
const preactCompatPatchPlugin = (): Plugin => ({
|
|
||||||
name: 'preact-compat-react19-patch',
|
|
||||||
transform(code, id) {
|
|
||||||
if (id.includes('preact') && id.includes('compat.module.js')) {
|
|
||||||
return {
|
|
||||||
code:
|
|
||||||
code +
|
|
||||||
'\nexport var use = undefined;\nexport var useOptimistic = undefined;\n',
|
|
||||||
map: null
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Common base plugins
|
// Common base plugins
|
||||||
const createBasePlugins = (
|
const createBasePlugins = (
|
||||||
devToolsEnabled: boolean,
|
devToolsEnabled: boolean,
|
||||||
includeBundleReporter = true
|
includeBundleReporter = true
|
||||||
): PluginOption[] => {
|
) => {
|
||||||
const plugins: PluginOption[] = [
|
const plugins = [
|
||||||
createPreactPlugin(devToolsEnabled),
|
createPreactPlugin(devToolsEnabled),
|
||||||
preactCompatPatchPlugin()
|
viteTsconfigPaths({
|
||||||
|
projects: ['./tsconfig.json']
|
||||||
|
})
|
||||||
];
|
];
|
||||||
if (includeBundleReporter) {
|
if (includeBundleReporter) {
|
||||||
plugins.push(bundleSizeReporter());
|
plugins.push(bundleSizeReporter());
|
||||||
@@ -130,10 +116,41 @@ const createBasePlugins = (
|
|||||||
return plugins;
|
return plugins;
|
||||||
};
|
};
|
||||||
|
|
||||||
const manualChunks = (id: string): string | undefined => {
|
// Manual chunk splitting strategy
|
||||||
if (id.includes('node_modules')) return 'vendor';
|
const createManualChunks = (detailed = false) => {
|
||||||
|
return (id: string): string | undefined => {
|
||||||
|
if (id.includes('node_modules')) {
|
||||||
|
if (id.includes('preact')) return '@preact';
|
||||||
|
if (detailed) {
|
||||||
|
if (id.includes('react-router')) return '@react-router';
|
||||||
|
if (id.includes('@mui/material')) return '@mui-material';
|
||||||
|
if (id.includes('@mui/icons-material')) return '@mui-icons';
|
||||||
|
if (id.includes('alova')) return '@alova';
|
||||||
|
if (id.includes('typesafe-i18n')) return '@i18n';
|
||||||
|
if (id.includes('react-toastify')) return '@toastify';
|
||||||
|
if (id.includes('@table-library')) return '@table-library';
|
||||||
|
if (id.includes('uuid')) return '@uuid';
|
||||||
|
if (id.includes('axios') || id.includes('fetch')) return '@http';
|
||||||
|
if (id.includes('lodash') || id.includes('ramda')) return '@utils';
|
||||||
|
}
|
||||||
|
return 'vendor';
|
||||||
|
}
|
||||||
|
if (detailed) {
|
||||||
|
// Group circularly dependent modules together to avoid circular chunk warnings
|
||||||
|
// components, app, and utils are tightly coupled, so combine them
|
||||||
|
if (
|
||||||
|
id.includes('components/') ||
|
||||||
|
id.includes('app/') ||
|
||||||
|
id.includes('utils/')
|
||||||
|
) {
|
||||||
|
return 'app';
|
||||||
|
}
|
||||||
|
// Keep api separate as it's typically more independent
|
||||||
|
if (id.includes('api/')) return 'api';
|
||||||
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// Common build base configuration
|
// Common build base configuration
|
||||||
const createBaseBuildConfig = () => ({
|
const createBaseBuildConfig = () => ({
|
||||||
@@ -217,8 +234,7 @@ export default defineConfig(
|
|||||||
plugins: [...createBasePlugins(true, true), mockServer()],
|
plugins: [...createBasePlugins(true, true), mockServer()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: RESOLVE_ALIASES,
|
alias: RESOLVE_ALIASES,
|
||||||
extensions: RESOLVE_EXTENSIONS,
|
extensions: RESOLVE_EXTENSIONS
|
||||||
tsconfigPaths: true
|
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
open: true,
|
open: true,
|
||||||
@@ -247,8 +263,7 @@ export default defineConfig(
|
|||||||
plugins: createBasePlugins(false, true),
|
plugins: createBasePlugins(false, true),
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: RESOLVE_ALIASES,
|
alias: RESOLVE_ALIASES,
|
||||||
extensions: RESOLVE_EXTENSIONS,
|
extensions: RESOLVE_EXTENSIONS
|
||||||
tsconfigPaths: true
|
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
...createBaseBuildConfig(),
|
...createBaseBuildConfig(),
|
||||||
@@ -259,7 +274,7 @@ export default defineConfig(
|
|||||||
moduleSideEffects: false
|
moduleSideEffects: false
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
manualChunks
|
manualChunks: createManualChunks(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,8 +297,7 @@ export default defineConfig(
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: RESOLVE_ALIASES,
|
alias: RESOLVE_ALIASES,
|
||||||
extensions: RESOLVE_EXTENSIONS,
|
extensions: RESOLVE_EXTENSIONS
|
||||||
tsconfigPaths: true
|
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
...createBaseBuildConfig(),
|
...createBaseBuildConfig(),
|
||||||
@@ -292,14 +306,15 @@ export default defineConfig(
|
|||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
treeshake: {
|
treeshake: {
|
||||||
moduleSideEffects: false,
|
moduleSideEffects: false,
|
||||||
propertyReadSideEffects: false as const,
|
propertyReadSideEffects: false,
|
||||||
|
tryCatchDeoptimization: false,
|
||||||
unknownGlobalSideEffects: false
|
unknownGlobalSideEffects: false
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
chunkFileNames: 'assets/[name]-[hash].js',
|
chunkFileNames: 'assets/[name]-[hash].js',
|
||||||
entryFileNames: 'assets/[name]-[hash].js',
|
entryFileNames: 'assets/[name]-[hash].js',
|
||||||
assetFileNames: 'assets/[name]-[hash].[ext]',
|
assetFileNames: 'assets/[name]-[hash].[ext]',
|
||||||
manualChunks,
|
manualChunks: createManualChunks(true),
|
||||||
sourcemap: false
|
sourcemap: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,9 @@
|
|||||||
#elif defined(ARDUINO_ARCH_ESP32)
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
#include <driver/rtc_io.h>
|
#include <driver/rtc_io.h>
|
||||||
#include <soc/gpio_struct.h>
|
#include <soc/gpio_struct.h>
|
||||||
|
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||||
#include "soc/gpio_periph.h"
|
#include "soc/gpio_periph.h"
|
||||||
|
#endif // ESP_IDF_VERSION_MAJOR >= 5
|
||||||
#define PIN_TO_BASEREG(pin) (0)
|
#define PIN_TO_BASEREG(pin) (0)
|
||||||
#define PIN_TO_BITMASK(pin) (pin)
|
#define PIN_TO_BITMASK(pin) (pin)
|
||||||
#define IO_REG_TYPE uint32_t
|
#define IO_REG_TYPE uint32_t
|
||||||
|
|||||||
@@ -12,9 +12,7 @@
|
|||||||
// Include all library components
|
// Include all library components
|
||||||
#include "esp32-psram/AllocatorPSRAM.h" // PSRAM-backed vector
|
#include "esp32-psram/AllocatorPSRAM.h" // PSRAM-backed vector
|
||||||
#include "esp32-psram/VectorPSRAM.h" // PSRAM-backed vector
|
#include "esp32-psram/VectorPSRAM.h" // PSRAM-backed vector
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
#include "esp32-psram/VectorHIMEM.h" // HIMEM-backed vector
|
||||||
#include "esp32-psram/VectorHIMEM.h" // HIMEM-backed vector (ESP32 only)
|
|
||||||
#endif
|
|
||||||
// #include "esp32-psram/InMemoryFile.h" // File interface using vectors
|
// #include "esp32-psram/InMemoryFile.h" // File interface using vectors
|
||||||
// #include "esp32-psram/PSRAM.h" // PSRAM file system
|
// #include "esp32-psram/PSRAM.h" // PSRAM file system
|
||||||
// #include "esp32-psram/HIMEM.h" // HIMEM file system
|
// #include "esp32-psram/HIMEM.h" // HIMEM file system
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// HIMEM is only available on original ESP32
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -363,5 +360,3 @@ class HimemBlock {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace esp32_psram
|
} // namespace esp32_psram
|
||||||
|
|
||||||
#endif // CONFIG_IDF_TARGET_ESP32
|
|
||||||
|
|||||||
@@ -238,9 +238,7 @@ using RingBufferStreamPSRAM = RingBufferStream<VectorPSRAM<uint8_t>>;
|
|||||||
/**
|
/**
|
||||||
* @brief Type alias for a RingBufferStream that uses HIMEM-backed vector storage
|
* @brief Type alias for a RingBufferStream that uses HIMEM-backed vector storage
|
||||||
*/
|
*/
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
|
||||||
using RingBufferStreamHIMEM = RingBufferStream<VectorHIMEM<uint8_t>>;
|
using RingBufferStreamHIMEM = RingBufferStream<VectorHIMEM<uint8_t>>;
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Type alias for a RingBufferStream that uses std::vector storage
|
* @brief Type alias for a RingBufferStream that uses std::vector storage
|
||||||
|
|||||||
@@ -209,10 +209,8 @@ using TypedRingBufferRAM = TypedRingBuffer<T, std::vector<T>>;
|
|||||||
/**
|
/**
|
||||||
* @brief Type alias for a typed ring buffer that uses HIMEM-backed vector storage
|
* @brief Type alias for a typed ring buffer that uses HIMEM-backed vector storage
|
||||||
*/
|
*/
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using TypedRingBufferHIMEM = TypedRingBuffer<T, VectorHIMEM<T>>;
|
using TypedRingBufferHIMEM = TypedRingBuffer<T, VectorHIMEM<T>>;
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Type alias for a typed ring buffer that uses PSRAM-backed vector storage
|
* @brief Type alias for a typed ring buffer that uses PSRAM-backed vector storage
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// HIMEM is only available on original ESP32
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
#include "HimemBlock.h"
|
#include "HimemBlock.h"
|
||||||
|
|
||||||
namespace esp32_psram {
|
namespace esp32_psram {
|
||||||
@@ -530,5 +527,3 @@ void swap(VectorHIMEM<T>& lhs, VectorHIMEM<T>& rhs) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace esp32_psram
|
} // namespace esp32_psram
|
||||||
|
|
||||||
#endif // CONFIG_IDF_TARGET_ESP32
|
|
||||||
@@ -49,10 +49,6 @@ the LICENSE file.
|
|||||||
#define EMC_CLIENTID_LENGTH 23 + 1
|
#define EMC_CLIENTID_LENGTH 23 + 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EMSESP_MQTT_STACKSIZE
|
|
||||||
#define EMC_TASK_STACK_SIZE EMSESP_MQTT_STACKSIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef EMC_TASK_STACK_SIZE
|
#ifndef EMC_TASK_STACK_SIZE
|
||||||
#define EMC_TASK_STACK_SIZE 5120
|
#define EMC_TASK_STACK_SIZE 5120
|
||||||
#endif
|
#endif
|
||||||
@@ -77,3 +73,7 @@ the LICENSE file.
|
|||||||
#define EMC_SIZE_POOL_ELEMENTS 128
|
#define EMC_SIZE_POOL_ELEMENTS 128
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TASMOTA_SDK
|
||||||
|
#define EMC_CLIENT_SECURE
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -62,19 +62,14 @@ MqttClient::MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint
|
|||||||
_xSemaphore = xSemaphoreCreateMutex();
|
_xSemaphore = xSemaphoreCreateMutex();
|
||||||
EMC_SEMAPHORE_GIVE(); // release before first use
|
EMC_SEMAPHORE_GIVE(); // release before first use
|
||||||
if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) {
|
if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) {
|
||||||
if (core > 1) {
|
|
||||||
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
|
|
||||||
} else {
|
|
||||||
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
|
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
(void) useInternalTask;
|
(void) useInternalTask;
|
||||||
(void) priority;
|
(void) priority;
|
||||||
(void) core;
|
(void) core;
|
||||||
#endif
|
#endif
|
||||||
_clientId = _generatedClientId;
|
_clientId = _generatedClientId;
|
||||||
_core = core;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MqttClient::~MqttClient() {
|
MqttClient::~MqttClient() {
|
||||||
|
|||||||
@@ -69,16 +69,6 @@ class MqttClient {
|
|||||||
const char* getClientId() const;
|
const char* getClientId() const;
|
||||||
size_t queueSize(); // No const because of mutex
|
size_t queueSize(); // No const because of mutex
|
||||||
void loop();
|
void loop();
|
||||||
uint32_t stack() {
|
|
||||||
#ifndef EMSESP_STANDALONE
|
|
||||||
return uxTaskGetStackHighWaterMark(_taskHandle);
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
uint8_t core() {
|
|
||||||
return _core;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint8_t priority = 1, uint8_t core = 1);
|
explicit MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint8_t priority = 1, uint8_t core = 1);
|
||||||
@@ -108,7 +98,6 @@ class MqttClient {
|
|||||||
uint8_t _willQos;
|
uint8_t _willQos;
|
||||||
bool _willRetain;
|
bool _willRetain;
|
||||||
uint32_t _timeout;
|
uint32_t _timeout;
|
||||||
uint8_t _core;
|
|
||||||
|
|
||||||
// state is protected to allow state changes by the transport system, defined in child classes
|
// state is protected to allow state changes by the transport system, defined in child classes
|
||||||
// eg. to allow AsyncTCP
|
// eg. to allow AsyncTCP
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ the LICENSE file.
|
|||||||
|
|
||||||
#include "ClientPosix.h"
|
#include "ClientPosix.h"
|
||||||
|
|
||||||
#if defined(__linux__) || defined(__APPLE__)
|
#if defined(__linux__)
|
||||||
|
|
||||||
namespace espMqttClientInternals {
|
namespace espMqttClientInternals {
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ the LICENSE file.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(__linux__) || defined(__APPLE__)
|
#if defined(__linux__)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -6,31 +6,28 @@ For a copy, see <https://opensource.org/licenses/MIT> or
|
|||||||
the LICENSE file.
|
the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_TLS_SUPPORT
|
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
||||||
|
|
||||||
#include "ClientSecureSync.h"
|
#include "ClientSecureSync.h"
|
||||||
#include <lwip/sockets.h>
|
#include <lwip/sockets.h> // socket options
|
||||||
#include "../Config.h"
|
|
||||||
|
|
||||||
namespace espMqttClientInternals {
|
namespace espMqttClientInternals {
|
||||||
|
|
||||||
ClientSecureSync::ClientSecureSync()
|
ClientSecureSync::ClientSecureSync()
|
||||||
: client() {
|
: client() {
|
||||||
client.setClient(&basic_client, true);
|
// empty
|
||||||
client.setBufferSizes(EMC_RX_BUFFER_SIZE, EMC_TX_BUFFER_SIZE);
|
|
||||||
client.setSessionTimeout(120); // Set the timeout in seconds (>=120 seconds)
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientSecureSync::~ClientSecureSync() {
|
|
||||||
stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClientSecureSync::connect(IPAddress ip, uint16_t port) {
|
bool ClientSecureSync::connect(IPAddress ip, uint16_t port) {
|
||||||
bool ret = client.connect(ip, port); // implicit conversion of return code int --> bool
|
bool ret = client.connect(ip, port); // implicit conversion of return code int --> bool
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
#if defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
client.setNoDelay(true);
|
||||||
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
// Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure
|
// Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure
|
||||||
int val = true;
|
int val = true;
|
||||||
basic_client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int));
|
client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -38,9 +35,13 @@ bool ClientSecureSync::connect(IPAddress ip, uint16_t port) {
|
|||||||
bool ClientSecureSync::connect(const char* host, uint16_t port) {
|
bool ClientSecureSync::connect(const char* host, uint16_t port) {
|
||||||
bool ret = client.connect(host, port); // implicit conversion of return code int --> bool
|
bool ret = client.connect(host, port); // implicit conversion of return code int --> bool
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
#if defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
client.setNoDelay(true);
|
||||||
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
// Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure
|
// Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure
|
||||||
int val = true;
|
int val = true;
|
||||||
basic_client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int));
|
client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,15 @@ the LICENSE file.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef NO_TLS_SUPPORT
|
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
||||||
|
|
||||||
// #include "esp_tls.h"
|
// Added for EMS-ESP
|
||||||
|
#include "../Config.h"
|
||||||
|
#if defined(EMC_CLIENT_SECURE)
|
||||||
|
#include <WiFiClientSecure.h> // includes IPAddress
|
||||||
|
#else
|
||||||
#include <WiFiClient.h>
|
#include <WiFiClient.h>
|
||||||
#include <ESP_SSLClient.h>
|
#endif
|
||||||
#include "Transport.h"
|
#include "Transport.h"
|
||||||
|
|
||||||
namespace espMqttClientInternals {
|
namespace espMqttClientInternals {
|
||||||
@@ -20,7 +24,6 @@ namespace espMqttClientInternals {
|
|||||||
class ClientSecureSync : public Transport {
|
class ClientSecureSync : public Transport {
|
||||||
public:
|
public:
|
||||||
ClientSecureSync();
|
ClientSecureSync();
|
||||||
~ClientSecureSync();
|
|
||||||
bool connect(IPAddress ip, uint16_t port) override;
|
bool connect(IPAddress ip, uint16_t port) override;
|
||||||
bool connect(const char * host, uint16_t port) override;
|
bool connect(const char * host, uint16_t port) override;
|
||||||
size_t write(const uint8_t * buf, size_t size) override;
|
size_t write(const uint8_t * buf, size_t size) override;
|
||||||
@@ -28,9 +31,12 @@ class ClientSecureSync : public Transport {
|
|||||||
void stop() override;
|
void stop() override;
|
||||||
bool connected() override;
|
bool connected() override;
|
||||||
bool disconnected() override;
|
bool disconnected() override;
|
||||||
|
// added for EMS-ESP
|
||||||
WiFiClient basic_client;
|
#if defined(EMC_CLIENT_SECURE)
|
||||||
ESP_SSLClient client;
|
WiFiClientSecure client;
|
||||||
|
#else
|
||||||
|
WiFiClient client;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace espMqttClientInternals
|
} // namespace espMqttClientInternals
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user