Skip to content

Commit

Permalink
Merge pull request #1 from BigFunger/pr/4473
Browse files Browse the repository at this point in the history
Pr/4473
  • Loading branch information
Filirom1 committed Jul 23, 2015
2 parents 28f513b + 811dc32 commit 0fd0505
Show file tree
Hide file tree
Showing 111 changed files with 5,248 additions and 1,897 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ target
*.log
esvm
.htpasswd
src/server/bin/plugins
5 changes: 4 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ module.exports = function (grunt) {
'Gruntfile.js',
'<%= root %>/tasks/**/*.js',
'<%= src %>/kibana/*.js',
'<%= src %>/server/**/*.js',
'<%= src %>/server/bin/*.js',
'<%= src %>/server/{config,lib,plugins}/**/*.js',
'<%= src %>/server/bin/{plugin,startup}/**/*.js',
'<%= src %>/kibana/{components,directives,factories,filters,plugins,registry,services,utils}/**/*.js',
'<%= unitTestDir %>/**/*.js',
'!<%= unitTestDir %>/specs/vislib/fixture/**/*'
Expand All @@ -44,6 +46,7 @@ module.exports = function (grunt) {
'<%= src %>/kibana/components/*/*.less',
'<%= src %>/kibana/styles/main.less',
'<%= src %>/kibana/components/vislib/styles/main.less',
'<%= src %>/server/plugins/status/public/styles/main.less',
'<%= plugins %>/dashboard/styles/main.less',
'<%= plugins %>/discover/styles/main.less',
'<%= plugins %>/settings/styles/main.less',
Expand Down
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"angular-bootstrap": "0.10.0",
"angular-elastic": "2.4.2",
"angular-mocks": "1.2.28",
"angular-nvd3": "https://github.com/krispo/angular-nvd3.git#1.0.0-beta",
"angular-route": "1.2.28",
"angular-ui-ace": "0.2.3",
"bluebird": "~2.9.27",
Expand All @@ -47,10 +48,12 @@
"requirejs-text": "2.0.14",
"marked": "0.3.3",
"numeral": "1.5.3",
"nvd3": "1.7.1",
"leaflet-draw": "0.2.4"
},
"devDependencies": {},
"resolutions": {
"angular": "1.2.28"
"angular": "1.2.28",
"d3": "3.5.5"
}
}
52 changes: 26 additions & 26 deletions docs/production.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* <<load-balancing, Load Balancing Across Multiple Elasticsearch Nodes>>

How you deploy Kibana largely depends on your use case. If you are the only user,
you can run Kibana on your local machine and configure it to point to whatever
Elasticsearch instance you want to interact with. Conversely, if you have a large
you can run Kibana on your local machine and configure it to point to whatever
Elasticsearch instance you want to interact with. Conversely, if you have a large
number of heavy Kibana users, you might need to load balance across multiple
Kibana instances that are all connected to the same Elasticsearch instance.

While Kibana isn't terribly resource intensive, we still recommend running Kibana
While Kibana isn't terribly resource intensive, we still recommend running Kibana
separate from your Elasticsearch data or master nodes. To distribute Kibana
traffic across the nodes in your Elasticsearch cluster, you can run Kibana
and an Elasticsearch client node on the same machine. For more information, see
Expand All @@ -22,16 +22,16 @@ and an Elasticsearch client node on the same machine. For more information, see
=== Configuring Kibana to Work with Shield
If you are using Shield to authenticate Elasticsearch users, you need to provide
the Kibana server with credentials so it can access the `.kibana` index and monitor
the cluster.
the cluster.

To configure credentials for the Kibana server:

. Assign the `kibana4_server` role to a user in Shield. For more information, see
{shield}/_shield_with_kibana_4.html[Configuring a Role for the Kibana 4 Server]
. Assign the `kibana4_server` role to a user in Shield. For more information, see
{shield}/kibana.html#kibana4-server-role[Configuring a Role for the Kibana 4 Server]
in the Shield documentation.

