Moved map js files, added exporting and saving of dashboard, added timer service to manage global timer cancelling, switched to font awesome

This commit is contained in:
Rashid Khan
2013-02-12 08:42:31 -07:00
parent 0d8f1fab9b
commit 0703dd8799
25 changed files with 1123 additions and 97 deletions
+22 -2
View File
@@ -3,10 +3,16 @@
'use strict';
angular.module('kibana.controllers', [])
.controller('DashCtrl', function($scope, $rootScope, ejsResource) {
.controller('DashCtrl', function($scope, $rootScope, ejsResource, timer) {
$scope.config = config;
$scope.dashboards = dashboards
if (Modernizr.localstorage && !(_.isUndefined(localStorage['dashboard']))) {
$scope.dashboards = JSON.parse(localStorage['dashboard']);
} else {
$scope.dashboards = dashboards;
}
var ejs = $scope.ejs = ejsResource(config.elasticsearch);
@@ -15,6 +21,20 @@ angular.module('kibana.controllers', [])
row.collapse = row.collapse ? false : true;
}
$scope.export = function() {
var blob = new Blob([angular.toJson($scope.dashboards)], {type: "application/json;charset=utf-8"});
saveAs(blob, $scope.dashboards.title+"-"+new Date().getTime());
}
$scope.default = function() {
if (Modernizr.localstorage) {
localStorage['dashboard'] = angular.toJson($scope.dashboards);
alert($scope.dashboards.title + " has been set as your default dashboard")
} else {
alert("Sorry, your browser is too old for this functionality");
}
}
});