mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge remote-tracking branch 'grafana/master' into alpha-react-virtualized-table
* grafana/master: Update README.md Update core:start cli command to watch theme changes again (#15856) Updated pull request template Updated pull request rtemplate Removed title case from issue template title Updated issue template titles Updated issue templates Updated templates fix: Update error message and replace npm with yarn #15851 fix: Make sure we dont add &autofitpanels to the url if it already exists #15849 Update upgrading.md for wrong spell return the same panelData unless it changes Map dataSourceTypeSearchQuery state from redux to search input. Revert "Fix for leaving playlist mode" add new issue templates
This commit is contained in:
commit
2db4004d62
16
.github/ISSUE_TEMPLATE.md
vendored
16
.github/ISSUE_TEMPLATE.md
vendored
@ -1,16 +0,0 @@
|
||||
Read before posting:
|
||||
|
||||
- Questions should be posted to https://community.grafana.com. Please search there and here on GitHub for similar issues before creating a new issue.
|
||||
- Checkout FAQ: https://community.grafana.com/c/howto/faq
|
||||
- Checkout How to troubleshoot metric query issues: https://community.grafana.com/t/how-to-troubleshoot-metric-query-issues/50
|
||||
|
||||
Please include this information:
|
||||
### What Grafana version are you using?
|
||||
### What datasource are you using?
|
||||
### What OS are you running grafana on?
|
||||
### What did you do?
|
||||
### What was the expected result?
|
||||
### What happened instead?
|
||||
### If related to metric query / data viz:
|
||||
### Include raw network request & response: get by opening Chrome Dev Tools (F12, Ctrl+Shift+I on windows, Cmd+Opt+I on Mac), go the network tab.
|
||||
|
27
.github/ISSUE_TEMPLATE/1-bug_report.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/1-bug_report.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a bug you found when using Grafana
|
||||
labels: 'type: bug'
|
||||
---
|
||||
|
||||
<!--
|
||||
Please use this template while reporting a bug and provide as much info as possible.
|
||||
Questions should be posted to https://community.grafana.com
|
||||
Use query inspector to troubleshoot issues: https://community.grafana.com/t/using-grafanas-query-inspector-to-troubleshoot-issues/2630
|
||||
-->
|
||||
|
||||
**What happened**:
|
||||
|
||||
**What you expected to happen**:
|
||||
|
||||
**How to reproduce it (as minimally and precisely as possible)**:
|
||||
|
||||
**Anything else we need to know?**:
|
||||
|
||||
**Environment**:
|
||||
- Grafana version:
|
||||
- Data source type & version:
|
||||
- OS Grafana is installed on:
|
||||
- User OS & Browser:
|
||||
- Grafana plugins:
|
||||
- Others:
|
11
.github/ISSUE_TEMPLATE/2-feature_request.md
vendored
Normal file
11
.github/ISSUE_TEMPLATE/2-feature_request.md
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
name: Enhancement request
|
||||
about: Suggest an enhancement or new feature for the Grafana project
|
||||
labels: 'type: feature request'
|
||||
---
|
||||
|
||||
<!-- Please only use this template for submitting feature requests -->
|
||||
|
||||
**What would you like to be added**:
|
||||
|
||||
**Why is this needed**:
|
26
.github/ISSUE_TEMPLATE/3-accessibility.md
vendored
Normal file
26
.github/ISSUE_TEMPLATE/3-accessibility.md
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
name: Accessibility issue
|
||||
about: Help make Grafana be better at keyboard navigation, screen-readable and accessible to all.
|
||||
labels: 'type: accessibility'
|
||||
---
|
||||
|
||||
<!--
|
||||
Please only use this template for submitting accessibility issues.
|
||||
|
||||
This is a new feature area for Grafana that we want to improve. We have long way to go
|
||||
to really improve accessibility and would like your help to know where to start.
|
||||
-->
|
||||
|
||||
**Steps to reproduce**:
|
||||
|
||||
**Actual Result**:
|
||||
|
||||
**Expected Result**
|
||||
|
||||
**Relevant WCAG Criteria:** [#.#.# WCAG Criterion](link to https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0)
|
||||
|
||||
**Environment**:
|
||||
- Grafana version:
|
||||
- Data source type & version:
|
||||
- User OS & Browser:
|
||||
- Others:
|
14
.github/ISSUE_TEMPLATE/4-question.md
vendored
Normal file
14
.github/ISSUE_TEMPLATE/4-question.md
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
name: Support request
|
||||
about: 'Question or support request relating to using Grafana'
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
STOP -- PLEASE READ!
|
||||
|
||||
GitHub is not the right place for questions and support requests.
|
||||
|
||||
Please ask questions on our community site: [https://community.grafana.com/](https://community.grafana.com/)
|
||||
|
30
.github/PULL_REQUEST_TEMPLATE.md
vendored
30
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,5 +1,27 @@
|
||||
* Follow the contribution guidelines in [`CONTRIBUTING.md`](https://github.com/grafana/grafana/blob/master/CONTRIBUTING.md)
|
||||
* Rebase your PR if it gets out of sync with master
|
||||
* Include `closes #<issue>` or a link to the issue in the description
|
||||
<!-- Thanks for sending a pull request! Here are some tips for you:
|
||||
|
||||
**REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST**
|
||||
1. If this is your first time, please read our [`CONTRIBUTING.md`](https://github.com/grafana/grafana/blob/master/CONTRIBUTING.md) guide.
|
||||
2. Ensure you have added or ran the appropriate tests for your PR.
|
||||
3. If it's a new feature or config option it will need a docs update. Docs are under the docs folder in repo root.
|
||||
4. If the PR is unfinished, mark it as a draft PR.
|
||||
5. Rebase your PR if it gets out of sync with master
|
||||
-->
|
||||
|
||||
**What this PR does / why we need it**:
|
||||
|
||||
**Which issue(s) this PR fixes**:
|
||||
<!--
|
||||
*Automatically closes linked issue when PR is merged.
|
||||
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
|
||||
-->
|
||||
Fixes #
|
||||
|
||||
**Special notes for your reviewer**:
|
||||
|
||||
**Release note**:
|
||||
<!--
|
||||
If this is a user facing change and should be mentioned in relase note add it below. If no, just write "NONE" below.
|
||||
-->
|
||||
```release-note
|
||||
|
||||
```
|
||||
|
@ -7,12 +7,6 @@
|
||||
Grafana is an open source, feature rich metrics dashboard and graph editor for
|
||||
Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
|
||||
|
||||

|
||||
|
||||
Join us Feb 25-26 in Los Angeles, California for GrafanaCon - a two-day event with talks focused on Grafana and the surrounding open source monitoring ecosystem. Get deep dives into Loki, the Explore workflow and all of the new features of Grafana 6, plus participate in hands on workshops to help you get the most out of your data.
|
||||
|
||||
Time is running out - grab your ticket now! http://grafanacon.org
|
||||
|
||||
<!---
|
||||

|
||||
-->
|
||||
|
@ -120,7 +120,7 @@ If you're using systemd and have a large amount of annotations consider temporar
|
||||
|
||||
## Upgrading to v6.0
|
||||
|
||||
If you have text panels with script tags they will no longer work due to a new setting that per default disallow unsanitzied HTML.
|
||||
If you have text panels with script tags they will no longer work due to a new setting that per default disallow unsanitized HTML.
|
||||
Read more [here](/installation/configuration/#disable-sanitize-html) about this new setting.
|
||||
|
||||
### Authentication and security
|
||||
@ -147,4 +147,4 @@ login_maximum_inactive_lifetime_days = 1
|
||||
login_maximum_lifetime_days = 1
|
||||
```
|
||||
|
||||
The default cookie name for storing the auth token is `grafana_session`. you can configure this with `login_cookie_name` in `[auth]` settings.
|
||||
The default cookie name for storing the auth token is `grafana_session`. you can configure this with `login_cookie_name` in `[auth]` settings.
|
||||
|
@ -4,6 +4,7 @@ import _ from 'lodash';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { getExploreUrl } from 'app/core/utils/explore';
|
||||
import { store } from 'app/store/store';
|
||||
|
||||
import Mousetrap from 'mousetrap';
|
||||
import 'mousetrap-global-bind';
|
||||
@ -294,7 +295,9 @@ export class KeybindingSrv {
|
||||
//Autofit panels
|
||||
this.bind('d a', () => {
|
||||
// this has to be a full page reload
|
||||
window.location.href = window.location.href + '&autofitpanels';
|
||||
const queryParams = store.getState().location.query;
|
||||
const newUrlParam = queryParams.autofitpanels ? '' : '&autofitpanels';
|
||||
window.location.href = window.location.href + newUrlParam;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ import { appEvents } from 'app/core/app_events';
|
||||
import { PlaylistSrv } from 'app/features/playlist/playlist_srv';
|
||||
|
||||
// Components
|
||||
import { ClickOutsideWrapper } from 'app/core/components/ClickOutsideWrapper/ClickOutsideWrapper';
|
||||
import { DashNavButton } from './DashNavButton';
|
||||
import { Tooltip } from '@grafana/ui';
|
||||
|
||||
@ -174,28 +173,26 @@ export class DashNav extends PureComponent<Props> {
|
||||
{this.renderDashboardTitleSearchButton()}
|
||||
|
||||
{this.playlistSrv.isPlaying && (
|
||||
<ClickOutsideWrapper onClick={this.onPlaylistStop}>
|
||||
<div className="navbar-buttons navbar-buttons--playlist">
|
||||
<DashNavButton
|
||||
tooltip="Go to previous dashboard"
|
||||
classSuffix="tight"
|
||||
icon="fa fa-step-backward"
|
||||
onClick={this.onPlaylistPrev}
|
||||
/>
|
||||
<DashNavButton
|
||||
tooltip="Stop playlist"
|
||||
classSuffix="tight"
|
||||
icon="fa fa-stop"
|
||||
onClick={this.onPlaylistStop}
|
||||
/>
|
||||
<DashNavButton
|
||||
tooltip="Go to next dashboard"
|
||||
classSuffix="tight"
|
||||
icon="fa fa-forward"
|
||||
onClick={this.onPlaylistNext}
|
||||
/>
|
||||
</div>
|
||||
</ClickOutsideWrapper>
|
||||
<div className="navbar-buttons navbar-buttons--playlist">
|
||||
<DashNavButton
|
||||
tooltip="Go to previous dashboard"
|
||||
classSuffix="tight"
|
||||
icon="fa fa-step-backward"
|
||||
onClick={this.onPlaylistPrev}
|
||||
/>
|
||||
<DashNavButton
|
||||
tooltip="Stop playlist"
|
||||
classSuffix="tight"
|
||||
icon="fa fa-stop"
|
||||
onClick={this.onPlaylistStop}
|
||||
/>
|
||||
<DashNavButton
|
||||
tooltip="Go to next dashboard"
|
||||
classSuffix="tight"
|
||||
icon="fa fa-forward"
|
||||
onClick={this.onPlaylistNext}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="navbar-buttons navbar-buttons--actions">
|
||||
|
@ -44,6 +44,7 @@ export interface State {
|
||||
isFirstLoad: boolean;
|
||||
loading: LoadingState;
|
||||
response: DataQueryResponse;
|
||||
panelData: PanelData;
|
||||
}
|
||||
|
||||
export class DataPanel extends Component<Props, State> {
|
||||
@ -63,6 +64,7 @@ export class DataPanel extends Component<Props, State> {
|
||||
response: {
|
||||
data: [],
|
||||
},
|
||||
panelData: {},
|
||||
isFirstLoad: true,
|
||||
};
|
||||
}
|
||||
@ -147,6 +149,7 @@ export class DataPanel extends Component<Props, State> {
|
||||
this.setState({
|
||||
loading: LoadingState.Done,
|
||||
response: resp,
|
||||
panelData: this.getPanelData(resp),
|
||||
isFirstLoad: false,
|
||||
});
|
||||
} catch (err) {
|
||||
@ -169,9 +172,7 @@ export class DataPanel extends Component<Props, State> {
|
||||
}
|
||||
};
|
||||
|
||||
getPanelData = () => {
|
||||
const { response } = this.state;
|
||||
|
||||
getPanelData(response: DataQueryResponse) {
|
||||
if (response.data.length > 0 && (response.data[0] as TableData).type === 'table') {
|
||||
return {
|
||||
tableData: response.data[0] as TableData,
|
||||
@ -183,12 +184,11 @@ export class DataPanel extends Component<Props, State> {
|
||||
timeSeries: response.data as TimeSeries[],
|
||||
tableData: null,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { queries } = this.props;
|
||||
const { loading, isFirstLoad } = this.state;
|
||||
const panelData = this.getPanelData();
|
||||
const { loading, isFirstLoad, panelData } = this.state;
|
||||
|
||||
// do not render component until we have first data
|
||||
if (isFirstLoad && (loading === LoadingState.Loading || loading === LoadingState.NotStarted)) {
|
||||
|
@ -70,6 +70,7 @@ function mapStateToProps(state: StoreState) {
|
||||
return {
|
||||
navModel: getNavModel(state.navIndex, 'datasources'),
|
||||
dataSourceTypes: getDataSourceTypes(state.dataSources),
|
||||
dataSourceTypeSearchQuery: state.dataSources.dataSourceTypeSearchQuery,
|
||||
isLoading: state.dataSources.isLoadingDataSources,
|
||||
};
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Libraries
|
||||
import React, { PureComponent } from 'react';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
// Services & Utils
|
||||
import { processTimeSeries, ThemeContext } from '@grafana/ui';
|
||||
@ -12,16 +12,28 @@ import { GaugeOptions } from './types';
|
||||
import { PanelProps, NullValueMode, TimeSeriesValue } from '@grafana/ui/src/types';
|
||||
|
||||
interface Props extends PanelProps<GaugeOptions> {}
|
||||
interface State {
|
||||
value: TimeSeriesValue;
|
||||
}
|
||||
|
||||
export class GaugePanel extends PureComponent<Props> {
|
||||
render() {
|
||||
const { panelData, width, height, replaceVariables, options } = this.props;
|
||||
export class GaugePanel extends Component<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: this.findValue(props),
|
||||
};
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: Props) {
|
||||
if (this.props.panelData !== prevProps.panelData) {
|
||||
this.setState({ value: this.findValue(this.props) });
|
||||
}
|
||||
}
|
||||
|
||||
findValue(props: Props): number | null {
|
||||
const { panelData, options } = props;
|
||||
const { valueOptions } = options;
|
||||
|
||||
const prefix = replaceVariables(valueOptions.prefix);
|
||||
const suffix = replaceVariables(valueOptions.suffix);
|
||||
let value: TimeSeriesValue;
|
||||
|
||||
if (panelData.timeSeries) {
|
||||
const vmSeries = processTimeSeries({
|
||||
timeSeries: panelData.timeSeries,
|
||||
@ -29,14 +41,21 @@ export class GaugePanel extends PureComponent<Props> {
|
||||
});
|
||||
|
||||
if (vmSeries[0]) {
|
||||
value = vmSeries[0].stats[valueOptions.stat];
|
||||
} else {
|
||||
value = null;
|
||||
return vmSeries[0].stats[valueOptions.stat];
|
||||
}
|
||||
} else if (panelData.tableData) {
|
||||
value = panelData.tableData.rows[0].find(prop => prop > 0);
|
||||
return panelData.tableData.rows[0].find(prop => prop > 0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { width, height, replaceVariables, options } = this.props;
|
||||
const { valueOptions } = options;
|
||||
const { value } = this.state;
|
||||
|
||||
const prefix = replaceVariables(valueOptions.prefix);
|
||||
const suffix = replaceVariables(valueOptions.suffix);
|
||||
return (
|
||||
<ThemeContext.Consumer>
|
||||
{theme => (
|
||||
|
@ -179,8 +179,7 @@
|
||||
<p>
|
||||
1. This could be caused by your reverse proxy settings.<br /><br />
|
||||
2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath<br /> <br />
|
||||
3. If you have a local dev build make sure you build frontend using: npm run dev, npm run watch, or npm run
|
||||
build<br /> <br />
|
||||
3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build<br /> <br />
|
||||
4. Sometimes restarting grafana-server can help<br />
|
||||
</p>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@ program
|
||||
.description('Starts Grafana front-end in development mode with watch enabled')
|
||||
.action(async cmd => {
|
||||
await execTask(startTask)({
|
||||
watchThemes: cmd.theme,
|
||||
watchThemes: cmd.watchTheme,
|
||||
hot: cmd.hot,
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user