@@ -31,7 +31,7 @@ import A from "components/misc/A";
31
31
import IntegerSlider from "components/misc/integer-slider" ;
32
32
import {
33
33
COURSE ,
34
- PRESETS ,
34
+ SITE_LICENSE ,
35
35
PRESET_MATCH_FIELDS ,
36
36
Preset ,
37
37
PresetConfig ,
@@ -324,7 +324,7 @@ export const QuotaConfig: React.FC<Props> = (props: Props) => {
324
324
325
325
function presetIsAdjusted ( ) {
326
326
if ( preset == null ) return ;
327
- const presetData : PresetConfig = PRESETS [ preset ] ;
327
+ const presetData : PresetConfig = SITE_LICENSE [ preset ] ;
328
328
if ( presetData == null ) {
329
329
return (
330
330
< div >
@@ -393,7 +393,8 @@ export const QuotaConfig: React.FC<Props> = (props: Props) => {
393
393
< > After selecting a preset, feel free to</ >
394
394
) : (
395
395
< >
396
- Selected preset < strong > "{ PRESETS [ preset ] ?. name } "</ strong > . You can
396
+ Selected preset < strong > "{ SITE_LICENSE [ preset ] ?. name } "</ strong > . You
397
+ can
397
398
</ >
398
399
) } { " " }
399
400
fine tune the selection in the "{ EXPERT_CONFIG } " tab. Subsequent preset
@@ -470,7 +471,7 @@ export const QuotaConfig: React.FC<Props> = (props: Props) => {
470
471
}
471
472
472
473
function renderPresetsNarrow ( ) {
473
- const p = preset != null ? PRESETS [ preset ] : undefined ;
474
+ const p = preset != null ? SITE_LICENSE [ preset ] : undefined ;
474
475
let presetInfo : JSX . Element | undefined = undefined ;
475
476
if ( p != null ) {
476
477
const { name, cpu, disk, ram, uptime, note } = p ;
@@ -505,11 +506,11 @@ export const QuotaConfig: React.FC<Props> = (props: Props) => {
505
506
< Radio . Group
506
507
size = "large"
507
508
value = { preset }
508
- onChange = { ( e ) => onPresetChange ( PRESETS , e . target . value ) }
509
+ onChange = { ( e ) => onPresetChange ( SITE_LICENSE , e . target . value ) }
509
510
>
510
511
< Space direction = "vertical" >
511
- { ( Object . keys ( PRESETS ) as Array < Preset > ) . map ( ( p ) => {
512
- const { name, icon, descr } = PRESETS [ p ] ;
512
+ { ( Object . keys ( SITE_LICENSE ) as Array < Preset > ) . map ( ( p ) => {
513
+ const { name, icon, descr } = SITE_LICENSE [ p ] ;
513
514
return (
514
515
< Radio key = { p } value = { p } >
515
516
< span >
@@ -530,58 +531,62 @@ export const QuotaConfig: React.FC<Props> = (props: Props) => {
530
531
function renderPresetPanels ( ) {
531
532
if ( narrow ) return renderPresetsNarrow ( ) ;
532
533
533
- const panels = ( Object . keys ( PRESETS ) as Array < Preset > ) . map ( ( p , idx ) => {
534
- const { name, icon, cpu, ram, disk, uptime, expect, descr, note } =
535
- PRESETS [ p ] ;
536
- const active = preset === p ;
537
- return (
538
- < PricingItem
539
- key = { idx }
540
- title = { name }
541
- icon = { icon }
542
- style = { { flex : 1 } }
543
- active = { active }
544
- onClick = { ( ) => onPresetChange ( PRESETS , p ) }
545
- >
546
- < Paragraph >
547
- < strong > { name } </ strong > { descr } .
548
- </ Paragraph >
549
- < Divider />
550
- < Line amount = { cpu } desc = { "CPU" } indent = { false } />
551
- < Line amount = { ram } desc = { "RAM" } indent = { false } />
552
- < Line amount = { disk } desc = { "Disk space" } indent = { false } />
553
- < Line
554
- amount = { displaySiteLicense ( uptime ) }
555
- desc = { renderIdleTimeoutWithHelp ( "Idle timeout" ) }
556
- indent = { false }
557
- />
558
- < Divider />
559
- < Paragraph >
560
- < Text type = "secondary" > In each project, you will be able to:</ Text >
561
- < ul >
562
- { expect . map ( ( what , idx ) => (
563
- < li key = { idx } > { what } </ li >
564
- ) ) }
565
- </ ul >
566
- </ Paragraph >
567
- { active && note != null ? (
568
- < >
569
- < Divider />
570
- < Paragraph type = "secondary" > { note } </ Paragraph >
571
- </ >
572
- ) : undefined }
573
- < Paragraph style = { { marginTop : "20px" , textAlign : "center" } } >
574
- < Button
575
- onClick = { ( ) => onPresetChange ( PRESETS , p ) }
576
- size = "large"
577
- type = { active ? "primary" : undefined }
578
- >
579
- { name }
580
- </ Button >
581
- </ Paragraph >
582
- </ PricingItem >
583
- ) ;
584
- } ) ;
534
+ const panels = ( Object . keys ( SITE_LICENSE ) as Array < Preset > ) . map (
535
+ ( p , idx ) => {
536
+ const { name, icon, cpu, ram, disk, uptime, expect, descr, note } =
537
+ SITE_LICENSE [ p ] ;
538
+ const active = preset === p ;
539
+ return (
540
+ < PricingItem
541
+ key = { idx }
542
+ title = { name }
543
+ icon = { icon }
544
+ style = { { flex : 1 } }
545
+ active = { active }
546
+ onClick = { ( ) => onPresetChange ( SITE_LICENSE , p ) }
547
+ >
548
+ < Paragraph >
549
+ < strong > { name } </ strong > { descr } .
550
+ </ Paragraph >
551
+ < Divider />
552
+ < Line amount = { cpu } desc = { "CPU" } indent = { false } />
553
+ < Line amount = { ram } desc = { "RAM" } indent = { false } />
554
+ < Line amount = { disk } desc = { "Disk space" } indent = { false } />
555
+ < Line
556
+ amount = { displaySiteLicense ( uptime ) }
557
+ desc = { renderIdleTimeoutWithHelp ( "Idle timeout" ) }
558
+ indent = { false }
559
+ />
560
+ < Divider />
561
+ < Paragraph >
562
+ < Text type = "secondary" >
563
+ In each project, you will be able to:
564
+ </ Text >
565
+ < ul >
566
+ { expect . map ( ( what , idx ) => (
567
+ < li key = { idx } > { what } </ li >
568
+ ) ) }
569
+ </ ul >
570
+ </ Paragraph >
571
+ { active && note != null ? (
572
+ < >
573
+ < Divider />
574
+ < Paragraph type = "secondary" > { note } </ Paragraph >
575
+ </ >
576
+ ) : undefined }
577
+ < Paragraph style = { { marginTop : "20px" , textAlign : "center" } } >
578
+ < Button
579
+ onClick = { ( ) => onPresetChange ( SITE_LICENSE , p ) }
580
+ size = "large"
581
+ type = { active ? "primary" : undefined }
582
+ >
583
+ { name }
584
+ </ Button >
585
+ </ Paragraph >
586
+ </ PricingItem >
587
+ ) ;
588
+ } ,
589
+ ) ;
585
590
return (
586
591
< Flex
587
592
style = { { width : "100%" } }
0 commit comments