mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 06:12:20 +08:00
Removed dashcontrol, added default_route setting, bumped minimum version
This commit is contained in:
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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'],
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,40 +0,0 @@
|
||||
<div>
|
||||
<a class="close" ng-click="dismiss()" href="">×</a>
|
||||
<h4>Load</h4>
|
||||
<div ng-show='panel.load.local'>
|
||||
<h5>Local File</h5>
|
||||
<form>
|
||||
<input type="file" id="dashupload" dash-upload /><br>
|
||||
</form>
|
||||
</div>
|
||||
<div ng-show='panel.load.gist'>
|
||||
<h5>Gist <small>Enter a gist number or url</small></h5>
|
||||
<form>
|
||||
<input type="text" ng-model="gist.url"/><br>
|
||||
<button class="btn" ng-click="gist_dblist(dashboard.gist_id(gist.url))" ng-show="dashboard.is_gist(gist.url)"><i class="icon-github-alt"></i> Get gist:{{gist.url | gistid}}</button>
|
||||
<h6 ng-show="gist.files.length">Dashboards in gist:{{gist.url | gistid}} <small>click to load</small></h6>
|
||||
<h6 ng-hide="gist.files.length">No gist dashboards found</h6>
|
||||
<table class="table table-condensed table-striped">
|
||||
<tr ng-repeat="file in gist.files">
|
||||
<td><a ng-click="dashboard.dash_load(file)">{{file.title}}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div ng-show='panel.load.elasticsearch'>
|
||||
<h5>Elasticsearch</h5>
|
||||
<form class="input-append">
|
||||
<input type="text" ng-model="elasticsearch.query"/>
|
||||
<button ng-click="elasticsearch_dblist(elasticsearch.query)" class='btn'><i class='icon-search'></i></button>
|
||||
</form>
|
||||
<h6 ng-show="elasticsearch.dashboards.length">Elasticsearch stored dashboards</h6>
|
||||
<h6 ng-hide="elasticsearch.dashboards.length">No dashboards matching your query found</h6>
|
||||
<table class="table table-condensed table-striped">
|
||||
<tr ng-repeat="row in elasticsearch.dashboards | orderBy:['_id']">
|
||||
<td><a ng-click="elasticsearch_delete(row._id)"><i class="icon-remove"></i></a></td>
|
||||
<td><a href="#/dashboard/elasticsearch/{{row._id}}">{{row._id}}</a></td>
|
||||
<td><a><i class="icon-share" ng-click="share = dashboard.share_link(row._id,'elasticsearch',row._id)" bs-modal="'app/panels/dashcontrol/share.html'"></i></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -1,6 +1,3 @@
|
||||
<div ng-controller='dashcontrol' ng-init="init()">
|
||||
<label class='small'>Dash Control <tip icon="warning-sign">This panel is deprecated! Please remove it from your dashboard</tip></label>
|
||||
<button class='btn' ng-show="panel.load.gist || panel.load.elasticsearch || panel.load.local" data-placement="bottom" data-unique="1" ng-click="elasticsearch_dblist(elasticsearch.query)" bs-popover="'app/panels/dashcontrol/load.html'"><i class='icon-folder-open'></i> <i class='icon-caret-down'></i></button>
|
||||
<button class='btn' ng-show="panel.save.gist || panel.save.elasticsearch || panel.save.local || panel.save.default" data-placement="bottom" data-unique="1" bs-popover="'app/panels/dashcontrol/save.html'"><i class='icon-save'></i> <i class='icon-caret-down'></i></button>
|
||||
<button ng-show="panel.temp" class='btn' ng-click="elasticsearch_save('temp',panel.temp_ttl)" bs-modal="'app/panels/dashcontrol/share.html'"><i class='icon-share'></i></button>
|
||||
This panel has been removed. Please use the dashboard controls in the top right and remove this panel from your dashboard
|
||||
</div>
|
@ -1,30 +0,0 @@
|
||||
<div>
|
||||
<a class="close" ng-click="dismiss()" href="">×</a>
|
||||
<h4>Save</h4>
|
||||
|
||||
<div ng-show="panel.save.default || panel.save.local">
|
||||
<h5>Locally</h5>
|
||||
<form>
|
||||
<ul class="nav nav-list">
|
||||
<li><a ng-show="panel.save.local" ng-click="dashboard.to_file()"><i class="icon-download"></i> Export to File</a></li>
|
||||
<li><a ng-show="panel.save.default" ng-click="set_default()"><i class="icon-bookmark"></i> Set as My Default</a></li>
|
||||
<li><a ng-show="panel.save.default" ng-click="purge_default()"><i class="icon-ban-circle"></i> Clear My Default</a></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div ng-show="panel.save.gist">
|
||||
<h5>Gist</h5>
|
||||
<form class="input-append">
|
||||
<input class='input-medium' placeholder='Title' type="text" ng-model="gist.title"/>
|
||||
<button class="btn" ng-click="save_gist()"><i class="icon-github-alt"></i></button>
|
||||
</form><br>
|
||||
<small ng-show="gist.last">Last gist: <a target="_blank" href="{{gist.last}}">{{gist.last}}</a></small>
|
||||
</div>
|
||||
<div ng-show="panel.save.elasticsearch">
|
||||
<h5>Elasticsearch</h5>
|
||||
<form class="input-append">
|
||||
<input class='input-medium' placeholder='Title' type="text" ng-model="elasticsearch.title"/>
|
||||
<button class="btn" ng-click="elasticsearch_save('dashboard')"><i class="icon-save"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -1,11 +0,0 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{{share.title}} <small>shareable link</small></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label>Share this dashboard with this URL</label>
|
||||
<input ng-model='share.link' type="text" style="width:90%" onclick="this.select()" onfocus="this.select()" ng-change="share = dashboard.share_link(share.title,share.type,share.id)">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success" ng-click="dismiss();$broadcast('render')">Close</button>
|
||||
</div>
|
@ -78,10 +78,10 @@
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
<li ng-show="dashboard.current.loader.save_default">
|
||||
<a class="link" ng-click="set_default()">Set as my home</a>
|
||||
<a class="link" ng-click="set_default()">Save as Home</a>
|
||||
</li>
|
||||
<li ng-show="dashboard.current.loader.save_default">
|
||||
<a class="link" ng-click="purge_default()">Clear my home</a>
|
||||
<a class="link" ng-click="purge_default()">Reset Home</a>
|
||||
</li>
|
||||
<li ng-show="dashboard.current.loader.save_local">
|
||||
<a class="link" ng-click="dashboard.to_file()">Export schema</a>
|
||||
|
@ -102,7 +102,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
self.script_load(_id);
|
||||
break;
|
||||
default:
|
||||
self.file_load('default.json');
|
||||
$location.path(config.default_route);
|
||||
}
|
||||
|
||||
// No dashboard in the URL
|
||||
@ -116,7 +116,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
self.dash_load(dashboard);
|
||||
// No? Ok, grab default.json, its all we have now
|
||||
} else {
|
||||
self.file_load('default.json');
|
||||
$location.path(config.default_route);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/** @scratch /configuration/config.js/1
|
||||
* == 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.
|
||||
*/
|
||||
@ -8,12 +8,12 @@ function (Settings) {
|
||||
"use strict";
|
||||
|
||||
/** @scratch /configuration/config.js/2
|
||||
* === Parameters ===
|
||||
* === Parameters
|
||||
*/
|
||||
return new Settings({
|
||||
|
||||
/** @scratch /configuration/config.js/5
|
||||
* ==== 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
|
||||
@ -24,7 +24,18 @@ function (Settings) {
|
||||
elasticsearch: "http://"+window.location.hostname+":9200",
|
||||
|
||||
/** @scratch /configuration/config.js/5
|
||||
* ==== 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',+
|
||||
*/
|
||||
default_route : '/dashboard/file/default.json',
|
||||
|
||||
/** @scratch /configuration/config.js/5
|
||||
* ==== kibana-int
|
||||
*
|
||||
* The default ES index to use for storing Kibana specific object
|
||||
* such as stored dashboards
|
||||
@ -32,7 +43,7 @@ function (Settings) {
|
||||
kibana_index: "kibana-int",
|
||||
|
||||
/** @scratch /configuration/config.js/5
|
||||
* ==== 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.
|
||||
@ -46,7 +57,6 @@ function (Settings) {
|
||||
'timepicker',
|
||||
'text',
|
||||
'hits',
|
||||
'dashcontrol',
|
||||
'column',
|
||||
'trends',
|
||||
'bettermap',
|
||||
|
@ -30,7 +30,6 @@ module.exports = function(grunt) {
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
grunt.task.run('string-replace:config');
|
||||
});
|
||||
grunt.task.run('git-describe');
|
||||
|
Reference in New Issue
Block a user