diff options
-rw-r--r-- | modern/src/DevicesList.js | 5 | ||||
-rw-r--r-- | modern/src/setupProxy.js | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js index 899d969..967ca82 100644 --- a/modern/src/DevicesList.js +++ b/modern/src/DevicesList.js @@ -8,6 +8,7 @@ import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; import Grid from '@material-ui/core/Grid'; import ListItemText from '@material-ui/core/ListItemText'; import SvgIcon from '@material-ui/core/SvgIcon'; +import Typography from '@material-ui/core/Typography'; import { FixedSizeList } from 'react-window'; import AutoSizer from 'react-virtualized-auto-sizer'; import BatteryFullIcon from '@material-ui/icons/BatteryFull'; @@ -118,7 +119,7 @@ const DeviceRow = ({ data, index, style }) => { {/* Status icon */} <ListItemText primary={ - <> + <Typography noWrap> <FiberManualRecordIcon fontSize="inherit" color={statusColor()} classes={{ colorPrimary: classes.green }} /> {position && position.attributes.out1 == false && ( <LockOpenIcon fontSize="inherit" color="primary" classes={{ colorPrimary: classes.green }} /> @@ -127,7 +128,7 @@ const DeviceRow = ({ data, index, style }) => { <LockIcon fontSize="inherit" color="error" /> )} {` ${item.name}`} - </>} secondary={( + </Typography>} secondary={( <> {/* Contact */} {item.contact && ( diff --git a/modern/src/setupProxy.js b/modern/src/setupProxy.js index 7161414..96ffb95 100644 --- a/modern/src/setupProxy.js +++ b/modern/src/setupProxy.js @@ -4,6 +4,9 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = (app) => { - app.use('/api/socket', createProxyMiddleware({ target: `wss://${process.env.REACT_APP_URL_NAME}`, changeOrigin: true, ws: true, protocolRewrite: 'wss' })); - app.use('/api', createProxyMiddleware({ target: `https://${process.env.REACT_APP_URL_NAME}`, changeOrigin: true, protocolRewrite: 'https', headers: { "Connection": "keep-alive" } })); + const proxy = createProxyMiddleware('/api/socket', { target: `wss://${process.env.REACT_APP_URL_NAME}`, changeOrigin: true, logLevel: 'debug' }); + const server = app.listen(3000); + server.on('upgrade', proxy.upgrade); + + app.use('/api', createProxyMiddleware(`https://${process.env.REACT_APP_URL_NAME}/api`, { changeOrigin: true, headers: { "Connection": "keep-alive" }, logLevel: 'debug' })); }; |