|
|
|
@ -341,11 +341,6 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'Status Updated At', |
|
|
|
|
type: FieldType.number, |
|
|
|
|
values: _.map(sortedTasks, (task) => convertTimestampToDate(task.progress?.time)), |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'From', |
|
|
|
|
type: FieldType.number, |
|
|
|
@ -356,11 +351,6 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
type: FieldType.number, |
|
|
|
|
values: _.map(sortedTasks, (task) => convertTimestampToDate(task.timeRange.to)), |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'User', |
|
|
|
|
type: FieldType.string, |
|
|
|
|
values: _.map(sortedTasks, (task) => task.username), |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'Exported Rows', |
|
|
|
|
type: FieldType.number, |
|
|
|
@ -408,7 +398,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
links: [ |
|
|
|
|
{ |
|
|
|
|
targetBlank: false, |
|
|
|
|
title: 'Download', |
|
|
|
|
title: 'Delete', |
|
|
|
|
url: '#', |
|
|
|
|
onClick: (event: DataLinkClickEvent) => onDeleteClick(event), |
|
|
|
|
}, |
|
|
|
@ -436,7 +426,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
const sortedTasks = _.orderBy(tasks, (task) => task.progress?.time, 'desc'); |
|
|
|
|
const taskToDelete = sortedTasks[rowIndex]; |
|
|
|
|
if (taskToDelete.progress?.status === ExportStatus.EXPORTING || taskToDelete.id === taskIdBeingDownloaded) { |
|
|
|
|
appEvents.emit(AppEvents.alertError, ['Data Exporter', 'Active task can`t be deleted']); |
|
|
|
|
appEvents.emit(AppEvents.alertWarning, ['Data Exporter', 'Active task can`t be deleted']); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
await deleteTask(taskToDelete?.id); |
|
|
|
@ -450,15 +440,15 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
const sortedTasks = _.orderBy(tasks, (task) => task.progress?.time, 'desc'); |
|
|
|
|
const task = sortedTasks[rowIndex]; |
|
|
|
|
if (task.progress?.status === ExportStatus.EXPORTING || task.id === taskIdBeingDownloaded) { |
|
|
|
|
appEvents.emit(AppEvents.alertError, ['Data Exporter', 'Active task can`t be downloaded']); |
|
|
|
|
appEvents.emit(AppEvents.alertWarning, ['Data Exporter', 'Active task can`t be downloaded']); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (task.progress?.status === ExportStatus.ERROR) { |
|
|
|
|
appEvents.emit(AppEvents.alertError, ['Data Exporter', 'Failed task can`t be downloaded']); |
|
|
|
|
appEvents.emit(AppEvents.alertWarning, ['Data Exporter', 'Failed task can`t be downloaded']); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
setTaskIdBeingDownloaded(task.id as string); |
|
|
|
|
await getStaticFile(task?.id); |
|
|
|
|
await getStaticFile(task?.filename); |
|
|
|
|
setTaskIdBeingDownloaded(null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|