mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore: Rename isDataPanel to noQueries
This commit is contained in:
parent
0019e0ffc9
commit
2db9cb3d93
@ -145,7 +145,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
|
|||||||
"info": panel.Info,
|
"info": panel.Info,
|
||||||
"hideFromList": panel.HideFromList,
|
"hideFromList": panel.HideFromList,
|
||||||
"sort": getPanelSort(panel.Id),
|
"sort": getPanelSort(panel.Id),
|
||||||
"isDataPanel": panel.IsDataPanel,
|
"noQueries": panel.NoQueries,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ type PluginBase struct {
|
|||||||
BaseUrl string `json:"baseUrl"`
|
BaseUrl string `json:"baseUrl"`
|
||||||
HideFromList bool `json:"hideFromList,omitempty"`
|
HideFromList bool `json:"hideFromList,omitempty"`
|
||||||
State PluginState `json:"state,omitempty"`
|
State PluginState `json:"state,omitempty"`
|
||||||
IsDataPanel bool `json:"isDataPanel"`
|
NoQueries bool `json:"noQueries"`
|
||||||
|
|
||||||
IncludedInAppId string `json:"-"`
|
IncludedInAppId string `json:"-"`
|
||||||
PluginDir string `json:"-"`
|
PluginDir string `json:"-"`
|
||||||
|
@ -131,8 +131,10 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|||||||
this.renderPanelPlugin(LoadingState.Done, snapshotDataToPanelData(panel), width, height)
|
this.renderPanelPlugin(LoadingState.Done, snapshotDataToPanelData(panel), width, height)
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{plugin.isDataPanel === true ?
|
{plugin.noQueries === true ?
|
||||||
<DataPanel
|
this.renderPanelPlugin(LoadingState.Done, null, width, height)
|
||||||
|
: (
|
||||||
|
<DataPanel
|
||||||
datasource={datasource}
|
datasource={datasource}
|
||||||
queries={targets}
|
queries={targets}
|
||||||
timeRange={timeRange}
|
timeRange={timeRange}
|
||||||
@ -145,8 +147,6 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|||||||
return this.renderPanelPlugin(loading, panelData, width, height);
|
return this.renderPanelPlugin(loading, panelData, width, height);
|
||||||
}}
|
}}
|
||||||
</DataPanel>
|
</DataPanel>
|
||||||
: (
|
|
||||||
this.renderPanelPlugin(LoadingState.Done, null, width, height)
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
@ -107,7 +107,7 @@ export class PanelEditor extends PureComponent<PanelEditorProps> {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// handle panels that do not have queries tab
|
// handle panels that do not have queries tab
|
||||||
if (!plugin.isDataPanel) {
|
if (plugin.noQueries === true) {
|
||||||
// remove queries tab
|
// remove queries tab
|
||||||
tabs.shift();
|
tabs.shift();
|
||||||
// switch tab
|
// switch tab
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"type": "panel",
|
"type": "panel",
|
||||||
"name": "Gauge",
|
"name": "Gauge",
|
||||||
"id": "gauge",
|
"id": "gauge",
|
||||||
"isDataPanel": true,
|
|
||||||
|
|
||||||
"info": {
|
"info": {
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"type": "panel",
|
"type": "panel",
|
||||||
"name": "React Graph",
|
"name": "React Graph",
|
||||||
"id": "graph2",
|
"id": "graph2",
|
||||||
"isDataPanel": true,
|
|
||||||
"state": "alpha",
|
"state": "alpha",
|
||||||
|
|
||||||
"info": {
|
"info": {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Text v2",
|
"name": "Text v2",
|
||||||
"id": "text2",
|
"id": "text2",
|
||||||
"state": "alpha",
|
"state": "alpha",
|
||||||
"isDataPanel": false,
|
"noQueries": true,
|
||||||
|
|
||||||
"info": {
|
"info": {
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -9,7 +9,7 @@ export interface PanelPlugin {
|
|||||||
info: any;
|
info: any;
|
||||||
sort: number;
|
sort: number;
|
||||||
exports?: PluginExports;
|
exports?: PluginExports;
|
||||||
isDataPanel?: boolean;
|
noQueries?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Plugin {
|
export interface Plugin {
|
||||||
|
Loading…
Reference in New Issue
Block a user