feat(plugins): began refactoring AppSettings -> PluginSettings, and have the plugins list view and plugin edit view be common for all plugins

This commit is contained in:
Torkel Ödegaard
2016-02-25 14:55:31 +01:00
parent 30f3b55baf
commit 8db7cf49a6
21 changed files with 304 additions and 297 deletions
@@ -5,7 +5,7 @@ import (
"github.com/grafana/grafana/pkg/plugins"
)
type AppSettings struct {
type PluginSetting struct {
Name string `json:"name"`
AppId string `json:"appId"`
Enabled bool `json:"enabled"`
@@ -18,8 +18,17 @@ type AppSettings struct {
JsonData map[string]interface{} `json:"jsonData"`
}
func NewAppSettingsDto(def *plugins.AppPlugin, data *models.AppSettings) *AppSettings {
dto := &AppSettings{
type PluginListItem struct {
Name string `json:"name"`
Type string `json:"type"`
PluginId string `json:"pluginId"`
Enabled bool `json:"enabled"`
Pinned bool `json:"pinned"`
Info *plugins.PluginInfo `json:"info"`
}
func NewPluginSettingDto(def *plugins.AppPlugin, data *models.PluginSetting) *PluginSetting {
dto := &PluginSetting{
AppId: def.Id,
Name: def.Name,
Info: &def.Info,