mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelLibrary: Adds api and db to create Library/Shared/Reusable Panel (#29642)
* PanelLibrary: Adds panellib table
* Refactor: removes drop table migration
* Refactor: fixes spelling mistake
* Refactor: changes after PR comments
* Refactor: some more renames
* PanelLibrary: Adds api and db to create Library/Shared/Reusable Panel
* Refactor: reverts SqlStore change and uses RegisterOverride instead
* Refactor: fixes lint error
* Refactor: fixes imports
* Refactor: reverts unintentional changes
* Refactor: Adds repository
* Revert "Refactor: Adds repository"
This reverts commit 4c46e8a6c4.
* Refactor: changes after PR comments
* Refactor: Simplfies further
* Chore: fixes linting
* Chore: Changes after PR comments
* Update pkg/services/librarypanels/api.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Chore: fixes import after commited suggestion
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -17,6 +17,8 @@ var (
|
||||
|
||||
type Response interface {
|
||||
WriteTo(ctx *models.ReqContext)
|
||||
// Status gets the response's status.
|
||||
Status() int
|
||||
}
|
||||
|
||||
type NormalResponse struct {
|
||||
@@ -41,6 +43,11 @@ func Wrap(action interface{}) macaron.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
// Status gets the response's status.
|
||||
func (r *NormalResponse) Status() int {
|
||||
return r.status
|
||||
}
|
||||
|
||||
func (r *NormalResponse) WriteTo(ctx *models.ReqContext) {
|
||||
if r.err != nil {
|
||||
ctx.Logger.Error(r.errMessage, "error", r.err, "remote_addr", ctx.RemoteAddr())
|
||||
|
||||
Reference in New Issue
Block a user