diff --git a/public/app/features/dashboard/dashboardSrv.js b/public/app/features/dashboard/dashboardSrv.js index ff53eb93f70..fbd950e60b6 100644 --- a/public/app/features/dashboard/dashboardSrv.js +++ b/public/app/features/dashboard/dashboardSrv.js @@ -404,8 +404,8 @@ function (angular, $, _, moment) { if (oldVersion < 11) { // update template variables _.each(this.templating.list, function(templateVariable) { - if (templateVariable.refresh) { templateVariable.refresh = 'On Dashboard Load'; } - if (!templateVariable.refresh) { templateVariable.refresh = 'Never'; } + if (templateVariable.refresh) { templateVariable.refresh = 1; } + if (!templateVariable.refresh) { templateVariable.refresh = 0; } }); } diff --git a/public/app/features/templating/editorCtrl.js b/public/app/features/templating/editorCtrl.js index 1b31ce9cf1a..b2916e1bcc7 100644 --- a/public/app/features/templating/editorCtrl.js +++ b/public/app/features/templating/editorCtrl.js @@ -12,13 +12,19 @@ function (angular, _) { var replacementDefaults = { type: 'query', datasource: null, - refresh: 'Never', + refresh: 0, name: '', options: [], includeAll: false, multi: false, }; + $scope.refreshOptions = [ + {value: 0, text: "Never"}, + {value: 1, text: "On Dashboard Load"}, + {value: 2, text: "On Time Range Change"}, + ]; + $scope.init = function() { $scope.mode = 'list'; diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index bbdabe92fb8..7bd1fd0940f 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -171,8 +171,8 @@