diff --git a/portal-ui/src/screens/Console/Dashboard/Prometheus/PrDashboard.tsx b/portal-ui/src/screens/Console/Dashboard/Prometheus/PrDashboard.tsx index 55ffd564d4..aa82f315d6 100644 --- a/portal-ui/src/screens/Console/Dashboard/Prometheus/PrDashboard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/Prometheus/PrDashboard.tsx @@ -41,6 +41,7 @@ import { DLayoutColumnProps, DLayoutRowProps, resourcesPanelsLayout, + resourcesPanelsLayoutAdvanced, RowPanelLayout, summaryPanelsLayout, trafficPanelsLayout, @@ -192,6 +193,10 @@ const PrDashboard = ({ apiPrefix = "admin" }: IPrDashboard) => { return renderPanelItems(resourcesPanelsLayout); }; + const renderAdvancedResourcesPanels = () => { + return renderPanelItems(resourcesPanelsLayoutAdvanced); + }; + return ( {zoomOpen && ( @@ -251,6 +256,10 @@ const PrDashboard = ({ apiPrefix = "admin" }: IPrDashboard) => { {panelInformation.length ? renderResourcesPanels() : null} +

+ Advanced +

+ {panelInformation.length ? renderAdvancedResourcesPanels() : null}
diff --git a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/CapacityItem.tsx b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/CapacityItem.tsx index 967b532b5c..4a1bacc080 100644 --- a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/CapacityItem.tsx +++ b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/CapacityItem.tsx @@ -49,6 +49,7 @@ const CapacityItem = ({ const [loading, setLoading] = useState(true); const [totalUsableFree, setTotalUsableFree] = useState(0); + const [totalUsableFreeRatio, setTotalUsableFreeRatio] = useState(0); const [totalUsed, setTotalUsed] = useState(0); const [totalUsable, setTotalUsable] = useState(0); @@ -100,7 +101,10 @@ const CapacityItem = ({ }); }); + const freeRatio = Math.round((tFree / tUsable) * 100); + setTotalUsableFree(tFree); + setTotalUsableFreeRatio(freeRatio); setTotalUsed(tUsed); setTotalUsable(tUsable); @@ -175,7 +179,7 @@ const CapacityItem = ({ fontSize: 12, }} > - {niceBytesInt(totalUsableFree)} + {`${totalUsableFreeRatio}%`}
- Current Usable Capacity + Free diff --git a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/LayoutUtil.tsx b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/LayoutUtil.tsx index f75d74bcbe..0f9061353e 100644 --- a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/LayoutUtil.tsx +++ b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/LayoutUtil.tsx @@ -216,13 +216,15 @@ export const resourcesPanelsLayout: DLayoutRowProps[] = [ }, columns: [ { - componentId: 11, + componentId: 82, }, { - componentId: 8, + componentId: 74, }, ], }, +]; +export const resourcesPanelsLayoutAdvanced: DLayoutRowProps[] = [ { sx: { display: "grid", @@ -232,14 +234,15 @@ export const resourcesPanelsLayout: DLayoutRowProps[] = [ }, columns: [ { - componentId: 82, + componentId: 11, }, { - componentId: 74, + componentId: 8, }, ], }, ]; + export const RowPanelLayout = ({ children }: { children: any }) => { return (