. Set the `kibana_elasticsearch_username` and
`kibana_elasticsearch_password` properties in `kibana.yml` to specify the credentials
`kibana_elasticsearch_password` properties in `kibana.yml` to specify the credentials
of the user you assigned the `kibana4_server`
role:
+
Expand All @@ -42,19 +42,19 @@ kibana_elasticsearch_password: kibana4-password
----

Kibana 4 users also need access to the `.kibana` index so they can save and load searches, visualizations, and dashboards.
For more information, see {shield}/_shield_with_kibana_4.html#kibana4-roles[Configuring Roles for Kibana 4 Users] in
For more information, see {shield}/kibana.html#kibana4-server-role[Configuring Roles for Kibana 4 Users] in
the Shield documentation.

TIP: See <<kibana-dynamic-mapping, Kibana and Elasticsearch Dynamic Mapping>> for important information on Kibana and
TIP: See <<kibana-dynamic-mapping, Kibana and Elasticsearch Dynamic Mapping>> for important information on Kibana and
the dynamic mapping feature in Elasticsearch.

[float]
[[enabling-ssl]]
=== Enabling SSL
Kibana supports SSL encryption for both client requests and the requests the Kibana server
Kibana supports SSL encryption for both client requests and the requests the Kibana server
sends to Elasticsearch.

To encrypt communications between the browser and the Kibana server, you configure the `ssl_key_file `and
To encrypt communications between the browser and the Kibana server, you configure the `ssl_key_file `and
`ssl_cert_file` properties in `kibana.yml`:

[source,text]
Expand All @@ -64,9 +64,9 @@ ssl_key_file: /path/to/your/server.key
ssl_cert_file: /path/to/your/server.crt
----

If you are using Shield or a proxy that provides an HTTPS endpoint for Elasticsearch,
If you are using Shield or a proxy that provides an HTTPS endpoint for Elasticsearch,
you can configure Kibana to access Elasticsearch via HTTPS so communications between
the Kibana server and Elasticsearch are encrypted.
the Kibana server and Elasticsearch are encrypted.

To do this, you specify the HTTPS
protocol when you configure the Elasticsearch URL in `kibana.yml`:
Expand All @@ -89,29 +89,29 @@ ca: /path/to/your/ca/cacert.pem
[float]
[[controlling-access]]
=== Controlling access
You can use http://www.elastic.co/overview/shield/[Elasticsearch Shield]
(Shield) to control what Elasticsearch data users can access through Kibana.
Shield provides index-level access control. If a user isn't authorized to run
the query that populates a Kibana visualization, the user just sees an empty
visualization.
You can use http://www.elastic.co/overview/shield/[Elasticsearch Shield]
(Shield) to control what Elasticsearch data users can access through Kibana.
Shield provides index-level access control. If a user isn't authorized to run
the query that populates a Kibana visualization, the user just sees an empty
visualization.

To configure access to Kibana using Shield, you create Shield roles
for Kibana using the `kibana4` default role as a starting point. For more
information, see http://www.elastic.co/guide/en/shield/current/_shield_with_kibana_4.html[Using Shield with Kibana 4].
To configure access to Kibana using Shield, you create Shield roles
for Kibana using the `kibana4` default role as a starting point. For more
information, see {shield}/kibana.html#_using_kibana_4_with_shield[Shield with Kibana 4][Using Shield with Kibana 4].

[float]
[[load-balancing]]
=== Load Balancing Across Multiple Elasticsearch Nodes
If you have multiple nodes in your Elasticsearch cluster, the easiest way to distribute Kibana requests
across the nodes is to run an Elasticsearch _client_ node on the same machine as Kibana.
across the nodes is to run an Elasticsearch _client_ node on the same machine as Kibana.
Elasticsearch client nodes are essentially smart load balancers that are part of the cluster. They
process incoming HTTP requests, redirect operations to the other nodes in the cluster as needed, and
gather and return the results. For more information, see
process incoming HTTP requests, redirect operations to the other nodes in the cluster as needed, and
gather and return the results. For more information, see
http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html[Node] in the Elasticsearch reference.

