GetDisplay get display info for Displayer plugin. swagger:operation GET /plugin/{id}/display plugin getPluginDisplay Get display info for a Displayer plugin. --- consumes: [application/json] produces: [application/json] parameters: - name: id in: path description: the plugin id requi
(ctx *gin.Context)
| 240 | // schema: |
| 241 | // $ref: "#/definitions/Error" |
| 242 | func (c *PluginAPI) GetDisplay(ctx *gin.Context) { |
| 243 | withID(ctx, "id", func(id uint) { |
| 244 | conf, err := c.DB.GetPluginConfByID(id) |
| 245 | if success := successOrAbort(ctx, 500, err); !success { |
| 246 | return |
| 247 | } |
| 248 | if conf == nil || !isPluginOwner(ctx, conf) { |
| 249 | ctx.AbortWithError(404, errors.New("unknown plugin")) |
| 250 | return |
| 251 | } |
| 252 | instance, err := c.Manager.Instance(id) |
| 253 | if err != nil { |
| 254 | ctx.AbortWithError(404, errors.New("plugin instance not found")) |
| 255 | return |
| 256 | } |
| 257 | ctx.JSON(200, instance.GetDisplay(location.Get(ctx))) |
| 258 | }) |
| 259 | } |
| 260 | |
| 261 | // GetConfig returns Configurer plugin configuration in YAML format. |
| 262 | // swagger:operation GET /plugin/{id}/config plugin getPluginConfig |
nothing calls this directly
no test coverage detected