@@ -10,15 +10,11 @@ javascript object in the same format as quota_params cancel_upgrading takes no
10
10
arguments and is called when the cancel button is hit.
11
11
*/
12
12
13
- import { Button as AntdButton , Checkbox , Alert } from "antd" ;
14
-
13
+ import { Button as AntdButton , Checkbox , Alert , InputNumber } from "antd" ;
15
14
import {
16
15
Button ,
17
16
ButtonToolbar ,
18
17
Col ,
19
- FormControl ,
20
- FormGroup ,
21
- InputGroup ,
22
18
Row ,
23
19
} from "@cocalc/frontend/antd-bootstrap" ;
24
20
import {
@@ -123,7 +119,7 @@ export const UpgradeAdjustor: React.FC<Props> = (props) => {
123
119
// how much unused upgrade you have remaining
124
120
const user_remaining = map_diff (
125
121
props . upgrades_you_can_use as any ,
126
- user_upgrades as any
122
+ user_upgrades as any ,
127
123
) ;
128
124
// the overall limits are capped by the maximum per project
129
125
const proj_maximum = PROJECT_UPGRADES . max_per_project ;
@@ -210,7 +206,7 @@ export const UpgradeAdjustor: React.FC<Props> = (props) => {
210
206
current : number ,
211
207
limit : number ,
212
208
total : number ,
213
- proj_remainder : number
209
+ proj_remainder : number ,
214
210
) {
215
211
let label , reason , reasons , show_remaining , val ;
216
212
if ( data == null ) {
@@ -338,19 +334,13 @@ export const UpgradeAdjustor: React.FC<Props> = (props) => {
338
334
{ remaining_note }
339
335
</ Col >
340
336
< Col sm = { 5 } >
341
- < FormGroup >
342
- < InputGroup >
343
- < FormControl
344
- type = { "text" }
345
- value = { val_state }
346
- style = { style }
347
- onChange = { ( e ) => set_state ( name , ( e . target as any ) . value ) }
348
- />
349
- < InputGroup . Addon >
350
- { render_addon ( name , display_unit , limit ) }
351
- </ InputGroup . Addon >
352
- </ InputGroup >
353
- </ FormGroup >
337
+ < InputNumber
338
+ addonAfter = { render_addon ( name , display_unit , limit ) }
339
+ value = { val }
340
+ style = { style }
341
+ min = { 0 }
342
+ onChange = { ( value ) => set_state ( name , value ) }
343
+ />
354
344
{ label }
355
345
</ Col >
356
346
</ Row >
@@ -372,7 +362,7 @@ export const UpgradeAdjustor: React.FC<Props> = (props) => {
372
362
const current_val = round2 ( ( current [ name ] ?? 0 ) * factor ) ;
373
363
const remaining_val = Math . max (
374
364
round2 ( ( remaining [ name ] ?? 0 ) * factor ) ,
375
- 0
365
+ 0 ,
376
366
) ; // everything is now in display units
377
367
378
368
if ( data . input_type === "checkbox" ) {
@@ -514,7 +504,7 @@ export const UpgradeAdjustor: React.FC<Props> = (props) => {
514
504
current [ name ] ?? 0 ,
515
505
limits [ name ] ?? 0 ,
516
506
totals [ name ] ?? 0 ,
517
- proj_remainder [ name ] ?? 0
507
+ proj_remainder [ name ] ?? 0 ,
518
508
) ;
519
509
} ) }
520
510
< UpgradeRestartWarning style = { { marginTop : "15px" } } />
0 commit comments