@@ -52,7 +52,6 @@ const applyScaledUpdates = (
5252
5353 const ratio = thisPerformanceIndicator / otherPerformanceIndicator ;
5454
55-
5655 const scaleKeys : ( keyof Pick < ServerType , 'ssd' | 'ram' | 'hdd' > ) [ ] = [ 'ssd' , 'ram' , 'hdd' ] ;
5756 const scaledUpdates : Partial < ServerType > = { } ;
5857
@@ -84,7 +83,7 @@ interface DropdownProps {
8483
8584const Dropdown : React . FC < DropdownProps > = ( { label, thisServer, otherServer, showAdvanced, advancedOptions} ) => {
8685
87- const { singleComparison, updateServer, setSingleComparison, setAdvancedOptions, getPerformanceIndicator} = useBenchmarkContext ( ) ;
86+ const { singleComparison, workload , updateServer, setSingleComparison, setAdvancedOptions, setAdvancedSettings , getPerformanceIndicator} = useBenchmarkContext ( ) ;
8887
8988 const specs_selected :CPUEntry = CPU_DATA [ thisServer . cpu ] ;
9089 const specs_compareTo :CPUEntry = CPU_DATA [ otherServer . cpu ] ;
@@ -121,9 +120,9 @@ const Dropdown: React.FC<DropdownProps> = ({ label, thisServer, otherServer, sho
121120 if ( onlyCPU ) {
122121 updates = {
123122 cpu : updates . cpu ,
124- ram : thisServer . ram ,
125- ssd : thisServer . ssd ,
126- hdd : thisServer . hdd ,
123+ ram : otherServer . ram ,
124+ ssd : otherServer . ssd ,
125+ hdd : otherServer . hdd ,
127126 }
128127 }
129128
@@ -141,8 +140,8 @@ const Dropdown: React.FC<DropdownProps> = ({ label, thisServer, otherServer, sho
141140 if ( advancedOptions === 'Scale' && onlyCPU ) {
142141 const scaledUpdates = applyScaledUpdates (
143142 updates ,
144- getPerformanceIndicator ( otherServer . cpu ) ,
145143 getPerformanceIndicator ( updates . cpu || thisServer . cpu ) ,
144+ getPerformanceIndicator ( otherServer . cpu ) ,
146145 ) ;
147146 updateServer ( thisServer , scaledUpdates ) ;
148147 return ;
@@ -152,8 +151,8 @@ const Dropdown: React.FC<DropdownProps> = ({ label, thisServer, otherServer, sho
152151 if ( advancedOptions === 'Scale' && ! onlyCPU ) {
153152 const scaledUpdates = applyScaledUpdates (
154153 updates ,
155- getPerformanceIndicator ( updates . cpu || thisServer . cpu ) ,
156154 getPerformanceIndicator ( otherServer . cpu ) ,
155+ getPerformanceIndicator ( updates . cpu || thisServer . cpu ) ,
157156 ) ;
158157 updateServer ( otherServer , scaledUpdates ) ;
159158 return ;
@@ -181,7 +180,7 @@ const Dropdown: React.FC<DropdownProps> = ({ label, thisServer, otherServer, sho
181180 return ;
182181 }
183182
184- } , [ advancedOptions ] )
183+ } , [ advancedOptions , workload ] )
185184
186185 return (
187186 < div className = "col-span-1 flex flex-col gap-2 font-light relative" >
@@ -202,7 +201,7 @@ const Dropdown: React.FC<DropdownProps> = ({ label, thisServer, otherServer, sho
202201 className = "h-5" />
203202 </ button >
204203 </ div >
205- < ServerPresetsComponent { ...{ presetValue, updateComponent, setAdvancedOptions } } />
204+ < ServerPresetsComponent { ...{ presetValue, updateComponent, setAdvancedOptions, setAdvancedSettings } } />
206205 < div className = { `${ showDropdown ? 'opacity-100' : 'opacity-0 pointer-events-none' } relative duration-150` } >
207206 < select
208207 className = "block appearance-none text-base w-full bg-gray-100 border-2 border-gray-400 py-1 px-2 pr-8 rounded focus:outline-none focus:bg-white focus:border-gray-500"
@@ -249,11 +248,12 @@ const Dropdown: React.FC<DropdownProps> = ({ label, thisServer, otherServer, sho
249248 < table className = "text-base grow border-collapse" >
250249 < tbody >
251250 { Object . entries ( DISPLAY ) . map ( ( [ key , prop ] ) => {
252- const selectedValue = specs_selected [ prop ] || 0 ;
251+ let selectedValue = specs_selected [ prop ] || 0 ;
253252 const compareValue = ( specs_compareTo ?. [ prop ] ?? selectedValue ) || 0 ;
253+ if ( key == 'TDP' ) selectedValue = selectedValue + ' W' ;
254254 return (
255255 < tr key = { key } >
256- < td className = "w-0 pr-4 align-top text-right " > { key } :</ td >
256+ < td className = "w-0 pr-4 align-top text-left " > { key } :</ td >
257257 < td className = "flex items-center gap-1" >
258258 < p > { selectedValue } </ p >
259259 { selectedValue > compareValue && ! singleComparison && (
0 commit comments