Przeglądaj źródła

feat: Introduce IsDataPanel attribute to plugin.json

Johannes Schill 6 lat temu
rodzic
commit
a8a9bca07b

+ 1 - 0
pkg/api/frontendsettings.go

@@ -145,6 +145,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
 			"info":         panel.Info,
 			"hideFromList": panel.HideFromList,
 			"sort":         getPanelSort(panel.Id),
+			"isDataPanel":  panel.IsDataPanel,
 		}
 	}
 

+ 1 - 0
pkg/plugins/models.go

@@ -47,6 +47,7 @@ type PluginBase struct {
 	BaseUrl      string             `json:"baseUrl"`
 	HideFromList bool               `json:"hideFromList,omitempty"`
 	State        PluginState        `json:"state,omitempty"`
+	IsDataPanel  bool               `json:"isDataPanel"`
 
 	IncludedInAppId string `json:"-"`
 	PluginDir       string `json:"-"`

+ 1 - 0
public/app/plugins/panel/gauge/plugin.json

@@ -2,6 +2,7 @@
   "type": "panel",
   "name": "Gauge",
   "id": "gauge",
+  "isDataPanel": true,
 
   "info": {
     "author": {

+ 1 - 1
public/app/plugins/panel/graph2/plugin.json

@@ -2,7 +2,7 @@
   "type": "panel",
   "name": "React Graph",
   "id": "graph2",
-
+  "isDataPanel": true,
   "state": "alpha",
 
   "info": {

+ 1 - 1
public/app/plugins/panel/text2/plugin.json

@@ -2,8 +2,8 @@
   "type": "panel",
   "name": "Text v2",
   "id": "text2",
-
   "state": "alpha",
+  "isDataPanel": false,
 
   "info": {
     "author": {

+ 1 - 0
public/app/types/plugins.ts

@@ -9,6 +9,7 @@ export interface PanelPlugin {
   info: any;
   sort: number;
   exports?: PluginExports;
+  isDataPanel?: boolean;
 }
 
 export interface Plugin {