mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
adding fetching to query status (#15064)
This commit is contained in:
parent
256e1452fe
commit
2d3f552b51
@ -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>
|
||||
|
@ -30,6 +30,7 @@ export type QueryState =
|
||||
| 'running'
|
||||
| 'scheduled'
|
||||
| 'success'
|
||||
| 'fetching'
|
||||
| 'timed_out';
|
||||
|
||||
export type Query = {
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user