diff --git a/js/controllers.js b/js/controllers.js
index 81fab71812c..cc473e2825d 100644
--- a/js/controllers.js
+++ b/js/controllers.js
@@ -5,22 +5,25 @@
angular.module('kibana.controllers', [])
.controller('DashCtrl', function($scope, $rootScope, ejsResource, timer) {
- $scope.config = config;
- $scope._ = _;
+ $scope.init = function() {
+ $scope.config = config;
+ $scope._ = _;
+ $scope.reset_row();
- // The global dashboards object should be moved to an $http request for json
- if (Modernizr.localstorage &&
- !(_.isUndefined(localStorage['dashboard'])) &&
- localStorage['dashboard'] !== ''
- ) {
- $scope.dashboards = JSON.parse(localStorage['dashboard']);
- } else {
- $scope.dashboards = dashboards;
+ // The global dashboards object should be moved to an $http request for json
+ if (Modernizr.localstorage &&
+ !(_.isUndefined(localStorage['dashboard'])) &&
+ localStorage['dashboard'] !== ''
+ ) {
+ $scope.dashboards = JSON.parse(localStorage['dashboard']);
+ } else {
+ $scope.dashboards = dashboards;
+ }
+
+ var ejs = $scope.ejs = ejsResource(config.elasticsearch);
}
- var ejs = $scope.ejs = ejsResource(config.elasticsearch);
-
$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());
@@ -44,9 +47,34 @@ angular.module('kibana.controllers', [])
}
}
+ $scope.add_row = function(dashboards,row) {
+ $scope.dashboards.rows.push(row);
+ }
+
+ $scope.reset_row = function() {
+ $scope.row = {
+ title: '',
+ height: '150px',
+ editable: true,
+ };
+ };
+
+ $scope.init();
+
+
})
.controller('RowCtrl', function($scope, $rootScope, $timeout, ejsResource, timer) {
+ var _d = {
+ title: "Row",
+ height: "150px",
+ collapse: false,
+ editable: true,
+ panels: [],
+ }
+ _.defaults($scope.row,_d)
+
+
$scope.init = function(){
$scope.reset_panel();
}
diff --git a/panels/sort/module.html b/panels/sort/module.html
index 752a9cf0216..0fdc9ff5520 100644
--- a/panels/sort/module.html
+++ b/panels/sort/module.html
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/partials/dashboard.html b/partials/dashboard.html
index d5f3c8ccb4a..06ae483d3ca 100644
--- a/partials/dashboard.html
+++ b/partials/dashboard.html
@@ -5,9 +5,8 @@
-
- {{row.title}}
-
+
+ {{row.title}}
diff --git a/partials/dasheditor.html b/partials/dasheditor.html
new file mode 100644
index 00000000000..5ab04a7344b
--- /dev/null
+++ b/partials/dasheditor.html
@@ -0,0 +1,53 @@
+
+
+
{{dashboards.title}} editor
+
+
+
Dashboard Control
+
+
+
+
+
+
+
+
+
+
+
Panels
+
+
+
Title
+
Delete
+
Move
+
+
+
{{row.title}}
+
+
+
+
+
+
+
+
New row
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/partials/roweditor.html b/partials/roweditor.html
index 97666f85e54..ceed6fa2252 100644
--- a/partials/roweditor.html
+++ b/partials/roweditor.html
@@ -12,7 +12,7 @@