Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft dashboard - #1958 #2083

Merged
merged 68 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
58ddee9
mock dashboard data
proddy Oct 2, 2024
fa4281c
package update
proddy Oct 2, 2024
f9f87dd
add comment
proddy Oct 2, 2024
fb0d945
dashboard v.01
proddy Oct 3, 2024
01db9db
update dashboard for analog
proddy Oct 3, 2024
fd7d8ca
enable write in dashboard
proddy Oct 4, 2024
4fde9e7
fix slowness
proddy Oct 4, 2024
e501ac3
translations and finish writeDevice
proddy Oct 5, 2024
812df36
turn on test data
proddy Oct 5, 2024
10c03a3
Merge branch 'dev' into ft_dashboard
proddy Oct 6, 2024
87cea58
optimize with useMemo
proddy Oct 8, 2024
5d69ce1
optimize with useMemo
proddy Oct 8, 2024
1681d99
replace data with nodes
proddy Oct 8, 2024
59c4866
updated for Dashboard
proddy Oct 8, 2024
0c3a83d
ignore mjs files
proddy Oct 8, 2024
e7d9978
package update
proddy Oct 8, 2024
621f35b
add Dashboard test in api3
proddy Oct 8, 2024
8b1015b
add note about upload speeds on MacBooks
proddy Oct 8, 2024
8cbac95
3.7.0-dev.44
proddy Oct 8, 2024
aa88c07
more cleanup
proddy Oct 8, 2024
fc0fd62
show error when using an invalid gpio in webUI
proddy Oct 8, 2024
4611ed4
Dashboard implementation
proddy Oct 8, 2024
f94ac6b
change CTRL-C to CTRL-S as pio monitor uses ctrl-c to exit
proddy Oct 8, 2024
dbaefe4
added some comments
proddy Oct 8, 2024
81541d0
added a standalone test
proddy Oct 8, 2024
8e56cbf
fix data loading when dialog was open
proddy Oct 8, 2024
63f3517
make all REMOVE and UPDATE buttons look the same
proddy Oct 8, 2024
0881c57
reverse polarity if offset 0
proddy Oct 9, 2024
1e78357
package update
proddy Oct 9, 2024
6b99fb0
add icon for Scheduler
proddy Oct 10, 2024
3203d03
move Sensors to Modules
proddy Oct 10, 2024
d39fc82
rename DevicesDialog
proddy Oct 10, 2024
2bdd4af
support for unknown value and uom
proddy Oct 10, 2024
faa0198
DashboardItem[]
proddy Oct 10, 2024
87c9036
text for Dashboard
proddy Oct 10, 2024
03ae973
add test for Dashboard
proddy Oct 10, 2024
594a48a
Dashboard data
proddy Oct 10, 2024
5a472cb
package update
proddy Oct 10, 2024
0e451f0
rename test sensors
proddy Oct 10, 2024
c5257d7
ignore local package
proddy Oct 10, 2024
5234a44
3.7.0-dev.44
proddy Oct 10, 2024
a9b01e0
CTRL-D for console
proddy Oct 10, 2024
ca8ed2d
added DeviceTypeUniqueID for Dashboard
proddy Oct 10, 2024
b7e6552
Dashboard - #1958
proddy Oct 10, 2024
9a6e84c
replace DashboardData with array
proddy Oct 10, 2024
e52753e
rename DialogProps
proddy Oct 10, 2024
37ac684
rename test temp sensors
proddy Oct 10, 2024
31cfdc6
support single scheduler item updates for Dashboard
proddy Oct 10, 2024
a001a31
use DeviceTypeUniqueID
proddy Oct 10, 2024
d373309
Implements back end for Dashboard - Feature: Dashboard showing all da…
proddy Oct 10, 2024
6d45dfb
DE translations for Dashboard
proddy Oct 11, 2024
ef3d42b
fix s3 board_build.extra_flags for USB serial
MichaelDvP Oct 11, 2024
33efb1a
all dashboard changes uses commands
MichaelDvP Oct 11, 2024
662df4c
package update
proddy Oct 11, 2024
e36f6db
Merge pull request #6 from MichaelDvP/ft_dashboard
proddy Oct 11, 2024
38f4244
update test data for dashboard
proddy Oct 11, 2024
c79d5f2
toast slide in from left so it doesnt obscure data
proddy Oct 11, 2024
4fac364
table formatting, remove inner scrollbar
proddy Oct 11, 2024
ebd7d86
table formatting
proddy Oct 12, 2024
b251fa4
alova update
proddy Oct 12, 2024
b78f6da
add comment reminders
proddy Oct 12, 2024
67f7cc5
update sample test data
proddy Oct 12, 2024
801c1ae
add TODOs for formatting reminders
proddy Oct 12, 2024
4ca7da6
add a test_analogsensor3 that is disabled
proddy Oct 12, 2024
ed11260
don't include disabled analog sensors in dashboard
proddy Oct 12, 2024
e40d01f
package update
proddy Oct 13, 2024
55bcc44
fix dashboard/disabled analog sensors
proddy Oct 13, 2024
3c1bfa0
formatting table
proddy Oct 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ words-found-verbose.txt

