generated from kubefirst/react-app-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
153 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,64 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import React, { FunctionComponent, useState } from 'react'; | ||
import Image from 'next/image'; | ||
import CopyToClipboard from 'react-copy-to-clipboard'; | ||
|
||
import Typography from '../typography'; | ||
import Button from '../../components/button'; | ||
import Button from '../button'; | ||
import Password from '../password'; | ||
|
||
import { Container, Link, Title } from './clusterReady.styled'; | ||
import { Container, Link, PasswordContainer, Title } from './clusterReady.styled'; | ||
|
||
export interface ClusterRunningMessageProps { | ||
clusterName?: string; | ||
domainName?: string; | ||
kbotPassword?: string; | ||
onOpenConsole: () => void; | ||
} | ||
|
||
const ClusterReady: FunctionComponent<ClusterRunningMessageProps> = ({ | ||
clusterName, | ||
domainName, | ||
kbotPassword, | ||
onOpenConsole, | ||
}) => ( | ||
<Container> | ||
<Image alt="box" src="/static/box.svg" width={170} height={160} /> | ||
<Title> | ||
<Typography variant="body1"> | ||
Cluster <strong>{clusterName || '<cluster identifier>'}</strong> is now up and running. | ||
}) => { | ||
const [copyLabel, setCopyLabel] = useState<string>('Copy'); | ||
|
||
const handleOnCopy = () => { | ||
setCopyLabel('Copied!'); | ||
|
||
setTimeout(() => setCopyLabel('Copy'), 3000); | ||
}; | ||
|
||
return ( | ||
<Container> | ||
<Image alt="box" src="/static/box.svg" width={170} height={160} /> | ||
<Title> | ||
<Typography variant="body1"> | ||
Cluster <strong>{clusterName || '<cluster identifier>'}</strong> is now up and running. | ||
</Typography> | ||
</Title> | ||
<Typography variant="body2"> | ||
Copy this k-bot password and log into the kubefirst console UI. | ||
</Typography> | ||
</Title> | ||
<Button variant="contained" color="primary"> | ||
<Link | ||
href={`https://kubefirst.${domainName}/services`} | ||
target="_blank" | ||
onClick={onOpenConsole} | ||
> | ||
Open kubefirst console | ||
</Link> | ||
</Button> | ||
</Container> | ||
); | ||
<PasswordContainer> | ||
<Password value={kbotPassword} sx={{ width: '398px' }} /> | ||
<CopyToClipboard text={kbotPassword as string} onCopy={handleOnCopy}> | ||
<Button color="text" variant="text"> | ||
{copyLabel} | ||
</Button> | ||
</CopyToClipboard> | ||
</PasswordContainer> | ||
<Button variant="contained" color="primary"> | ||
<Link | ||
href={`https://kubefirst.${domainName}/services`} | ||
target="_blank" | ||
onClick={onOpenConsole} | ||
> | ||
Open kubefirst console | ||
</Link> | ||
</Button> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default ClusterReady; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
import TerminalLogs from '../terminalLogs'; | ||
import { FormStep } from '../../constants/installation'; | ||
|
||
import AuthForm from './shared/authForm'; | ||
import ClusterRunning from './shared/clusterRunning'; | ||
import SetupForm from './shared/setupForm'; | ||
|
||
const FORM_FLOW_MAP = { | ||
[FormStep.AUTHENTICATION]: AuthForm, | ||
[FormStep.SETUP]: SetupForm, | ||
[FormStep.PROVISIONING]: TerminalLogs, | ||
[FormStep.READY]: ClusterRunning, | ||
}; | ||
|
||
export const FormFlow: FunctionComponent<{ currentStep: FormStep }> = ({ currentStep }) => { | ||
const ActiveFormStep = FORM_FLOW_MAP[currentStep]; | ||
|
||
if (!ActiveFormStep) { | ||
return null; | ||
} | ||
|
||
return <ActiveFormStep />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.