adding fetching to query status (#15064)

This commit is contained in:
AAfghahi 2021-06-09 19:11:49 -04:00 committed by GitHub
parent 256e1452fe
commit 2d3f552b51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View File

@ -120,6 +120,14 @@ const statusAttributes = {
status: 'queued',
},
},
error: {
color: ({ theme }) => theme.colors.error.base,
config: {
name: 'error',
label: t('Unknown Status'),
status: 'unknown status!',
},
},
};
const StatusIcon = styled(Icon, {
@ -172,6 +180,8 @@ const QueryTable = props => {
return props.queries
.map(query => {
const q = { ...query };
const status = statusAttributes[q.state] || statusAttributes.error;
if (q.endDttm) {
q.duration = fDuration(q.startDttm, q.endDttm);
}
@ -268,14 +278,11 @@ const QueryTable = props => {
/>
);
q.state = (
<Tooltip
title={statusAttributes[q.state].config.label}
placement="bottom"
>
<Tooltip title={status.config.label} placement="bottom">
<span>
<StatusIcon
name={statusAttributes[q.state].config.name}
status={statusAttributes[q.state].config.status}
name={status.config.name}
status={status.config.status}
/>
</span>
</Tooltip>

View File

@ -30,6 +30,7 @@ export type QueryState =
| 'running'
| 'scheduled'
| 'success'
| 'fetching'
| 'timed_out';
export type Query = {

View File

@ -263,6 +263,7 @@ class QueryStatus(str, Enum): # pylint: disable=too-few-public-methods
RUNNING: str = "running"
SCHEDULED: str = "scheduled"
SUCCESS: str = "success"
FETCHING: str = "fetching"
TIMED_OUT: str = "timed_out"