Browse Source

Use datasource name instead of measurement

pull/1/head
rozetko 6 years ago
parent
commit
67b23f2855
  1. 7
      src/routes/datasource.ts
  2. 3
      src/routes/tasks.ts

7
src/routes/datasource.ts

@ -40,10 +40,6 @@ function query(req, res) {
text: 'Datasource', text: 'Datasource',
type: 'string' type: 'string'
}, },
{
text: 'Measurement',
type: 'string'
},
{ {
text: 'Exported Rows', text: 'Exported Rows',
type: 'number' type: 'number'
@ -93,8 +89,7 @@ function query(req, res) {
resp.rows.push([ resp.rows.push([
status.time, status.time,
status.user, status.user,
status.datasource, status.datasourceName,
status.measurement,
status.exportedRows, status.exportedRows,
status.progress, status.progress,
downloadLink, downloadLink,

3
src/routes/tasks.ts

@ -10,6 +10,7 @@ async function addTask(req, res) {
let panelUrl = body.panelUrl; let panelUrl = body.panelUrl;
let targets = [body.target]; let targets = [body.target];
let datasource = body.datasourceRequest; let datasource = body.datasourceRequest;
let datasourceName = body.datasourceName;
let user = body.user; let user = body.user;
if(isNaN(from) || isNaN(to)) { if(isNaN(from) || isNaN(to)) {
@ -18,7 +19,7 @@ async function addTask(req, res) {
res.status(500).send('Range error: "from" should be less than "to"'); res.status(500).send('Range error: "from" should be less than "to"');
} else { } else {
res.status(200).send('Task added'); res.status(200).send('Task added');
let target = new Target(panelUrl, user, datasource, targets, from, to); let target = new Target(panelUrl, user, datasource, targets, from, to, datasourceName);
target.export(); target.export();
} }
} }

Loading…
Cancel
Save