aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-06 02:09:47 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-06 02:09:47 -0600
commit324585ae83ad1802ed3903a1e7fdab81707ed1b7 (patch)
treeb718f34b93035f6710d4c95eb61e5ec40acb2dee
parent79a6c4f12df873c4087b143bdee3fb0a0bb801f4 (diff)
downloadetbsa-traccar-web-324585ae83ad1802ed3903a1e7fdab81707ed1b7.tar.gz
etbsa-traccar-web-324585ae83ad1802ed3903a1e7fdab81707ed1b7.tar.bz2
etbsa-traccar-web-324585ae83ad1802ed3903a1e7fdab81707ed1b7.zip
Temporarily fixed websocket development proxy and set device name to noWrap in device list
-rw-r--r--modern/src/DevicesList.js5
-rw-r--r--modern/src/setupProxy.js7
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' }));
};