Added collapsable rows, error handling in table panel, ground work for new kinds of binding, refactored view a bit

This commit is contained in:
Rashid Khan
2013-02-01 14:16:55 -07:00
parent 896a6f7c10
commit a73242cae5
13 changed files with 78 additions and 34 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
<div ng-controller='histogram'>
<div ng-controller='histogram' style="height:{{row.height}}">
<h4>{{panel.title}}</h4>
<div histogram params="{{panel}}" style="height:{{row.height}}"></div>
</div>
+5 -2
View File
@@ -87,12 +87,15 @@ angular.module('kibana.histogram', [])
restrict: 'A',
link: function(scope, elem, attrs, ctrl) {
scope.$watch('data', function() {
// If the data or row state changes, re-render
scope.$watch(function () {
return angular.toJson([scope.data, scope.row])
}, function() {
if(!(_.isUndefined(scope.data)))
render_panel(scope,elem,attrs);
});
// Re-render if the window is
// Re-render if the window is resized
angular.element(window).bind('resize', function(){
render_panel(scope,elem,attrs);
});
+6 -3
View File
@@ -63,9 +63,12 @@ angular.module('kibana.map', [])
restrict: 'A',
link: function(scope, elem, attrs) {
// Re-rending panel if data changes
scope.$watch('data', function() {
render_panel(scope,elem,attrs);
// If the data or row state changes, re-render
scope.$watch(function () {
return angular.toJson([scope.data, scope.row])
}, function() {
if(!(_.isUndefined(scope.data)))
render_panel(scope,elem,attrs);
});
// Or if the window is resized
+8 -4
View File
@@ -112,13 +112,15 @@ angular.module('kibana.pie', [])
restrict: 'A',
link: function(scope, elem, attrs) {
// Re-rending the panel if it is resized,
scope.$watch('data', function() {
// Watch if data or row state changes
scope.$watch(function () {
return angular.toJson([scope.data, scope.row])
}, function() {
if(!(_.isUndefined(scope.data)))
render_panel(scope,elem,attrs);
});
// Or if the model changes
// Or if the window is resized
angular.element(window).bind('resize', function(){
render_panel(scope,elem,attrs);
});
@@ -152,7 +154,9 @@ angular.module('kibana.pie', [])
};
// Populate element
$.plot(elem, scope.data, pie);
if(elem.is(":visible")){
$.plot(elem, scope.data, pie);
}
//elem.show();
}
}
+3 -3
View File
@@ -1,5 +1,5 @@
<div ng-controller='sort'>
<h4 ng-hide="_.isUndefined(panel.title)">{{panel.title}}</h4>
<select ng-model="panel.sort[0]" ng-options="f for f in fields"></select>
<div ng-controller='sort' style="white-space: nowrap;">
<h4 ng-class="{'ng-cloak': !panel.title}">{{panel.title}}</h4>
<i ng-click="toggle_sort()" ng-class="{'icon-chevron-up': panel.sort[1] == 'asc','icon-chevron-down': panel.sort[1] == 'desc'}"></i>
<select ng-model="panel.sort[0]" ng-options="f for f in fields"></select>
</div>
+2 -2
View File
@@ -1,6 +1,6 @@
<div ng-controller='stringquery'>
<h4 ng-hide="_.isUndefined(panel.title)">{{panel.title}}</h4>
<form class="form-search">
<h4 ng-class="{'ng-cloak': !panel.title}">{{panel.title}}</h4>
<form class="form-search" style="margin-bottom:0px">
<input type="text" class="input-medium search-query" ng-model="query" style="width:85%">
<button type="submit" class="btn" ng-click="send_query(query)">Search</button>
</form>