Added fields and hits panels, updated config and default dashboard.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<div ng-controller='sort' style="white-space: nowrap;">
|
||||
<h4 ng-class="{'ng-cloak': !panel.title}">{{panel.title}}</h4>
|
||||
<label><small>{{panel.label}}</small></label>
|
||||
<select style="width:85%" ng-model="panel.sort[0]" ng-options="f for f in fields"></select>
|
||||
<select style="width:85%" ng-model="panel.sort[0]" ng-change="set_sort()" ng-options="f for f in fields"></select>
|
||||
<i ng-click="toggle_sort()" ng-class="{'icon-chevron-up': panel.sort[1] == 'asc','icon-chevron-down': panel.sort[1] == 'desc'}"></i>
|
||||
</div>
|
||||
@@ -16,13 +16,18 @@ angular.module('kibana.sort', [])
|
||||
$scope.init = function() {
|
||||
$scope.fields = [];
|
||||
$scope.$on($scope.panel.group+"-fields", function(event, fields) {
|
||||
$scope.panel.sort = fields.sort;
|
||||
$scope.panel.sort = _.clone(fields.sort);
|
||||
$scope.fields = _.union(fields.all,$scope.fields);
|
||||
});
|
||||
}
|
||||
|
||||
$scope.set_sort = function() {
|
||||
$rootScope.$broadcast($scope.panel.group+"-sort",$scope.panel.sort)
|
||||
}
|
||||
|
||||
$scope.toggle_sort = function() {
|
||||
$scope.panel.sort[1] = $scope.panel.sort[1] == 'asc' ? 'desc' : 'asc';
|
||||
$rootScope.$broadcast($scope.panel.group+"-sort",$scope.panel.sort)
|
||||
}
|
||||
$scope.init();
|
||||
})
|
||||
Reference in New Issue
Block a user