|
|
@ -75,7 +75,6 @@ async function addTask(req: TRequest, res) { |
|
|
|
res.status(400).send('Range error: "from" should be less than "to"'); |
|
|
|
res.status(400).send('Range error: "from" should be less than "to"'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const names = tasks.map(item => item.datasource.name).join(', '); |
|
|
|
const names = tasks.map(item => item.datasource.name).join(', '); |
|
|
|
res.status(200).send(`Exporting ${names} data from ${new Date(from).toLocaleString()} to ${new Date(to).toLocaleString()}`); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const targets = tasks.map((task: Task) => new Target( |
|
|
|
const targets = tasks.map((task: Task) => new Target( |
|
|
|
task.panel, |
|
|
|
task.panel, |
|
|
@ -83,6 +82,7 @@ async function addTask(req: TRequest, res) { |
|
|
|
)); |
|
|
|
)); |
|
|
|
const exporter = exporterFactory.getExporter(); |
|
|
|
const exporter = exporterFactory.getExporter(); |
|
|
|
exporter.export(targets, datasourceUrl, username, from, to); |
|
|
|
exporter.export(targets, datasourceUrl, username, from, to); |
|
|
|
|
|
|
|
res.status(200).send(`Exporting ${names} data from ${new Date(from).toLocaleString()} to ${new Date(to).toLocaleString()}`); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|