@@ -62,10 +62,12 @@ import HelpBox from "../../../common/HelpBox";
62
62
import SettingsIcon from "../../../icons/SettingsIcon" ;
63
63
import RegisterStatus from "./RegisterStatus" ;
64
64
import FormSwitchWrapper from "../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper" ;
65
+ import { AppState } from "../../../store" ;
65
66
66
67
interface IRegister {
67
68
classes : any ;
68
69
displayErrorMessage : typeof setErrorSnackMessage ;
70
+ operatorMode : boolean ;
69
71
}
70
72
71
73
const styles = ( theme : Theme ) =>
@@ -85,6 +87,11 @@ const styles = (theme: Theme) =>
85
87
textAlign : "center" ,
86
88
marginBottom : 10 ,
87
89
} ,
90
+ headerStyle : {
91
+ color : theme . palette . primary . main ,
92
+ fontSize : 16 ,
93
+ fontWeight : "bold" ,
94
+ } ,
88
95
registerActivationIcon : {
89
96
color : theme . palette . primary . main ,
90
97
fontSize : 16 ,
@@ -112,9 +119,6 @@ const styles = (theme: Theme) =>
112
119
fontWeight : "bold" ,
113
120
} ,
114
121
} ,
115
- subnetLoginInputBoxWrapper : {
116
- paddingRight : 20 ,
117
- } ,
118
122
registeredStatus : {
119
123
border : "1px solid #E2E2E2" ,
120
124
padding : "24px 24px 24px 24px" ,
@@ -147,12 +151,22 @@ const styles = (theme: Theme) =>
147
151
color : "#2781B0" ,
148
152
cursor : "pointer" ,
149
153
} ,
154
+ smallBoxy : {
155
+ border : "#E5E5E5 1px solid" ,
156
+ borderRadius : 2 ,
157
+ padding : 20 ,
158
+ backgroundColor : "#fff" ,
159
+ } ,
150
160
...actionsTray ,
151
161
...searchField ,
152
162
...containerForHeader ( theme . spacing ( 4 ) ) ,
153
163
} ) ;
154
164
155
- const Register = ( { classes, displayErrorMessage } : IRegister ) => {
165
+ const Register = ( {
166
+ classes,
167
+ displayErrorMessage,
168
+ operatorMode,
169
+ } : IRegister ) => {
156
170
const [ license , setLicense ] = useState < string > ( "" ) ;
157
171
const [ subnetPassword , setSubnetPassword ] = useState < string > ( "" ) ;
158
172
const [ subnetEmail , setSubnetEmail ] = useState < string > ( "" ) ;
@@ -355,12 +369,12 @@ const Register = ({ classes, displayErrorMessage }: IRegister) => {
355
369
const title = onlineActivation ? (
356
370
< Fragment >
357
371
< OnlineRegistrationIcon />
358
- Online Activation SUBNET License
372
+ Register with MinIO Subscription Network
359
373
</ Fragment >
360
374
) : (
361
375
< Fragment >
362
376
< OfflineRegistrationIcon />
363
- Offline Activating SUBNET License
377
+ Offline Activation of SUBNET License
364
378
</ Fragment >
365
379
) ;
366
380
@@ -444,67 +458,95 @@ const Register = ({ classes, displayErrorMessage }: IRegister) => {
444
458
clusterRegistrationForm = (
445
459
< Fragment >
446
460
< Grid item xs = { 12 } className = { classes . subnetDescription } >
447
- The MinIO Subscription Network (SUBNET for short) is a simple, yet
448
- powerful software stack that ensures commercial customers are
449
- getting the very best out of their MinIO instances. SUBNET is priced
450
- on capacity - just like cloud storage and comes in two
451
- configurations, Standard and Enterprise.
452
- </ Grid >
453
- < br />
454
- < Grid item xs = { 12 } className = { classes . subnetDescription } >
455
- You can use your credentials from SUBNET to register.{ " " }
456
- < Link
457
- className = { classes . link }
458
- color = "inherit"
459
- target = "_blank"
460
- href = "https://min.io/product/subnet"
461
- >
462
- Learn more about SUBNET →.
463
- </ Link >
461
+ Use your MinIO Subscription Network login credentials to register
462
+ this cluster.
464
463
</ Grid >
465
464
< br />
466
465
< Grid item xs = { 12 } className = { clsx ( classes . actionsTray ) } >
467
- < InputBoxWrapper
468
- className = { classes . subnetLoginInputBoxWrapper }
469
- id = "subnet-email"
470
- name = "subnet-email"
471
- onChange = { ( event : React . ChangeEvent < HTMLInputElement > ) =>
472
- setSubnetEmail ( event . target . value )
473
- }
474
- label = "Email"
475
- value = { subnetEmail }
476
- noLabelMinWidth
477
- overlayIcon = { < UsersIcon /> }
478
- />
479
- < InputBoxWrapper
480
- className = { classes . subnetLoginInputBoxWrapper }
481
- id = "subnet-password"
482
- name = "subnet-password"
483
- onChange = { ( event : React . ChangeEvent < HTMLInputElement > ) =>
484
- setSubnetPassword ( event . target . value )
485
- }
486
- label = "Password"
487
- type = { showPassword ? "text" : "password" }
488
- value = { subnetPassword }
489
- noLabelMinWidth
490
- overlayIcon = {
491
- showPassword ? < VisibilityOffIcon /> : < RemoveRedEyeIcon />
492
- }
493
- overlayAction = { ( ) => setShowPassword ( ! showPassword ) }
494
- />
495
- < Button
496
- type = "submit"
497
- variant = "contained"
498
- color = "primary"
499
- disabled = {
500
- loading ||
501
- subnetEmail . trim ( ) . length === 0 ||
502
- subnetPassword . trim ( ) . length === 0
503
- }
504
- onClick = { ( ) => subnetLogin ( ) }
466
+ < Grid
467
+ container
468
+ justifyContent = { "center" }
469
+ item
470
+ xs = { 4 }
471
+ style = { { margin : "auto" } }
505
472
>
506
- Register
507
- </ Button >
473
+ < Grid item xs = { 12 } >
474
+ < InputBoxWrapper
475
+ id = "subnet-email"
476
+ name = "subnet-email"
477
+ onChange = { ( event : React . ChangeEvent < HTMLInputElement > ) =>
478
+ setSubnetEmail ( event . target . value )
479
+ }
480
+ label = "Email"
481
+ value = { subnetEmail }
482
+ overlayIcon = { < UsersIcon /> }
483
+ />
484
+ </ Grid >
485
+ < Grid item xs = { 12 } >
486
+ { " " }
487
+ < InputBoxWrapper
488
+ id = "subnet-password"
489
+ name = "subnet-password"
490
+ onChange = { ( event : React . ChangeEvent < HTMLInputElement > ) =>
491
+ setSubnetPassword ( event . target . value )
492
+ }
493
+ label = "Password"
494
+ type = { showPassword ? "text" : "password" }
495
+ value = { subnetPassword }
496
+ overlayIcon = {
497
+ showPassword ? < VisibilityOffIcon /> : < RemoveRedEyeIcon />
498
+ }
499
+ overlayAction = { ( ) => setShowPassword ( ! showPassword ) }
500
+ />
501
+ </ Grid >
502
+ < Grid item xs = { 12 } >
503
+ < br />
504
+ </ Grid >
505
+ < Grid item xs = { 12 } textAlign = { "center" } >
506
+ < Button
507
+ type = "submit"
508
+ variant = "outlined"
509
+ onClick = { ( e ) => {
510
+ e . preventDefault ( ) ;
511
+ window . open (
512
+ `https://min.io/signup?ref=${
513
+ operatorMode ? "op" : "con"
514
+ } `,
515
+ "_blank"
516
+ ) ;
517
+ } }
518
+ >
519
+ Sign up
520
+ </ Button >
521
+ < Button
522
+ type = "submit"
523
+ variant = "contained"
524
+ color = "primary"
525
+ disabled = {
526
+ loading ||
527
+ subnetEmail . trim ( ) . length === 0 ||
528
+ subnetPassword . trim ( ) . length === 0
529
+ }
530
+ onClick = { ( ) => subnetLogin ( ) }
531
+ >
532
+ Register
533
+ </ Button >
534
+ </ Grid >
535
+ </ Grid >
536
+ </ Grid >
537
+ < Grid item xs = { 12 } className = { classes . subnetDescription } >
538
+ < div className = { classes . smallBoxy } >
539
+ < h1 className = { classes . headerStyle } > Why should I register?</ h1 >
540
+ Registering this cluster with the MinIO Subscription Network
541
+ (SUBNET) provides the following benefits in addition to the
542
+ commercial license and SLA backed support:
543
+ < br />
544
+ < ul >
545
+ < li > Call Home Monitoring</ li >
546
+ < li > Health Diagnostics</ li >
547
+ < li > Performance Analysis</ li >
548
+ </ ul >
549
+ </ div >
508
550
</ Grid >
509
551
</ Fragment >
510
552
) ;
@@ -517,10 +559,7 @@ const Register = ({ classes, displayErrorMessage }: IRegister) => {
517
559
</ Grid >
518
560
< Grid item xs = { 12 } className = { clsx ( classes . actionsTray ) } >
519
561
< InputBoxWrapper
520
- className = { clsx (
521
- classes . subnetLoginInputBoxWrapper ,
522
- classes . copyInputBox
523
- ) }
562
+ className = { clsx ( classes . copyInputBox ) }
524
563
id = "registration-token"
525
564
name = "registration-token"
526
565
placeholder = ""
@@ -551,7 +590,6 @@ const Register = ({ classes, displayErrorMessage }: IRegister) => {
551
590
</ Grid >
552
591
< Grid item xs = { 12 } className = { clsx ( classes . actionsTray ) } >
553
592
< InputBoxWrapper
554
- className = { classes . subnetLoginInputBoxWrapper }
555
593
value = { license }
556
594
onChange = { ( event : React . ChangeEvent < HTMLInputElement > ) =>
557
595
setLicense ( event . target . value )
@@ -667,7 +705,11 @@ const Register = ({ classes, displayErrorMessage }: IRegister) => {
667
705
) ;
668
706
} ;
669
707
670
- const connector = connect ( null , {
708
+ const mapState = ( state : AppState ) => ( {
709
+ operatorMode : state . system . operatorMode ,
710
+ } ) ;
711
+
712
+ const connector = connect ( mapState , {
671
713
displayErrorMessage : setErrorSnackMessage ,
672
714
} ) ;
673
715
0 commit comments