Skip to content

Commit

Permalink
Bump frontend version to 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Feb 9, 2025
1 parent c4884fe commit f82f01d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 13 deletions.
6 changes: 3 additions & 3 deletions frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "./static/css/main.cf25d33e.css",
"main.js": "./static/js/main.fd3d0108.js",
"main.js": "./static/js/main.1c3bc5a8.js",
"static/js/453.abd36b29.chunk.js": "./static/js/453.abd36b29.chunk.js",
"static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.4535474e1cf8598695ad.woff2",
"static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.7077203b1982951ecf76.woff2",
Expand Down Expand Up @@ -61,11 +61,11 @@
"static/media/roboto-greek-ext-400-normal.woff": "./static/media/roboto-greek-ext-400-normal.16eb83b4a3b1ea994243.woff",
"index.html": "./index.html",
"main.cf25d33e.css.map": "./static/css/main.cf25d33e.css.map",
"main.fd3d0108.js.map": "./static/js/main.fd3d0108.js.map",
"main.1c3bc5a8.js.map": "./static/js/main.1c3bc5a8.js.map",
"453.abd36b29.chunk.js.map": "./static/js/453.abd36b29.chunk.js.map"
},
"entrypoints": [
"static/css/main.cf25d33e.css",
"static/js/main.fd3d0108.js"
"static/js/main.1c3bc5a8.js"
]
}
2 changes: 1 addition & 1 deletion frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.fd3d0108.js"></script><link href="./static/css/main.cf25d33e.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.1c3bc5a8.js"></script><link href="./static/css/main.cf25d33e.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/build/static/js/main.1c3bc5a8.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/build/static/js/main.fd3d0108.js.map

This file was deleted.

6 changes: 6 additions & 0 deletions frontend/src/components/SystemInfoTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ export function SystemInfoTable({ systemInfo, compact }) {
systemInfo.freeMemory = `${freeMemory} / ${totalMemory}`;
delete systemInfo.totalMemory;
}
if (compact && systemInfo.heapTotal) {
const heapTotal = systemInfo.heapTotal;
const heapUsed = systemInfo.heapUsed;
systemInfo.heapUsed = `${heapUsed} / ${heapTotal}`;
delete systemInfo.heapTotal;
}
if (compact && systemInfo.osRelease) {
const osType = systemInfo.osType;
const osRelease = systemInfo.osRelease;
Expand Down
14 changes: 9 additions & 5 deletions frontend/src/components/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import { WebSocketContext } from './WebSocketProvider';
import { Connecting } from './Connecting';
// import { debug } from '../App';
const debug = true;
let uniqueId = 0;

function Test() {
// WebSocket context
const { online, sendMessage, addListener, removeListener } = useContext(WebSocketContext);
const { online, sendMessage, addListener, removeListener, getUniqueId } = useContext(WebSocketContext);

// Local states
const [settings, setSettings] = useState({});
Expand All @@ -25,6 +26,9 @@ function Test() {
const [cpu, setCpu] = useState({});
const [memory, setMemory] = useState({});

if(uniqueId === 0) uniqueId = getUniqueId();
console.log('Test uniqueId:', uniqueId);

useEffect(() => {
if(debug) console.log('Test useEffect WebSocketMessage mounting');
const handleWebSocketMessage = (msg) => {
Expand Down Expand Up @@ -59,12 +63,12 @@ function Test() {
if(debug) console.log(`Test received ${msg.response.length} devices:`, msg.response);
setDevices(msg.response);
for(let device of msg.response) {
if(debug) console.log('Test sending /api/clusters for device:', device.name);
if(debug) console.log('Test sending /api/clusters for device:', device.pluginName, device.name, device.endpoint);
sendMessage({ method: "/api/clusters", src: "Frontend", dst: "Matterbridge", params: { plugin: device.pluginName, endpoint: device.endpoint } });
}
}
if (msg.method === '/api/clusters') {
if(debug) console.log(`Test received ${msg.response.length} clusters:`, msg.response);
if(debug) console.log(`Test received ${msg.response.length} clusters for device ${msg.deviceName} endpoint ${msg.endpoint}:`, msg);
setClusters(msg.response);
}
} else {
Expand Down Expand Up @@ -104,9 +108,9 @@ function Test() {
return (
<div className="MbfPageDiv" style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>
<img src="matterbridge 64x64.png" alt="Matterbridge Logo" style={{ height: '64px', width: '64px' }} />
<p>Welcome to the Test page of Matterbridge frontend</p>
<p>Welcome to the Test page of the Matterbridge frontend</p>
<p>- - -</p>
<p>Cpu usage: {cpu.cpuUsage} Uptime: {memory.systemUptime} Memory: freeMemory {memory.freeMemory} totalMemory {memory.totalMemory} rss {memory.rss} heap {memory.heap}</p>
<p>cpuUsed: {cpu.cpuUsed} systemUptime: {memory.systemUptime} freeMemory {memory.freeMemory} totalMemory {memory.totalMemory} rss {memory.rss} heapUsed {memory.heapUsed} heapTotal {memory.heapTotal}</p>
</div>
);
}
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/WebSocketProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export function WebSocketProvider({ children }) {
logFilterSearchRef.current = logFilterSearch;
}, [logFilterSearch]);

const getUniqueId = useCallback(() => {
return Math.floor(Math.random() * (999999 - 10 + 1)) + 10;
}, []);

const sendMessage = useCallback((message) => {
if (wsRef.current && wsRef.current.readyState === WebSocket.OPEN) {
try {
Expand Down Expand Up @@ -268,6 +272,7 @@ export function WebSocketProvider({ children }) {
setMessages,
setLogFilters,
online,
getUniqueId,
addListener,
removeListener,
sendMessage,
Expand Down

0 comments on commit f82f01d

Please sign in to comment.