Commit 2dc44f60 by Torkel Ödegaard

Merge branch 'master' into develop

parents a5947e82 f4bc0231
......@@ -78,8 +78,8 @@ disable_login_form = true
### Automatic OAuth login
Set to true to attempt login with OAuth automatically, skipping the login screen.
This setting is ignored if multiple OAuth providers are configured.
Set to true to attempt login with OAuth automatically, skipping the login screen.
This setting is ignored if multiple OAuth providers are configured.
Defaults to `false`.
```bash
......@@ -95,3 +95,12 @@ Set to the option detailed below to true to hide sign-out menu link. Useful if y
[auth]
disable_signout_menu = true
```
### URL redirect after signing out
URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from oauth provider.
```bash
[auth]
signout_redirect_url =
```
......@@ -584,8 +584,8 @@ kbn.valueFormats.flowcms = kbn.formatBuilders.fixedUnit('cms');
kbn.valueFormats.flowcfs = kbn.formatBuilders.fixedUnit('cfs');
kbn.valueFormats.flowcfm = kbn.formatBuilders.fixedUnit('cfm');
kbn.valueFormats.litreh = kbn.formatBuilders.fixedUnit('l/h');
kbn.valueFormats.flowlpm = kbn.formatBuilders.decimalSIPrefix('L');
kbn.valueFormats.flowmlpm = kbn.formatBuilders.decimalSIPrefix('L', -1);
kbn.valueFormats.flowlpm = kbn.formatBuilders.decimalSIPrefix('l/min');
kbn.valueFormats.flowmlpm = kbn.formatBuilders.decimalSIPrefix('mL/min', -1);
// Angle
kbn.valueFormats.degree = kbn.formatBuilders.fixedUnit('°');
......
......@@ -42,7 +42,7 @@ class TypeaheadItem extends React.PureComponent<TypeaheadItemProps> {
render() {
const { isSelected, item, prefix } = this.props;
const className = isSelected ? 'typeahead-item typeahead-item__selected' : 'typeahead-item';
const { label } = item;
const label = item.label || '';
return (
<li ref={this.getRef} className={className} onClick={this.onClick}>
<Highlighter textToHighlight={label} searchWords={[prefix]} highlightClassName="typeahead-match" />
......
......@@ -95,5 +95,14 @@ describe('Query imports', () => {
const result = await instance.importPrometheusQuery('metric{foo="bar",baz="42"}');
expect(result).toEqual('{foo="bar"}');
});
it('returns selector query from selector query with all labels if logging label list is empty', async () => {
const datasourceWithLabels = {
metadataRequest: url => (url === '/api/prom/label' ? { data: { data: [] } } : { data: { data: [] } }),
};
const instance = new LanguageProvider(datasourceWithLabels);
const result = await instance.importPrometheusQuery('metric{foo="bar",baz="42"}');
expect(result).toEqual('{baz="42",foo="bar"}');
});
});
});
......@@ -97,9 +97,10 @@ export default class LoggingLanguageProvider extends LanguageProvider {
if (history && history.length > 0) {
const historyItems = _.chain(history)
.uniqBy('query.expr')
.take(HISTORY_ITEM_COUNT)
.map(h => h.query.expr)
.filter()
.uniq()
.take(HISTORY_ITEM_COUNT)
.map(wrapLabel)
.map(item => addHistoryMetadata(item, history))
.value();
......@@ -194,17 +195,24 @@ export default class LoggingLanguageProvider extends LanguageProvider {
// Keep only labels that exist on origin and target datasource
await this.start(); // fetches all existing label keys
const commonLabels = {};
for (const key in labels) {
const existingKeys = this.labelKeys[EMPTY_SELECTOR];
if (existingKeys && existingKeys.indexOf(key) > -1) {
// Should we check for label value equality here?
commonLabels[key] = labels[key];
const existingKeys = this.labelKeys[EMPTY_SELECTOR];
let labelsToKeep = {};
if (existingKeys && existingKeys.length > 0) {
// Check for common labels
for (const key in labels) {
if (existingKeys && existingKeys.indexOf(key) > -1) {
// Should we check for label value equality here?
labelsToKeep[key] = labels[key];
}
}
} else {
// Keep all labels by default
labelsToKeep = labels;
}
const labelKeys = Object.keys(commonLabels).sort();
const labelKeys = Object.keys(labelsToKeep).sort();
const cleanSelector = labelKeys
.map(key => `${key}${commonLabels[key].operator}${commonLabels[key].value}`)
.map(key => `${key}${labelsToKeep[key].operator}${labelsToKeep[key].value}`)
.join(',');
return ['{', cleanSelector, '}'].join('');
......
......@@ -125,9 +125,10 @@ export default class PromQlLanguageProvider extends LanguageProvider {
if (history && history.length > 0) {
const historyItems = _.chain(history)
.uniqBy('query.expr')
.take(HISTORY_ITEM_COUNT)
.map(h => h.query.expr)
.filter()
.uniq()
.take(HISTORY_ITEM_COUNT)
.map(wrapLabel)
.map(item => addHistoryMetadata(item, history))
.value();
......
......@@ -4,7 +4,7 @@
.footer {
color: $footer-link-color;
padding: 5rem 0 1rem 0;
padding: 1rem 0 1rem 0;
font-size: $font-size-sm;
position: relative;
width: 98%; /* was causing horiz scrollbars - need to examine */
......@@ -38,6 +38,7 @@
}
}
// Keeping footer inside the graphic on Login screen
.login-page {
.footer {
bottom: $spacer;
......
......@@ -82,7 +82,7 @@ $input-border: 1px solid $input-border-color;
align-content: flex-start;
.gf-form + .gf-form {
margin-right: $gf-form-margin;
margin-left: $gf-form-margin;
}
}
......@@ -163,7 +163,6 @@ $input-border: 1px solid $input-border-color;
width: 100%;
height: $gf-form-input-height;
padding: $input-padding-y $input-padding-x;
margin-right: $gf-form-margin;
font-size: $font-size-md;
line-height: $input-line-height;
color: $input-color;
......
......@@ -35,7 +35,7 @@
}
.gf-form + .gf-form {
margin-right: 0;
margin-left: 0;
}
}
......
......@@ -40,6 +40,29 @@
&--dashboard {
height: calc(100% - 56px);
}
// Sticky footer
display: flex;
flex-direction: column;
> div {
flex-grow: 1;
}
> .footer {
flex-shrink: 0;
}
// Render in correct position even ng-view div is not rendered yet
> .footer:first-child {
flex-grow: 1;
display: flex;
> * {
width: 100%;
align-self: flex-end;
}
}
}
// fix for phantomjs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment