Skip to content

Commit 290f3ae

Browse files
committed
move refresh button out
Signed-off-by: Lyon Lu <lyon@union.ai>
1 parent f5d884f commit 290f3ae

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

packages/oss-console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions/FlyteDeckButton.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import Grid from '@mui/material/Grid';
88
import IconButton from '@mui/material/IconButton';
99
import Typography from '@mui/material/Typography';
1010
import DialogContent from '@mui/material/DialogContent';
11+
import { useDownloadLink } from '@clients/oss-console/components/hooks/useDataProxy';
12+
import RefreshIcon from '@mui/icons-material/Refresh';
1113
import t from '../strings';
1214
import { WorkflowNodeExecution } from '../../contexts';
1315
import { NodeExecutionPhase } from '../../../../models/Execution/enums';
@@ -52,13 +54,11 @@ export const FlyteDeckButton: FC<FlyteDeckButtonProps> = ({
5254
setSetFullScreen(!fullScreen);
5355
};
5456

57+
const downloadLink = useDownloadLink(nodeExecution?.id);
58+
5559
return nodeExecution?.closure?.deckUri ? (
5660
<>
57-
<Button
58-
variant="outlined"
59-
color="primary"
60-
onClick={() => setShowDeck(true)}
61-
>
61+
<Button variant="outlined" color="primary" onClick={() => setShowDeck(true)}>
6262
{flyteDeckText || t('flyteDeck')}
6363
</Button>
6464
<Dialog
@@ -90,10 +90,17 @@ export const FlyteDeckButton: FC<FlyteDeckButtonProps> = ({
9090
fontSize: '24px',
9191
lineHeight: '32px',
9292
marginBlock: 0,
93+
display: 'flex',
94+
justifyContent: 'center',
95+
alignItems: 'center',
96+
gap: 1,
9397
}}
9498
py={2}
9599
>
96100
{t('flyteDeck')}
101+
<IconButton onClick={() => downloadLink.fetch()}>
102+
<RefreshIcon />
103+
</IconButton>
97104
</Typography>
98105
</Grid>
99106
<Grid item>
@@ -108,7 +115,7 @@ export const FlyteDeckButton: FC<FlyteDeckButtonProps> = ({
108115
overflow: 'hidden',
109116
}}
110117
>
111-
<ExecutionNodeDeck nodeExecutionId={nodeExecution.id} />
118+
<ExecutionNodeDeck nodeExecutionId={nodeExecution.id} downloadLink={downloadLink} />
112119
</DialogContent>
113120
</Dialog>
114121
</>

packages/oss-console/src/components/Executions/ExecutionDetails/ExecutionNodeDeck.tsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { WaitForData } from '../../common/WaitForData';
99
export const ExecutionNodeDeck: React.FC<{
1010
nodeExecutionId: Core.NodeExecutionIdentifier;
1111
className?: string;
12-
}> = ({ nodeExecutionId, className = '' }) => {
13-
const downloadLink = useDownloadLink(nodeExecutionId);
12+
downloadLink: ReturnType<typeof useDownloadLink>;
13+
}> = ({ className = '', downloadLink }) => {
1414
const iFrameSrc = downloadLink?.value?.signedUrl?.[0];
1515

1616
// Taken from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox
@@ -40,22 +40,6 @@ export const ExecutionNodeDeck: React.FC<{
4040
If you're not using the real-time deck, it's because the corresponding task is still in
4141
progress.
4242
</p>
43-
<button
44-
onClick={() => downloadLink.fetch()}
45-
style={{
46-
marginTop: '20px',
47-
padding: '10px 20px',
48-
fontSize: '16px',
49-
fontWeight: 'bold',
50-
color: '#fff',
51-
backgroundColor: '#a31aff',
52-
border: 'none',
53-
borderRadius: '4px',
54-
cursor: 'pointer',
55-
}}
56-
>
57-
Refresh
58-
</button>
5943
</div>
6044
);
6145
}

0 commit comments

Comments
 (0)