diff --git a/docs/sources/auth/overview.md b/docs/sources/auth/overview.md index d4360d554c1..0480ee88adc 100644 --- a/docs/sources/auth/overview.md +++ b/docs/sources/auth/overview.md @@ -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 = +``` diff --git a/public/app/core/utils/kbn.ts b/public/app/core/utils/kbn.ts index 398ad9bb3e7..5d417d24169 100644 --- a/public/app/core/utils/kbn.ts +++ b/public/app/core/utils/kbn.ts @@ -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('°'); diff --git a/public/app/features/dashboard/dashgrid/AlertTab.tsx b/public/app/features/dashboard/dashgrid/AlertTab.tsx index bf691782e92..7df7864c758 100644 --- a/public/app/features/dashboard/dashgrid/AlertTab.tsx +++ b/public/app/features/dashboard/dashgrid/AlertTab.tsx @@ -64,7 +64,7 @@ export class AlertTab extends PureComponent { render() { return ( - +
(this.element = element)} /> ); diff --git a/public/app/features/dashboard/dashgrid/EditorTabBody.tsx b/public/app/features/dashboard/dashgrid/EditorTabBody.tsx index 0192de77e9f..8f213533a1e 100644 --- a/public/app/features/dashboard/dashgrid/EditorTabBody.tsx +++ b/public/app/features/dashboard/dashgrid/EditorTabBody.tsx @@ -4,6 +4,7 @@ import { FadeIn } from 'app/core/components/Animations/FadeIn'; interface Props { children: JSX.Element; + heading: string; main?: EditorToolBarView; toolbarItems: EditorToolBarView[]; } @@ -19,6 +20,7 @@ export interface EditorToolBarView { interface State { openView?: EditorToolBarView; + fadeIn: boolean; } export class EditorTabBody extends PureComponent { @@ -27,9 +29,14 @@ export class EditorTabBody extends PureComponent { this.state = { openView: null, + fadeIn: false, }; } + componentDidMount() { + this.setState({ fadeIn: true }); + } + onToggleToolBarView = (item: EditorToolBarView) => { this.setState({ openView: item === this.state.openView ? null : item, @@ -94,24 +101,26 @@ export class EditorTabBody extends PureComponent { } render() { - const { children, toolbarItems, main } = this.props; - const { openView } = this.state; + const { children, toolbarItems, main, heading } = this.props; + const { openView, fadeIn } = this.state; + return ( <> - {main && ( -
- {this.renderMainSelection(main)} -
- {toolbarItems.map(item => this.renderButton(item))} -
- )} +
+
{heading}
+ {main && this.renderMainSelection(main)} +
+ {toolbarItems.map(item => this.renderButton(item))} +
+ +
{openView && this.renderOpenView(openView)}
+
- - {openView && this.renderOpenView(openView)} + + {children} - {children}
diff --git a/public/app/features/dashboard/dashgrid/GeneralTab.tsx b/public/app/features/dashboard/dashgrid/GeneralTab.tsx index 0b600e08d83..96694e346df 100644 --- a/public/app/features/dashboard/dashgrid/GeneralTab.tsx +++ b/public/app/features/dashboard/dashgrid/GeneralTab.tsx @@ -43,14 +43,8 @@ export class GeneralTab extends PureComponent { } render() { - const currentDataSource = { - title: 'ProductionDB', - imgSrc: 'public/app/plugins/datasource/prometheus/img/prometheus_logo.svg', - render: () =>

hello

, - }; - return ( - +
(this.element = element)} /> ); diff --git a/public/app/features/dashboard/dashgrid/PanelEditor.tsx b/public/app/features/dashboard/dashgrid/PanelEditor.tsx index 019982707a1..56067f67495 100644 --- a/public/app/features/dashboard/dashgrid/PanelEditor.tsx +++ b/public/app/features/dashboard/dashgrid/PanelEditor.tsx @@ -26,7 +26,6 @@ interface PanelEditorProps { interface PanelEditorTab { id: string; text: string; - icon: string; } export class PanelEditor extends PureComponent { @@ -74,35 +73,37 @@ export class PanelEditor extends PureComponent { const activeTab = store.getState().location.query.tab || 'queries'; const tabs = [ - { id: 'general', text: 'General', icon: 'gicon gicon-preferences' }, - { id: 'queries', text: 'Queries', icon: 'fa fa-database' }, - { id: 'visualization', text: 'Visualization', icon: 'fa fa-line-chart' }, + { id: 'queries', text: 'Queries' }, + { id: 'visualization', text: 'Visualization' }, + { id: 'general', text: 'General' }, ]; if (config.alertingEnabled && plugin.id === 'graph') { tabs.push({ id: 'alert', text: 'Alert', - icon: 'gicon gicon-alert', }); } return (
-
-
-
-
+
+
+ { + //
+ //
+ //
+ //
+ //
+ }
-
    - {tabs.map(tab => { - return ; - })} -
+ {tabs.map(tab => { + return ; + })}
- {this.renderCurrentTab(activeTab)} +
{this.renderCurrentTab(activeTab)}
); } @@ -116,15 +117,15 @@ interface TabItemParams { function TabItem({ tab, activeTab, onClick }: TabItemParams) { const tabClasses = classNames({ - 'gf-tabs-link': true, + 'panel-editor-tabs__link': true, active: activeTab === tab.id, }); return ( -
  • onClick(tab)}> +
    onClick(tab)}> - {tab.text} + -
  • +
    ); } diff --git a/public/app/features/dashboard/dashgrid/QueriesTab.tsx b/public/app/features/dashboard/dashgrid/QueriesTab.tsx index 878472094dc..cba631fb141 100644 --- a/public/app/features/dashboard/dashgrid/QueriesTab.tsx +++ b/public/app/features/dashboard/dashgrid/QueriesTab.tsx @@ -238,7 +238,7 @@ export class QueriesTab extends PureComponent { }; return ( - +
    (this.element = element)} style={{ width: '100%' }} /> ); diff --git a/public/app/features/dashboard/dashgrid/VisualizationTab.tsx b/public/app/features/dashboard/dashgrid/VisualizationTab.tsx index d6573fe9eec..bcb1c0bb0a6 100644 --- a/public/app/features/dashboard/dashgrid/VisualizationTab.tsx +++ b/public/app/features/dashboard/dashgrid/VisualizationTab.tsx @@ -126,8 +126,14 @@ export class VisualizationTab extends PureComponent { }, }; + const panelHelp = { + title: '', + icon: 'fa fa-question', + render: () =>

    Help

    , + }; + return ( - + {this.renderPanelOptions()} ); diff --git a/public/app/features/dashboard/dashgrid/VizTypePicker.tsx b/public/app/features/dashboard/dashgrid/VizTypePicker.tsx index 4d886c86d74..2dd1b0284b6 100644 --- a/public/app/features/dashboard/dashgrid/VizTypePicker.tsx +++ b/public/app/features/dashboard/dashgrid/VizTypePicker.tsx @@ -67,10 +67,6 @@ export class VizTypePicker extends PureComponent { /> -
    - - -
    ); } diff --git a/public/app/features/explore/Typeahead.tsx b/public/app/features/explore/Typeahead.tsx index 13882e030f6..721527fbebe 100644 --- a/public/app/features/explore/Typeahead.tsx +++ b/public/app/features/explore/Typeahead.tsx @@ -42,7 +42,7 @@ class TypeaheadItem extends React.PureComponent { 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 (
  • diff --git a/public/app/features/panel/partials/metrics_tab.html b/public/app/features/panel/partials/metrics_tab.html index 7899312f5c3..ecee1f76ea9 100644 --- a/public/app/features/panel/partials/metrics_tab.html +++ b/public/app/features/panel/partials/metrics_tab.html @@ -1,73 +1,3 @@ -
    -
    -
    - - - -
    - -
    - -
    - -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - - A lower limit for the auto group by time interval. Recommended to be set to write frequency, - for example 1m if your data is written every minute. Access auto interval via variable $__interval for time range - string and $__interval_ms for numeric variable that can be used in math expressions. - -
    -
    - - - - If your time series store has a query cache this option can override the default - cache timeout. Specify a numeric value in seconds. - -
    -
    - - - - The maximum data points the query should return. For graphs this - is automatically set to one data point per pixel. - -
    -
    - -
    -
    - - - -
    - - -
    -
    diff --git a/public/app/plugins/datasource/logging/language_provider.test.ts b/public/app/plugins/datasource/logging/language_provider.test.ts index 79f696843bb..f4fc7efa7cb 100644 --- a/public/app/plugins/datasource/logging/language_provider.test.ts +++ b/public/app/plugins/datasource/logging/language_provider.test.ts @@ -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"}'); + }); }); }); diff --git a/public/app/plugins/datasource/logging/language_provider.ts b/public/app/plugins/datasource/logging/language_provider.ts index eb47b3b1e27..21d2846ac63 100644 --- a/public/app/plugins/datasource/logging/language_provider.ts +++ b/public/app/plugins/datasource/logging/language_provider.ts @@ -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(''); diff --git a/public/app/plugins/datasource/prometheus/language_provider.ts b/public/app/plugins/datasource/prometheus/language_provider.ts index 5fd8fcebaaf..d7ccead8725 100644 --- a/public/app/plugins/datasource/prometheus/language_provider.ts +++ b/public/app/plugins/datasource/prometheus/language_provider.ts @@ -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(); diff --git a/public/img/panel-tabs/alert-selected.svg b/public/img/panel-tabs/alert-selected.svg new file mode 100644 index 00000000000..482b3c16e73 --- /dev/null +++ b/public/img/panel-tabs/alert-selected.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/img/panel-tabs/alert.svg b/public/img/panel-tabs/alert.svg new file mode 100644 index 00000000000..482b3c16e73 --- /dev/null +++ b/public/img/panel-tabs/alert.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/img/panel-tabs/general-selected.svg b/public/img/panel-tabs/general-selected.svg new file mode 100644 index 00000000000..d200bbc367b --- /dev/null +++ b/public/img/panel-tabs/general-selected.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/img/panel-tabs/general.svg b/public/img/panel-tabs/general.svg new file mode 100644 index 00000000000..994b8512bc9 --- /dev/null +++ b/public/img/panel-tabs/general.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/img/panel-tabs/queries-selected.svg b/public/img/panel-tabs/queries-selected.svg new file mode 100644 index 00000000000..d200bbc367b --- /dev/null +++ b/public/img/panel-tabs/queries-selected.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/img/panel-tabs/queries.svg b/public/img/panel-tabs/queries.svg new file mode 100644 index 00000000000..994b8512bc9 --- /dev/null +++ b/public/img/panel-tabs/queries.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/img/panel-tabs/visualization-selected.svg b/public/img/panel-tabs/visualization-selected.svg new file mode 100644 index 00000000000..b7b5fd96aed --- /dev/null +++ b/public/img/panel-tabs/visualization-selected.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/img/panel-tabs/visualization.svg b/public/img/panel-tabs/visualization.svg new file mode 100644 index 00000000000..d2cdd81401f --- /dev/null +++ b/public/img/panel-tabs/visualization.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index cdd5fc46ad6..2e98bc48aae 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -79,6 +79,7 @@ $brand-gradient: linear-gradient( ); $page-gradient: linear-gradient(180deg, #222426 10px, rgb(22, 23, 25) 100px); +$edit-gradient: linear-gradient(180deg, rgb(22, 23, 25) 00px, #090909 60%); // Links // ------------------------- @@ -268,9 +269,7 @@ $menu-dropdown-shadow: 5px 5px 20px -5px $black; $tab-border-color: $dark-4; // Toolbar -$toolbar-bg: $page-header-bg; -$toolbar-shadow: 0 0 20px black; -$toolbar-tab-bg: $gray-blue; +$toolbar-bg: $black; // Pagination // ------------------------- @@ -367,6 +366,6 @@ $switch-slider-shadow: 0 0 3px black; //Checkbox // ------------------------- $checkbox-bg: $dark-1; -$checkbox-border: 1px solid $gray-2; +$checkbox-border: 1px solid $gray-1; $checkbox-checked-bg: linear-gradient(0deg, $orange, $red); $checkbox-color: $dark-1; diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index 4e3c8fc3bd6..806aae353c3 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -76,6 +76,7 @@ $textShadow: none; // gradients $brand-gradient: linear-gradient(to right, rgba(255, 213, 0, 1) 0%, rgba(255, 68, 0, 1) 99%, rgba(255, 68, 0, 1) 100%); $page-gradient: linear-gradient(-60deg, $gray-7, #f5f6f9 70%, $gray-7 98%); +$edit-gradient: linear-gradient(-60deg, $gray-7, #f5f6f9 70%, $gray-7 98%); // Links // ------------------------- @@ -215,9 +216,7 @@ $menu-dropdown-shadow: 5px 5px 10px -5px $gray-1; $tab-border-color: $gray-5; // Toolbar -$toolbar-bg: linear-gradient(90deg, #ffffff, #e6eef9); -$toolbar-shadow: 1px 1px 3px #c7d0d8; -$toolbar-tab-bg: $white; +$toolbar-bg: white; // search $search-shadow: 0 5px 30px 0 $gray-4; diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 9bc99c30d1d..893eea02914 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -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; diff --git a/public/sass/components/_gf-form.scss b/public/sass/components/_gf-form.scss index 48e886e4c93..389b5943155 100644 --- a/public/sass/components/_gf-form.scss +++ b/public/sass/components/_gf-form.scss @@ -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; @@ -181,6 +180,7 @@ $input-border: 1px solid $input-border-color; @at-root textarea#{&} { overflow: auto; white-space: pre-wrap; + height: auto; } // Unstyle the caret on `