From ffe0ecfaaa4fd8505ed08bb35cb3767945d3fc1e Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 27 Feb 2017 10:33:26 +0100 Subject: [PATCH 1/8] release 4.2.0 beta1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc3970bfe69..dd2045e7c2f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "4.2.0-pre1", + "version": "4.2.0-beta1", "repository": { "type": "git", "url": "http://github.com/grafana/grafana.git" From a763285daac6927ee58537a58fb621a503504058 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 27 Feb 2017 11:05:05 +0100 Subject: [PATCH 2/8] updates script for packagecloud --- packaging/publish/publish_testing.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/publish/publish_testing.sh b/packaging/publish/publish_testing.sh index 1e39d65b7e5..76419eb7a7e 100755 --- a/packaging/publish/publish_testing.sh +++ b/packaging/publish/publish_testing.sh @@ -1,13 +1,13 @@ #! /usr/bin/env bash -deb_ver=4.1.0-1482230757beta1 -rpm_ver=4.1.0-1482230757beta1 +deb_ver=4.2.0-beta1 +rpm_ver=4.2.0-beta1 -wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb +wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_${deb_ver}_amd64.deb package_cloud push grafana/testing/debian/jessie grafana_${deb_ver}_amd64.deb package_cloud push grafana/testing/debian/wheezy grafana_${deb_ver}_amd64.deb -wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm +wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${rpm_ver}.x86_64.rpm package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm From 1631c8de9558e791e878a501a2e556d14748273b Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 28 Feb 2017 09:09:49 +0100 Subject: [PATCH 3/8] build: use correct version for tar.gz files --- build.go | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/build.go b/build.go index 73f641bfec3..5c04b78cecf 100644 --- a/build.go +++ b/build.go @@ -20,6 +20,7 @@ import ( "strconv" "strings" "time" + "path" ) var ( @@ -120,14 +121,24 @@ func main() { } func makeLatestDistCopies() { - rpmIteration := "-1" - if linuxPackageIteration != "" { - rpmIteration = linuxPackageIteration + files, err := ioutil.ReadDir("dist") + if err != nil { + log.Fatalf("failed to create latest copies. Cannot read from /dist") } - runError("cp", fmt.Sprintf("dist/grafana_%v-%v_amd64.deb", linuxPackageVersion, linuxPackageIteration), "dist/grafana_latest_amd64.deb") - runError("cp", fmt.Sprintf("dist/grafana-%v-%v.x86_64.rpm", linuxPackageVersion, rpmIteration), "dist/grafana-latest-1.x86_64.rpm") - runError("cp", fmt.Sprintf("dist/grafana-%v-%v.linux-x64.tar.gz", linuxPackageVersion, linuxPackageIteration), "dist/grafana-latest.linux-x64.tar.gz") + latestMapping := map[string]string { + ".deb": "dist/grafana_latest_amd64.deb", + ".rpm": "dist/grafana-latest-1.x86_64.rpm", + ".tar.gz": "dist/grafana-latest.linux-x64.tar.gz", + } + + for _, file := range files { + for extension, fullName := range latestMapping { + if strings.HasSuffix(file.Name(), extension) { + runError("cp", path.Join("dist", file.Name()), fullName) + } + } + } } func readVersionFromPackageJson() { @@ -332,9 +343,9 @@ func grunt(params ...string) { func gruntBuildArg(task string) []string { args := []string{task} if includeBuildNumber { - args = append(args, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration)) + args = append(args, fmt.Sprintf("--pkgVer=%v-%v", version, linuxPackageIteration)) } else { - args = append(args, fmt.Sprintf("--pkgVer=%v", linuxPackageVersion)) + args = append(args, fmt.Sprintf("--pkgVer=%v", version)) } if pkgArch != "" { args = append(args, fmt.Sprintf("--arch=%v", pkgArch)) From 62eb19a186ee723e6be4b594584bf8ed21bc16d2 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 28 Feb 2017 17:04:47 +0100 Subject: [PATCH 4/8] template: dont allow template variables to begin with '__' closes #7678 --- public/app/features/templating/editor_ctrl.ts | 1 + .../features/templating/partials/editor.html | 367 +++++++++--------- public/sass/components/_gf-form.scss | 19 + 3 files changed, 205 insertions(+), 182 deletions(-) diff --git a/public/app/features/templating/editor_ctrl.ts b/public/app/features/templating/editor_ctrl.ts index c5e24741a96..7bd745bed53 100644 --- a/public/app/features/templating/editor_ctrl.ts +++ b/public/app/features/templating/editor_ctrl.ts @@ -10,6 +10,7 @@ export class VariableEditorCtrl { constructor(private $scope, private datasourceSrv, private variableSrv, templateSrv) { $scope.variableTypes = variableTypes; $scope.ctrl = {}; + $scope.namePattern = /^((?!__).)*$/; $scope.refreshOptions = [ {value: 0, text: "Never"}, diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index 4fc2553244c..5f844931b4c 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -1,155 +1,158 @@
-
-

- Templating -

+
+

+ Templating +

- + - -
+ +
-
+
-
-
- No template variables defined -
- - - - +
+
+ No template variables defined +
+
- - ${{variable.name}} - - - {{variable.query}} -
+ + + - - - + + - - - -
+ + ${{variable.name}} + + + {{variable.query}} + + Duplicate - - - Edit - - - - - -
-
+ + + + Edit + + + + + + + + + +
-
-
-   New -
-
+
+
+   New +
+
-
-
Variable
-
-
-
- Name - -
-
- + +
Variable
+
+
+ Template names cannot begin with '__' that's reserved for Grafanas global variables +
+
+
+ Name + +
+
+ Type - {{variableTypes[current.type].description}} + {{variableTypes[current.type].description}} -
- -
-
+
+ +
+
-
-
- Label - -
-
- Hide +
+
+ Label + +
+
+ Hide
- -
-
-
-
+ +
+
+
+
-
+
Interval Options
-
- Values - -
+
+ Values + +
-
- - +
+ + -
- - Step count How many times should the current time range be divided to calculate the value - -
- -
-
-
- - Min interval The calculated value will not go below this threshold - - -
-
-
+
+ + Step count How many times should the current time range be divided to calculate the value + +
+ +
+
+
+ + Min interval The calculated value will not go below this threshold + + +
+
+
-
+
Custom Options
-
- Values separated by comma - -
-
+
+ Values separated by comma + +
+
-
+
Constant options
-
- Value - -
-
+
+ Value + +
+
-
+
Query Options
@@ -170,8 +173,8 @@
-
-
+
+
Query
@@ -184,26 +187,26 @@
-
- - Sort - - How to sort the values of this variable. - - -
- -
-
-
+
+ + Sort + + How to sort the values of this variable. + + +
+ +
+
+ -
-
Data source options
+
+
Data source options
-
- -
- +
+ +
+
@@ -222,18 +225,18 @@
-
+
Options
-
- Data source -
- -
-
-
+
+ Data source +
+ +
+
+
-
-
Selection Options
+
+
Selection Options
Value groups/tags (Experimental feature)
- - -
- Tags query - -
-
-
  • Tag values query
  • - -
    -
    + + +
    + Tags query + +
    +
    +
  • Tag values query
  • + +
    +
    -
    -
    Preview of values (shows max 20)
    -
    -
    - {{option.text}} -
    -
    -
    +
    +
    Preview of values (shows max 20)
    +
    +
    + {{option.text}} +
    +
    +
    -
    - {{infoText}} -
    +
    + {{infoText}} +
    -
    - - -
    +
    + + +
    - -
    + +
    diff --git a/public/sass/components/_gf-form.scss b/public/sass/components/_gf-form.scss index 004ab86fb76..19588634dd3 100644 --- a/public/sass/components/_gf-form.scss +++ b/public/sass/components/_gf-form.scss @@ -66,6 +66,25 @@ $gf-form-margin: 0.25rem; } } +.gf-form-error { + padding: $input-padding-y $input-padding-x; + margin-right: $gf-form-margin; + flex-shrink: 0; + + background-color: $input-label-bg; + display: block; + font-size: $font-size-sm; + margin-right: $gf-form-margin; + + border: $input-btn-border-width solid $red; + @include border-radius($label-border-radius-sm); + + &--grow { + flex-grow: 1; + min-height: 2.60rem; + } +} + .gf-form-checkbox { flex-shrink: 0; padding: $input-padding-y $input-padding-x; From ee190d57ebaf804484606291d9242e19f5131d79 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 2 Mar 2017 13:57:28 +0100 Subject: [PATCH 5/8] webhooks: get proxy settings from ini file closes #7710 --- pkg/services/notifications/webhook.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/services/notifications/webhook.go b/pkg/services/notifications/webhook.go index 25d015e2db4..c74804ab828 100644 --- a/pkg/services/notifications/webhook.go +++ b/pkg/services/notifications/webhook.go @@ -25,6 +25,7 @@ type Webhook struct { } var netTransport = &http.Transport{ + Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ Timeout: 30 * time.Second, }).Dial, From 835d420294342cafdf307814ef7e42b74e1e2575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 9 Mar 2017 12:56:49 +0100 Subject: [PATCH 6/8] alerting: fixed width of query component in alert tab --- public/app/features/alerting/partials/alert_tab.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/alerting/partials/alert_tab.html b/public/app/features/alerting/partials/alert_tab.html index 8b11ec4ebc1..76841db75ba 100644 --- a/public/app/features/alerting/partials/alert_tab.html +++ b/public/app/features/alerting/partials/alert_tab.html @@ -47,7 +47,7 @@ OF
    - +
    From 54c6699c2bedc035a84ff2a1624324de9d286b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 20 Mar 2017 11:37:33 +0100 Subject: [PATCH 7/8] usermanagement: disable invite features when login form is disabled, cherry picked from master, #7875 --- pkg/api/frontendsettings.go | 1 + pkg/api/login.go | 4 ++ pkg/api/org_invite.go | 4 ++ public/app/features/org/org_users_ctrl.ts | 26 ++++----- .../app/features/org/partials/add_user.html | 55 +++++++++++++++++++ .../app/features/org/partials/orgUsers.html | 6 +- 6 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 public/app/features/org/partials/add_user.html diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index c0e27897ff4..328b8abbc5f 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -142,6 +142,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro "ldapEnabled": setting.LdapEnabled, "alertingEnabled": setting.AlertingEnabled, "googleAnalyticsId": setting.GoogleAnalyticsId, + "disableLoginForm": setting.DisableLoginForm, "buildInfo": map[string]interface{}{ "version": setting.BuildVersion, "commit": setting.BuildCommit, diff --git a/pkg/api/login.go b/pkg/api/login.go index 8fbe414c08c..8ab76c7b48d 100644 --- a/pkg/api/login.go +++ b/pkg/api/login.go @@ -94,6 +94,10 @@ func LoginApiPing(c *middleware.Context) { } func LoginPost(c *middleware.Context, cmd dtos.LoginCommand) Response { + if setting.DisableLoginForm { + return ApiError(401, "Login is disabled", nil) + } + authQuery := login.LoginUserQuery{ Username: cmd.User, Password: cmd.Password, diff --git a/pkg/api/org_invite.go b/pkg/api/org_invite.go index 8d916677ed2..9e85808950f 100644 --- a/pkg/api/org_invite.go +++ b/pkg/api/org_invite.go @@ -38,6 +38,10 @@ func AddOrgInvite(c *middleware.Context, inviteDto dtos.AddInviteForm) Response if err != m.ErrUserNotFound { return ApiError(500, "Failed to query db for existing user check", err) } + + if setting.DisableLoginForm { + return ApiError(401, "User could not be found", nil) + } } else { return inviteExistingUserToOrg(c, userQuery.Result, &inviteDto) } diff --git a/public/app/features/org/org_users_ctrl.ts b/public/app/features/org/org_users_ctrl.ts index 9e70328f345..6181edddc9a 100644 --- a/public/app/features/org/org_users_ctrl.ts +++ b/public/app/features/org/org_users_ctrl.ts @@ -1,8 +1,8 @@ /// -import angular from 'angular'; +import config from 'app/core/config'; import _ from 'lodash'; -import coreModule from '../../core/core_module'; +import coreModule from 'app/core/core_module'; export class OrgUsersCtrl { @@ -10,6 +10,7 @@ export class OrgUsersCtrl { users: any; pendingInvites: any; editor: any; + showInviteUI: boolean; /** @ngInject */ constructor(private $scope, private $http, private backendSrv) { @@ -17,8 +18,10 @@ export class OrgUsersCtrl { loginOrEmail: '', role: 'Viewer', }; + this.get(); this.editor = { index: 0 }; + this.showInviteUI = config.disableLoginForm === false; } get() { @@ -50,17 +53,13 @@ export class OrgUsersCtrl { removeUserConfirmed(user) { this.backendSrv.delete('/api/org/users/' + user.userId) - .then(() => { - this.get(); - }); + .then(this.get.bind(this)); } revokeInvite(invite, evt) { evt.stopPropagation(); this.backendSrv.patch('/api/org/invites/' + invite.code + '/revoke') - .then(() => { - this.get(); - }); + .then(this.get.bind(this)); } copyInviteToClipboard(evt) { @@ -69,17 +68,18 @@ export class OrgUsersCtrl { openInviteModal() { var modalScope = this.$scope.$new(); - modalScope.invitesSent = function() { - this.get(); - }; + modalScope.invitesSent = this.get.bind(this); + + var src = this.showInviteUI + ? 'public/app/features/org/partials/invite.html' + : 'public/app/features/org/partials/add_user.html'; this.$scope.appEvent('show-modal', { - src: 'public/app/features/org/partials/invite.html', + src: src, modalClass: 'invite-modal', scope: modalScope }); } - } coreModule.controller('OrgUsersCtrl', OrgUsersCtrl); diff --git a/public/app/features/org/partials/add_user.html b/public/app/features/org/partials/add_user.html new file mode 100644 index 00000000000..53fe7884df9 --- /dev/null +++ b/public/app/features/org/partials/add_user.html @@ -0,0 +1,55 @@ + diff --git a/public/app/features/org/partials/orgUsers.html b/public/app/features/org/partials/orgUsers.html index 36b00b3bc03..8d348721301 100644 --- a/public/app/features/org/partials/orgUsers.html +++ b/public/app/features/org/partials/orgUsers.html @@ -8,7 +8,7 @@
    -
    +
    From f2e4269242ec92e486d3b6d387b12b53ec6e36c4 Mon Sep 17 00:00:00 2001 From: Andrii Skomorokhov Date: Fri, 17 Mar 2017 12:48:28 +0200 Subject: [PATCH 8/8] Fixed position of tooltip with description at graph. (#7854) --- public/app/features/panel/panel_directive.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 24977bd386c..165de76333c 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -160,6 +160,7 @@ module.directive('grafanaPanel', function($rootScope) { classes: ctrl.error ? 'drop-error' : 'drop-help', openOn: 'hover', hoverOpenDelay: 100, + constrainToScrollParent: false, }); } }