mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-12-16 02:05:48 -07:00
Fixed Installed Software Search Breaking the WebUI
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
////////// PROJECT FILE SEPARATION LINE ////////// CODE AFTER THIS LINE ARE FROM: <ProjectRoot>/Data/Engine/web-interface/src/Devices/Device_Details.jsx
|
////////// PROJECT FILE SEPARATION LINE ////////// CODE AFTER THIS LINE ARE FROM: <ProjectRoot>/Data/Engine/web-interface/src/Devices/Device_Details.jsx
|
||||||
|
|
||||||
import React, { useState, useEffect, useMemo, useCallback, useRef } from "react";
|
import React, { useState, useEffect, useMemo, useCallback } from "react";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Tabs,
|
Tabs,
|
||||||
@@ -268,7 +268,6 @@ export default function DeviceDetails({ device, onBack, onQuickJobLaunch }) {
|
|||||||
const [menuAnchor, setMenuAnchor] = useState(null);
|
const [menuAnchor, setMenuAnchor] = useState(null);
|
||||||
const [clearDialogOpen, setClearDialogOpen] = useState(false);
|
const [clearDialogOpen, setClearDialogOpen] = useState(false);
|
||||||
const [assemblyNameMap, setAssemblyNameMap] = useState({});
|
const [assemblyNameMap, setAssemblyNameMap] = useState({});
|
||||||
const softwareGridApiRef = useRef(null);
|
|
||||||
// Snapshotted status for the lifetime of this page
|
// Snapshotted status for the lifetime of this page
|
||||||
const [lockedStatus, setLockedStatus] = useState(() => {
|
const [lockedStatus, setLockedStatus] = useState(() => {
|
||||||
// Prefer status provided by the device list row if available
|
// Prefer status provided by the device list row if available
|
||||||
@@ -717,19 +716,6 @@ export default function DeviceDetails({ device, onBack, onQuickJobLaunch }) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const softwareRows = useMemo(() => details.software || [], [details.software]);
|
const softwareRows = useMemo(() => details.software || [], [details.software]);
|
||||||
const handleSoftwareGridReady = useCallback(
|
|
||||||
(params) => {
|
|
||||||
softwareGridApiRef.current = params.api;
|
|
||||||
params.api.setQuickFilter(softwareSearch);
|
|
||||||
},
|
|
||||||
[softwareSearch]
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (softwareGridApiRef.current) {
|
|
||||||
softwareGridApiRef.current.setQuickFilter(softwareSearch);
|
|
||||||
}
|
|
||||||
}, [softwareSearch]);
|
|
||||||
|
|
||||||
const getSoftwareRowId = useCallback(
|
const getSoftwareRowId = useCallback(
|
||||||
(params) => `${params.data?.name || "software"}-${params.data?.version || ""}-${params.rowIndex}`,
|
(params) => `${params.data?.name || "software"}-${params.data?.version || ""}-${params.rowIndex}`,
|
||||||
@@ -1260,7 +1246,7 @@ export default function DeviceDetails({ device, onBack, onQuickJobLaunch }) {
|
|||||||
paginationPageSize={20}
|
paginationPageSize={20}
|
||||||
paginationPageSizeSelector={[20, 50, 100]}
|
paginationPageSizeSelector={[20, 50, 100]}
|
||||||
animateRows
|
animateRows
|
||||||
onGridReady={handleSoftwareGridReady}
|
quickFilterText={softwareSearch}
|
||||||
getRowId={getSoftwareRowId}
|
getRowId={getSoftwareRowId}
|
||||||
components={GRID_COMPONENTS}
|
components={GRID_COMPONENTS}
|
||||||
theme={myTheme}
|
theme={myTheme}
|
||||||
|
|||||||
Reference in New Issue
Block a user