Selaa lähdekoodia

TableData: support name (#16983)

Ryan McKinley 6 vuotta sitten
vanhempi
commit
30bf9bf00f

+ 1 - 0
packages/grafana-ui/src/types/data.ts

@@ -70,6 +70,7 @@ export interface Column {
 }
 }
 
 
 export interface TableData extends QueryResultBase {
 export interface TableData extends QueryResultBase {
+  name?: string;
   columns: Column[];
   columns: Column[];
   rows: any[][];
   rows: any[][];
 }
 }

+ 1 - 0
packages/grafana-ui/src/utils/processSeriesData.ts

@@ -19,6 +19,7 @@ function convertTableToSeriesData(table: TableData): SeriesData {
     rows: table.rows,
     rows: table.rows,
     refId: table.refId,
     refId: table.refId,
     meta: table.meta,
     meta: table.meta,
+    name: table.name,
   };
   };
 }
 }
 
 

+ 1 - 0
public/app/plugins/datasource/testdata/datasource.ts

@@ -78,6 +78,7 @@ export class TestDataDatasource implements DataSourceApi<TestDataQuery> {
           for (const t of results.tables || []) {
           for (const t of results.tables || []) {
             const table = t as TableData;
             const table = t as TableData;
             table.refId = query.refId;
             table.refId = query.refId;
+            table.name = query.alias;
             data.push(table);
             data.push(table);
           }
           }