mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Inspect: Should not subscribe to transformed data * PQR- allow controll whether or not field overrides and transformations should be applied * UI for inspector data options * fix * Null check fix * Refactor PanelInspector * TS fix * Merge fix * fix test * Update public/app/features/dashboard/components/Inspector/InspectDataTab.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * review batch 1 * Update API of usePanelLatestData * css * review batch 2 * Update usePanelLatestData hook Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
23 lines
489 B
TypeScript
23 lines
489 B
TypeScript
import React from 'react';
|
|
import { DataQueryError } from '@grafana/data';
|
|
import { JSONFormatter } from '@grafana/ui';
|
|
|
|
interface InspectErrorTabProps {
|
|
error?: DataQueryError;
|
|
}
|
|
|
|
export const InspectErrorTab: React.FC<InspectErrorTabProps> = ({ error }) => {
|
|
if (!error) {
|
|
return null;
|
|
}
|
|
if (error.data) {
|
|
return (
|
|
<>
|
|
<h3>{error.data.message}</h3>
|
|
<JSONFormatter json={error} open={2} />
|
|
</>
|
|
);
|
|
}
|
|
return <div>{error.message}</div>;
|
|
};
|