From faa15d0a6b6b37344b2cfe5e21e657a20be06ceb Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 6 Dec 2013 12:32:38 -0700 Subject: [PATCH] Removed dashcontrol, added default_route setting, bumped minimum version --- docs/kibana/configuration/config.js.asciidoc | 23 +++++++---- src/app/app.js | 10 ++++- src/app/components/require.config.js | 3 +- src/app/components/settings.js | 7 ++-- src/app/controllers/dash.js | 2 +- src/app/directives/kibanaPanel.js | 3 +- src/app/panels/dashcontrol/load.html | 40 -------------------- src/app/panels/dashcontrol/module.html | 5 +-- src/app/panels/dashcontrol/save.html | 30 --------------- src/app/panels/dashcontrol/share.html | 11 ------ src/app/partials/dashLoader.html | 4 +- src/app/services/dashboard.js | 4 +- src/config.js | 22 ++++++++--- tasks/build_task.js | 1 - 14 files changed, 55 insertions(+), 110 deletions(-) delete mode 100644 src/app/panels/dashcontrol/load.html delete mode 100644 src/app/panels/dashcontrol/save.html delete mode 100644 src/app/panels/dashcontrol/share.html diff --git a/docs/kibana/configuration/config.js.asciidoc b/docs/kibana/configuration/config.js.asciidoc index 2147c29a42c..75ab58ffee3 100644 --- a/docs/kibana/configuration/config.js.asciidoc +++ b/docs/kibana/configuration/config.js.asciidoc @@ -1,12 +1,12 @@ -== Configuration == +== Configuration config.js is where you will find the core Kibana configuration. This file contains parameter that must be set before kibana is run for the first time. // src/config.js:1 -=== Parameters === +=== Parameters // src/config.js:10 -==== elasticsearch ==== +==== elasticsearch The URL to your elasticsearch server. You almost certainly don't want +http://localhost:9200+ here. Even if Kibana and Elasticsearch are on @@ -15,15 +15,24 @@ elasticsearch installed on. You probably want to set it to the FQDN of your elasticsearch host // src/config.js:15 -==== kibana-int ==== +==== default_route + +This is the default landing page when you don't specify a dashboard to load. You can specify +files, scripts or saved dashboards here. For example, if you had saved a dashboard called +`WebLogs' to elasticsearch you might use: + ++default_route: '/dashboard/elasticsearch/WebLogs',+ +// src/config.js:26 + +==== kibana-int The default ES index to use for storing Kibana specific object such as stored dashboards -// src/config.js:26 +// src/config.js:37 -==== panel_name ==== +==== panel_name An array of panel modules available. Panels will only be loaded when they are defined in the dashboard, but this list is used in the "add panel" interface. -// src/config.js:34 +// src/config.js:45 diff --git a/src/app/app.js b/src/app/app.js index 132e7f2b994..e602580203c 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -12,9 +12,10 @@ define([ 'angular-strap', 'angular-dragdrop', 'extend-jquery', - 'bindonce' + 'bindonce', ], function (angular, $, _, appLevelRequire) { + "use strict"; var app = angular.module('kibana', []), @@ -25,6 +26,11 @@ function (angular, $, _, appLevelRequire) { // features if we define them after boot time register_fns = {}; + app.constant('kibanaVersion',"3.0.0pre5"); + + // Use this for cache busting partials + app.constant('cacheBust',"cache-bust="+Date.now()); + /** * Tells the application to watch the module, once bootstraping has completed * the modules controller, service, etc. functions will be overwritten to register directly @@ -59,6 +65,7 @@ function (angular, $, _, appLevelRequire) { }; app.config(function ($routeProvider, $controllerProvider, $compileProvider, $filterProvider, $provide) { + $routeProvider .when('/dashboard', { templateUrl: 'app/partials/dashboard.html', @@ -72,6 +79,7 @@ function (angular, $, _, appLevelRequire) { .otherwise({ redirectTo: 'dashboard' }); + // this is how the internet told me to dynamically add modules :/ register_fns.controller = $controllerProvider.register; register_fns.directive = $compileProvider.directive; diff --git a/src/app/components/require.config.js b/src/app/components/require.config.js index a13dac6b458..21f3fd993cd 100644 --- a/src/app/components/require.config.js +++ b/src/app/components/require.config.js @@ -50,7 +50,7 @@ require.config({ }, angular: { - deps: ['jquery'], + deps: ['jquery','config'], exports: 'angular' }, @@ -67,6 +67,7 @@ require.config({ }, // simple dependency declaration + // 'jquery-ui': ['jquery'], 'jquery.flot': ['jquery'], 'jquery.flot.byte': ['jquery', 'jquery.flot'], diff --git a/src/app/components/settings.js b/src/app/components/settings.js index a3dcd15e9d9..eb1e79cfa08 100644 --- a/src/app/components/settings.js +++ b/src/app/components/settings.js @@ -10,9 +10,10 @@ function (_) { * @type {Object} */ var defaults = { - elasticsearch : "http://"+window.location.hostname+":9200", - panel_names : [], - kibana_index : 'kibana-int' + elasticsearch : "http://"+window.location.hostname+":9200", + panel_names : [], + kibana_index : 'kibana-int', + default_route : '/dashboard/file/default.json' }; // This initializes a new hash on purpose, to avoid adding parameters to diff --git a/src/app/controllers/dash.js b/src/app/controllers/dash.js index d15330346d4..eca0439c81c 100644 --- a/src/app/controllers/dash.js +++ b/src/app/controllers/dash.js @@ -31,7 +31,7 @@ function (angular, config, _) { module.controller('DashCtrl', function( $scope, $route, ejsResource, fields, dashboard, alertSrv, panelMove, esVersion) { - $scope.requiredElasticSearchVersion = ">=0.20.5"; + $scope.requiredElasticSearchVersion = ">=0.90.3"; $scope.editor = { index: 0 diff --git a/src/app/directives/kibanaPanel.js b/src/app/directives/kibanaPanel.js index bbe5483d604..009fb8f8e41 100644 --- a/src/app/directives/kibanaPanel.js +++ b/src/app/directives/kibanaPanel.js @@ -78,7 +78,8 @@ function (angular) { var nameAsPath = name.replace(".", "/"); $scope.require([ 'jquery', - 'text!panels/'+nameAsPath+'/module.html' + 'text!panels/'+nameAsPath+'/module.html', + 'text!panels/'+nameAsPath+'/editor.html' ], function ($, moduleTemplate) { var $module = $(moduleTemplate); // top level controllers diff --git a/src/app/panels/dashcontrol/load.html b/src/app/panels/dashcontrol/load.html deleted file mode 100644 index 29afae124be..00000000000 --- a/src/app/panels/dashcontrol/load.html +++ /dev/null @@ -1,40 +0,0 @@ -
- × -

