-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Query): progress for spyt engine [YTFRONT-3981]
- Loading branch information
1 parent
ed36636
commit 14a59b0
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
packages/ui/src/ui/pages/query-tracker/QueryResults/QueryResultActions/QueryProgress.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,27 @@ | ||
import React, {FC} from 'react'; | ||
import {Progress, Tooltip} from '@gravity-ui/uikit'; | ||
import {QueryItem, QueryStatus} from '../../module/api'; | ||
|
||
type Props = { | ||
query: QueryItem; | ||
}; | ||
|
||
export const QueryProgress: FC<Props> = ({query}) => { | ||
if ( | ||
query.engine !== 'spyt' || | ||
!(query.state === QueryStatus.RUNNING || query.state === QueryStatus.COMPLETING) | ||
) | ||
return null; | ||
|
||
const percent = query.progress?.spyt_progress | ||
? Math.round(query.progress.spyt_progress * 100) | ||
: 0; | ||
|
||
return ( | ||
<Tooltip content={`${percent}%`}> | ||
<div> | ||
<Progress theme="info" size="xs" value={percent} /> | ||
</div> | ||
</Tooltip> | ||
); | ||
}; |
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