diff --git a/pkg/api/dtos/plugins.go b/pkg/api/dtos/plugins.go index 3692b4b2667..6286832e352 100644 --- a/pkg/api/dtos/plugins.go +++ b/pkg/api/dtos/plugins.go @@ -1,13 +1,10 @@ package dtos -import ( - "github.com/grafana/grafana/pkg/models" - "github.com/grafana/grafana/pkg/plugins" -) +import "github.com/grafana/grafana/pkg/plugins" type PluginSetting struct { Name string `json:"name"` - AppId string `json:"appId"` + PluginId string `json:"pluginId"` Enabled bool `json:"enabled"` Pinned bool `json:"pinned"` Module string `json:"module"` @@ -26,24 +23,3 @@ type PluginListItem struct { 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, - Module: def.Module, - BaseUrl: def.BaseUrl, - Pages: def.Pages, - Includes: def.Includes, - } - - if data != nil { - dto.Enabled = data.Enabled - dto.Pinned = data.Pinned - dto.Info = &def.Info - dto.JsonData = data.JsonData - } - - return dto -} diff --git a/pkg/api/index.go b/pkg/api/index.go index 9edbdda7c96..df752109530 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -72,7 +72,7 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{ Text: "Plugins", Icon: "icon-gf icon-gf-apps", - Url: setting.AppSubUrl + "/apps", + Url: setting.AppSubUrl + "/plugins", }) } diff --git a/pkg/api/plugin_setting.go b/pkg/api/plugin_setting.go index 2a2e6ba3f55..dde75c95729 100644 --- a/pkg/api/plugin_setting.go +++ b/pkg/api/plugin_setting.go @@ -38,15 +38,34 @@ func GetPluginList(c *middleware.Context) Response { func GetPluginSettingById(c *middleware.Context) Response { pluginId := c.Params(":pluginId") - if pluginDef, exists := plugins.Apps[pluginId]; !exists { - return ApiError(404, "PluginId not found, no installed plugin with that id", nil) + if def, exists := plugins.Plugins[pluginId]; !exists { + return ApiError(404, "Plugin not found, no installed plugin with that id", nil) } else { - query := m.GetPluginSettingByIdQuery{PluginId: pluginId, OrgId: c.OrgId} - if err := bus.Dispatch(&query); err != nil { - return ApiError(500, "Failed to get login settings", nil) + dto := &dtos.PluginSetting{ + PluginId: def.Id, + Name: def.Name, + Info: &def.Info, } - return Json(200, dtos.NewPluginSettingDto(pluginDef, query.Result)) + if app, exists := plugins.Apps[pluginId]; exists { + dto.Pages = app.Pages + dto.Includes = app.Includes + dto.BaseUrl = app.BaseUrl + dto.Module = app.Module + } + + query := m.GetPluginSettingByIdQuery{PluginId: pluginId, OrgId: c.OrgId} + if err := bus.Dispatch(&query); err != nil { + if err != m.ErrPluginSettingNotFound { + return ApiError(500, "Failed to get login settings", nil) + } + } else { + dto.Enabled = query.Result.Enabled + dto.Pinned = query.Result.Pinned + dto.JsonData = query.Result.JsonData + } + + return Json(200, dto) } } diff --git a/public/app/features/admin/partials/edit_org.html b/public/app/features/admin/partials/edit_org.html index de92cd3adf5..b08d0c49a45 100644 --- a/public/app/features/admin/partials/edit_org.html +++ b/public/app/features/admin/partials/edit_org.html @@ -1,5 +1,8 @@ - + + + Orgs +
diff --git a/public/app/features/admin/partials/edit_user.html b/public/app/features/admin/partials/edit_user.html index 24f98a206f4..6d3e6e68f54 100644 --- a/public/app/features/admin/partials/edit_user.html +++ b/public/app/features/admin/partials/edit_user.html @@ -1,5 +1,8 @@ - + + + Users +
diff --git a/public/app/features/admin/partials/new_user.html b/public/app/features/admin/partials/new_user.html index 3ae2dbfc209..1d4a4b231b5 100644 --- a/public/app/features/admin/partials/new_user.html +++ b/public/app/features/admin/partials/new_user.html @@ -1,5 +1,8 @@ - + + + Users +
diff --git a/public/app/features/admin/partials/orgs.html b/public/app/features/admin/partials/orgs.html index aba3ef70a92..ae02b72b418 100644 --- a/public/app/features/admin/partials/orgs.html +++ b/public/app/features/admin/partials/orgs.html @@ -1,5 +1,8 @@ - + + + Orgs +
diff --git a/public/app/features/admin/partials/users.html b/public/app/features/admin/partials/users.html index adafe2ddf6f..a1c86391088 100644 --- a/public/app/features/admin/partials/users.html +++ b/public/app/features/admin/partials/users.html @@ -1,5 +1,8 @@ - + + + Users +
diff --git a/public/app/features/datasources/partials/list.html b/public/app/features/datasources/partials/list.html index 0a2e2673bbd..6ad9c18bc53 100644 --- a/public/app/features/datasources/partials/list.html +++ b/public/app/features/datasources/partials/list.html @@ -22,8 +22,8 @@ - - + + diff --git a/public/app/features/plugins/partials/edit.html b/public/app/features/plugins/partials/edit.html index 7def9a3c96e..d93d76b1fc9 100644 --- a/public/app/features/plugins/partials/edit.html +++ b/public/app/features/plugins/partials/edit.html @@ -1,108 +1,112 @@ - + + + + Apps +
-
-
- -
-
-

- {{ctrl.appModel.name}} -

-
- {{ctrl.appModel.info.description}}
- - Version: {{ctrl.appModel.info.version}}     Updated: {{ctrl.appModel.info.updated}} - -
- -
- -       - -
-
- + -
-

Included with app:

-
-
-
- - Dashboards -
-
    -
  • None
  • -
-
-
-
- - Panels -
-
    -
  • None
  • -
  • - {{panel.name}} -
  • -
-
-
-
- - Datasources -
-
    -
  • None
  • -
  • - {{ds.name}} -
  • -
-
-
-
- - Pages -
- -
- +
+
+ {{ctrl.model.info.description}}
+ + Version: {{ctrl.model.info.version}}     Updated: {{ctrl.model.info.updated}} +
-
-
-

Dependencies:

-
- Grafana 2.6.x +
+ +       +
-
- -
-

Configuration:

-
-
- -
- -
-
-
- - +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/sass/_grafana.scss b/public/sass/_grafana.scss index 33c8fefa390..84ea799febc 100644 --- a/public/sass/_grafana.scss +++ b/public/sass/_grafana.scss @@ -72,7 +72,7 @@ @import "pages/playlist"; @import "pages/admin"; @import "pages/alerting"; -@import "pages/apps"; +@import "pages/plugins"; @import "pages/signup"; @import "pages/styleguide"; diff --git a/public/sass/layout/_page.scss b/public/sass/layout/_page.scss index cf53b0958a3..86fb945ed61 100644 --- a/public/sass/layout/_page.scss +++ b/public/sass/layout/_page.scss @@ -27,6 +27,10 @@ background-image: linear-gradient(60deg, transparent 70%, darken($page-bg, 4%) 98%) } +.page-header-logo { + max-width: 7rem; +} + .page-header { padding: $spacer 0 $spacer/2 0; display: flex; diff --git a/public/sass/pages/_apps.scss b/public/sass/pages/_apps.scss deleted file mode 100644 index 73959edf50b..00000000000 --- a/public/sass/pages/_apps.scss +++ /dev/null @@ -1,26 +0,0 @@ - -.app-edit-logo-box { - padding: 1.2rem; - background: $panel-bg; - text-align: center; - img { - max-width: 7rem; - } - margin-right: 2rem; -} - -.app-edit-links { - list-style: none; - margin: 0 0 0 2rem; - - li { - background: $panel-bg; - margin-top: 4px; - padding: 0.2rem 1rem; - } -} - -.app-edit-description { - font-style: italic; - margin-bottom: 1.5rem; -} diff --git a/public/sass/pages/_plugins.scss b/public/sass/pages/_plugins.scss new file mode 100644 index 00000000000..217327c60f5 --- /dev/null +++ b/public/sass/pages/_plugins.scss @@ -0,0 +1,26 @@ + +// .app-edit-logo-box { +// padding: 1.2rem; +// background: $panel-bg; +// text-align: center; +// img { +// max-width: 7rem; +// } +// margin-right: 2rem; +// } +// +// .app-edit-links { +// list-style: none; +// margin: 0 0 0 2rem; +// +// li { +// background: $panel-bg; +// margin-top: 4px; +// padding: 0.2rem 1rem; +// } +// } +// +// .app-edit-description { +// font-style: italic; +// margin-bottom: 1.5rem; +// }
NameUrlnameurl