|
|
@ -142,6 +142,7 @@ export class DataProcessor { |
|
|
|
let fields = []; |
|
|
|
let fields = []; |
|
|
|
var firstItem = dataList[0]; |
|
|
|
var firstItem = dataList[0]; |
|
|
|
let fieldParts = []; |
|
|
|
let fieldParts = []; |
|
|
|
|
|
|
|
|
|
|
|
function getPropertiesRecursive(obj) { |
|
|
|
function getPropertiesRecursive(obj) { |
|
|
|
_.forEach(obj, (value, key) => { |
|
|
|
_.forEach(obj, (value, key) => { |
|
|
|
if (_.isObject(value)) { |
|
|
|
if (_.isObject(value)) { |
|
|
@ -156,20 +157,19 @@ export class DataProcessor { |
|
|
|
}); |
|
|
|
}); |
|
|
|
fieldParts.pop(); |
|
|
|
fieldParts.pop(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (firstItem.type === 'docs') { |
|
|
|
if (firstItem.type === 'docs') { |
|
|
|
if (firstItem.datapoints.length === 0) { |
|
|
|
if (firstItem.datapoints.length === 0) { |
|
|
|
return []; |
|
|
|
return []; |
|
|
|
} |
|
|
|
} |
|
|
|
getPropertiesRecursive(firstItem.datapoints[0]); |
|
|
|
getPropertiesRecursive(firstItem.datapoints[0]); |
|
|
|
return fields; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return fields; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getXAxisValueOptions(options) { |
|
|
|
getXAxisValueOptions(options) { |
|
|
|
switch (this.panel.xaxis.mode) { |
|
|
|
switch (this.panel.xaxis.mode) { |
|
|
|
case 'time': { |
|
|
|
|
|
|
|
return []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 'series': { |
|
|
|
case 'series': { |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
{text: 'Avg', value: 'avg'}, |
|
|
|
{text: 'Avg', value: 'avg'}, |
|
|
@ -180,6 +180,8 @@ export class DataProcessor { |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return []; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pluckDeep(obj: any, property: string) { |
|
|
|
pluckDeep(obj: any, property: string) { |
|
|
|