Torkel Ödegaard 11 лет назад
Родитель
Сommit
17ffb167e2

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

@@ -19,7 +19,7 @@ function (_, crypto) {
       default_route                 : '/dashboard/file/default.json',
       playlist_timespan             : "1m",
       unsaved_changes_warning       : true,
-      search                        : { max_results: 20 },
+      search                        : { max_results: 16 },
       admin                         : {}
     };
 

+ 8 - 1
src/app/controllers/dashboardCtrl.js

@@ -13,7 +13,7 @@ function (angular, $, config, _) {
   module.controller('DashboardCtrl', function(
       $scope, $rootScope, dashboardKeybindings,
       filterSrv, dashboardSrv, dashboardViewStateSrv,
-      panelMoveSrv, timer) {
+      panelMoveSrv, timer, $timeout) {
 
     $scope.editor = { index: 0 };
     $scope.panelNames = config.panels;
@@ -21,6 +21,13 @@ function (angular, $, config, _) {
     $scope.init = function() {
       $scope.availablePanels = config.panels;
       $scope.onAppEvent('setup-dashboard', $scope.setupDashboard);
+
+      angular.element(window).bind('resize', function() {
+        $timeout(function() {
+          $scope.$broadcast('render');
+        });
+      });
+
     };
 
     $scope.setupDashboard = function(event, dashboardData) {

+ 0 - 5
src/app/directives/grafanaGraph.js

@@ -46,11 +46,6 @@ function (angular, $, kbn, moment, _) {
           render_panel();
         });
 
-        // Re-render if the window is resized
-        angular.element(window).bind('resize', function() {
-          render_panel();
-        });
-
         function setElementHeight() {
           try {
             var height = scope.height || scope.panel.height || scope.row.height;

+ 5 - 5
src/app/partials/search.html

@@ -64,11 +64,6 @@
 							bindonce ng-repeat="row in results.dashboards"
 							ng-class="{'selected': $index === selectedIndex }" ng-click="goToDashboard(row.id)">
 
-							<a class="search-result-link" href="#/dashboard/db/{{row.id}}">
-								<i class="icon icon-th-large"></i>
-								<span bo-text="row.id"></span>
-							</a>
-
 							<div class="search-result-actions">
 								<a ng-click="shareDashboard(row.id, row.id, $event)" config-modal="app/partials/dashLoaderShare.html">
 									<i class="icon-share"></i> share &nbsp;&nbsp;&nbsp;
@@ -84,6 +79,11 @@
 								</a>
 							</div>
 
+							<a class="search-result-link" href="#/dashboard/db/{{row.id}}">
+								<i class="icon icon-th-large"></i>
+								<span bo-text="row.id"></span>
+							</a>
+
 					</div>
 				</div>
 

+ 2 - 2
src/app/services/graphite/graphiteDatasource.js

@@ -150,7 +150,7 @@ function (angular, _, $, config, kbn, moment) {
 
       if (rounding === 'round-up') {
         if (date.get('s')) {
-          date.add('m', 1);
+          date.add(1, 'm');
         }
       }
       else if (rounding === 'round-down') {
@@ -159,7 +159,7 @@ function (angular, _, $, config, kbn, moment) {
         // to guarantee that we get all the data that
         // exists for the specified range
         if (date.get('s')) {
-          date.subtract('m', 1);
+          date.subtract(1, 'm');
         }
       }
 

+ 1 - 1
src/css/less/grafana.less

@@ -52,7 +52,7 @@
 }
 
 .search-results-container {
-  max-height: 570px;
+  max-height: 600px;
   overflow: auto;
   display: block;
   .search-result-item a {