mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Merge branch 'master' of github.com:elastic/kibana into implement/npmCleanTask
This commit is contained in:
commit
4e9e30c7d3
44 changed files with 202 additions and 168 deletions
76
.eslintrc
76
.eslintrc
|
@ -1,76 +1,2 @@
|
|||
---
|
||||
parser: babel-eslint
|
||||
|
||||
plugins:
|
||||
- mocha
|
||||
|
||||
env:
|
||||
es6: true
|
||||
amd: true
|
||||
node: true
|
||||
mocha: true
|
||||
browser: true
|
||||
|
||||
|
||||
rules:
|
||||
block-scoped-var: 2
|
||||
camelcase: [ 2, { properties: never } ]
|
||||
comma-dangle: 0
|
||||
comma-style: [ 2, last ]
|
||||
consistent-return: 0
|
||||
curly: [ 2, multi-line ]
|
||||
dot-location: [ 2, property ]
|
||||
dot-notation: [ 2, { allowKeywords: true } ]
|
||||
eqeqeq: [ 2, allow-null ]
|
||||
guard-for-in: 2
|
||||
indent: [ 2, 2, { SwitchCase: 1 } ]
|
||||
key-spacing: [ 0, { align: value } ]
|
||||
max-len: [ 2, 140, 2, { ignoreComments: true, ignoreUrls: true } ]
|
||||
new-cap: [ 2, { capIsNewExceptions: [ Private ] } ]
|
||||
no-bitwise: 0
|
||||
no-caller: 2
|
||||
no-cond-assign: 0
|
||||
no-const-assign: 2
|
||||
no-debugger: 2
|
||||
no-empty: 2
|
||||
no-eval: 2
|
||||
no-extend-native: 2
|
||||
no-extra-parens: 0
|
||||
no-irregular-whitespace: 2
|
||||
no-iterator: 2
|
||||
no-loop-func: 2
|
||||
no-multi-spaces: 0
|
||||
no-multi-str: 2
|
||||
no-nested-ternary: 2
|
||||
no-new: 0
|
||||
no-path-concat: 0
|
||||
no-proto: 2
|
||||
no-return-assign: 0
|
||||
no-script-url: 2
|
||||
no-sequences: 2
|
||||
no-shadow: 0
|
||||
no-trailing-spaces: 2
|
||||
no-undef: 2
|
||||
no-underscore-dangle: 0
|
||||
no-unused-expressions: 0
|
||||
no-unused-vars: 0
|
||||
no-use-before-define: [ 2, nofunc ]
|
||||
no-with: 2
|
||||
one-var: [ 2, never ]
|
||||
quotes: [ 2, single ]
|
||||
semi-spacing: [ 2, { before: false, after: true } ]
|
||||
semi: [ 2, always ]
|
||||
space-after-keywords: [ 2, always ]
|
||||
space-before-blocks: [ 2, always ]
|
||||
space-before-function-paren: [ 2, { anonymous: always, named: never } ]
|
||||
space-in-parens: [ 2, never ]
|
||||
space-infix-ops: [ 2, { int32Hint: false } ]
|
||||
space-return-throw-case: [ 2 ]
|
||||
space-unary-ops: [ 2 ]
|
||||
strict: [ 2, never ]
|
||||
valid-typeof: 2
|
||||
wrap-iife: [ 2, outside ]
|
||||
yoda: 0
|
||||
|
||||
mocha/no-exclusive-tests: 2
|
||||
mocha/handle-done-callback: 2
|
||||
extends: '@elastic/kibana'
|
||||
|
|
|
@ -1 +1 @@
|
|||
4.2.4
|
||||
4.3.0
|
||||
|
|
4
FAQ.md
4
FAQ.md
|
@ -4,10 +4,10 @@
|
|||
**A:** Kibana 4 packages are architecture specific. Ensure you are using the correct package for your architecture.
|
||||
|
||||
**Q:** Where do I go for support?
|
||||
**A:** Please join us at [discuss.elastic.co](discuss.elastic.co) with questions. Your problem might be a bug, but it might just be a misunderstanding, or feature we could improve. We're also available on Freenode in #kibana
|
||||
**A:** Please join us at [discuss.elastic.co](https://discuss.elastic.co) with questions. Your problem might be a bug, but it might just be a misunderstanding, or feature we could improve. We're also available on Freenode in #kibana
|
||||
|
||||
**Q:** Ok, we talked about it and its definitely a bug
|
||||
**A:** Doh, ok, let's get that fixed. File an issue on [github.com/elastic/kibana](github.com/elastic/kibana). I'd recommend reading the beginning of the CONTRIBUTING.md, just so you know how we'll handle the issue.
|
||||
**A:** Doh, ok, let's get that fixed. File an issue on [github.com/elastic/kibana](https://github.com/elastic/kibana). I'd recommend reading the beginning of the CONTRIBUTING.md, just so you know how we'll handle the issue.
|
||||
|
||||
### Kibana 3 Migration
|
||||
**Q:** Where is feature X that I loved from Kibana 3?
|
||||
|
|
|
@ -4,7 +4,7 @@ Kibana is an open source ([Apache Licensed](https://github.com/elastic/kibana/bl
|
|||
|
||||
## Requirements
|
||||
|
||||
- Elasticsearch version 2.2.0 or later
|
||||
- Elasticsearch master
|
||||
- Kibana binary package
|
||||
|
||||
## Installation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
You can set up Kibana and start exploring your Elasticsearch indices in minutes.
|
||||
All you need is:
|
||||
|
||||
* Elasticsearch 2.1 or later
|
||||
* Elasticsearch master
|
||||
* A modern web browser - http://www.elastic.co/subscriptions/matrix#matrix_browsers[Supported Browsers].
|
||||
* Information about your Elasticsearch installation:
|
||||
** URL of the Elasticsearch instance you want to connect to.
|
||||
|
@ -82,8 +82,8 @@ simply be the name of a single index.
|
|||
reads the index mapping to list all of the fields that contain a timestamp. If your index doesn't have time-based data,
|
||||
disable the *Index contains time-based events* option.
|
||||
+
|
||||
WARNING: Using event times to create index names is *deprecated* in this release of Kibana. Support for this functionality
|
||||
will be removed entirely in the next major Kibana release. Elasticsearch 2.1 includes sophisticated date parsing APIs that
|
||||
WARNING: Using event times to create index names is *deprecated* in this release of Kibana. Support for this functionality
|
||||
will be removed entirely in the next major Kibana release. Elasticsearch 2.1 includes sophisticated date parsing APIs that
|
||||
Kibana uses to determine date information, removing the need to specify dates in the index pattern name.
|
||||
+
|
||||
. Click *Create* to add the index pattern. This first pattern is automatically configured as the default.
|
||||
|
|
15
package.json
15
package.json
|
@ -93,8 +93,8 @@
|
|||
"commander": "2.8.1",
|
||||
"css-loader": "0.17.0",
|
||||
"d3": "3.5.6",
|
||||
"elasticsearch": "8.0.1",
|
||||
"elasticsearch-browser": "8.0.1",
|
||||
"elasticsearch": "10.1.2",
|
||||
"elasticsearch-browser": "10.1.2",
|
||||
"expiry-js": "0.1.7",
|
||||
"exports-loader": "0.6.2",
|
||||
"expose-loader": "0.7.0",
|
||||
|
@ -140,13 +140,14 @@
|
|||
"wreck": "6.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elastic/eslint-config-kibana": "0.0.2",
|
||||
"Nonsense": "0.1.2",
|
||||
"angular-mocks": "1.4.7",
|
||||
"auto-release-sinon": "1.0.3",
|
||||
"babel-eslint": "4.1.7",
|
||||
"babel-eslint": "4.1.8",
|
||||
"chokidar": "1.0.5",
|
||||
"eslint": "1.5.1",
|
||||
"eslint-plugin-mocha": "1.0.0",
|
||||
"eslint": "1.10.3",
|
||||
"eslint-plugin-mocha": "1.1.0",
|
||||
"expect.js": "0.3.1",
|
||||
"faker": "1.1.0",
|
||||
"glob": "4.5.3",
|
||||
|
@ -155,7 +156,7 @@
|
|||
"grunt-cli": "0.1.13",
|
||||
"grunt-contrib-clean": "0.6.0",
|
||||
"grunt-contrib-copy": "0.8.1",
|
||||
"grunt-esvm": "2.0.0",
|
||||
"grunt-esvm": "2.1.1",
|
||||
"grunt-karma": "0.12.0",
|
||||
"grunt-run": "0.5.0",
|
||||
"grunt-s3": "0.2.0-alpha.3",
|
||||
|
@ -187,7 +188,7 @@
|
|||
"supertest-as-promised": "2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.2.4",
|
||||
"node": "4.3.0",
|
||||
"npm": "2.14.15"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,13 @@ module.exports = class ClusterManager {
|
|||
|
||||
bindAll(this, 'onWatcherAdd', 'onWatcherError', 'onWatcherChange');
|
||||
|
||||
if (opts.watch) this.setupWatching();
|
||||
if (opts.watch) {
|
||||
this.setupWatching([
|
||||
...settings.plugins.paths,
|
||||
...settings.plugins.scanDirs
|
||||
]);
|
||||
}
|
||||
|
||||
else this.startCluster();
|
||||
}
|
||||
|
||||
|
@ -75,7 +81,7 @@ module.exports = class ClusterManager {
|
|||
}
|
||||
}
|
||||
|
||||
setupWatching() {
|
||||
setupWatching(extraPaths) {
|
||||
const chokidar = require('chokidar');
|
||||
const utils = require('requirefrom')('src/utils');
|
||||
const fromRoot = utils('fromRoot');
|
||||
|
@ -86,7 +92,7 @@ module.exports = class ClusterManager {
|
|||
'src/ui',
|
||||
'src/utils',
|
||||
'config',
|
||||
'installedPlugins'
|
||||
...extraPaths
|
||||
], {
|
||||
cwd: fromRoot('.'),
|
||||
ignored: /[\\\/](\..*|node_modules|bower_components|public|__tests__)[\\\/]/
|
||||
|
|
|
@ -4,14 +4,14 @@ import DirectoryNameAsMain from 'webpack-directory-name-as-main';
|
|||
import ExtractTextPlugin from 'extract-text-webpack-plugin';
|
||||
import CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';
|
||||
|
||||
let utils = require('requirefrom')('src/utils');
|
||||
let fromRoot = utils('fromRoot');
|
||||
import fromRoot from '../utils/fromRoot';
|
||||
import babelOptions from './babelOptions';
|
||||
import { inherits } from 'util';
|
||||
import { defaults } from 'lodash';
|
||||
import { defaults, transform } from 'lodash';
|
||||
import { resolve } from 'path';
|
||||
import { writeFile } from 'fs';
|
||||
let babelExclude = [/[\/\\](webpackShims|node_modules|bower_components)[\/\\]/];
|
||||
import pkg from '../../package.json';
|
||||
|
||||
class BaseOptimizer {
|
||||
constructor(opts) {
|
||||
|
@ -133,12 +133,20 @@ class BaseOptimizer {
|
|||
resolve: {
|
||||
extensions: ['.js', '.json', '.jsx', '.less', ''],
|
||||
postfixes: [''],
|
||||
modulesDirectories: ['webpackShims', 'node_modules'],
|
||||
modulesDirectories: ['webpackShims', 'node_modules', fromRoot('webpackShims'), fromRoot('node_modules')],
|
||||
loaderPostfixes: ['-loader', ''],
|
||||
root: fromRoot('.'),
|
||||
alias: this.env.aliases,
|
||||
unsafeCache: this.unsafeCache,
|
||||
},
|
||||
|
||||
resolveLoader: {
|
||||
alias: transform(pkg.dependencies, function (aliases, version, name) {
|
||||
if (name.endsWith('-loader')) {
|
||||
aliases[name.replace(/-loader$/, '')] = require.resolve(name);
|
||||
}
|
||||
}, {})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -12,3 +12,5 @@ exports.webpack = {
|
|||
};
|
||||
|
||||
exports.node = cloneDeep(exports.webpack);
|
||||
exports.node.optional = ['asyncToGenerator'];
|
||||
exports.node.blacklist = ['regenerator'];
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import angular from 'angular';
|
||||
import 'angular-mocks';
|
||||
import 'mocha';
|
||||
|
||||
if (angular.mocks) {
|
||||
throw new Error(
|
||||
'Don\'t require angular-mocks directly or the tests ' +
|
||||
|
|
|
@ -28,8 +28,8 @@ module.exports = function ({ Plugin }) {
|
|||
cert: string(),
|
||||
key: string()
|
||||
}).default(),
|
||||
apiVersion: string().default('2.0'),
|
||||
engineVersion: string().valid('^2.1.0').default('^2.1.0')
|
||||
apiVersion: Joi.string().default('master'),
|
||||
engineVersion: Joi.string().valid('^3.0.0').default('^3.0.0')
|
||||
}).default();
|
||||
},
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ describe('plugins/elasticsearch', function () {
|
|||
testRoute({
|
||||
method: 'POST',
|
||||
url: '/elasticsearch/_msearch?timeout=0&ignore_unavailable=true&preference=1429577952339',
|
||||
payload: '{"index":"logstash-2015.04.21","ignore_unavailable":true}\n{"size":500,"sort":{"@timestamp":"desc"},"query":{"filtered":{"query":{"query_string":{"analyze_wildcard":true,"query":"*"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1429577068175,"lte":1429577968175}}}],"must_not":[]}}}},"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30s","pre_zone":"-07:00","pre_zone_adjust_large_interval":true,"min_doc_count":0,"extended_bounds":{"min":1429577068175,"max":1429577968175}}}},"fields":["*","_source"],"script_fields":{},"fielddata_fields":["timestamp_offset","@timestamp","utc_time"]}\n' // eslint-disable-line max-len
|
||||
payload: '{"index":"logstash-2015.04.21","ignore_unavailable":true}\n{"size":500,"sort":{"@timestamp":"desc"},"query":{"bool":{"must":[{"query_string":{"analyze_wildcard":true,"query":"*"}},{"bool":{"must":[{"range":{"@timestamp":{"gte":1429577068175,"lte":1429577968175}}}],"must_not":[]}}],"must_not":[]}},"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30s","pre_zone":"-07:00","pre_zone_adjust_large_interval":true,"min_doc_count":0,"extended_bounds":{"min":1429577068175,"max":1429577968175}}}},"fields":["*","_source"],"script_fields":{},"fielddata_fields":["timestamp_offset","@timestamp","utc_time"]}\n' // eslint-disable-line max-len
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import elasticsearch from 'elasticsearch';
|
||||
import _ from 'lodash';
|
||||
import Bluebird from 'bluebird';
|
||||
const readFile = (file) => require('fs').readFileSync(file, 'utf8');
|
||||
import util from 'util';
|
||||
import url from 'url';
|
||||
|
@ -44,6 +45,9 @@ module.exports = function (server) {
|
|||
plugins: options.plugins,
|
||||
apiVersion: options.apiVersion,
|
||||
keepAlive: options.keepAlive,
|
||||
defer: function () {
|
||||
return Bluebird.defer();
|
||||
},
|
||||
log: function () {
|
||||
this.error = function (err) {
|
||||
server.log(['error', 'elasticsearch'], err);
|
||||
|
|
|
@ -56,8 +56,10 @@ export default function FieldAggParamFactory(Private) {
|
|||
var field = aggConfig.params.field;
|
||||
|
||||
if (field.scripted) {
|
||||
output.params.script = field.script;
|
||||
output.params.lang = field.lang;
|
||||
output.params.script = {
|
||||
script: field.script,
|
||||
lang: field.lang,
|
||||
};
|
||||
} else {
|
||||
output.params.field = field.name;
|
||||
}
|
||||
|
|
5
src/ui/public/chrome/directives/active_http_spinner.html
Normal file
5
src/ui/public/chrome/directives/active_http_spinner.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<ul class="nav navbar-nav navbar-right navbar-timepicker" >
|
||||
<li ng-show="chrome.httpActive.length" class="navbar-text hidden-xs">
|
||||
<div class="spinner"></div>
|
||||
</li>
|
||||
</ul>
|
|
@ -2,6 +2,12 @@ import $ from 'jquery';
|
|||
|
||||
import chromeNavControlsRegistry from 'ui/registry/chrome_nav_controls';
|
||||
import UiModules from 'ui/modules';
|
||||
import spinnerHtml from './active_http_spinner.html';
|
||||
|
||||
const spinner = {
|
||||
name: 'active http requests',
|
||||
template: spinnerHtml
|
||||
};
|
||||
|
||||
export default function (chrome, internals) {
|
||||
|
||||
|
@ -13,7 +19,7 @@ export default function (chrome, internals) {
|
|||
const parts = [$element.html()];
|
||||
const controls = Private(chromeNavControlsRegistry);
|
||||
|
||||
for (const control of controls.inOrder) {
|
||||
for (const control of [spinner, ...controls.inOrder]) {
|
||||
parts.unshift(
|
||||
`<!-- nav control ${control.name} -->`,
|
||||
control.template
|
||||
|
|
|
@ -44,7 +44,7 @@ export default function (chrome, internals) {
|
|||
onRouteChange();
|
||||
|
||||
// and some local values
|
||||
$scope.httpActive = $http.pendingRequests;
|
||||
chrome.httpActive = $http.pendingRequests;
|
||||
$scope.notifList = require('ui/notify')._notifs;
|
||||
$scope.appSwitcherTemplate = new ConfigTemplate({
|
||||
switcher: '<app-switcher></app-switcher>'
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
import ConfigValsProvider from 'ui/config/_vals';
|
||||
export default function DelayedUpdaterFactory(Private, $rootScope, Promise, Notifier) {
|
||||
import Notifier from 'ui/notify/notifier';
|
||||
|
||||
export default function DelayedUpdaterFactory(Private, $rootScope, Promise) {
|
||||
var notify = new Notifier();
|
||||
|
||||
var vals = Private(ConfigValsProvider);
|
||||
|
|
|
@ -6,16 +6,16 @@ import ConfigValsProvider from 'ui/config/_vals';
|
|||
import CourierDataSourceDocSourceProvider from 'ui/courier/data_source/doc_source';
|
||||
import uiRoutes from 'ui/routes';
|
||||
import uiModules from 'ui/modules';
|
||||
var module = uiModules.get('kibana/config', [
|
||||
'kibana/notify'
|
||||
]);
|
||||
import Notifier from 'ui/notify/notifier';
|
||||
|
||||
var module = uiModules.get('kibana/config');
|
||||
|
||||
uiRoutes.addSetupWork(function (config) {
|
||||
return config.init();
|
||||
});
|
||||
|
||||
// service for delivering config variables to everywhere else
|
||||
module.service('config', function (Private, Notifier, kbnVersion, kbnIndex, $rootScope, buildNum) {
|
||||
module.service('config', function (Private, kbnVersion, kbnIndex, $rootScope, buildNum) {
|
||||
var config = this;
|
||||
|
||||
var defaults = Private(ConfigDefaultsProvider);
|
||||
|
|
|
@ -279,9 +279,7 @@ export default function SourceAbstractFactory(Private, Promise, PromiseEmitter)
|
|||
};
|
||||
}
|
||||
|
||||
if (flatState.body.size === 0) {
|
||||
flatState.search_type = 'count';
|
||||
} else {
|
||||
if (flatState.body.size > 0) {
|
||||
var computedFields = flatState.index.getComputedFields();
|
||||
flatState.body.fields = computedFields.fields;
|
||||
flatState.body.script_fields = flatState.body.script_fields || {};
|
||||
|
@ -307,6 +305,21 @@ export default function SourceAbstractFactory(Private, Promise, PromiseEmitter)
|
|||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Translate a filter into a query to support es 3+
|
||||
* @param {Object} filter - The fitler to translate
|
||||
* @return {Object} the query version of that filter
|
||||
*/
|
||||
var translateToQuery = function (filter) {
|
||||
if (!filter) return;
|
||||
|
||||
if (filter.query) {
|
||||
return filter.query;
|
||||
}
|
||||
|
||||
return filter;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clean out any invalid attributes from the filters
|
||||
* @param {object} filter The filter to clean
|
||||
|
@ -326,19 +339,45 @@ export default function SourceAbstractFactory(Private, Promise, PromiseEmitter)
|
|||
});
|
||||
|
||||
flatState.body.query = {
|
||||
filtered: {
|
||||
query: flatState.body.query,
|
||||
filter: {
|
||||
bool: {
|
||||
must: _(flatState.filters).filter(filterNegate(false)).map(cleanFilter).value(),
|
||||
must_not: _(flatState.filters).filter(filterNegate(true)).map(cleanFilter).value()
|
||||
}
|
||||
}
|
||||
bool: {
|
||||
must: (
|
||||
[flatState.body.query].concat(
|
||||
(flatState.filters || [])
|
||||
.filter(filterNegate(false))
|
||||
.map(translateToQuery)
|
||||
.map(cleanFilter)
|
||||
)
|
||||
),
|
||||
must_not: (
|
||||
(flatState.filters || [])
|
||||
.filter(filterNegate(true))
|
||||
.map(translateToQuery)
|
||||
.map(cleanFilter)
|
||||
)
|
||||
}
|
||||
};
|
||||
}
|
||||
delete flatState.filters;
|
||||
}
|
||||
|
||||
// re-write filters within filter aggregations
|
||||
(function recurse(aggBranch) {
|
||||
if (!aggBranch) return;
|
||||
Object.keys(aggBranch).forEach(function (id) {
|
||||
const agg = aggBranch[id];
|
||||
|
||||
if (agg.filters) {
|
||||
// translate filters aggregations
|
||||
const filters = agg.filters.filters;
|
||||
|
||||
Object.keys(filters).forEach(function (filterId) {
|
||||
filters[filterId] = translateToQuery(filters[filterId]);
|
||||
});
|
||||
}
|
||||
|
||||
recurse(agg.aggs || agg.aggregations);
|
||||
});
|
||||
}(flatState.body.aggs || flatState.body.aggregations));
|
||||
}
|
||||
|
||||
return flatState;
|
||||
|
|
|
@ -15,4 +15,3 @@ export default function DecorateQuery(config) {
|
|||
return query;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ import CourierDataSourceDocSendToEsProvider from 'ui/courier/data_source/_doc_se
|
|||
import CourierDataSourceAbstractProvider from 'ui/courier/data_source/_abstract';
|
||||
import CourierFetchRequestDocProvider from 'ui/courier/fetch/request/doc';
|
||||
import CourierFetchStrategyDocProvider from 'ui/courier/fetch/strategy/doc';
|
||||
import 'ui/es';
|
||||
import 'ui/storage';
|
||||
|
||||
export default function DocSourceFactory(Private, Promise, es, sessionStorage) {
|
||||
var sendToEs = Private(CourierDataSourceDocSendToEsProvider);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default function CourierFetchNotifier(Notifier) {
|
||||
import Notifier from 'ui/notify/notifier';
|
||||
|
||||
export default function CourierFetchNotifier() {
|
||||
return new Notifier({
|
||||
location: 'Courier Fetch'
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import CourierErrorHandlersProvider from 'ui/courier/_error_handlers';
|
||||
import Notifier from 'ui/notify/notifier';
|
||||
|
||||
export default function RequestErrorHandlerFactory(Private, Notifier) {
|
||||
export default function RequestErrorHandlerFactory(Private) {
|
||||
var errHandlers = Private(CourierErrorHandlersProvider);
|
||||
|
||||
var notify = new Notifier({
|
||||
|
|
|
@ -93,8 +93,6 @@ export default function CourierSegmentedReqProvider(es, Private, Promise, Notifi
|
|||
params.body.size = self._pickSizeForIndices(indices);
|
||||
}
|
||||
|
||||
if (params.body.size === 0) params.search_type = 'count';
|
||||
|
||||
return params;
|
||||
});
|
||||
};
|
||||
|
@ -126,7 +124,6 @@ export default function CourierSegmentedReqProvider(es, Private, Promise, Notifi
|
|||
return SearchReq.prototype.complete.call(this);
|
||||
};
|
||||
|
||||
|
||||
/*********
|
||||
** SegmentedReq specific methods
|
||||
*********/
|
||||
|
|
|
@ -152,7 +152,7 @@ describe('timepicker directive', function () {
|
|||
|
||||
it('should default the interval on the courier with incorrect values', function (done) {
|
||||
// Change refresh interval and digest
|
||||
$scope.setRefreshInterval('undefined');
|
||||
$scope.setRefreshInterval();
|
||||
$elem.scope().$digest();
|
||||
expect($courier.searchLooper.loopInterval()).to.be(0);
|
||||
done();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import 'elasticsearch-browser/elasticsearch.angular.js';
|
||||
import 'elasticsearch-browser';
|
||||
import _ from 'lodash';
|
||||
import uiModules from 'ui/modules';
|
||||
|
||||
|
|
|
@ -9,7 +9,12 @@ export default function () {
|
|||
fielddataFields = _.pluck(self.fields.byType.date, 'name');
|
||||
|
||||
_.each(self.getScriptedFields(), function (field) {
|
||||
scriptFields[field.name] = { script: field.script, lang: field.lang };
|
||||
scriptFields[field.name] = {
|
||||
script: {
|
||||
script: field.script,
|
||||
lang: field.lang
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
|
@ -61,7 +61,7 @@ export default function MapperService(Private, Promise, es, config, kbnIndex) {
|
|||
return promise.then(function (indexList) {
|
||||
return es.indices.getFieldMapping({
|
||||
index: indexList,
|
||||
field: '*',
|
||||
fields: '*',
|
||||
ignoreUnavailable: _.isArray(indexList),
|
||||
allowNoIndices: false,
|
||||
includeDefaults: true
|
||||
|
|
|
@ -57,7 +57,8 @@ uiModules
|
|||
// use generic sort handler
|
||||
self.sort.getter = function (row) {
|
||||
var value = row[index];
|
||||
if (value && value.value != null) return value.value;
|
||||
if (value && value.value != null) value = value.value;
|
||||
if (typeof value === 'boolean') value = value ? 0 : 1;
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,9 +3,10 @@ import rison from 'ui/utils/rison';
|
|||
import applyDiff from 'ui/utils/diff_object';
|
||||
import qs from 'ui/utils/query_string';
|
||||
import EventsProvider from 'ui/events';
|
||||
import Notifier from 'ui/notify/notifier';
|
||||
|
||||
|
||||
export default function StateProvider(Notifier, Private, $rootScope, $location) {
|
||||
export default function StateProvider(Private, $rootScope, $location) {
|
||||
var Events = Private(EventsProvider);
|
||||
|
||||
_.class(State).inherits(Events);
|
||||
|
@ -147,4 +148,3 @@ export default function StateProvider(Notifier, Private, $rootScope, $location)
|
|||
return State;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -3,12 +3,14 @@ import angular from 'angular';
|
|||
import moment from 'moment';
|
||||
import dateMath from 'ui/utils/dateMath';
|
||||
import 'ui/state_management/global_state';
|
||||
import 'ui/config';
|
||||
import EventsProvider from 'ui/events';
|
||||
import UtilsDiffTimePickerValsProvider from 'ui/utils/diff_time_picker_vals';
|
||||
import TimefilterLibDiffTimeProvider from 'ui/timefilter/lib/diff_time';
|
||||
import TimefilterLibDiffIntervalProvider from 'ui/timefilter/lib/diff_interval';
|
||||
import uiRoutes from 'ui/routes';
|
||||
import uiModules from 'ui/modules';
|
||||
|
||||
uiRoutes
|
||||
.addSetupWork(function (timefilter) {
|
||||
return timefilter.init();
|
||||
|
@ -111,4 +113,3 @@ uiModules
|
|||
|
||||
return new Timefilter();
|
||||
});
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
|
|||
};
|
||||
|
||||
$scope.setRefreshInterval = function (interval) {
|
||||
interval = _.clone(interval);
|
||||
interval = _.clone(interval || {});
|
||||
notify.log('before: ' + interval.pause);
|
||||
interval.pause = (interval.pause == null || interval.pause === false) ? false : true;
|
||||
|
||||
|
@ -158,4 +158,3 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
|
|||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -1,14 +1,28 @@
|
|||
import Scanner from 'ui/utils/scanner';
|
||||
import expect from 'expect.js';
|
||||
import elasticsearch from 'elasticsearch-browser';
|
||||
import Bluebird from 'bluebird';
|
||||
import 'elasticsearch-browser';
|
||||
import ngMock from 'ngMock';
|
||||
import sinon from 'sinon';
|
||||
|
||||
var es = new elasticsearch.Client({
|
||||
host: 'http://localhost:9210',
|
||||
});
|
||||
|
||||
|
||||
describe('Scanner', function () {
|
||||
let es;
|
||||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
beforeEach(ngMock.inject(function (esFactory) {
|
||||
es = esFactory({
|
||||
host: 'http://localhost:9210',
|
||||
defer: function () {
|
||||
return Bluebird.defer();
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
afterEach(function () {
|
||||
es.close();
|
||||
es = null;
|
||||
});
|
||||
|
||||
describe('initialization', function () {
|
||||
it('should throw errors if missing arguments on initialization', function () {
|
||||
expect(() => new Scanner()).to.throwError();
|
||||
|
|
|
@ -30,7 +30,7 @@ define(function () {
|
|||
// check all types
|
||||
type: '*',
|
||||
// limit the response to just the _source field for each index
|
||||
field: '_source'
|
||||
fields: '_source'
|
||||
}).then(function (resp) {
|
||||
return _.keys(resp[indexName].mappings);
|
||||
});
|
||||
|
|
|
@ -36,7 +36,7 @@ class UiApp {
|
|||
getModules() {
|
||||
return _.chain([
|
||||
this.uiExports.find(_.get(this, 'spec.uses', [])),
|
||||
this.uiExports.find(['chromeNavControls', 'sledgehammers']),
|
||||
this.uiExports.find(['chromeNavControls', 'hacks']),
|
||||
])
|
||||
.flatten()
|
||||
.uniq()
|
||||
|
|
|
@ -64,7 +64,7 @@ class UiExports {
|
|||
case 'navbarExtensions':
|
||||
case 'settingsSections':
|
||||
case 'docViews':
|
||||
case 'sledgehammers':
|
||||
case 'hacks':
|
||||
return (plugin, spec) => {
|
||||
this.aliases[type] = _.union(this.aliases[type] || [], spec);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ module.exports = function (grunt) {
|
|||
|
||||
return {
|
||||
options: {
|
||||
branch: '2.1',
|
||||
branch: 'master',
|
||||
fresh: !grunt.option('esvm-no-fresh'),
|
||||
config: {
|
||||
network: {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
module.exports = function (grunt) {
|
||||
let { compact } = require('lodash');
|
||||
|
||||
grunt.registerTask('jenkins', 'Jenkins build script', function () {
|
||||
process.env.JAVA_HOME = '/usr/lib/jvm/jdk8';
|
||||
grunt.option('os-packages', true);
|
||||
|
||||
grunt.task.run(compact([
|
||||
'test',
|
||||
process.env.JOB_NAME === 'kibana_core' ? 'build' : null
|
||||
|
|
17
test/fixtures/scenario_manager.js
vendored
17
test/fixtures/scenario_manager.js
vendored
|
@ -9,7 +9,10 @@ function ScenarioManager(server) {
|
|||
// NOTE: some large sets of test data can take several minutes to load
|
||||
this.client = new elasticsearch.Client({
|
||||
host: server,
|
||||
requestTimeout: 300000
|
||||
requestTimeout: 300000,
|
||||
defer: function () {
|
||||
return Promise.defer();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -42,6 +45,18 @@ ScenarioManager.prototype.load = function (id) {
|
|||
body: body
|
||||
});
|
||||
})
|
||||
.then(function (response) {
|
||||
if (response.errors) {
|
||||
throw new Error(
|
||||
'bulk failed\n' +
|
||||
response.items
|
||||
.map(i => i[Object.keys(i)[0]].error)
|
||||
.filter(Boolean)
|
||||
.map(err => ' ' + JSON.stringify(err))
|
||||
.join('\n')
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
if (bulk.haltOnFailure === false) return;
|
||||
throw err;
|
||||
|
|
|
@ -19,14 +19,10 @@ module.exports = {
|
|||
'dynamic_templates': [{
|
||||
'string_fields': {
|
||||
'mapping': {
|
||||
'type': 'multi_field',
|
||||
'doc_values': true,
|
||||
'type': 'string',
|
||||
'index': 'analyzed',
|
||||
'omit_norms': true,
|
||||
'fields': {
|
||||
'{name}': {
|
||||
'index': 'analyzed',
|
||||
'omit_norms': true,
|
||||
'type': 'string'
|
||||
},
|
||||
'raw': {
|
||||
'index': 'not_analyzed',
|
||||
'type': 'string',
|
||||
|
@ -47,7 +43,7 @@ module.exports = {
|
|||
},
|
||||
'id': {
|
||||
'type': 'integer',
|
||||
'index': 'not_analyzed',
|
||||
'index': true,
|
||||
'include_in_all': false
|
||||
},
|
||||
'clientip': {
|
||||
|
@ -98,7 +94,7 @@ module.exports = {
|
|||
},
|
||||
'lastname': {
|
||||
'type': 'integer',
|
||||
'index': 'not_analyzed'
|
||||
'index': true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,14 +19,10 @@ module.exports = {
|
|||
'dynamic_templates': [{
|
||||
'string_fields': {
|
||||
'mapping': {
|
||||
'type': 'multi_field',
|
||||
'doc_values': true,
|
||||
'type': 'string',
|
||||
'index': 'analyzed',
|
||||
'omit_norms': true,
|
||||
'fields': {
|
||||
'{name}': {
|
||||
'index': 'analyzed',
|
||||
'omit_norms': true,
|
||||
'type': 'string'
|
||||
},
|
||||
'raw': {
|
||||
'index': 'not_analyzed',
|
||||
'type': 'string',
|
||||
|
@ -47,7 +43,7 @@ module.exports = {
|
|||
},
|
||||
'id': {
|
||||
'type': 'integer',
|
||||
'index': 'not_analyzed',
|
||||
'index': true,
|
||||
'include_in_all': false
|
||||
},
|
||||
'clientip': {
|
||||
|
@ -98,7 +94,7 @@ module.exports = {
|
|||
},
|
||||
'lastname': {
|
||||
'type': 'integer',
|
||||
'index': 'not_analyzed'
|
||||
'index': true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
3
webpackShims/elasticsearch-browser.js
Normal file
3
webpackShims/elasticsearch-browser.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
require('angular');
|
||||
module.exports = require('elasticsearch-browser/elasticsearch.angular.js');
|
||||
require('ui/modules').get('kibana', ['elasticsearch']);
|
|
@ -1,3 +1,2 @@
|
|||
require('angular');
|
||||
module.exports = require('node_modules/elasticsearch/elasticsearch.angular.min');
|
||||
require('ui/modules').get('kibana', ['elasticsearch']);
|
||||
module.exports = false;
|
||||
throw new Error('The elasticsearch npm module is not designed for use in the browser. Please use elasticsearch-browser');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue