From 0032f934c943932d625cf4b57b7392806867c9c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 5 Feb 2014 20:56:48 +0100 Subject: [PATCH] Closes #62, there is now a New button in the open / search dashboard view. --- src/app/controllers/search.js | 15 +++-- src/app/dashboards/default.json | 2 +- src/app/dashboards/empty.json | 83 ++++++++++++++++++++++++++ src/app/partials/search.html | 27 ++++++--- src/css/bootstrap.dark.min.css | 2 +- src/css/bootstrap.light.min.css | 2 +- src/vendor/bootstrap/less/grafana.less | 17 ++++-- 7 files changed, 126 insertions(+), 22 deletions(-) create mode 100644 src/app/dashboards/empty.json diff --git a/src/app/controllers/search.js b/src/app/controllers/search.js index 59f621a9cd9..2b34729e77a 100644 --- a/src/app/controllers/search.js +++ b/src/app/controllers/search.js @@ -51,12 +51,6 @@ function (angular, _, config, $) { }); }; - $scope.toggleImport = function ($event) { - $event.stopPropagation(); - - $scope.showImport = !$scope.showImport; - }; - $scope.elasticsearch_dblist = function(queryStr) { $scope.showImport = false; $scope.selectedIndex = -1; @@ -120,6 +114,15 @@ function (angular, _, config, $) { }); }; + $scope.toggleImport = function ($event) { + $event.stopPropagation(); + $scope.showImport = !$scope.showImport; + }; + + $scope.newDashboard = function() { + $location.url('/dashboard/file/empty.json'); + }; + }); diff --git a/src/app/dashboards/default.json b/src/app/dashboards/default.json index 5cb06e45371..2e3ac8bdfff 100644 --- a/src/app/dashboards/default.json +++ b/src/app/dashboards/default.json @@ -1,5 +1,5 @@ { - "title": "New Dashboard", + "title": "Welcome to Grafana!", "services": { "filter": { "list": [], diff --git a/src/app/dashboards/empty.json b/src/app/dashboards/empty.json new file mode 100644 index 00000000000..1cc249cfadd --- /dev/null +++ b/src/app/dashboards/empty.json @@ -0,0 +1,83 @@ +{ + "title": "New Dashboard", + "services": { + "filter": { + "list": [], + "time": { + "from": "now-6h", + "to": "now" + } + } + }, + "rows": [ + { + "title": "Row1", + "height": "250px", + "editable": true, + "collapse": false, + "collapsable": true, + "panels": [], + "notice": false + } + ], + "editable": true, + "failover": false, + "panel_hints": true, + "style": "dark", + "pulldowns": [ + { + "type": "filtering", + "collapse": false, + "notice": false, + "enable": false + } + ], + "nav": [ + { + "type": "timepicker", + "collapse": false, + "notice": false, + "enable": true, + "status": "Stable", + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ], + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "now": true + } + ], + "loader": { + "save_gist": false, + "save_elasticsearch": true, + "save_local": true, + "save_default": true, + "save_temp": true, + "save_temp_ttl_enable": true, + "save_temp_ttl": "30d", + "load_gist": false, + "load_elasticsearch": true, + "load_elasticsearch_size": 20, + "load_local": false, + "hide": false + }, + "refresh": false +} \ No newline at end of file diff --git a/src/app/partials/search.html b/src/app/partials/search.html index b10ab18d459..b1f6347e768 100644 --- a/src/app/partials/search.html +++ b/src/app/partials/search.html @@ -19,12 +19,24 @@