diff --git a/CHANGELOG.md b/CHANGELOG.md index 075f4758dd7..c8322c2c239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,20 @@ -# 3.0.0-beta2 (unreleased) +# 3.0.0-beta3 (unreleased) + +### Enhancements +* **InfluxDB**: Changed multi query encoding to work with InfluxDB 0.11 & 0.12, closes [#4533](https://github.com/grafana/grafana/issues/4533) + +### Bug fixes +* **Postgres**: Fixed page render crash when using postgres, fixes [#4558](https://github.com/grafana/grafana/issues/4558) +* **Table panel**: Fixed table panel bug when trying to show annotations in table panel, fixes [#4563](https://github.com/grafana/grafana/issues/4563) +* **App Config**: Fixed app config issue showing content of other app config, fixes [#4575](https://github.com/grafana/grafana/issues/4575) +* **Graph Panel**: Fixed legend option max not updating, fixes [#4601](https://github.com/grafana/grafana/issues/4601) +* **Graph Panel**: Fixed issue where newly added graph panels shared same axes config, fixes [#4582](https://github.com/grafana/grafana/issues/4582) +* **Graph Panel**: Fixed issue with axis labels overlapping Y-axis, fixes [#4626](https://github.com/grafana/grafana/issues/4626) +* **InfluxDB**: Fixed issue with templating query containing template variable, fixes [#4602](https://github.com/grafana/grafana/issues/4602) +* **Graph Panel**: Fixed issue with hiding series and stacking, fixes [#4557](https://github.com/grafana/grafana/issues/4557) +* **Graph Panel**: Fixed issue with legend height in table mode with few series, affected iframe embedding as well, fixes [#4640](https://github.com/grafana/grafana/issues/4640) + +# 3.0.0-beta2 (2016-04-04) ### New Features (introduces since 3.0-beta1) * **Preferences**: Set home dashboard on user and org level, closes [#1678](https://github.com/grafana/grafana/issues/1678) diff --git a/pkg/api/api.go b/pkg/api/api.go index 85f1e2474c3..b1c89e54bc3 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -30,6 +30,7 @@ func Register(r *macaron.Macaron) { // authed views r.Get("/profile/", reqSignedIn, Index) r.Get("/profile/password", reqSignedIn, Index) + r.Get("/profile/switch-org/:id", reqSignedIn, ChangeActiveOrgAndRedirectToHome) r.Get("/org/", reqSignedIn, Index) r.Get("/org/new", reqSignedIn, Index) r.Get("/datasources/", reqSignedIn, Index) diff --git a/pkg/api/user.go b/pkg/api/user.go index 5af243eeb22..8f54feaf6a0 100644 --- a/pkg/api/user.go +++ b/pkg/api/user.go @@ -4,6 +4,7 @@ import ( "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/middleware" m "github.com/grafana/grafana/pkg/models" + "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" ) @@ -109,6 +110,23 @@ func UserSetUsingOrg(c *middleware.Context) Response { return ApiSuccess("Active organization changed") } +// GET /profile/switch-org/:id +func ChangeActiveOrgAndRedirectToHome(c *middleware.Context) { + orgId := c.ParamsInt64(":id") + + if !validateUsingOrg(c.UserId, orgId) { + NotFoundHandler(c) + } + + cmd := m.SetUsingOrgCommand{UserId: c.UserId, OrgId: orgId} + + if err := bus.Dispatch(&cmd); err != nil { + NotFoundHandler(c) + } + + c.Redirect(setting.AppSubUrl + "/") +} + func ChangeUserPassword(c *middleware.Context, cmd m.ChangeUserPasswordCommand) Response { userQuery := m.GetUserByIdQuery{Id: c.UserId} diff --git a/pkg/cmd/grafana-cli/commands/commands.go b/pkg/cmd/grafana-cli/commands/commands.go index 55a0e2660ec..2e0c395727b 100644 --- a/pkg/cmd/grafana-cli/commands/commands.go +++ b/pkg/cmd/grafana-cli/commands/commands.go @@ -25,7 +25,7 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C var pluginCommands = []cli.Command{ { Name: "install", - Usage: "install ", + Usage: "install ", Action: runCommand(installCommand), }, { Name: "list-remote", @@ -33,7 +33,7 @@ var pluginCommands = []cli.Command{ Action: runCommand(listremoteCommand), }, { Name: "upgrade", - Usage: "upgrade ", + Usage: "upgrade ", Action: runCommand(upgradeCommand), }, { Name: "upgrade-all", @@ -43,9 +43,13 @@ var pluginCommands = []cli.Command{ Name: "ls", Usage: "list all installed plugins", Action: runCommand(lsCommand), + }, { + Name: "uninstall", + Usage: "uninstall ", + Action: runCommand(removeCommand), }, { Name: "remove", - Usage: "remove ", + Usage: "remove ", Action: runCommand(removeCommand), }, } diff --git a/pkg/metrics/report_usage.go b/pkg/metrics/report_usage.go index c5c2afed7f7..85a87155f6d 100644 --- a/pkg/metrics/report_usage.go +++ b/pkg/metrics/report_usage.go @@ -10,6 +10,7 @@ import ( "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/log" m "github.com/grafana/grafana/pkg/models" + "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/setting" ) @@ -56,6 +57,9 @@ func sendUsageStats() { metrics["stats.users.count"] = statsQuery.Result.UserCount metrics["stats.orgs.count"] = statsQuery.Result.OrgCount metrics["stats.playlist.count"] = statsQuery.Result.PlaylistCount + metrics["stats.plugins.apps.count"] = len(plugins.Apps) + metrics["stats.plugins.panels.count"] = len(plugins.Panels) + metrics["stats.plugins.datasources.count"] = len(plugins.DataSources) dsStats := m.GetDataSourceStatsQuery{} if err := bus.Dispatch(&dsStats); err != nil { diff --git a/public/app/core/components/sidemenu/sidemenu.html b/public/app/core/components/sidemenu/sidemenu.html index 4ff30c92f47..25aa38c45b8 100644 --- a/public/app/core/components/sidemenu/sidemenu.html +++ b/public/app/core/components/sidemenu/sidemenu.html @@ -21,10 +21,6 @@ {{::menuItem.text}} - - - {{::menuItem.text}} - diff --git a/public/app/core/components/sidemenu/sidemenu.ts b/public/app/core/components/sidemenu/sidemenu.ts index a47704f9d7d..30230586e78 100644 --- a/public/app/core/components/sidemenu/sidemenu.ts +++ b/public/app/core/components/sidemenu/sidemenu.ts @@ -72,9 +72,8 @@ export class SideMenuCtrl { this.orgMenu.push({ text: "Switch to " + org.name, icon: "fa fa-fw fa-random", - click: () => { - this.switchOrg(org.orgId); - } + url: this.getUrl('/profile/switch-org/' + org.orgId), + target: '_self' }); }); @@ -83,12 +82,6 @@ export class SideMenuCtrl { } }); } - - switchOrg(orgId) { - this.backendSrv.post('/api/user/using/' + orgId).then(() => { - window.location.href = `${config.appSubUrl}/`; - }); - }; } export function sideMenuDirective() { diff --git a/public/app/core/components/switch.ts b/public/app/core/components/switch.ts index 1dddae20d49..10211b5b914 100644 --- a/public/app/core/components/switch.ts +++ b/public/app/core/components/switch.ts @@ -21,14 +21,14 @@ export class SwitchCtrl { id: any; /** @ngInject */ - constructor($scope) { + constructor($scope, private $timeout) { this.show = true; this.id = $scope.$id; } internalOnChange() { return new Promise(resolve => { - setTimeout(() => { + this.$timeout(() => { this.onChange(); resolve(); }); diff --git a/public/app/core/services/popover_srv.ts b/public/app/core/services/popover_srv.ts index 4711dc1b23c..73249a67b5b 100644 --- a/public/app/core/services/popover_srv.ts +++ b/public/app/core/services/popover_srv.ts @@ -46,9 +46,12 @@ function popoverSrv($compile, $rootScope) { drop.on('close', () => { popoverScope.dismiss({fromDropClose: true}); destroyDrop(); + if (options.onClose) { + options.onClose(); + } }); - drop.open(); + setTimeout(() => { drop.open(); }, 10); }; } diff --git a/public/app/features/dashboard/partials/shareModal.html b/public/app/features/dashboard/partials/shareModal.html index 41c08fede0b..c8462c7bffc 100644 --- a/public/app/features/dashboard/partials/shareModal.html +++ b/public/app/features/dashboard/partials/shareModal.html @@ -38,31 +38,26 @@
-
-
+
+
-
-
- -
-
@@ -117,7 +113,7 @@

-