linting and added filter states

This commit is contained in:
Rashid Khan
2013-07-17 21:57:19 -07:00
parent 254a553e5b
commit c03373c692
14 changed files with 383 additions and 348 deletions
+31 -26
View File
@@ -11,7 +11,7 @@ angular.module('kibana.controllers', [])
editable: true,
rows: [],
last: null
}
};
$scope.init = function() {
@@ -22,16 +22,16 @@ angular.module('kibana.controllers', [])
$scope.dashboard = dashboard;
// Provide a global list of all see fields
$scope.fields = fields
$scope.fields = fields;
$scope.reset_row();
$scope.clear_all_alerts();
var ejs = $scope.ejs = ejsResource(config.elasticsearch);
}
};
$scope.add_row = function(dash,row) {
dash.rows.push(row);
}
};
$scope.reset_row = function() {
$scope.row = {
@@ -42,8 +42,8 @@ angular.module('kibana.controllers', [])
};
$scope.row_style = function(row) {
return { 'min-height': row.collapse ? '5px' : row.height }
}
return { 'min-height': row.collapse ? '5px' : row.height };
};
$scope.alert = function(title,text,severity,timeout) {
var alert = {
@@ -52,30 +52,34 @@ angular.module('kibana.controllers', [])
severity: severity || 'info',
};
$scope.global_alert.push(alert);
if (timeout > 0)
if (timeout > 0) {
$timeout(function() {
$scope.global_alert = _.without($scope.global_alert,alert)
$scope.global_alert = _.without($scope.global_alert,alert);
}, timeout);
}
}
};
$scope.clear_alert = function(alert) {
$scope.global_alert = _.without($scope.global_alert,alert);
}
};
$scope.clear_all_alerts = function() {
$scope.global_alert = []
}
$scope.global_alert = [];
};
$scope.edit_path = function(type) {
if(type)
if(type) {
return 'panels/'+type+'/editor.html';
}
} else {
return false;
}
};
// This is whoafully incomplete, but will do for now
$scope.parse_error = function(data) {
var _error = data.match("nested: (.*?);")
var _error = data.match("nested: (.*?);");
return _.isNull(_error) ? data : _error[1];
}
};
$scope.init();
@@ -89,31 +93,32 @@ angular.module('kibana.controllers', [])
collapsable: true,
editable: true,
panels: [],
}
_.defaults($scope.row,_d)
};
_.defaults($scope.row,_d);
$scope.init = function() {
$scope.reset_panel();
}
};
$scope.toggle_row = function(row) {
row.collapse = row.collapse ? false : true;
if (!row.collapse) {
$timeout(function() {
$scope.$broadcast('render')
$scope.$broadcast('render');
});
}
}
};
// This can be overridden by individual panel
// This can be overridden by individual panels
$scope.close_edit = function() {
$scope.$broadcast('render')
}
$scope.$broadcast('render');
};
$scope.add_panel = function(row,panel) {
$scope.row.panels.push(panel);
}
};
$scope.reset_panel = function() {
$scope.panel = {
@@ -121,7 +126,7 @@ angular.module('kibana.controllers', [])
error : false,
span : 3,
editable: true,
group : ['default'],
group : ['default']
};
};