Commit 3e504bc1 authored by Leonardo Menezes's avatar Leonardo Menezes
Browse files

display initializing/relocating shards on cluster overview

closes #39
parent e371c25f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -608,6 +608,8 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http',
    $scope.indices = undefined;
    $scope.nodes = undefined;
    $scope.unassigned_shards = 0;
    $scope.relocating_shards = 0;
    $scope.initializing_shards = 0;
    $scope.closed_indices = 0;
    $scope.special_indices = 0;
    $scope.expandedView = false;
@@ -652,6 +654,8 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http',
          $scope.setIndices(data.indices);
          $scope.setNodes(data.nodes);
          $scope.unassigned_shards = data.unassigned_shards;
          $scope.relocating_shards = data.relocating_shards;
          $scope.initializing_shards = data.initializing_shards;
          $scope.closed_indices = data.closed_indices;
          $scope.special_indices = data.special_indices;
          $scope.shardAllocation = data.shard_allocation;
@@ -662,6 +666,8 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http',
          $scope.indices = undefined;
          $scope.nodes = undefined;
          $scope.unassigned_shards = 0;
          $scope.relocating_shards = 0;
          $scope.initializing_shards = 0;
          $scope.closed_indices = 0;
          $scope.special_indices = 0;
          $scope.shardAllocation = true;
+8 −2
Original line number Diff line number Diff line
@@ -151,11 +151,17 @@
    </tr>
    </thead>
    <tbody>
    <tr ng-show="unassigned_shards > 0">
    <tr ng-show="unassigned_shards > 0 || relocating_shards > 0 || initializing_shards > 0">
      <td>
        <div class="subtitle">
        <div class="subtitle" ng-show="unassigned_shards >= 0">
          <i class="fa fa-warning alert-warning"> </i> {{unassigned_shards}} unassigned shards
        </div>
        <div class="subtitle" ng-show="relocating_shards > 0">
          <i class="fa fa-refresh fa-spin"> </i> {{relocating_shards}} relocating shards
        </div>
        <div class="subtitle" ng-show="initializing_shards > 0">
          <i class="fa fa-spinner fa-spin"> </i> {{initializing_shards}} initializing shards
        </div>
        <div>
          <span class="normal-action" ng-show="indices_filter.healthy" ng-click="indices_filter.healthy = false"><i><small>show only unhealthy indices</small></i></span>
          <span class="normal-action" ng-hide="indices_filter.healthy" ng-click="indices_filter.healthy = true"><i><small>show all indices</small></i></span>
+6 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http',
    $scope.indices = undefined;
    $scope.nodes = undefined;
    $scope.unassigned_shards = 0;
    $scope.relocating_shards = 0;
    $scope.initializing_shards = 0;
    $scope.closed_indices = 0;
    $scope.special_indices = 0;
    $scope.expandedView = false;
@@ -53,6 +55,8 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http',
          $scope.setIndices(data.indices);
          $scope.setNodes(data.nodes);
          $scope.unassigned_shards = data.unassigned_shards;
          $scope.relocating_shards = data.relocating_shards;
          $scope.initializing_shards = data.initializing_shards;
          $scope.closed_indices = data.closed_indices;
          $scope.special_indices = data.special_indices;
          $scope.shardAllocation = data.shard_allocation;
@@ -63,6 +67,8 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http',
          $scope.indices = undefined;
          $scope.nodes = undefined;
          $scope.unassigned_shards = 0;
          $scope.relocating_shards = 0;
          $scope.initializing_shards = 0;
          $scope.closed_indices = 0;
          $scope.special_indices = 0;
          $scope.shardAllocation = true;
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ describe('OverviewController', function() {
    expect(this.scope.indices).toEqual(undefined);
    expect(this.scope.nodes).toEqual(undefined);
    expect(this.scope.unassigned_shards).toEqual(0);
    expect(this.scope.initializing_shards).toEqual(0);
    expect(this.scope.relocating_shards).toEqual(0);
    expect(this.scope.shardAllocation).toEqual(true);
    expect(this.scope.closed_indices).toEqual(0);
    expect(this.scope.special_indices).toEqual(0);
@@ -67,6 +69,8 @@ describe('OverviewController', function() {
          indices: indices,
          nodes: nodes,
          unassigned_shards: 1,
          relocating_shards: 2,
          initializing_shards: 3,
          closed_indices: 2,
          special_indices: 3,
          shard_allocation: true
@@ -80,6 +84,8 @@ describe('OverviewController', function() {
        this.scope.refresh();
        expect(this.DataService.getOverview).toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function));
        expect(this.scope.unassigned_shards).toEqual(1);
        expect(this.scope.initializing_shards).toEqual(3);
        expect(this.scope.relocating_shards).toEqual(2);
        expect(this.scope.closed_indices).toEqual(2);
        expect(this.scope.special_indices).toEqual(3);
        expect(this.scope.shardAllocation).toEqual(true);