|
|
@ -29,7 +29,7 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
const dataFrame = getDataFrameForTable(tasks, setTasks); |
|
|
|
const dataFrame = getDataFrameForTable(tasks, setTasks); |
|
|
|
setDataFrame(dataFrame) |
|
|
|
setDataFrame(dataFrame); |
|
|
|
}, [tasks]); |
|
|
|
}, [tasks]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -38,7 +38,9 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan |
|
|
|
return makeRequest<TableRowConfig[]>('/tasks', {}); |
|
|
|
return makeRequest<TableRowConfig[]>('/tasks', {}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getTasks().then(tasks => setTasks(tasks)).catch(err => console.error(err)); |
|
|
|
getTasks() |
|
|
|
|
|
|
|
.then((tasks) => setTasks(tasks)) |
|
|
|
|
|
|
|
.catch((err) => console.error(err)); |
|
|
|
}, []); |
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
function onAddTaskClick(): void { |
|
|
|
function onAddTaskClick(): void { |
|
|
@ -51,9 +53,10 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
{dataFrame === null ? |
|
|
|
{dataFrame === null ? ( |
|
|
|
// TODO: if datasource responds with error, display the error
|
|
|
|
// TODO: if datasource responds with error, display the error
|
|
|
|
<LoadingPlaceholder text="Loading..."></LoadingPlaceholder> : |
|
|
|
<LoadingPlaceholder text="Loading..."></LoadingPlaceholder> |
|
|
|
|
|
|
|
) : ( |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<Table width={width} height={height - 40} data={dataFrame} /> |
|
|
|
<Table width={width} height={height - 40} data={dataFrame} /> |
|
|
|
<HorizontalGroup justify="flex-end"> |
|
|
|
<HorizontalGroup justify="flex-end"> |
|
|
@ -68,7 +71,7 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan |
|
|
|
</Button> |
|
|
|
</Button> |
|
|
|
</HorizontalGroup> |
|
|
|
</HorizontalGroup> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|