diff --git a/public/app/features/panel/metrics_panel_ctrl.ts b/public/app/features/panel/metrics_panel_ctrl.ts index 795afb41bf6..375283b6a7d 100644 --- a/public/app/features/panel/metrics_panel_ctrl.ts +++ b/public/app/features/panel/metrics_panel_ctrl.ts @@ -192,7 +192,43 @@ class MetricsPanelCtrl extends PanelCtrl { return results; }); } + + addDataQuery(datasource) { + this.dashboard.addDataQueryTo(this.panel, datasource); + } + + removeDataQuery(query) { + this.dashboard.removeDataQuery(this.panel, query); + this.refresh(); + }; + + duplicateDataQuery(query) { + this.dashboard.duplicateDataQuery(this.panel, query); + } + + moveDataQuery(fromIndex, toIndex) { + this.dashboard.moveDataQuery(this.panel, fromIndex, toIndex); + } + + setDatasource(datasource) { + // switching to mixed + if (datasource.meta.mixed) { + _.each(this.panel.targets, target => { + target.datasource = this.panel.datasource; + if (target.datasource === null) { + target.datasource = config.defaultDatasource; + } + }); + } else if (this.datasource && this.datasource.meta.mixed) { + _.each(this.panel.targets, target => { + delete target.datasource; + }); + } + + this.panel.datasource = datasource.value; + this.datasource = null; + this.refresh(); + } } export {MetricsPanelCtrl}; - diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index ac12bac53ba..8da398ee3d3 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -16,6 +16,7 @@ export class PanelCtrl { fullscreen: boolean; inspector: any; editModeInitiated: boolean; + editorHelpIndex: number; constructor($scope, $injector) { var plugin = config.panels[this.panel.type]; @@ -100,4 +101,13 @@ export class PanelCtrl { broadcastRender(arg1?, arg2?) { this.$scope.$broadcast('render', arg1, arg2); } + + toggleEditorHelp(index) { + if (this.editorHelpIndex === index) { + this.editorHelpIndex = null; + return; + } + this.editorHelpIndex = index; + } + } diff --git a/public/app/plugins/datasource/graphite/partials/query.editor.html b/public/app/plugins/datasource/graphite/partials/query.editor.html index 76c0d6ddb65..9cb2b454132 100755 --- a/public/app/plugins/datasource/graphite/partials/query.editor.html +++ b/public/app/plugins/datasource/graphite/partials/query.editor.html @@ -25,19 +25,19 @@
  • - Duplicate + Duplicate
  • - Move up + Move up
  • - Move down + Move down
  • - +
  • @@ -48,7 +48,7 @@ {{target.refId}}
  • - +
  • diff --git a/public/app/plugins/datasource/graphite/partials/query.options.html b/public/app/plugins/datasource/graphite/partials/query.options.html index bdfe362d427..f20b55b1348 100644 --- a/public/app/plugins/datasource/graphite/partials/query.options.html +++ b/public/app/plugins/datasource/graphite/partials/query.options.html @@ -11,7 +11,7 @@
  • @@ -39,27 +39,27 @@
  • - + shorter legend names
  • - + series as parameters
  • - + stacking
  • - + templating
  • - + max data points
  • @@ -71,7 +71,7 @@
    -
    +
    Shorter legend names
    • alias() function to specify a custom series name
    • @@ -81,7 +81,7 @@
    -
    +
    Series as parameter
    • Some graphite functions allow you to have many series arguments
    • @@ -99,7 +99,7 @@
    -
    +
    Stacking
    • You find the stacking option under Display Styles tab
    • @@ -107,7 +107,7 @@
    -
    +
    Templating
    • You can use a template variable in place of metric names
    • @@ -116,7 +116,7 @@
    -
    +
    Max data points
    • Every graphite request is issued with a maxDataPoints parameter