To use a local client node to load balance Kibana requests:

. Install Elasticsearch on the same machine as Kibana.
. Install Elasticsearch on the same machine as Kibana.
. Configure the node as a client node. In `elasticsearch.yml`, set both `node.data` and `node.master` to `false`:
+
--------
Expand All @@ -122,7 +122,7 @@ To use a local client node to load balance Kibana requests:
node.master: false
node.data: false
--------
. Configure the client node to join your Elasticsearch cluster. In `elasticsearch.yml`, set the `cluster.name` to the
. Configure the client node to join your Elasticsearch cluster. In `elasticsearch.yml`, set the `cluster.name` to the
name of your cluster.
+
--------
Expand Down
2 changes: 1 addition & 1 deletion docs/setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All you need is:
** Which Elasticsearch indices you want to search.

NOTE: If your Elasticsearch installation is protected by http://www.elastic.co/overview/shield/[Shield] see
{shield}/_shield_with_kibana_4.html[Shield with Kibana 4] for additional setup instructions.
{shield}/kibana.html#_using_kibana_4_with_shield[Shield with Kibana 4] for additional setup instructions.

[float]
[[install]]
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"scripts": {
"test": "grunt test",
"start": "node ./src/server/bin/kibana.js",
"postinstall": "bower install && grunt licenses --check-validity",
"precommit": "grunt lintStagedFiles"
},
"repository": {
Expand All @@ -48,22 +47,23 @@
"cookie-parser": "^1.3.3",
"debug": "^2.1.1",
"elasticsearch": "^5.0.0",
"expiry-js": "^0.1.7",
"express": "^4.10.6",
"glob": "^4.3.2",
"good": "^5.1.2",
"good-console": "^4.1.0",
"good-file": "^4.0.2",
"good-reporter": "^3.1.0",
"hapi": "^8.6.1",
"http-auth": "^2.2.5",
"joi": "^6.4.3",
"js-yaml": "^3.2.5",
"lodash": "^3.9.3",
"json-stringify-safe": "^5.0.1",
"lodash": "^3.9.3",
"moment": "^2.10.3",
"numeral": "^1.5.3",
"request": "^2.40.0",
"requirefrom": "^0.2.0",
"rimraf": "^2.4.0",
"semver": "^4.3.6",
"serve-favicon": "^2.2.0",
"through": "^2.3.6"
Expand Down Expand Up @@ -95,14 +95,14 @@
"husky": "^0.8.1",
"istanbul": "^0.3.15",
"jade": "^1.8.2",
"license-checker": "3.0.3",
"libesvm": "^1.0.1",
"license-checker": "^3.1.0",
"load-grunt-config": "^0.7.0",
"marked": "^0.3.3",
"marked-text-renderer": "^0.1.0",
"mkdirp": "^0.5.0",
"mocha": "^2.2.5",
"nock": "^1.6.0",
"nock": "^2.7.0",
"npm": "^2.11.0",
"opn": "^1.0.0",
"path-browserify": "0.0.0",
Expand Down
23 changes: 14 additions & 9 deletions src/kibana/components/agg_response/geo_json/rowsToFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,35 @@ define(function (require) {
var geohash = unwrap(row[geoI]);
if (!geohash) return;

// fetch latLn of northwest and southeast corners, and center point
var location = decodeGeoHash(geohash);
var center = [
location.longitude[2],
location.latitude[2]

var centerLatLng = [
location.latitude[2],
location.longitude[2]
];

// order is nw, ne, se, sw
var rectangle = [
[location.longitude[0], location.latitude[0]],
[location.longitude[1], location.latitude[0]],
[location.longitude[1], location.latitude[1]],
[location.longitude[0], location.latitude[1]]
[location.latitude[0], location.longitude[0]],
[location.latitude[0], location.longitude[1]],
[location.latitude[1], location.longitude[1]],
[location.latitude[1], location.longitude[0]],
];

// geoJson coords use LngLat, so we reverse the centerLatLng
// See here for details: http://geojson.org/geojson-spec.html#positions
features.push({
type: 'Feature',
geometry: {
type: 'Point',
coordinates: center
coordinates: centerLatLng.slice(0).reverse()
},
properties: {
geohash: geohash,
value: unwrap(row[metricI]),
aggConfigResult: getAcr(row[metricI]),
center: center,
center: centerLatLng,
rectangle: rectangle
}
});
Expand Down
12 changes: 10 additions & 2 deletions src/kibana/components/agg_table/agg_table.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ kbn-agg-table-group {
.flex(1, 1, auto);
.flex-direction(column);

&-paginated-table {
&-paginated {
.flex(1, 1, auto);
overflow: auto;

tr:hover td {
background-color: lighten(@gray-lighter, 4%);
}

.cell-hover:hover {
background-color: @gray-lighter;
}

th i.fa-sort {
color: @gray-light;
}
Expand All @@ -32,4 +40,4 @@ kbn-agg-table-group {
padding: 0;
}
}
}
}
2 changes: 1 addition & 1 deletion src/kibana/components/agg_types/buckets/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ define(function (require) {
group: 'none',
name: 'orderAgg',
title: 'Order Agg',
aggFilter: ['!percentiles', '!std_dev']
aggFilter: ['!percentiles', '!median', '!std_dev']
}
])).all[0];

Expand Down
1 change: 1 addition & 0 deletions src/kibana/components/agg_types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ define(function (require) {
Private(require('components/agg_types/metrics/count')),
Private(require('components/agg_types/metrics/avg')),
Private(require('components/agg_types/metrics/sum')),
Private(require('components/agg_types/metrics/median')),
Private(require('components/agg_types/metrics/min')),
Private(require('components/agg_types/metrics/max')),
Private(require('components/agg_types/metrics/std_deviation')),
Expand Down
29 changes: 29 additions & 0 deletions src/kibana/components/agg_types/metrics/median.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
define(function (require) {
return function AggTypeMetricMaxProvider(Private) {
var _ = require('lodash');
var MetricAggType = Private(require('components/agg_types/metrics/_metric_agg_type'));
var getResponseAggConfig = Private(require('components/agg_types/metrics/_get_response_agg_config'));
var percentiles = Private(require('components/agg_types/metrics/percentiles'));

return new MetricAggType({
name: 'median',
dslName: 'percentiles',
title: 'Median',
makeLabel: function (aggConfig) {
return 'Median ' + aggConfig.params.field.displayName;
},
params: [
{
name: 'field',
filterFieldTypes: 'number'
},
{
name: 'percents',
default: [50]
}
],
getResponseAggs: percentiles.getResponseAggs,
getValue: percentiles.getValue
});
};
});
26 changes: 15 additions & 11 deletions src/kibana/components/config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,24 @@ define(function () {
},
'timepicker:timeDefaults': {
type: 'json',
value: JSON.stringify({
from: 'now-15m',
to: 'now',
mode: 'quick'
}, null, 2)
value: [
'{',
' "from": "now-15m",',
' "to": "now",',
' "mode": "quick"',
'}'
].join('\n')
},
'timepicker:refreshIntervalDefaults': {
type: 'json',
value: JSON.stringify({
display: 'Off',
pause: false,
value: 0
}, null, 2)
value: [
'{',
' "display": "Off",',
' "pause": false,',
' "value": 0',
'}'
].join('\n')
}
};
};
});
});
Loading

0 comments on commit 0fd0505

Please sign in to comment.