瀏覽代碼

Added config setting for default playlist timespan

Torkel Ödegaard 11 年之前
父節點
當前提交
1e4ff1e774
共有 4 個文件被更改,包括 9 次插入3 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 1
      src/app/components/settings.js
  3. 1 1
      src/app/controllers/playlistCtrl.js
  4. 6 1
      src/config.sample.js

+ 1 - 0
CHANGELOG.md

@@ -2,6 +2,7 @@ vNext
 - New Y-axis formater for metric values that represent seconds (Issue #427) - thx @jippi
 - Allow special characters in serie names (influxdb datasource), PR #390 - thx  @majst01
 - Refactoring of filterSrv (Issue #428), thx @Tetha
+- New config for playlist feature. Set playlist_timespan to set default playlist interval (Issue #445) - thx @rmca
 
 # Fixes
 - Filter option loading when having muliple nested filters now works better.

+ 1 - 1
src/app/components/settings.js

@@ -25,7 +25,7 @@ function (_, crypto) {
       grafana_index                 : 'grafana-dash',
       elasticsearch_all_disabled    : false,
       timezoneOffset                : null,
-      playlistTimespan              : "15s",
+      playlist_timespan             : "1m",
       unsaved_changes_warning       : true
     };
 

+ 1 - 1
src/app/controllers/playlistCtrl.js

@@ -11,7 +11,7 @@ function (angular, _, config) {
   module.controller('PlaylistCtrl', function($scope, playlistSrv) {
 
     $scope.init = function() {
-      $scope.timespan = config.playlistTimespan;
+      $scope.timespan = config.playlist_timespan;
       $scope.loadFavorites();
       $scope.$on('modal-opened', $scope.loadFavorites);
     };

+ 6 - 1
src/config.sample.js

@@ -14,7 +14,6 @@ function (Settings) {
      * For Basic authentication use: http://username:password@domain.com:9200
      */
     elasticsearch: "http://"+window.location.hostname+":9200",
-    playlistTimespan: "15s",
 
     /**
      * graphite-web url:
@@ -69,6 +68,12 @@ function (Settings) {
      */
     unsaved_changes_warning: true,
 
+    /**
+     * set the default timespan for the playlist feature
+     * Example: "1m", "1h"
+     */
+    playlist_timespan: "1m",
+
     panel_names: [
       'text',
       'graphite'