-
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: eugenejahn <[email protected]>
- Loading branch information
1 parent
8f85c0b
commit b76d4ea
Showing
13 changed files
with
294 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import * as React from 'react'; | ||
import { | ||
Typography, | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableContainer, | ||
TableHead, | ||
TableRow, | ||
Paper, | ||
} from '@material-ui/core'; | ||
import { makeStyles, Theme } from '@material-ui/core/styles'; | ||
import { contentMarginGridUnits } from 'common/layout'; | ||
import { Core } from 'flyteidl'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
container: { | ||
marginBottom: theme.spacing(1), | ||
}, | ||
headerText: { | ||
fontWeight: 700, | ||
color: '#B3B3B3', | ||
}, | ||
table: { | ||
marginLeft: theme.spacing(contentMarginGridUnits), | ||
}, | ||
})); | ||
|
||
interface MyProps { | ||
rows: Core.IKeyValuePair[]; | ||
} | ||
|
||
export default function BasicTable({ rows }: MyProps) { | ||
const styles = useStyles(); | ||
|
||
if (!rows || rows.length == 0) { | ||
return <Typography>Empty</Typography>; | ||
} | ||
return ( | ||
<TableContainer className={styles.container} component={Paper}> | ||
<Table size="small" aria-label="a dense table"> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell> | ||
{' '} | ||
<Typography className={styles.headerText}>Key </Typography> | ||
</TableCell> | ||
<TableCell> | ||
<Typography className={styles.headerText}>Value </Typography> | ||
</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{rows.map((row) => ( | ||
<TableRow key={row.key}> | ||
<TableCell component="th" scope="row"> | ||
{row.key} | ||
</TableCell> | ||
<TableCell component="th" scope="row"> | ||
{row.value} | ||
</TableCell> | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
); | ||
} |
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,31 @@ | ||
import * as React from 'react'; | ||
import { Typography } from '@material-ui/core'; | ||
import { makeStyles, Theme } from '@material-ui/core/styles'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
row: { | ||
display: 'flex', | ||
marginBottom: theme.spacing(1), | ||
}, | ||
title: { | ||
width: 100, | ||
color: '#B3B3B3', | ||
}, | ||
})); | ||
|
||
interface MyProps { | ||
children?: React.ReactNode; | ||
title: String; | ||
} | ||
export const Row: React.FC<MyProps> = (props) => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<div className={styles.row}> | ||
<div className={styles.title}> | ||
<Typography>{props.title}</Typography> | ||
</div> | ||
<div>{props.children}</div> | ||
</div> | ||
); | ||
}; |
73 changes: 73 additions & 0 deletions
73
packages/zapp/console/src/components/Entities/VersionDetails/EntityVersionDetails.tsx
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,73 @@ | ||
import * as React from 'react'; | ||
import { Typography } from '@material-ui/core'; | ||
import { makeStyles, Theme } from '@material-ui/core/styles'; | ||
import { contentMarginGridUnits } from 'common/layout'; | ||
import { WaitForData } from 'components/common/WaitForData'; | ||
import { useTaskTemplate } from 'components/hooks/useTask'; | ||
import { ResourceIdentifier, Identifier } from 'models/Common/types'; | ||
import { compact } from 'lodash'; | ||
import { useOnlyMyExecutionsFilterState } from 'components/Executions/filters/useOnlyMyExecutionsFilterState'; | ||
import { DumpJSON } from 'components/common/DumpJSON'; | ||
import { Row } from '../Row'; | ||
import BasicTable from '../EnvVars'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
container: { | ||
maxHeight: 500, | ||
overflow: 'scroll', | ||
}, | ||
header: { | ||
marginBottom: theme.spacing(1), | ||
marginLeft: theme.spacing(contentMarginGridUnits), | ||
}, | ||
table: { | ||
marginLeft: theme.spacing(contentMarginGridUnits), | ||
}, | ||
})); | ||
|
||
export interface EntityExecutionsProps { | ||
id: ResourceIdentifier; | ||
} | ||
|
||
/** The tab/page content for viewing a workflow's executions */ | ||
export const EntityVersionDetails: React.FC<EntityExecutionsProps> = ({ id }) => { | ||
const styles = useStyles(); | ||
|
||
// TODO: need to be generic for supporting other type like workflow, etc. | ||
const templateState = useTaskTemplate(id as Identifier); | ||
|
||
const template = templateState?.value?.closure?.compiledTask?.template; | ||
const envVars = template?.container?.env; | ||
const image = template?.container?.image; | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<Typography className={styles.header} variant="h6"> | ||
Task Details | ||
</Typography> | ||
<WaitForData {...templateState}> | ||
<div className={styles.table}> | ||
{image && ( | ||
<Row key="Image" title="Image"> | ||
{' '} | ||
<Typography>{image}</Typography>{' '} | ||
</Row> | ||
)} | ||
{envVars && ( | ||
<Row key="envVars" title="Env vars"> | ||
{' '} | ||
<BasicTable rows={envVars} />{' '} | ||
</Row> | ||
)} | ||
|
||
{template && ( | ||
<Row key="commands" title="Comands"> | ||
{' '} | ||
<DumpJSON value={template} />{' '} | ||
</Row> | ||
)} | ||
</div> | ||
</WaitForData> | ||
</div> | ||
); | ||
}; |
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
File renamed without changes.
Oops, something went wrong.