diff --git a/interface/package-lock.json b/interface/package-lock.json index 6fded4ef9..33d9c64ef 100644 --- a/interface/package-lock.json +++ b/interface/package-lock.json @@ -21,7 +21,7 @@ "@types/react-router-dom": "^5.3.3", "async-validator": "^4.0.7", "axios": "^0.26.1", - "http-proxy-middleware": "^2.0.4", + "http-proxy-middleware": "^2.0.6", "jwt-decode": "^3.1.2", "lodash": "^4.17.21", "notistack": "^2.0.4", @@ -8879,9 +8879,9 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.4.tgz", - "integrity": "sha512-m/4FxX17SUvz4lJ5WPXOHDUuCwIqXLfLHs1s0uZ3oYjhoXlx9csYxaOa0ElDEJ+h8Q4iJ1s+lTMbiCa4EXIJqg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", "dependencies": { "@types/http-proxy": "^1.17.8", "http-proxy": "^1.18.1", @@ -23917,9 +23917,9 @@ } }, "http-proxy-middleware": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.4.tgz", - "integrity": "sha512-m/4FxX17SUvz4lJ5WPXOHDUuCwIqXLfLHs1s0uZ3oYjhoXlx9csYxaOa0ElDEJ+h8Q4iJ1s+lTMbiCa4EXIJqg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", "requires": { "@types/http-proxy": "^1.17.8", "http-proxy": "^1.18.1", diff --git a/interface/package.json b/interface/package.json index 103e24276..131a7195a 100644 --- a/interface/package.json +++ b/interface/package.json @@ -17,7 +17,7 @@ "@types/react-router-dom": "^5.3.3", "async-validator": "^4.0.7", "axios": "^0.26.1", - "http-proxy-middleware": "^2.0.4", + "http-proxy-middleware": "^2.0.6", "jwt-decode": "^3.1.2", "lodash": "^4.17.21", "notistack": "^2.0.4", diff --git a/interface/src/project/DashboardData.tsx b/interface/src/project/DashboardData.tsx index a4e32ae00..ccd5e6209 100644 --- a/interface/src/project/DashboardData.tsx +++ b/interface/src/project/DashboardData.tsx @@ -102,7 +102,9 @@ const DashboardData: FC = () => { HeaderRow: ` text-transform: uppercase; background-color: black; + color: #90CAF9; border-bottom: 1px solid #e0e0e0; + font-weight: 500; `, Row: ` background-color: #1e1e1e; @@ -171,6 +173,7 @@ const DashboardData: FC = () => { background-color: black; color: #90CAF9; border-bottom: 1px solid #e0e0e0; + font-weight: 500; `, Row: ` &:nth-of-type(odd) { @@ -237,8 +240,7 @@ const DashboardData: FC = () => { sortFns: { GPIO: (array) => array.sort((a, b) => a.g - b.g), NAME: (array) => array.sort((a, b) => a.n.localeCompare(b.n)), - TYPE: (array) => array.sort((a, b) => a.t - b.t), - VALUE: (array) => array.sort((a, b) => a.v.toString().localeCompare(b.v.toString())) + TYPE: (array) => array.sort((a, b) => a.t - b.t) } } ); @@ -269,8 +271,7 @@ const DashboardData: FC = () => { iconDown: }, sortFns: { - NAME: (array) => array.sort((a, b) => a.id.slice(2).localeCompare(b.id.slice(2))), - VALUE: (array) => array.sort((a, b) => a.v.toString().localeCompare(b.v.toString())) + NAME: (array) => array.sort((a, b) => a.id.slice(2).localeCompare(b.id.slice(2))) } } ); @@ -337,8 +338,7 @@ const DashboardData: FC = () => { ); }; - const refreshData = () => { - const selectedDevice = device_select.state.id; + const refreshDataIndex = (selectedDevice: string) => { if (selectedDevice === 'sensor') { fetchSensorData(); return; @@ -352,6 +352,10 @@ const DashboardData: FC = () => { } }; + const refreshData = () => { + refreshDataIndex(device_select.state.id); + }; + const fetchCoreData = useCallback(async () => { try { setCoreData((await EMSESP.readCoreData()).data); @@ -641,7 +645,6 @@ const DashboardData: FC = () => { const renderCoreData = () => ( {coreData.devices.length === 0 && } - {(tableList: any) => ( <> @@ -658,7 +661,9 @@ const DashboardData: FC = () => { {tableList.map((device: Device, index: number) => ( + {/* refreshDataIndex(device.id)}> */} + {/* */} {device.t} {device.n} @@ -673,7 +678,9 @@ const DashboardData: FC = () => { {(coreData.active_sensors > 0 || coreData.analog_enabled) && ( + {/* refreshDataIndex('sensor')}> */} + {/* */} Sensors Attached EMS-ESP Sensors @@ -722,7 +729,7 @@ const DashboardData: FC = () => { setOnlyFav(!onlyFav)} />} - label={favorites only} + label={show only favorites} />
{ ENTITY NAME - - - + VALUE @@ -895,16 +893,7 @@ const DashboardData: FC = () => { TYPE - - - + VALUE diff --git a/interface/src/project/DashboardStatus.tsx b/interface/src/project/DashboardStatus.tsx index 4a0df9df1..1e9d7113f 100644 --- a/interface/src/project/DashboardStatus.tsx +++ b/interface/src/project/DashboardStatus.tsx @@ -209,7 +209,7 @@ const DashboardStatus: FC = () => { - {tableList.map((stat: Stat, index: number) => ( + {tableList.map((stat: Stat) => ( {stat.id} {Intl.NumberFormat().format(stat.s)} diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index b64e08e58..e22e2aa07 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -34,6 +34,7 @@ import KeyboardArrowUpOutlinedIcon from '@mui/icons-material/KeyboardArrowUpOutl import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined'; import UnfoldMoreOutlinedIcon from '@mui/icons-material/UnfoldMoreOutlined'; import SearchIcon from '@mui/icons-material/Search'; +import FilterListIcon from '@mui/icons-material/FilterList'; import { ButtonRow, FormLoader, ValidatedTextField, SectionContent } from '../components'; @@ -68,6 +69,7 @@ const SettingsCustomization: FC = () => { background-color: black; border-bottom: 1px solid #e0e0e0; color: #90CAF9; + font-weight: 500; `, Row: ` background-color: #1e1e1e; @@ -97,6 +99,7 @@ const SettingsCustomization: FC = () => { } `, BaseCell: ` + padding-left: 8px; border-top: 1px solid transparent; border-right: 1px solid transparent; border-bottom: 1px solid transparent; @@ -104,6 +107,8 @@ const SettingsCustomization: FC = () => { left: 0px; min-width: 124px; width: 124px; + padding-left: 0px; + } &:nth-of-type(2) { min-width: 70%; @@ -111,10 +116,13 @@ const SettingsCustomization: FC = () => { } `, HeaderCell: ` - padding-left: 0px; - &:nth-of-type(2) { - border-right: 1px solid #565656; - } + padding-left: 0px; + &:nth-of-type(1) { + padding-left: 24px; + } + &:nth-of-type(2) { + border-right: 1px solid #565656; + } ` }); @@ -288,34 +296,53 @@ const SettingsCustomization: FC = () => { const maskDisabled = (set: boolean) => { setDeviceEntities( - deviceEntities - .filter((de) => de.m & selectedFilters || !selectedFilters) - .map(({ m, ...entities }) => ({ - ...entities, - m: set - ? m | (DeviceEntityMask.DV_API_MQTT_EXCLUDE | DeviceEntityMask.DV_WEB_EXCLUDE) - : m & ~(DeviceEntityMask.DV_API_MQTT_EXCLUDE | DeviceEntityMask.DV_WEB_EXCLUDE) - })) + deviceEntities.map(function (de) { + if ((de.m & selectedFilters || !selectedFilters) && de.id.toLowerCase().includes(search.toLowerCase())) { + return { + ...de, + m: set + ? de.m | (DeviceEntityMask.DV_API_MQTT_EXCLUDE | DeviceEntityMask.DV_WEB_EXCLUDE) + : de.m & ~(DeviceEntityMask.DV_API_MQTT_EXCLUDE | DeviceEntityMask.DV_WEB_EXCLUDE) + }; + } else { + return de; + } + }) ); }; + const shown_data = deviceEntities.filter( + (de) => (de.m & selectedFilters || !selectedFilters) && de.id.toLowerCase().includes(search.toLowerCase()) + ); + return ( <> - + - - Filter:  + + #: + + + {shown_data.length}/{deviceEntities.length} + + + + : + + + { + setSearch(event.target.value); + }} + /> + + + : + { + - - - { - setSearch(event.target.value); - }} - /> - + + : - -
(de.m & selectedFilters || !selectedFilters) && de.id.toLowerCase().includes(search.toLowerCase()) - ) - }} + data={{ nodes: shown_data }} theme={entities_theme} sort={entity_sort} layout={{ custom: true, horizontalScroll: true }} @@ -414,7 +443,7 @@ const SettingsCustomization: FC = () => { - + diff --git a/src/version.h b/src/version.h index a7efafb90..2c5e4afad 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.4.0b12t3" +#define EMSESP_APP_VERSION "3.4.0b12t4"