datasource.ts 680 B

123456789101112131415161718192021222324
  1. import { DataSourceApi, DataQueryRequest, DataQueryResponse, DataSourceInstanceSettings } from '@grafana/data';
  2. import { DashboardQuery } from './types';
  3. /**
  4. * This should not really be called
  5. */
  6. export class DashboardDatasource extends DataSourceApi<DashboardQuery> {
  7. constructor(instanceSettings: DataSourceInstanceSettings) {
  8. super(instanceSettings);
  9. }
  10. getCollapsedText(query: DashboardQuery) {
  11. return `Dashboard Reference: ${query.panelId}`;
  12. }
  13. query(options: DataQueryRequest<DashboardQuery>): Promise<DataQueryResponse> {
  14. return Promise.reject('This should not be called directly');
  15. }
  16. testDatasource() {
  17. return Promise.resolve({});
  18. }
  19. }