# sonarlint
compile_commands.json
package.json
7 changes: 4 additions & 3 deletions CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ For more details go to [www.emsesp.org](https://www.emsesp.org/).
- RT800 remote emulation [#1867](https://github.com/emsesp/EMS-ESP32/issues/1867)
- RC310 cooling parameters [#1857](https://github.com/emsesp/EMS-ESP32/issues/1857)
- command `api/device/entities` [#1897](https://github.com/emsesp/EMS-ESP32/issues/1897)
- switchprogmode [#1903]<https://github.com/emsesp/EMS-ESP32/discussions/1903>
- switchprogmode [#1903](https://github.com/emsesp/EMS-ESP32/discussions/1903)
- autodetect and download firmware upgrades via the WebUI
- command 'show log' that lists out the current weblog buffer, showing last messages.
- default web log buffer to 25 lines for ESP32s with no PSRAM
- try and determine correct board profile if none is set during boot
- auto Scroll in WebLog UI - reduced delay so incoming logs are faster
- uploading custom support info for Guest users [#2054]<https://github.com/emsesp/EMS-ESP32/issues/2054>
- uploading custom support info, shown to Guest users in Help page [#2054](https://github.com/emsesp/EMS-ESP32/issues/2054)
- feature: Dashboard showing all data (favorites, sensors, custom) [#1958](https://github.com/emsesp/EMS-ESP32/issues/1958)

## Fixed

Expand All @@ -69,7 +70,7 @@ For more details go to [www.emsesp.org](https://www.emsesp.org/).
- Change key-names in JSON to be compliant and consistent [#1860](https://github.com/emsesp/EMS-ESP32/issues/1860)
- Updates to webUI [#1920](https://github.com/emsesp/EMS-ESP32/issues/1920)
- Correct firmware naming #1933 [#1933](https://github.com/emsesp/EMS-ESP32/issues/1933)
- Don't start Serial console if not connected to a Serial port. Will initiate manually after a CTRL-C
- Don't start Serial console if not connected to a Serial port. Will initiate manually after a CTRL-C/CTRL-S
- WebLog UI matches color schema of the terminal console correctly
- Updated Web libraries, ArduinoJson
- Help page doesn't show detailed tech info if the user is not 'admin' role [#2054](https://github.com/emsesp/EMS-ESP32/issues/2054)
Expand Down
10 changes: 9 additions & 1 deletion interface/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ export default tseslint.config(
}
},
{
ignores: ['dist/*', 'build/*', '*.js', '**/*.cjs', '**/unpack.ts', 'i18n*.*']
ignores: [
'dist/*',
'*.mjs',
'build/*',
'*.js',
'**/*.cjs',
'**/unpack.ts',
'i18n*.*'
]
},
{
rules: {
Expand Down
22 changes: 11 additions & 11 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,35 @@
"lint": "eslint . --fix"
},
"dependencies": {
"@alova/adapter-xhr": "2.0.7",
"@alova/adapter-xhr": "2.0.8",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mui/icons-material": "^6.1.2",
"@mui/material": "^6.1.2",
"@mui/icons-material": "^6.1.3",
"@mui/material": "^6.1.3",
"@table-library/react-table-library": "4.1.7",
"alova": "3.0.17",
"alova": "3.1.0",
"async-validator": "^4.2.5",
"jwt-decode": "^4.0.0",
"mime-types": "^2.1.35",
"preact": "^10.24.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.26.2",
"react-toastify": "^10.0.5",
"react-router-dom": "^6.27.0",
"react-toastify": "^10.0.6",
"typesafe-i18n": "^5.26.2",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"devDependencies": {
"@babel/core": "^7.25.7",
"@babel/core": "^7.25.8",
"@eslint/js": "^9.12.0",
"@preact/compat": "^18.3.1",
"@preact/preset-vite": "^2.9.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/formidable": "^3",
"@types/node": "^22.7.4",
"@types/node": "^22.7.5",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"concurrently": "^9.0.1",
"eslint": "^9.12.0",
Expand All @@ -58,7 +58,7 @@
"prettier": "^3.3.3",
"rollup-plugin-visualizer": "^5.12.0",
"terser": "^5.34.1",
"typescript-eslint": "8.8.0",
"typescript-eslint": "8.8.1",
"vite": "^5.4.8",
"vite-plugin-imagemin": "^0.6.1",
"vite-tsconfig-paths": "^5.0.1"
Expand Down
2 changes: 1 addition & 1 deletion interface/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const App = () => {
<CustomTheme>
<AppRouting />
<ToastContainer
position="bottom-right"
position="bottom-left"
autoClose={3000}
hideProgressBar={false}
newestOnTop={false}
Expand Down
2 changes: 2 additions & 0 deletions interface/src/AuthenticatedRouting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Navigate, Route, Routes } from 'react-router-dom';

import CustomEntities from 'app/main/CustomEntities';
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';
Expand Down Expand Up @@ -32,6 +33,7 @@ const AuthenticatedRouting = () => {
return (
<Layout>
<Routes>
<Route path="/dashboard/*" element={<Dashboard />} />
<Route path="/devices/*" element={<Devices />} />
<Route path="/sensors/*" element={<Sensors />} />
<Route path="/status/*" element={<Status />} />
Expand Down
9 changes: 8 additions & 1 deletion interface/src/api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
Action,
Activity,
CoreData,
DashboardItem,
DeviceData,
DeviceEntity,
Entities,
Expand All @@ -19,7 +20,13 @@ import type {
WriteTemperatureSensor
} from '../app/main/types';

// DashboardDevices
// Dashboard
export const readDashboard = () =>
alovaInstance.Get<DashboardItem[]>('/rest/dashboardData', {
responseType: 'arraybuffer' // uses msgpack
});

// Devices
export const readCoreData = () => alovaInstance.Get<CoreData>(`/rest/coreData`);
export const readDeviceData = (id: number) =>
alovaInstance.Get<DeviceData>('/rest/deviceData', {
Expand Down
21 changes: 8 additions & 13 deletions interface/src/app/main/CustomEntities.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useState } from 'react';
import { useCallback, useState } from 'react';
import { useBlocker } from 'react-router-dom';
import { toast } from 'react-toastify';

Expand Down Expand Up @@ -27,6 +27,7 @@ import {
useLayoutTitle
} from 'components';
import { useI18nContext } from 'i18n/i18n-react';
import { useInterval } from 'utils';

import { readCustomEntities, writeCustomEntities } from '../../api/app';
import SettingsCustomEntitiesDialog from './CustomEntitiesDialog';
Expand All @@ -52,17 +53,11 @@ const CustomEntities = () => {
initialData: []
});

useEffect(() => {
const timer = setInterval(async () => {
if (dialogOpen || numChanges > 0) {
return;
}
await fetchEntities();
}, 2000);
return () => {
clearInterval(timer);
};
});
useInterval(() => {
if (!dialogOpen && !numChanges) {
void fetchEntities();
}
}, 3000);

const { send: writeEntities } = useRequest(
(data: Entities) => writeCustomEntities(data),
Expand Down Expand Up @@ -295,7 +290,7 @@ const CustomEntities = () => {
<SectionContent>
{blocker ? <BlockNavigation blocker={blocker} /> : null}
<Box mb={2} color="warning.main">
<Typography variant="body2">{LL.ENTITIES_HELP_1()}</Typography>
<Typography variant="body1">{LL.ENTITIES_HELP_1()}</Typography>
</Box>

{renderEntity()}
Expand Down
2 changes: 1 addition & 1 deletion interface/src/app/main/Customizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ const Customizations = () => {
const renderDeviceList = () => (
<>
<Box mb={1} color="warning.main">
<Typography variant="body2">{LL.CUSTOMIZATIONS_HELP_1()}.</Typography>
<Typography variant="body1">{LL.CUSTOMIZATIONS_HELP_1()}.</Typography>
</Box>
<Box display="flex" flexWrap="wrap" alignItems="center" gap={2}>
{rename ? (
Expand Down
Loading