mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Merge branch 'master' into feature/ingest
This commit is contained in:
commit
98f9f53008
564 changed files with 882 additions and 747 deletions
|
@ -1,10 +1,11 @@
|
|||
require('babel/register')(require('./src/optimize/babelOptions').node);
|
||||
const camelCase = require('lodash').camelCase;
|
||||
require('babel/register')(require('./src/optimize/babel_options').node);
|
||||
|
||||
module.exports = function (grunt) {
|
||||
// set the config once before calling load-grunt-config
|
||||
// and once during so that we have access to it via
|
||||
// grunt.config.get() within the config files
|
||||
var config = {
|
||||
const config = {
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
root: __dirname,
|
||||
src: __dirname + '/src',
|
||||
|
@ -12,7 +13,7 @@ module.exports = function (grunt) {
|
|||
plugins: __dirname + '/src/plugins',
|
||||
server: __dirname + '/src/server',
|
||||
target: __dirname + '/target', // location of the compressed build targets
|
||||
testUtilsDir: __dirname + '/src/testUtils',
|
||||
testUtilsDir: __dirname + '/src/test_utils',
|
||||
configFile: __dirname + '/src/config/kibana.yml',
|
||||
|
||||
karmaBrowser: (function () {
|
||||
|
|
|
@ -175,7 +175,7 @@
|
|||
"karma-mocha": "0.2.0",
|
||||
"karma-safari-launcher": "0.1.1",
|
||||
"license-checker": "3.1.0",
|
||||
"load-grunt-config": "0.7.2",
|
||||
"load-grunt-config": "0.19.1",
|
||||
"makelogs": "3.0.0-beta3",
|
||||
"marked-text-renderer": "0.1.0",
|
||||
"mocha": "2.3.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
import pkg from '../utils/packageJson';
|
||||
import Command from './Command';
|
||||
import pkg from '../utils/package_json';
|
||||
import Command from './command';
|
||||
|
||||
let argv = process.env.kbnWorkerArgv ? JSON.parse(process.env.kbnWorkerArgv) : process.argv.slice();
|
||||
let program = new Command('bin/kibana');
|
||||
|
|
|
@ -4,7 +4,7 @@ const { format: formatUrl } = require('url');
|
|||
import Hapi from 'hapi';
|
||||
const { debounce, compact, get, invoke, bindAll, once, sample, uniq } = require('lodash');
|
||||
|
||||
import Log from '../Log';
|
||||
import Log from '../log';
|
||||
import Worker from './worker';
|
||||
import BasePathProxy from './base_path_proxy';
|
||||
|
||||
|
@ -83,7 +83,7 @@ module.exports = class ClusterManager {
|
|||
|
||||
setupWatching(extraPaths) {
|
||||
const chokidar = require('chokidar');
|
||||
const fromRoot = require('../../utils/fromRoot');
|
||||
const fromRoot = require('../../utils/from_root');
|
||||
|
||||
const watchPaths = uniq(
|
||||
[
|
||||
|
|
|
@ -3,7 +3,7 @@ import cluster from 'cluster';
|
|||
let { resolve } = require('path');
|
||||
let { EventEmitter } = require('events');
|
||||
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
|
||||
let cliPath = fromRoot('src/cli');
|
||||
let baseArgs = _.difference(process.argv.slice(2), ['--no-watch']);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// load the babel options seperately so that they can modify the process.env
|
||||
// before calling babel/register
|
||||
const babelOptions = require('../optimize/babelOptions').node;
|
||||
const babelOptions = require('../optimize/babel_options').node;
|
||||
require('babel/register')(babelOptions);
|
||||
require('./cli');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import path from 'path';
|
||||
import expect from 'expect.js';
|
||||
|
||||
import fromRoot from '../../../utils/fromRoot';
|
||||
import fromRoot from '../../../utils/from_root';
|
||||
import settingParser from '../setting_parser';
|
||||
|
||||
describe('kibana cli', function () {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import fromRoot from '../../utils/fromRoot';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
import settingParser from './setting_parser';
|
||||
import installer from './plugin_installer';
|
||||
import remover from './plugin_remover';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import _ from 'lodash';
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
import pluginDownloader from './plugin_downloader';
|
||||
import pluginCleaner from './plugin_cleaner';
|
||||
import pluginExtractor from './plugin_extractor';
|
||||
import KbnServer from '../../server/KbnServer';
|
||||
import KbnServer from '../../server/kbn_server';
|
||||
import readYamlConfig from '../serve/read_yaml_config';
|
||||
import Promise from 'bluebird';
|
||||
import { sync as rimrafSync } from 'rimraf';
|
||||
|
|
|
@ -2,7 +2,7 @@ import _ from 'lodash';
|
|||
import fs from 'fs';
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
|
||||
let legacySettingMap = {
|
||||
// server
|
||||
|
|
|
@ -3,7 +3,7 @@ const { isWorker } = require('cluster');
|
|||
const { resolve } = require('path');
|
||||
|
||||
const cwd = process.cwd();
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
|
||||
let canCluster;
|
||||
try {
|
||||
|
@ -126,7 +126,7 @@ module.exports = function (program) {
|
|||
}
|
||||
|
||||
let kbnServer = {};
|
||||
const KbnServer = require('../../server/KbnServer');
|
||||
const KbnServer = require('../../server/kbn_server');
|
||||
try {
|
||||
kbnServer = new KbnServer(settings);
|
||||
await kbnServer.ready();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import TestUtilsStubIndexPatternProvider from 'testUtils/stub_index_pattern';
|
||||
import TestUtilsStubIndexPatternProvider from 'test_utils/stub_index_pattern';
|
||||
import IndexPatternsFieldTypesProvider from 'ui/index_patterns/_field_types';
|
||||
import FixturesLogstashFieldsProvider from 'fixtures/logstash_fields';
|
||||
export default function stubbedLogstashIndexPatternService(Private) {
|
||||
|
|
|
@ -4,8 +4,8 @@ import DirectoryNameAsMain from 'webpack-directory-name-as-main';
|
|||
import ExtractTextPlugin from 'extract-text-webpack-plugin';
|
||||
import CommonsChunkPlugin from 'webpack/lib/optimize/CommonsChunkPlugin';
|
||||
|
||||
import fromRoot from '../utils/fromRoot';
|
||||
import babelOptions from './babelOptions';
|
||||
import fromRoot from '../utils/from_root';
|
||||
import babelOptions from './babel_options';
|
||||
import { inherits } from 'util';
|
||||
import { defaults, transform } from 'lodash';
|
||||
import { resolve } from 'path';
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import BaseOptimizer from './BaseOptimizer';
|
||||
import fromRoot from '../utils/fromRoot';
|
||||
import BaseOptimizer from './base_optimizer';
|
||||
import fromRoot from '../utils/from_root';
|
||||
import { fromNode } from 'bluebird';
|
||||
import { writeFile } from 'fs';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import FsOptimizer from './FsOptimizer';
|
||||
import FsOptimizer from './fs_optimizer';
|
||||
module.exports = async (kbnServer, server, config) => {
|
||||
if (!config.get('optimize.enabled')) return;
|
||||
|
||||
|
|
|
@ -21,11 +21,11 @@ module.exports = async (kbnServer, server, config) => {
|
|||
*/
|
||||
switch (process.env.kbnWorkerType) {
|
||||
case 'optmzr':
|
||||
await kbnServer.mixin(require('./optmzrRole'));
|
||||
await kbnServer.mixin(require('./optmzr_role'));
|
||||
break;
|
||||
|
||||
case 'server':
|
||||
await kbnServer.mixin(require('./proxyRole'));
|
||||
await kbnServer.mixin(require('./proxy_role'));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Boom from 'boom';
|
||||
|
||||
import BaseOptimizer from '../BaseOptimizer';
|
||||
import WeirdControlFlow from './WeirdControlFlow';
|
||||
import BaseOptimizer from '../base_optimizer';
|
||||
import WeirdControlFlow from './weird_control_flow';
|
||||
import { once, pick, size } from 'lodash';
|
||||
import { join } from 'path';
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import LazyServer from './LazyServer';
|
||||
import LazyOptimizer from './LazyOptimizer';
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import LazyServer from './lazy_server';
|
||||
import LazyOptimizer from './lazy_optimizer';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
|
||||
export default async (kbnServer, kibanaHapiServer, config) => {
|
||||
let server = new LazyServer(
|
|
@ -3,7 +3,7 @@ module.exports = (kibana) => {
|
|||
return new kibana.Plugin({
|
||||
uiExports: {
|
||||
spyModes: [
|
||||
'plugins/devMode/visDebugSpyPanel'
|
||||
'plugins/dev_mode/vis_debug_spy_panel'
|
||||
]
|
||||
}
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "devMode",
|
||||
"name": "dev_mode",
|
||||
"version": "1.0.0"
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import visDebugSpyPanelTemplate from 'plugins/devMode/visDebugSpyPanel.html';
|
||||
import visDebugSpyPanelTemplate from 'plugins/dev_mode/vis_debug_spy_panel.html';
|
||||
// register the spy mode or it won't show up in the spys
|
||||
require('ui/registry/spy_modes').register(VisDetailsSpyProvider);
|
||||
|
|
@ -3,7 +3,7 @@ import Promise from 'bluebird';
|
|||
import sinon from 'sinon';
|
||||
import url from 'url';
|
||||
|
||||
import serverConfig from '../../../../../test/serverConfig';
|
||||
import serverConfig from '../../../../../test/server_config';
|
||||
import checkEsVersion from '../check_es_version';
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
|
|
|
@ -6,7 +6,7 @@ import url from 'url';
|
|||
const NoConnections = require('elasticsearch').errors.NoConnections;
|
||||
|
||||
import healthCheck from '../health_check';
|
||||
import serverConfig from '../../../../../test/serverConfig';
|
||||
import serverConfig from '../../../../../test/server_config';
|
||||
|
||||
const esPort = serverConfig.servers.elasticsearch.port;
|
||||
const esUrl = url.format(serverConfig.servers.elasticsearch);
|
||||
|
|
|
@ -3,11 +3,11 @@ import expect from 'expect.js';
|
|||
import sinon from 'sinon';
|
||||
|
||||
import isUpgradeable from '../is_upgradeable';
|
||||
import pkg from '../../../../utils/packageJson';
|
||||
import pkg from '../../../../utils/package_json';
|
||||
let version = pkg.version;
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
describe('lib/isUpgradeable', function () {
|
||||
describe('lib/is_upgradeable', function () {
|
||||
let server = {
|
||||
config: _.constant({
|
||||
get: function (key) {
|
||||
|
|
|
@ -2,7 +2,7 @@ import angular from 'angular';
|
|||
import _ from 'lodash';
|
||||
import sinon from 'auto-release-sinon';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import $ from 'jquery';
|
||||
import 'ui/render_directive';
|
||||
import 'plugins/kbn_doc_views/views/table';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/VislibVisType';
|
||||
import VisSchemasProvider from 'ui/Vis/Schemas';
|
||||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/vislib_vis_type';
|
||||
import VisSchemasProvider from 'ui/vis/schemas';
|
||||
import areaTemplate from 'plugins/kbn_vislib_vis_types/editors/area.html';
|
||||
|
||||
export default function HistogramVisType(Private) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/VislibVisType';
|
||||
import VisSchemasProvider from 'ui/Vis/Schemas';
|
||||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/vislib_vis_type';
|
||||
import VisSchemasProvider from 'ui/vis/schemas';
|
||||
import histogramTemplate from 'plugins/kbn_vislib_vis_types/editors/histogram.html';
|
||||
|
||||
export default function HistogramVisType(Private) {
|
||||
|
|
|
@ -3,4 +3,4 @@ visTypes.register(require('plugins/kbn_vislib_vis_types/histogram'));
|
|||
visTypes.register(require('plugins/kbn_vislib_vis_types/line'));
|
||||
visTypes.register(require('plugins/kbn_vislib_vis_types/pie'));
|
||||
visTypes.register(require('plugins/kbn_vislib_vis_types/area'));
|
||||
visTypes.register(require('plugins/kbn_vislib_vis_types/tileMap'));
|
||||
visTypes.register(require('plugins/kbn_vislib_vis_types/tile_map'));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/VislibVisType';
|
||||
import VisSchemasProvider from 'ui/Vis/Schemas';
|
||||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/vislib_vis_type';
|
||||
import VisSchemasProvider from 'ui/vis/schemas';
|
||||
import lineTemplate from 'plugins/kbn_vislib_vis_types/editors/line.html';
|
||||
|
||||
export default function HistogramVisType(Private) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/VislibVisType';
|
||||
import VisSchemasProvider from 'ui/Vis/Schemas';
|
||||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/vislib_vis_type';
|
||||
import VisSchemasProvider from 'ui/vis/schemas';
|
||||
import pieTemplate from 'plugins/kbn_vislib_vis_types/editors/pie.html';
|
||||
|
||||
export default function HistogramVisType(Private) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import _ from 'lodash';
|
||||
import supports from 'ui/utils/supports';
|
||||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/VislibVisType';
|
||||
import VisSchemasProvider from 'ui/Vis/Schemas';
|
||||
import VislibVisTypeVislibVisTypeProvider from 'ui/vislib_vis_type/vislib_vis_type';
|
||||
import VisSchemasProvider from 'ui/vis/schemas';
|
||||
import AggResponseGeoJsonGeoJsonProvider from 'ui/agg_response/geo_json/geo_json';
|
||||
import FilterBarPushFilterProvider from 'ui/filter_bar/push_filter';
|
||||
import tileMapTemplate from 'plugins/kbn_vislib_vis_types/editors/tile_map.html';
|
|
@ -1,4 +1,5 @@
|
|||
import ingest from './server/routes/api/ingest';
|
||||
import search from './server/routes/api/search';
|
||||
|
||||
module.exports = function (kibana) {
|
||||
return new kibana.Plugin({
|
||||
|
@ -38,6 +39,7 @@ module.exports = function (kibana) {
|
|||
|
||||
init: function (server, options) {
|
||||
ingest(server);
|
||||
search(server);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import Binder from 'ui/Binder';
|
||||
import Binder from 'ui/binder';
|
||||
import 'gridster';
|
||||
import uiModules from 'ui/modules';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import angular from 'angular';
|
||||
import ConfigTemplate from 'ui/ConfigTemplate';
|
||||
import ConfigTemplate from 'ui/config_template';
|
||||
import chrome from 'ui/chrome';
|
||||
import 'ui/directives/config';
|
||||
import 'ui/courier';
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import sinon from 'auto-release-sinon';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import expect from 'expect.js';
|
||||
import $ from 'jquery';
|
||||
import 'ui/private';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import fieldCalculator from 'plugins/kibana/discover/components/field_chooser/lib/field_calculator';
|
||||
import expect from 'expect.js';
|
||||
import 'ui/private';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import angular from 'angular';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import _ from 'lodash';
|
||||
import sinon from 'auto-release-sinon';
|
||||
import expect from 'expect.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import expect from 'expect.js';
|
||||
import PluginsKibanaDiscoverHitSortFnProvider from 'plugins/kibana/discover/_hit_sort_fn';
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
import moment from 'moment';
|
||||
import ConfigTemplate from 'ui/ConfigTemplate';
|
||||
import ConfigTemplate from 'ui/config_template';
|
||||
import getSort from 'ui/doc_table/lib/get_sort';
|
||||
import rison from 'ui/utils/rison';
|
||||
import dateMath from 'ui/utils/dateMath';
|
||||
import dateMath from 'ui/utils/date_math';
|
||||
import 'ui/doc_table';
|
||||
import 'ui/visualize';
|
||||
import 'ui/notify';
|
||||
import 'ui/fixedScroll';
|
||||
import 'ui/fixed_scroll';
|
||||
import 'ui/directives/validate_json';
|
||||
import 'ui/filters/moment';
|
||||
import 'ui/courier';
|
||||
|
@ -17,7 +17,7 @@ import 'ui/state_management/app_state';
|
|||
import 'ui/timefilter';
|
||||
import 'ui/highlight/highlight_tags';
|
||||
import 'ui/share';
|
||||
import VisProvider from 'ui/Vis';
|
||||
import VisProvider from 'ui/vis';
|
||||
import DocTitleProvider from 'ui/doc_title';
|
||||
import UtilsBrushEventProvider from 'ui/utils/brush_event';
|
||||
import PluginsKibanaDiscoverHitSortFnProvider from 'plugins/kibana/discover/_hit_sort_fn';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Load the kibana app dependencies.
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import expect from 'expect.js';
|
||||
import 'plugins/kibana/doc/index';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
|
|
|
@ -20,7 +20,7 @@ uiRoutes
|
|||
redirectTo: '/settings/indices'
|
||||
});
|
||||
|
||||
require('ui/index_patterns/routeSetup/loadDefault')({
|
||||
require('ui/index_patterns/route_setup/load_default')({
|
||||
notRequiredRe: /^\/settings\//,
|
||||
whenMissingRedirectTo: '/settings/indices'
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import $ from 'jquery';
|
||||
import 'plugins/kibana/visualize/editor/agg';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import VisAggConfigProvider from 'ui/Vis/AggConfig';
|
||||
import VisAggConfigProvider from 'ui/vis/agg_config';
|
||||
import uiModules from 'ui/modules';
|
||||
import aggAddTemplate from 'plugins/kibana/visualize/editor/agg_add.html';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import IndexedArray from 'ui/IndexedArray';
|
||||
import IndexedArray from 'ui/indexed_array';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import aggSelectHtml from 'plugins/kibana/visualize/editor/agg_select.html';
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'ui/visualize';
|
|||
import 'ui/collapsible_sidebar';
|
||||
import 'ui/share';
|
||||
import angular from 'angular';
|
||||
import ConfigTemplate from 'ui/ConfigTemplate';
|
||||
import ConfigTemplate from 'ui/config_template';
|
||||
import Notifier from 'ui/notify/notifier';
|
||||
import RegistryVisTypesProvider from 'ui/registry/vis_types';
|
||||
import DocTitleProvider from 'ui/doc_title';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import VisProvider from 'ui/Vis';
|
||||
import VisProvider from 'ui/vis';
|
||||
import uiModules from 'ui/modules';
|
||||
uiModules
|
||||
.get('app/visualize')
|
||||
|
|
|
@ -7,9 +7,10 @@ module.exports = function registerDelete(server) {
|
|||
path: '/api/kibana/ingest/{id}',
|
||||
method: 'DELETE',
|
||||
handler: function (req, reply) {
|
||||
const kibanaIndex = server.config().get('kibana.index');
|
||||
const callWithRequest = server.plugins.elasticsearch.callWithRequest;
|
||||
const deletePatternParams = {
|
||||
index: '.kibana',
|
||||
index: kibanaIndex,
|
||||
type: 'index-pattern',
|
||||
id: req.params.id
|
||||
};
|
||||
|
|
|
@ -7,52 +7,53 @@ import initDefaultFieldProps from '../../../lib/init_default_field_props';
|
|||
import {ingestToPattern, patternToIngest} from '../../../../common/lib/convert_pattern_and_ingest_name';
|
||||
import { keysToCamelCaseShallow } from '../../../../common/lib/case_conversion';
|
||||
|
||||
function patternRollback(rootError, indexPatternId, boundCallWithRequest) {
|
||||
const deleteParams = {
|
||||
index: '.kibana',
|
||||
type: 'index-pattern',
|
||||
id: indexPatternId
|
||||
};
|
||||
module.exports = function registerPost(server) {
|
||||
const kibanaIndex = server.config().get('kibana.index');
|
||||
|
||||
return boundCallWithRequest('delete', deleteParams)
|
||||
.then(
|
||||
() => {
|
||||
throw rootError;
|
||||
},
|
||||
(patternDeletionError) => {
|
||||
throw new Error(
|
||||
`index-pattern ${indexPatternId} created successfully but index template or pipeline
|
||||
function patternRollback(rootError, indexPatternId, boundCallWithRequest) {
|
||||
const deleteParams = {
|
||||
index: kibanaIndex,
|
||||
type: 'index-pattern',
|
||||
id: indexPatternId
|
||||
};
|
||||
|
||||
return boundCallWithRequest('delete', deleteParams)
|
||||
.then(
|
||||
() => {
|
||||
throw rootError;
|
||||
},
|
||||
(patternDeletionError) => {
|
||||
throw new Error(
|
||||
`index-pattern ${indexPatternId} created successfully but index template or pipeline
|
||||
creation failed. Failed to rollback index-pattern creation, must delete manually.
|
||||
${patternDeletionError.toString()}
|
||||
${rootError.toString()}`
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function templateRollback(rootError, templateName, boundCallWithRequest) {
|
||||
const deleteParams = {
|
||||
name: templateName
|
||||
};
|
||||
function templateRollback(rootError, templateName, boundCallWithRequest) {
|
||||
const deleteParams = {
|
||||
name: templateName
|
||||
};
|
||||
|
||||
return boundCallWithRequest('indices.deleteTemplate', deleteParams)
|
||||
.then(
|
||||
() => {
|
||||
throw rootError;
|
||||
},
|
||||
(templateDeletionError) => {
|
||||
throw new Error(
|
||||
`index template ${templateName} created successfully but pipeline
|
||||
return boundCallWithRequest('indices.deleteTemplate', deleteParams)
|
||||
.then(
|
||||
() => {
|
||||
throw rootError;
|
||||
},
|
||||
(templateDeletionError) => {
|
||||
throw new Error(
|
||||
`index template ${templateName} created successfully but pipeline
|
||||
creation failed. Failed to rollback template creation, must delete manually.
|
||||
${templateDeletionError.toString()}
|
||||
${rootError.toString()}`
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
module.exports = function registerPost(server) {
|
||||
server.route({
|
||||
path: '/api/kibana/ingest',
|
||||
method: 'POST',
|
||||
|
@ -82,7 +83,7 @@ module.exports = function registerPost(server) {
|
|||
|
||||
// Set up call with request params
|
||||
const patternCreateParams = {
|
||||
index: '.kibana',
|
||||
index: kibanaIndex,
|
||||
type: 'index-pattern',
|
||||
id: indexPatternId,
|
||||
body: indexPattern
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
import _ from 'lodash';
|
||||
import handleESError from '../../../../lib/handle_es_error';
|
||||
|
||||
export default function registerCount(server) {
|
||||
server.route({
|
||||
path: '/api/kibana/{id}/_count',
|
||||
method: ['POST', 'GET'],
|
||||
handler: function (req, reply) {
|
||||
const boundCallWithRequest = _.partial(server.plugins.elasticsearch.callWithRequest, req);
|
||||
|
||||
boundCallWithRequest('count', {
|
||||
allowNoIndices: false,
|
||||
index: req.params.id
|
||||
})
|
||||
.then(
|
||||
function (res) {
|
||||
reply({count: res.count});
|
||||
},
|
||||
function (error) {
|
||||
reply(handleESError(error));
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
5
src/plugins/kibana/server/routes/api/search/index.js
Normal file
5
src/plugins/kibana/server/routes/api/search/index.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import registerCount from './count/register_count';
|
||||
|
||||
export default function (server) {
|
||||
registerCount(server);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import expect from 'expect.js';
|
||||
|
||||
describe('markdown vis controller', function () {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'plugins/markdown_vis/markdown_vis.less';
|
||||
import 'plugins/markdown_vis/markdown_vis_controller';
|
||||
import TemplateVisTypeTemplateVisTypeProvider from 'ui/template_vis_type/TemplateVisType';
|
||||
import TemplateVisTypeTemplateVisTypeProvider from 'ui/template_vis_type/template_vis_type';
|
||||
import markdownVisTemplate from 'plugins/markdown_vis/markdown_vis.html';
|
||||
import markdownVisParamsTemplate from 'plugins/markdown_vis/markdown_vis_params.html';
|
||||
// we need to load the css ourselves
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import expect from 'expect.js';
|
||||
|
||||
describe('metric vis', function () {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'plugins/metric_vis/metric_vis.less';
|
||||
import 'plugins/metric_vis/metric_vis_controller';
|
||||
import TemplateVisTypeTemplateVisTypeProvider from 'ui/template_vis_type/TemplateVisType';
|
||||
import VisSchemasProvider from 'ui/Vis/Schemas';
|
||||
import TemplateVisTypeTemplateVisTypeProvider from 'ui/template_vis_type/template_vis_type';
|
||||
import VisSchemasProvider from 'ui/vis/schemas';
|
||||
import metricVisTemplate from 'plugins/metric_vis/metric_vis.html';
|
||||
import metricVisParamsTemplate from 'plugins/metric_vis/metric_vis_params.html';
|
||||
// we need to load the css ourselves
|
||||
|
|
|
@ -2,8 +2,8 @@ module.exports = function (kibana) {
|
|||
return new kibana.Plugin({
|
||||
uiExports: {
|
||||
spyModes: [
|
||||
'plugins/spyModes/tableSpyMode',
|
||||
'plugins/spyModes/reqRespStatsSpyMode'
|
||||
'plugins/spy_modes/table_spy_mode',
|
||||
'plugins/spy_modes/req_resp_stats_spy_mode'
|
||||
]
|
||||
}
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "spyModes",
|
||||
"name": "spy_modes",
|
||||
"version": "1.0.0"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import reqRespStatsHTML from 'plugins/spyModes/reqRespStatsSpyMode.html';
|
||||
import reqRespStatsHTML from 'plugins/spy_modes/req_resp_stats_spy_mode.html';
|
||||
|
||||
const linkReqRespStats = function ($scope, config) {
|
||||
$scope.$bind('req', 'searchSource.history[searchSource.history.length - 1]');
|
|
@ -2,7 +2,7 @@ import { saveAs } from '@spalger/filesaver';
|
|||
import _ from 'lodash';
|
||||
import 'ui/agg_table';
|
||||
import AggResponseTabifyTabifyProvider from 'ui/agg_response/tabify/tabify';
|
||||
import tableSpyModeTemplate from 'plugins/spyModes/tableSpyMode.html';
|
||||
import tableSpyModeTemplate from 'plugins/spy_modes/table_spy_mode.html';
|
||||
function VisSpyTableProvider(Notifier, $filter, $rootScope, config, Private) {
|
||||
const tabifyAggResponse = Private(AggResponseTabifyTabifyProvider);
|
||||
|
|
@ -3,7 +3,7 @@ module.exports = function (kibana) {
|
|||
uiExports: {
|
||||
app: {
|
||||
title: 'Server Status',
|
||||
main: 'plugins/statusPage/statusPage',
|
||||
main: 'plugins/status_page/status_page',
|
||||
hidden: true,
|
||||
url: '/status'
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "statusPage",
|
||||
"name": "status_page",
|
||||
"version": "1.0.0"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import formatNumber from './formatNumber';
|
||||
import formatNumber from './format_number';
|
||||
|
||||
module.exports = function makeChartOptions(type) {
|
||||
return {
|
|
@ -2,8 +2,8 @@ import _ from 'lodash';
|
|||
import notify from 'ui/notify';
|
||||
import $ from 'jquery';
|
||||
import 'ui/autoload/styles';
|
||||
import 'plugins/statusPage/statusPageMetric';
|
||||
import 'plugins/statusPage/statusPage.less';
|
||||
import 'plugins/status_page/status_page_metric';
|
||||
import 'plugins/status_page/status_page.less';
|
||||
|
||||
|
||||
const chrome = require('ui/chrome')
|
||||
|
@ -14,7 +14,7 @@ const chrome = require('ui/chrome')
|
|||
activeIndicatorColor: '#EFF0F2'
|
||||
}
|
||||
])
|
||||
.setRootTemplate(require('plugins/statusPage/statusPage.html'))
|
||||
.setRootTemplate(require('plugins/status_page/status_page.html'))
|
||||
.setRootController('ui', function ($http, $scope) {
|
||||
const ui = this;
|
||||
ui.loading = false;
|
|
@ -2,11 +2,11 @@ import _ from 'lodash';
|
|||
import moment from 'moment';
|
||||
import numeral from 'numeral';
|
||||
|
||||
import toTitleCase from './lib/toTitleCase';
|
||||
import formatNumber from './lib/formatNumber';
|
||||
import readStatData from './lib/readStatData';
|
||||
import toTitleCase from './lib/to_title_case';
|
||||
import formatNumber from './lib/format_number';
|
||||
import readStatData from './lib/read_stat_data';
|
||||
import uiModules from 'ui/modules';
|
||||
import statusPageMetricTemplate from 'plugins/statusPage/statusPageMetric.html';
|
||||
import statusPageMetricTemplate from 'plugins/status_page/status_page_metric.html';
|
||||
|
||||
function calcAvg(metricList, metricNumberType) {
|
||||
return metricList.map(function (data) {
|
|
@ -1,10 +1,10 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import sinon from 'auto-release-sinon';
|
||||
import AggResponseTabifyTableGroupProvider from 'ui/agg_response/tabify/_table_group';
|
||||
import VisProvider from 'ui/Vis';
|
||||
import VisProvider from 'ui/vis';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
describe('Integration', function () {
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ngMock';
|
||||
import ngMock from 'ng_mock';
|
||||
import sinon from 'auto-release-sinon';
|
||||
import tabifyPm from 'ui/agg_response/tabify/tabify';
|
||||
import AggResponseTabifyTableGroupProvider from 'ui/agg_response/tabify/_table_group';
|
||||
import VisProvider from 'ui/Vis';
|
||||
import VisProvider from 'ui/vis';
|
||||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
|
||||
describe('Controller', function () {
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ import 'plugins/table_vis/table_vis_controller';
|
|||
import 'plugins/table_vis/table_vis_params';
|
||||
import 'ui/agg_table';
|
||||
import 'ui/agg_table/agg_table_group';
|
||||
import TemplateVisTypeTemplateVisTypeProvider from 'ui/template_vis_type/TemplateVisType';
|
||||
import VisSchemasProvider from 'ui/Vis/Schemas';
|
||||
import TemplateVisTypeTemplateVisTypeProvider from 'ui/template_vis_type/template_vis_type';
|
||||
import VisSchemasProvider from 'ui/vis/schemas';
|
||||
import tableVisTemplate from 'plugins/table_vis/table_vis.html';
|
||||
// we need to load the css ourselves
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"name": "testsBundle",
|
||||
"version": "0.0.0"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
import { chain, memoize } from 'lodash';
|
||||
import { resolve } from 'path';
|
||||
import { map, fromNode } from 'bluebird';
|
|
@ -1,6 +1,7 @@
|
|||
import { union } from 'lodash';
|
||||
import findSourceFiles from './findSourceFiles';
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
|
||||
import findSourceFiles from './find_source_files';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
|
||||
export default (kibana) => {
|
||||
return new kibana.Plugin({
|
||||
|
@ -18,7 +19,7 @@ export default (kibana) => {
|
|||
let config = kibana.config;
|
||||
|
||||
const testGlobs = ['src/ui/public/**/*.js'];
|
||||
const testingPluginId = config.get('testsBundle.pluginId');
|
||||
const testingPluginId = config.get('tests_bundle.pluginId');
|
||||
|
||||
if (testingPluginId) {
|
||||
const plugin = plugins.byId[testingPluginId];
|
||||
|
@ -48,7 +49,7 @@ export default (kibana) => {
|
|||
const testFiles = await findSourceFiles(testGlobs);
|
||||
for (let f of testFiles) modules.push(f);
|
||||
|
||||
if (config.get('testsBundle.instrument')) {
|
||||
if (config.get('tests_bundle.instrument')) {
|
||||
env.addPostLoader({
|
||||
test: /\.jsx?$/,
|
||||
exclude: /[\/\\](__tests__|node_modules|bower_components|webpackShims)[\/\\]/,
|
||||
|
@ -59,15 +60,15 @@ export default (kibana) => {
|
|||
return new UiBundle({
|
||||
id: 'tests',
|
||||
modules: modules,
|
||||
template: require('./testsEntryTemplate'),
|
||||
template: require('./tests_entry_template'),
|
||||
env: env
|
||||
});
|
||||
},
|
||||
|
||||
modules: {
|
||||
ngMock$: fromRoot('src/plugins/devMode/public/ngMock'),
|
||||
ng_mock$: fromRoot('src/plugins/dev_mode/public/ng_mock'),
|
||||
fixtures: fromRoot('src/fixtures'),
|
||||
testUtils: fromRoot('src/testUtils'),
|
||||
test_utils: fromRoot('src/test_utils'),
|
||||
'angular-mocks': {
|
||||
path: require.resolve('angular-mocks'),
|
||||
imports: 'angular'
|
4
src/plugins/tests_bundle/package.json
Normal file
4
src/plugins/tests_bundle/package.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "tests_bundle",
|
||||
"version": "0.0.0"
|
||||
}
|
|
@ -31,9 +31,9 @@ window.__KBN__ = {
|
|||
}
|
||||
};
|
||||
|
||||
require('ui/testHarness');
|
||||
require('ui/test_harness');
|
||||
${requires}
|
||||
require('ui/testHarness').bootstrap(/* go! */);
|
||||
require('ui/test_harness').bootstrap(/* go! */);
|
||||
|
||||
`;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import deepCloneWithBuffers from '../deepCloneWithBuffers';
|
||||
import deepCloneWithBuffers from '../deep_clone_with_buffers';
|
||||
import expect from 'expect.js';
|
||||
|
||||
describe('deepCloneWithBuffers()', function () {
|
|
@ -1,4 +1,4 @@
|
|||
import explodeBy from '../explodeBy';
|
||||
import explodeBy from '../explode_by';
|
||||
import expect from 'expect.js';
|
||||
|
||||
describe('explode_by(dot, flatObject)', function () {
|
|
@ -1,4 +1,4 @@
|
|||
import flattenWith from '../flattenWith';
|
||||
import flattenWith from '../flatten_with';
|
||||
import expect from 'expect.js';
|
||||
|
||||
describe('flatten_with(dot, nestedObj)', function () {
|
|
@ -3,8 +3,8 @@ import Joi from 'joi';
|
|||
import _ from 'lodash';
|
||||
import override from './override';
|
||||
import createDefaultSchema from './schema';
|
||||
import pkg from '../../utils/packageJson';
|
||||
import clone from './deepCloneWithBuffers';
|
||||
import pkg from '../../utils/package_json';
|
||||
import clone from './deep_clone_with_buffers';
|
||||
import { zipObject } from 'lodash';
|
||||
|
||||
const schema = Symbol('Joi Schema');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
import flattenWith from './flattenWith';
|
||||
import explodeBy from './explodeBy';
|
||||
import flattenWith from './flatten_with';
|
||||
import explodeBy from './explode_by';
|
||||
|
||||
module.exports = function (target, source) {
|
||||
var _target = flattenWith('.', target);
|
||||
|
|
|
@ -4,7 +4,7 @@ import path from 'path';
|
|||
import { get } from 'lodash';
|
||||
import { randomBytes } from 'crypto';
|
||||
|
||||
import fromRoot from '../../utils/fromRoot';
|
||||
import fromRoot from '../../utils/from_root';
|
||||
|
||||
module.exports = () => Joi.object({
|
||||
pkg: Joi.object({
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue