-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pianist038801 <[email protected]> Co-authored-by: Pianist038801 <[email protected]>
- Loading branch information
1 parent
e494a42
commit eac7069
Showing
5 changed files
with
181 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import { Dialog, DialogContent } from '@material-ui/core'; | ||
import Link from '@material-ui/core/Link'; | ||
import { makeStyles, Theme } from '@material-ui/core/styles'; | ||
import { ClosableDialogTitle } from 'components/common/ClosableDialogTitle'; | ||
import { useVersion } from 'components/hooks/useVersion'; | ||
import * as React from 'react'; | ||
|
||
const { version: platformVersion } = require('../../../package.json'); | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
content: { | ||
paddingTop: theme.spacing(2), | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center' | ||
}, | ||
dialog: { | ||
maxWidth: `calc(100% - ${theme.spacing(12)}px)`, | ||
maxHeight: `calc(100% - ${theme.spacing(12)}px)`, | ||
height: theme.spacing(36), | ||
width: theme.spacing(38) | ||
}, | ||
versionWrapper: { | ||
minWidth: theme.spacing(20), | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
fontFamily: 'Apple SD Gothic Neo', | ||
fontWeight: 'normal', | ||
fontSize: '14px', | ||
lineHeight: '17px', | ||
color: '#636379', | ||
marginBottom: '6px' | ||
}, | ||
title: { | ||
fontFamily: 'Open Sans', | ||
fontWeight: 'bold', | ||
fontSize: '16px', | ||
lineHeight: '22px', | ||
margin: '7px 0 26px 0', | ||
color: '#000' | ||
}, | ||
link: { | ||
fontFamily: 'Apple SD Gothic Neo', | ||
fontWeight: 'normal', | ||
fontSize: '14px', | ||
lineHeight: '17px', | ||
color: '#636379', | ||
margin: '17px 0 2px 0' | ||
} | ||
})); | ||
|
||
interface VersionDisplayModalProps { | ||
onClose(): void; | ||
} | ||
|
||
export const VersionDisplayModal: React.FC<VersionDisplayModalProps> = ({ | ||
onClose | ||
}) => { | ||
const styles = useStyles(); | ||
const version = useVersion(); | ||
|
||
return ( | ||
<Dialog | ||
PaperProps={{ className: styles.dialog }} | ||
maxWidth={false} | ||
open={true} | ||
onClose={onClose} | ||
> | ||
<ClosableDialogTitle onClose={onClose}>{}</ClosableDialogTitle> | ||
<DialogContent className={styles.content}> | ||
<svg height={32} viewBox="100 162 200 175"> | ||
<path | ||
fill="#40119C" | ||
d="M152.24 254.36S106 214.31 106 174.27c0 0 6.79-6.89 33.93-8.55l-.31 8.55c0 40.04 12.62 80.09 12.62 80.09zm46.24-80.09s-6.8-6.89-33.92-8.55l.31 8.55c0 40-12.63 80.09-12.63 80.09s46.24-40.05 46.24-80.09zm-16.69 131.07l-7.55 4c15 22.68 24.36 25.11 24.36 25.11 34.68-20 46.24-80.09 46.24-80.09s-28.37 30.96-63.05 50.98zm-29.43-51a11 11 0 00-.23 2.62c0 4.25 1.27 13.94 9.79 31l7.24-4.54c34.69-20 75.68-29.11 75.68-29.11s-25.69-8.9-53.09-8.9c-13.7 0-27.83 2.23-39.39 8.9zm121.69-50.8l7.24 4.54c8.53-17.1 9.79-26.78 9.79-31a11.34 11.34 0 00-.22-2.62c-11.57-6.68-25.69-8.9-39.4-8.9-27.4 0-53.09 8.89-53.09 8.89s41 9.08 75.68 29.11zm-29.44 51c.85-.22 10.08-3.52 24.37-25.11l-7.56-4c-34.68-20-63.05-51-63.05-51s11.56 60.08 46.24 80.1z" | ||
/> | ||
</svg> | ||
<div className={styles.title}>Flyte Console</div> | ||
<div className={styles.versionWrapper}> | ||
<span>UI Version</span> | ||
<span>0.1.1</span> | ||
</div> | ||
<div className={styles.versionWrapper}> | ||
<span>Platform Version</span> | ||
<span>{platformVersion}</span> | ||
</div> | ||
<div className={styles.versionWrapper}> | ||
<span>Admin Version</span> | ||
<span> | ||
{version && | ||
version.value && | ||
version.value.controlPlaneVersion | ||
? version.value.controlPlaneVersion.Version | ||
: null} | ||
</span> | ||
</div> | ||
<div className={styles.link}>Documentation Link:</div> | ||
<Link | ||
href="https://docs.flyte.org/en/latest/" | ||
style={{ | ||
color: '#1982E3', | ||
fontSize: '12px' | ||
}} | ||
> | ||
https://docs.flyte.org/en/latest/ | ||
</Link> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
}; |
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,14 @@ | ||
import { useAPIContext } from 'components/data/apiContext'; | ||
import { GetVersionResponse } from 'models/Common/types'; | ||
import { useFetchableData } from './useFetchableData'; | ||
|
||
/** State hook that returns the version information */ | ||
export function useVersion() { | ||
const { getVersion } = useAPIContext(); | ||
return useFetchableData<GetVersionResponse | null>({ | ||
debugName: 'Version', | ||
defaultValue: null, | ||
doFetch: getVersion, | ||
useCache: true | ||
}); | ||
} |
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