Skip to content

Commit 732d853

Browse files
committed
[Debug]
1 parent ab368c8 commit 732d853

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/QueryEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type Props = QueryEditorProps<DataSource, MyQuery, MyDataSourceOptions>;
1818
const { FormField } = LegacyForms;
1919

2020
const QueryEditor: React.FC<Props> = ({ datasource, query, range, onChange, onRunQuery }) => {
21+
console.log('QueryEditor 1');
2122
const { baseUrl } = datasource;
2223
const from = range!.from.valueOf();
2324
const to = range!.to.valueOf();

src/datasource.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
2020
}
2121

2222
async query(options: DataQueryRequest<MyQuery>): Promise<DataQueryResponse> {
23+
console.log('query 1');
2324
const { range } = options;
2425
const from = range!.from.valueOf();
2526
const to = range!.to.valueOf();
@@ -57,11 +58,12 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
5758
})
5859
.then((response: any) => {
5960
PubSub.publish('CHART_DATA', response);
60-
61+
console.log({ response });
6162
const frame = new MutableDataFrame({
6263
refId,
6364
fields: response.data.result.labels.map((id: string, i: number) => {
6465
const node = response.data.summary.nodes.find((n: any) => n.nd === id);
66+
console.log({ node });
6567
return {
6668
name: node?.name || id,
6769
type: i === 0 ? FieldType.time : FieldType.number,
@@ -76,6 +78,8 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
7678
frame.appendRow([timestamp, ...rest.map((r: any[]) => r[valueIndex])]);
7779
});
7880

81+
throw new Error('TEST ERROR!');
82+
7983
return frame;
8084
})
8185
.catch((error) => {

0 commit comments

Comments
 (0)