From c3380b9af5b843eb006de85246ab928ee09706f3 Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 10 Dec 2024 10:15:30 -0800 Subject: [PATCH] [SALAD-23118] WebApp: Demand monitor display name (#1235) * ModalWithOverlay component - added * temp * GetNotifiedDemandChangesModal - added * demandHardware.displayName - applied * duplicated code - removed --- .../DemandMonitorTable/DemandMonitorTable.tsx | 98 ++++++++++--------- .../GetNotifiedDemandChangesModal.tsx | 2 +- .../DemandMonitorStore.tsx | 1 + 3 files changed, 52 insertions(+), 49 deletions(-) diff --git a/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/DemandMonitorTable/DemandMonitorTable.tsx b/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/DemandMonitorTable/DemandMonitorTable.tsx index 7bdfa480a..7dd0dfed4 100644 --- a/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/DemandMonitorTable/DemandMonitorTable.tsx +++ b/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/DemandMonitorTable/DemandMonitorTable.tsx @@ -189,57 +189,59 @@ const _DemandMonitorTable: FunctionComponent = ({ classes, demandedHardwa - {sortedDemandedHardwarePerformanceList.map(({ name, earningRates, recommendedSpecs, utilizationPct }) => { - const demand = getHardwareDemandLevel(utilizationPct) - const avgEarningTimeHours = earningRates.avgEarningTimeMinutes / 60 - const avgRunningTime = Math.round(avgEarningTimeHours * 10) / 10 + {sortedDemandedHardwarePerformanceList.map( + ({ displayName, earningRates, recommendedSpecs, utilizationPct }) => { + const demand = getHardwareDemandLevel(utilizationPct) + const avgEarningTimeHours = earningRates.avgEarningTimeMinutes / 60 + const avgRunningTime = Math.round(avgEarningTimeHours * 10) / 10 - return ( - - -
- - {name} - - HOURLY RATE - - ${earningRates.minEarningRate} - ${earningRates.maxEarningRate} - - - -
- {recommendedSpecs.ramGb} GB System RAM - 120 GB Storage -
- - -
- {demand} -
- - -
- - ${earningRates.avgEarning} + return ( + + +
+ + {displayName} -
- - -
- - {avgRunningTime} hours + HOURLY RATE + + ${earningRates.minEarningRate} - ${earningRates.maxEarningRate} -
- - - ) - })} + + +
+ {recommendedSpecs.ramGb} GB System RAM + 120 GB Storage +
+ + +
+ {demand} +
+ + +
+ + ${earningRates.avgEarning} + +
+ + +
+ + {avgRunningTime} hours + +
+ + + ) + }, + )} diff --git a/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/GetNotifiedDemandChangesModal/GetNotifiedDemandChangesModal.tsx b/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/GetNotifiedDemandChangesModal/GetNotifiedDemandChangesModal.tsx index 2b5c51c52..8de455d87 100644 --- a/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/GetNotifiedDemandChangesModal/GetNotifiedDemandChangesModal.tsx +++ b/packages/web-app/src/modules/demand-monitor-views/DemandMonitorPage/GetNotifiedDemandChangesModal/GetNotifiedDemandChangesModal.tsx @@ -129,7 +129,7 @@ const _GetNotifiedDemandChangesModal = ({ onContinuesClick, }: Props) => { const demandHardwareOptions = demandedHardwarePerformanceList?.map((demandHardware) => ({ - label: demandHardware.name, + label: demandHardware.displayName, value: demandHardware.name, })) diff --git a/packages/web-app/src/modules/demand-monitor-views/DemandMonitorStore.tsx b/packages/web-app/src/modules/demand-monitor-views/DemandMonitorStore.tsx index 4d7e65d43..6496768be 100644 --- a/packages/web-app/src/modules/demand-monitor-views/DemandMonitorStore.tsx +++ b/packages/web-app/src/modules/demand-monitor-views/DemandMonitorStore.tsx @@ -4,6 +4,7 @@ import { demandMonitorGpuEndpointPath } from './constants' export interface DemandedHardwarePerformance { name: string + displayName: string earningRates: { avgEarning: number avgEarningTimeMinutes: number