Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
59055ee
natel branding
ryantxu May 6, 2019
0f984bc
expose emitter
ryantxu May 6, 2019
f1596e0
never match
ryantxu May 6, 2019
f10eaea
Merge remote-tracking branch 'grafana/master' into v6-circle-no-master
ryantxu May 9, 2019
54f02ea
Merge remote-tracking branch 'grafana/master' into v6-expose-emitter
ryantxu May 9, 2019
a95d242
copy patch from ryantxu
ryantxu May 9, 2019
f593bf7
copy patch from ryantxu
ryantxu May 9, 2019
d83ad08
build all... not just fast
ryantxu May 9, 2019
c986d30
build all
ryantxu May 9, 2019
5d29bd1
a commit
ryantxu May 10, 2019
1c739d6
new PR
ryantxu May 10, 2019
969e270
Merge branch 'master' into v6-branding
ryantxu May 10, 2019
899728c
merge master
ryantxu May 10, 2019
04ee262
Merge branch 'master' into natel-oauth-redirect
ryantxu May 10, 2019
69318c9
Merge branch 'master' into natel-emitter
ryantxu May 10, 2019
3242bab
put back the test
ryantxu May 10, 2019
e5c93e8
fix test
ryantxu May 10, 2019
272649f
update test
ryantxu May 11, 2019
04c57fe
upstream footer
ryantxu May 13, 2019
a8ed5d2
fix test
ryantxu May 13, 2019
39c96c2
Merge branch 'v6-branding' of github.com:natelenergy/grafana into v6-…
ryantxu May 13, 2019
51bb0ac
remove snapshots
ryantxu May 13, 2019
f986df1
remove snapshots
ryantxu May 13, 2019
5fb03c8
Merge remote-tracking branch 'grafana/master' into natel-dynamic-height
ryantxu May 14, 2019
d24a193
add aria
ryantxu May 14, 2019
d8d4859
merge master
ryantxu May 15, 2019
6fca2c9
Merge remote-tracking branch 'grafana/master' into natel-dynamic-height
ryantxu May 15, 2019
b63d19d
merge master
ryantxu May 15, 2019
d6ed1a3
merge master
ryantxu May 15, 2019
cd5398a
export grafana runtime
ryantxu May 16, 2019
8e95af2
Merge branch 'master' into v6-branding
ryantxu May 16, 2019
d47d429
Merge branch 'master' into natel-oauth-redirect
ryantxu May 16, 2019
d2a73ff
Merge branch 'master' into v6-circle-no-master
ryantxu May 16, 2019
f7e0034
Merge branch 'master' into natel-dynamic-height
ryantxu May 16, 2019
68f89e3
Merge branch 'master' into natel-V6
ryantxu May 16, 2019
70a9afd
Merge branch 'v6-branding' into natel-V6
ryantxu May 16, 2019
1ec3d43
Merge branch 'export-services' into natel-V6
ryantxu May 16, 2019
7b8b713
Merge branch 'v6-circle-no-master' into natel-V6
ryantxu May 16, 2019
f4cd906
Merge branch 'natel-oauth-redirect' into natel-V6
ryantxu May 16, 2019
0798186
Merge branch 'natel-dynamic-height' into natel-V6
ryantxu May 16, 2019
04cb362
Merge branch 'master' into natel-emitter
ryantxu May 16, 2019
dac537f
Merge branch 'natel-emitter' into natel-V6
ryantxu May 16, 2019
d607460
merge all
ryantxu May 16, 2019
14212fe
remove the border
ryantxu May 16, 2019
78d763a
Merge remote-tracking branch 'grafana/master' into v6-branding
ryantxu May 17, 2019
9aeebff
merge master
ryantxu May 17, 2019
94f89dd
merge master
ryantxu May 17, 2019
b547477
Chore: Update grafana-ui version to 6.2.0-alpha.0 (#17109)
dprokop May 16, 2019
2703426
GraphPanel: Don't sort series when legend table & sort column is not …
May 16, 2019
4a07112
Fix: tighten revive exit code & make it happy (#17127)
markelog May 17, 2019
eea0b9e
explore: make sure datasource is added to target (#17116)
marefr May 17, 2019
db183a2
explore: fix issues when loading and both graph/table are collapsed …
marefr May 17, 2019
d189e56
Feature: LDAP refactoring (#16950)
markelog May 17, 2019
5d43f44
y is the trigger
ryantxu May 17, 2019
d096e35
Merge remote-tracking branch 'grafana/master' into natel-dynamic-height
ryantxu May 17, 2019
8f604a4
Merge remote-tracking branch 'grafana/master' into natel-oauth-redirect
ryantxu May 17, 2019
af677e7
redirect again to root?
ryantxu May 17, 2019
5dc2964
Merge branch 'master' into natel-V6
ryantxu May 17, 2019
e8ea390
Merge branch 'natel-oauth-redirect' into natel-V6
ryantxu May 17, 2019
8c1224f
Merge branch 'natel-dynamic-height' into natel-V6
ryantxu May 17, 2019
d06a4b0
Merge branch 'v6-branding' into natel-V6
ryantxu May 17, 2019
cb5c42a
Merge branch 'master' into natel-V6
ryantxu May 17, 2019
30355e3
Merge branch 'master' into natel-oauth-redirect
ryantxu May 17, 2019
3e42c2a
Merge branch 'master' into natel-dynamic-height
ryantxu May 17, 2019
3c00ded
Merge branch 'master' into v6-branding
ryantxu May 17, 2019
1fb4f1c
fix extra quote
ryantxu May 17, 2019
caf6a51
Merge branch 'natel-oauth-redirect' into natel-V6
ryantxu May 17, 2019
817055d
Merge branch 'natel-dynamic-height' into natel-V6
ryantxu May 17, 2019
9706d28
Merge branch 'v6-branding' into natel-V6
ryantxu May 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ aliases:
ignore: master
- &filter-only-master
branches:
only: master
only: masterXXX # never match... for Natel

version: 2

Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
command: '/tmp/bootstrap.sh'
- run:
name: package grafana
command: './scripts/build/build.sh --fast --package-only'
command: './scripts/build/build-all.sh'
- run:
name: sha-sum packages
command: 'go run build.go sha-dist'
Expand Down
4 changes: 2 additions & 2 deletions emails/templates/layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<table class="twelve columns">
<tr>
<td class="twelve sub-columns center">
<img class="logo" src="http://grafana.org/assets/img/logo_new_transparent_200x48.png" style="width: 200px; float: none; display: inline">
<img class="logo" src="1hskmz3i2o5bhic6pojfb512.wpengine.netdna-cdn.com/wp-content/uploads/2016/10/Natel_Energy_logo_blue.png" style="width: 200px; float: none; display: inline">
</td>
<td class="expander"></td>
</tr>
Expand Down Expand Up @@ -143,7 +143,7 @@
<center>
<p style="text-align: center; font-size: 12px; color: #999999;">
Sent by <a href="[[.AppUrl]]">Grafana v[[.BuildVersion]]</a>
<br />&copy; 2018 Grafana Labs
<br />&copy; 2019 Natel Energy
</p>
</center>
</td>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"calculate-size": "1.1.1",
"classnames": "2.2.6",
"clipboard": "2.0.4",
"css-element-queries": "^1.1.1",
"d3": "4.13.0",
"d3-scale-chromatic": "1.3.3",
"eventemitter3": "2.0.3",
Expand Down
12 changes: 12 additions & 0 deletions pkg/api/login_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ func (hs *HTTPServer) OAuthLogin(ctx *m.ReqContext) {

cookieState := ctx.GetCookie(OauthStateCookieName)

// https://github.com/grafana/grafana/pull/7046
if cookieState == "" {
if ctx.Query("redirected") == "yes" {
//ctx.Handle(500, "login.OAuthLogin(missing saved state) after redirect", nil)
ctx.Redirect(setting.AppUrl)
return
}
loc := setting.AppUrl + "login/" + name + "?" + ctx.Req.URL.RawQuery + "&redirected=yes"
ctx.Redirect(loc)
return
}

// delete cookie
ctx.Resp.Header().Del("Set-Cookie")
hs.deleteCookie(ctx.Resp, OauthStateCookieName)
Expand Down
7 changes: 6 additions & 1 deletion pkg/login/social/social.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func NewOAuthService() {
TlsClientCa: sec.Key("tls_client_ca").String(),
TlsSkipVerify: sec.Key("tls_skip_verify_insecure").MustBool(),
SendClientCredentialsViaPost: sec.Key("send_client_credentials_via_post").MustBool(),
RedirectUrl: sec.Key("redirect_url").String(),
}

if !info.Enabled {
Expand All @@ -105,7 +106,7 @@ func NewOAuthService() {
AuthURL: info.AuthUrl,
TokenURL: info.TokenUrl,
},
RedirectURL: strings.TrimSuffix(setting.AppUrl, "/") + SocialBaseUrl + name,
RedirectURL: info.RedirectUrl,
Scopes: info.Scopes,
}

Expand Down Expand Up @@ -192,6 +193,10 @@ func NewOAuthService() {
allowedOrganizations: util.SplitString(sec.Key("allowed_organizations").String()),
}
}

if len(config.RedirectURL) == 0 {
config.RedirectURL = strings.TrimSuffix(setting.AppUrl, "/") + SocialBaseUrl + name
}
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/setting/setting_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type OAuthInfo struct {
ClientId, ClientSecret string
Scopes []string
AuthUrl, TokenUrl string
RedirectUrl string
Enabled bool
EmailAttributeName string
AllowedDomains []string
Expand Down
31 changes: 4 additions & 27 deletions public/app/core/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FC } from 'react';
import { Tooltip } from '@grafana/ui';

interface Props {
appName: string;
Expand All @@ -16,37 +15,15 @@ export const Footer: FC<Props> = React.memo(
<div className="text-center">
<ul>
<li>
<a href="http://docs.grafana.org" target="_blank">
<i className="fa fa-file-code-o" /> Docs
<a href="https://upstream.tech/" target="_blank">
Upstream Tech
</a>
</li>
<li>
<a href="https://grafana.com/services/support" target="_blank">
<i className="fa fa-support" /> Support Plans
<a href="https://grafana.com" target="_blank" title={`(commit: ${buildCommit})`}>
v{buildVersion}
</a>
</li>
<li>
<a href="https://community.grafana.com/" target="_blank">
<i className="fa fa-comments-o" /> Community
</a>
</li>
<li>
<a href="https://grafana.com" target="_blank">
{appName}
</a>{' '}
<span>
v{buildVersion} (commit: {buildCommit})
</span>
</li>
{newGrafanaVersionExists && (
<li>
<Tooltip placement="auto" content={newGrafanaVersion}>
<a href="https://grafana.com/get" target="_blank">
New version available!
</a>
</Tooltip>
</li>
)}
</ul>
</div>
</footer>
Expand Down
10 changes: 6 additions & 4 deletions public/app/core/components/OrgActionBar/OrgActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Props {
export default class OrgActionBar extends PureComponent<Props> {
render() {
const { searchQuery, layoutMode, onSetLayoutMode, linkButton, setSearchQuery, target } = this.props;
const linkProps = { href: linkButton.href };
const linkProps = { href: linkButton ? linkButton.href : '#' };

if (target) {
(linkProps as any).target = target;
Expand All @@ -33,9 +33,11 @@ export default class OrgActionBar extends PureComponent<Props> {
<LayoutSelector mode={layoutMode} onLayoutModeChanged={(mode: LayoutMode) => onSetLayoutMode(mode)} />
</div>
<div className="page-action-bar__spacer" />
<a className="btn btn-primary" {...linkProps}>
{linkButton.title}
</a>
{linkButton && (
<a className="btn btn-primary" {...linkProps}>
{linkButton.title}
</a>
)}
</div>
);
}
Expand Down
26 changes: 2 additions & 24 deletions public/app/features/admin/__snapshots__/ServerStats.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -159,35 +159,13 @@ exports[`ServerStats Should render table with stats 1`] = `
<ul>
<li>
<a
href="http://docs.grafana.org"
href="https://upstream.tech/"
target="_blank"
>
<i
className="fa fa-file-code-o"
/>
Docs
</a>
</li>
<li>
<a
href="https://grafana.com/services/support"
target="_blank"
>
<i
className="fa fa-support"
/>
Support Plans
</a>
</li>
<li>
<a
href="https://community.grafana.com/"
target="_blank"
>
<i
className="fa fa-comments-o"
/>
Community
Upstream Tech
</a>
</li>
<li>
Expand Down
10 changes: 10 additions & 0 deletions public/app/features/dashboard/services/ChangeTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class ChangeTracker {
// ignore iteration property
delete dash.iteration;

let hasDynamicHeight = false;
dash.panels = _.filter(dash.panels, panel => {
if (panel.repeatPanelId) {
return false;
Expand All @@ -124,6 +125,15 @@ export class ChangeTracker {
delete panel.legend.sortDesc;
}

// ignore all y parameters after a dynamic height
if (panel.dynamicHeight) {
hasDynamicHeight = true;
delete panel.gridPos.h;
}
if (hasDynamicHeight) {
delete panel.gridPos.y;
}

return true;
});

Expand Down
21 changes: 20 additions & 1 deletion public/app/features/panel/panel_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
calculateInnerPanelHeight,
} from 'app/features/dashboard/utils/panel';

import { GRID_COLUMN_COUNT } from 'app/core/constants';
import { GRID_COLUMN_COUNT, GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from 'app/core/constants';

export class PanelCtrl {
panel: any;
Expand Down Expand Up @@ -63,6 +63,25 @@ export class PanelCtrl {
profiler.renderingCompleted();
}

dynamicHeightChanged(height: number): boolean {
const min = this.panel.dynamicHeightMIN || 50;
if (height < min) {
height = min;
}
if (this.panel.dynamicHeightMAX && height > this.panel.dynamicHeightMAX) {
height = this.panel.dynamicHeightMAX;
}
const h = Math.ceil((height + 5) / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN)) + 1;
if (h !== this.panel.gridPos.h) {
//console.log('Dynamic Height Changed', height, 'new:', h, 'old', this.panel.gridPos.h);
this.panel.gridPos.h = h;
this.events.emit('panel-size-changed');
this.dashboard.events.emit('row-expanded'); // triggers grid re-layout
return true;
}
return false;
}

refresh() {
this.panel.refresh();
}
Expand Down
29 changes: 28 additions & 1 deletion public/app/features/panel/panel_directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import angular from 'angular';
import $ from 'jquery';
import Drop from 'tether-drop';
import baron from 'baron';
import ResizeSensor from 'css-element-queries/src/ResizeSensor.js';

const module = angular.module('grafana.directives');

Expand Down Expand Up @@ -40,6 +41,8 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
const ctrl = scope.ctrl;
let infoDrop;
let panelScrollbar;
let panelInnerContent;
let panelInnerContentHeight = -1;

// the reason for handling these classes this way is for performance
// limit the watchers on panels etc
Expand All @@ -58,6 +61,16 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
ctrl.dashboard.setPanelFocus(0);
}

function checkInnerContentHeight() {
if (ctrl.panel.dynamicHeight && panelInnerContent) {
const v = panelInnerContent.outerHeight(true);
if (v !== panelInnerContentHeight) {
panelInnerContentHeight = v;
ctrl.dynamicHeightChanged(panelInnerContentHeight);
}
}
}

function resizeScrollableContent() {
if (panelScrollbar) {
panelScrollbar.update();
Expand All @@ -82,7 +95,21 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
`;

const scrollRoot = panelContent;
const scroller = panelContent.find(':first').find(':first');
let scroller = panelContent.find(':first').find(':first');

// Add a div under the scroller and watch for changes
if (ctrl.panel.dynamicHeight) {
$(scroller).wrap('<div class="panel-height-helper"></div>');
scroller = panelContent.find(':first');

panelInnerContent = $(scroller).find(':first');
panelInnerContent.removeClass('panel-height-helper');
panelInnerContent.css('margin-right', '20px');
// panelInnerContent.css('border', '2px solid #F0F');

// tslint:disable-next-line
new ResizeSensor(panelInnerContent, checkInnerContentHeight);
}

scrollRoot.addClass(scrollRootClass);
$(scrollBarHTML).appendTo(scrollRoot);
Expand Down
18 changes: 18 additions & 0 deletions public/app/features/panel/partials/general_tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,21 @@
<panel-links-editor panel="ctrl.panel"></panel-links-editor>
</div>
</div>


<div class="panel-option-section">
<div class="panel-option-section__header">Height</div>
<div class="panel-option-section__body">
<gf-form-switch class="gf-form" label-class="width-7" switch-class="max-width-6" label="Dynamic" checked="ctrl.panel.dynamicHeight" on-change="ctrl.render()"></gf-form-switch>
<div class="gf-form" ng-if="ctrl.panel.dynamicHeight">
<span class="gf-form-label width-7">Minimum</span>
<input type="number" class="gf-form-input width-6" placeholder="10px" ng-model="ctrl.panel.dynamicHeightMIN"></input>
</div>
<div class="gf-form" ng-if="ctrl.panel.dynamicHeight">
<span class="gf-form-label width-7">Maximum</span>
<input type="number" class="gf-form-input width-6" placeholder="none" ng-model="ctrl.panel.dynamicHeightMAX"></input>
</div>
</div>
</div>


7 changes: 1 addition & 6 deletions public/app/features/plugins/PluginListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ export class PluginListPage extends PureComponent<Props> {
searchQuery,
} = this.props;

const linkButton = {
href: 'https://grafana.com/plugins?utm_source=grafana_plugin_list',
title: 'Find more plugins on Grafana.com',
};

return (
<Page navModel={navModel}>
<Page.Contents isLoading={!hasFetched}>
Expand All @@ -55,7 +50,7 @@ export class PluginListPage extends PureComponent<Props> {
layoutMode={layoutMode}
onSetLayoutMode={mode => setPluginsLayoutMode(mode)}
setSearchQuery={query => setPluginsSearchQuery(query)}
linkButton={linkButton}
linkButton={null}
/>
{hasFetched && plugins && (plugins && <PluginList plugins={plugins} layoutMode={layoutMode} />)}
</>
Expand Down
Loading