mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 07:26:31 +08:00
prettier: change to single quoting
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import _ from "lodash";
|
||||
import _ from 'lodash';
|
||||
|
||||
export default class ResponseParser {
|
||||
constructor(private $q) {}
|
||||
@ -21,14 +21,14 @@ export default class ResponseParser {
|
||||
target: series.name,
|
||||
datapoints: series.points,
|
||||
refId: queryRes.refId,
|
||||
meta: queryRes.meta
|
||||
meta: queryRes.meta,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (queryRes.tables) {
|
||||
for (let table of queryRes.tables) {
|
||||
table.type = "table";
|
||||
table.type = 'table';
|
||||
table.refId = queryRes.refId;
|
||||
table.meta = queryRes.meta;
|
||||
data.push(table);
|
||||
@ -50,8 +50,8 @@ export default class ResponseParser {
|
||||
|
||||
const columns = results.data.results[refId].tables[0].columns;
|
||||
const rows = results.data.results[refId].tables[0].rows;
|
||||
const textColIndex = this.findColIndex(columns, "__text");
|
||||
const valueColIndex = this.findColIndex(columns, "__value");
|
||||
const textColIndex = this.findColIndex(columns, '__text');
|
||||
const valueColIndex = this.findColIndex(columns, '__value');
|
||||
|
||||
if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) {
|
||||
return this.transformToKeyValueList(rows, textColIndex, valueColIndex);
|
||||
@ -67,7 +67,7 @@ export default class ResponseParser {
|
||||
if (!this.containsKey(res, rows[i][textColIndex])) {
|
||||
res.push({
|
||||
text: rows[i][textColIndex],
|
||||
value: rows[i][valueColIndex]
|
||||
value: rows[i][valueColIndex],
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -120,18 +120,18 @@ export default class ResponseParser {
|
||||
let tagsColumnIndex = -1;
|
||||
|
||||
for (let i = 0; i < table.columns.length; i++) {
|
||||
if (table.columns[i].text === "time") {
|
||||
if (table.columns[i].text === 'time') {
|
||||
timeColumnIndex = i;
|
||||
} else if (table.columns[i].text === "text") {
|
||||
} else if (table.columns[i].text === 'text') {
|
||||
textColumnIndex = i;
|
||||
} else if (table.columns[i].text === "tags") {
|
||||
} else if (table.columns[i].text === 'tags') {
|
||||
tagsColumnIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (timeColumnIndex === -1) {
|
||||
return this.$q.reject({
|
||||
message: "Missing mandatory time column in annotation query."
|
||||
message: 'Missing mandatory time column in annotation query.',
|
||||
});
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ export default class ResponseParser {
|
||||
text: row[textColumnIndex],
|
||||
tags: row[tagsColumnIndex]
|
||||
? row[tagsColumnIndex].trim().split(/\s*,\s*/)
|
||||
: []
|
||||
: [],
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user