Load

-
-
Local File
-
-
-
-
-
-
Gist Enter a gist number or url
-
-
- -
Dashboards in gist:{{gist.url | gistid}} click to load
-
No gist dashboards found
- - - - -
{{file.title}}
-
-
-
-
Elasticsearch
-
- - -
-
Elasticsearch stored dashboards
-
No dashboards matching your query found
- - - - - - -
{{row._id}}
-
-
diff --git a/src/app/panels/dashcontrol/module.html b/src/app/panels/dashcontrol/module.html index 6ea3aec639c..4a5fa07e42d 100644 --- a/src/app/panels/dashcontrol/module.html +++ b/src/app/panels/dashcontrol/module.html @@ -1,6 +1,3 @@
- - - - + This panel has been removed. Please use the dashboard controls in the top right and remove this panel from your dashboard
\ No newline at end of file diff --git a/src/app/panels/dashcontrol/save.html b/src/app/panels/dashcontrol/save.html deleted file mode 100644 index 2879c4a0999..00000000000 --- a/src/app/panels/dashcontrol/save.html +++ /dev/null @@ -1,30 +0,0 @@ -
- × -

Save

- -
-
Locally
-
- -
-
-
-
Gist
-
- - -

- Last gist: {{gist.last}} -
-
-
Elasticsearch
-
- - -
-
-
\ No newline at end of file diff --git a/src/app/panels/dashcontrol/share.html b/src/app/panels/dashcontrol/share.html deleted file mode 100644 index d542c2c1303..00000000000 --- a/src/app/panels/dashcontrol/share.html +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/src/app/partials/dashLoader.html b/src/app/partials/dashLoader.html index 5e450963329..c2913668374 100644 --- a/src/app/partials/dashLoader.html +++ b/src/app/partials/dashLoader.html @@ -78,10 +78,10 @@