Skip to content

Commit

Permalink
fix add gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
zivglik committed Jan 27, 2025
1 parent b0d1701 commit 01406b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/Routes/Base/SidebarLeft/useSubMenuAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import Icon, {
import { USER_GUIDE, RIGHT_SIDEBAR_NAMES } from 'const';
import { ReactComponent as DriversIcon } from 'images/drivers-icon.svg';
import { ReactComponent as WorkerIcon } from 'images/worker-icon.svg';
import { useStats, useStorage } from 'hooks/graphql';
import { useStats } from 'hooks/graphql';
import { Tag } from 'antd';
import {
/* import {
getColorStatus,
getStorageColorStatus,
combineStatus,
} from 'utils/warningColorStatus';
} from 'utils/warningColorStatus'; */
import {
Name,
IconStyle,
itemSubMenuStyle,
BadgeStyle,
tagStyle,
} from './MenuStyles';
import { getBottomActions } from './../../SidebarRight/schema';
// import { getBottomActions } from './../../SidebarRight/schema';

const useSubMenuAdmin = (totalNewWarnings, dataMoreCount) => {
const { pageName } = useParams();
const location = useLocation();

const { cpu, memory, gpu } = useStats();
const { storage } = useStorage();
const dataCounters = useMemo(
const { gpu } = useStats();
// const { cpu, memory, gpu } = useStats();
// const { storage } = useStorage();
/* const dataCounters = useMemo(
() =>
getBottomActions({
warnings: totalNewWarnings,
Expand All @@ -44,7 +44,7 @@ const useSubMenuAdmin = (totalNewWarnings, dataMoreCount) => {
}),
[cpu, gpu, memory, storage, totalNewWarnings]
);
); */

const menuAdminItems = useMemo(() => {
const itemsMenu = [
Expand Down Expand Up @@ -78,7 +78,7 @@ const useSubMenuAdmin = (totalNewWarnings, dataMoreCount) => {
],
];

if (dataCounters?.gpuStatus?.total) {
if (gpu?.legend?.length > 0) {
itemsMenu.push([
RIGHT_SIDEBAR_NAMES.GPU,
FundOutlined,
Expand All @@ -88,11 +88,11 @@ const useSubMenuAdmin = (totalNewWarnings, dataMoreCount) => {

return itemsMenu;
}, [
dataCounters?.gpuStatus?.total,
dataMoreCount.drivers,
dataMoreCount.workers,
dataMoreCount.drivers,
pageName,
totalNewWarnings,
gpu?.legend,
]);

const menuAdminItemsJson = useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/Routes/SidebarRight/NodeStatistics.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Container = styled.div`

// Define the custom formatter component outside of NodeStatistics
const CustomAxisLeftTick = ({ value }) =>
value.length > 15 ? (
value?.length > 15 ? (
<tspan>
{`${value.substring(0, 15)}...`}
<title>{value}</title>
Expand Down

0 comments on commit 01406b1

Please sign in to comment.