import { uiModules } from 'ui/modules';
import 'plugins/kbn_vislib_vis_types/controls/vislib_basic_options';
import _ from 'lodash';
import AggConfigResult from 'ui/vis/agg_config_result';
import { KibanaMap } from '../../tile_map/public/kibana_map';
import ChoroplethLayer from './choropleth_layer';
import { truncatedColorMaps }  from 'ui/vislib/components/color/truncated_colormaps';
import AggResponsePointSeriesTooltipFormatterProvider from './tooltip_formatter';
import 'ui/vis/map/service_settings';


const module = uiModules.get('kibana/region_map', ['kibana']);
module.controller('KbnRegionMapController', function ($scope, $element, Private, Notifier, getAppState,
                                                       serviceSettings, config) {

  const DEFAULT_ZOOM_SETTINGS = {
    zoom: 2,
    mapCenter: [0, 0]
  };

  const tooltipFormatter = Private(AggResponsePointSeriesTooltipFormatterProvider);
  const notify = new Notifier({ location: 'Region map' });

  let kibanaMap = null;
  let choroplethLayer = null;
  const kibanaMapReady = makeKibanaMap();

  $scope.$watch('resize', () => {
    if (kibanaMap) {
      kibanaMap.resize();
    }
Example #2
0
import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import html from './doc_table.html';
import { getSort } from './lib/get_sort';
import './infinite_scroll';
import './components/table_header';
import './components/table_row';
import { dispatchRenderComplete } from 'ui/render_complete';
import { uiModules } from 'ui/modules';
import 'ui/pager_control';
import 'ui/pager';
import { getRequestInspectorStats, getResponseInspectorStats } from 'ui/courier/utils/courier_inspector_utils';

import { getLimitedSearchResultsMessage } from './doc_table_strings';

uiModules.get('app/discover')
  .directive('docTable', function (config, Notifier, getAppState, pagerFactory, $filter, courier) {
    return {
      restrict: 'E',
      template: html,
      scope: {
        sorting: '=',
        columns: '=',
        hits: '=?', // You really want either hits & indexPattern, OR searchSource
        indexPattern: '=?',
        searchSource: '=?',
        infiniteScroll: '=?',
        filter: '=?',
        filters: '=?',
        minimumVisibleRows: '=?',
        onAddColumn: '=?',
Example #3
0
// add a dependency to all of the subsection routes
uiRoutes
  .defaults(/management\/kibana\/(index_patterns|index_pattern)/, {
    resolve: indexPatternsResolutions,
    requireUICapability: 'management.kibana.index_patterns',
  });

uiRoutes
  .when('/management/kibana/index_patterns', {
    template: indexPatternListTemplate,
    k7Breadcrumbs: getListBreadcrumbs
  });

// wrapper directive, which sets some global stuff up like the left nav
uiModules.get('apps/management')
  .directive('kbnManagementIndexPatterns', function ($route, config, kbnUrl, Private) {
    return {
      restrict: 'E',
      transclude: true,
      template: indexTemplate,
      link: async function ($scope) {
        const indexPatternListProvider = Private(IndexPatternListFactory)();
        const indexPatternCreationProvider = Private(IndexPatternCreationFactory)();
        const indexPatternCreationOptions = await indexPatternCreationProvider.getIndexPatternCreationOptions((url) => {
          $scope.$evalAsync(() => kbnUrl.change(url));
        });

        const renderList = () => {
          $scope.indexPatternList = $route.current.locals.indexPatterns.map(pattern => {
            const id = pattern.id;
Example #4
0
  createInitialQueryParametersState,
  QueryParameterActionsProvider,
  QUERY_PARAMETER_KEYS,
} from './query_parameters';
import {
  createInitialLoadingStatusState,
  FAILURE_REASONS,
  LOADING_STATUS,
  QueryActionsProvider,
} from './query';
import { timefilter } from 'ui/timefilter';

const module = uiModules.get('apps/context', [
  'elasticsearch',
  'kibana',
  'kibana/config',
  'kibana/notify',
  'ngRoute',
]);

module.directive('contextApp', function ContextApp() {
  return {
    bindToController: true,
    controller: callAfterBindingsWorkaround(ContextAppController),
    controllerAs: 'contextApp',
    restrict: 'E',
    scope: {
      anchorType: '=',
      anchorId: '=',
      columns: '=',
      indexPattern: '=',
Example #5
0
import './angular-venn-simple.js';
import gws from './graphClientWorkspace.js';
import utils from './utils.js';
import { SavedWorkspacesProvider } from './services/saved_workspaces';
import {
  iconChoices,
  colorChoices,
  iconChoicesByClass,
  drillDownIconChoices,
  drillDownIconChoicesByClass
} from './style_choices';
import {
  getOutlinkEncoders,
} from './services/outlink_encoders';

const app = uiModules.get('app/graph');

function checkLicense(Private, Promise, kbnBaseUrl) {
  const xpackInfo = Private(XPackInfoProvider);
  const licenseAllowsToShowThisPage = xpackInfo.get('features.graph.showAppLink') && xpackInfo.get('features.graph.enableAppLink');
  if (!licenseAllowsToShowThisPage) {
    const message = xpackInfo.get('features.graph.message');
    const newUrl = addAppRedirectMessageToUrl(chrome.addBasePath(kbnBaseUrl), message);
    window.location.href = newUrl;
    return Promise.halt();
  }

  return Promise.resolve();
}

app.directive('focusOn', function () {
Example #6
0
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import { uiModules } from 'ui/modules';
import contextLoadingButtonTemplate from './loading_button.html';


const module = uiModules.get('apps/context', [
  'kibana',
  'ngRoute',
]);

module.directive('contextLoadingButton', function ContextLoadingButton() {
  return {
    replace: true,
    restrict: 'E',
    scope: {
      isDisabled: '=',
      icon: '=',
    },
    template: contextLoadingButtonTemplate,
    transclude: true,
  };
});
Example #7
0
 * ownership. Elasticsearch B.V. licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import { uiModules } from 'ui/modules';
import { metadata } from 'ui/metadata';
import {
  I18nProvider,
  i18nFilter,
  i18nDirective,
} from '@kbn/i18n/angular';

uiModules.get('i18n')
  .provider('i18n', I18nProvider)
  .filter('i18n', i18nFilter)
  .directive('i18nId', i18nDirective)
  .config((i18nProvider) => {
    i18nProvider.init(metadata.translations);
  });
Example #8
0
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import { uiModules } from 'ui/modules';
import template from './event_output.html';
import './event_output.less';
import 'ace';

const app = uiModules.get('xpack/grokdebugger');

app.directive('eventOutput', function () {
  return {
    restrict: 'E',
    template: template,
    scope: {
      structuredEvent: '='
    },
    bindToController: true,
    controllerAs: 'eventOutput',
    controller: class EventOutputController {
      constructor($scope) {
        $scope.aceLoaded = (editor) => {
          this.editor = editor;
          editor.getSession().setUseWrapMode(true);
          editor.setOptions({
            readOnly: true,
            highlightActiveLine: false,
            highlightGutterLine: false,
Example #9
0
const emsServiceSettings = new Promise((resolve) => {
  uiModules.get('kibana').run(($injector) => {
    const serviceSttings = $injector.get('serviceSettings');
    resolve(serviceSttings);
  });
});
Example #10
0
import { uiModules } from 'ui/modules';
import watcherWizardElasticAction from './watcher_wizard_elastic_action';

const module = uiModules.get('apps/sentinl');
module.directive('watcherWizardElasticAction', watcherWizardElasticAction);
Example #11
0
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import React, { Fragment } from 'react';
import { render } from 'react-dom';
import moment from 'moment';
import { uiModules } from 'ui/modules';
import { timefilter } from 'ui/timefilter';
import { MonitoringTimeseriesContainer } from '../../components/chart/monitoring_timeseries_container';
import { EuiSpacer } from '@elastic/eui';
import { I18nContext } from 'ui/i18n';

const uiModule = uiModules.get('plugins/monitoring/directives', []);
uiModule.directive('monitoringChart', () => {
  return {
    restrict: 'E',
    scope: {
      series: '='
    },
    link(scope, $elem) {
      function onBrush({ xaxis }) {
        timefilter.setTime({
          from: moment(xaxis.from),
          to: moment(xaxis.to),
          mode: 'absolute'
        });
      }
Example #12
0
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import { uiModules } from 'ui/modules';
import wmsOptionsTemplate from './wms_options.html';
const module = uiModules.get('kibana');

module.directive('wmsOptions', function (serviceSettings) {
  return {
    restrict: 'E',
    template: wmsOptionsTemplate,
    replace: true,
    scope: {
      options: '='
    },
    link: function ($scope) {

      $scope.options.baseLayersAreLoaded = new Promise((resolve, reject) => {

        serviceSettings
          .getTMSServices()
Example #13
0
import 'ui/field_format_editor';
import 'angular-bootstrap-colorpicker';
import 'angular-bootstrap-colorpicker/css/colorpicker.css';
import _ from 'lodash';
import { RegistryFieldFormatsProvider } from 'ui/registry/field_formats';
import { IndexPatternsFieldProvider } from 'ui/index_patterns/_field';
import { uiModules } from 'ui/modules';
import fieldEditorTemplate from 'ui/field_editor/field_editor.html';
import '../directives/documentation_href';
import './field_editor.less';
import { GetEnabledScriptingLanguagesProvider, getSupportedScriptingLanguages } from '../scripting_languages';
import { getKbnTypeNames } from '../../../utils';

uiModules
.get('kibana', ['colorpicker.module'])
.directive('fieldEditor', function (Private, $sce, confirmModal, config) {
  const getConfig = (...args) => config.get(...args);
  const fieldFormats = Private(RegistryFieldFormatsProvider);
  const Field = Private(IndexPatternsFieldProvider);
  const getEnabledScriptingLanguages = Private(GetEnabledScriptingLanguagesProvider);

  const fieldTypesByLang = {
    painless: ['number', 'string', 'date', 'boolean'],
    expression: ['number'],
    default: getKbnTypeNames()
  };

  return {
    restrict: 'E',
    template: fieldEditorTemplate,
    scope: {
Example #14
0

import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';

import React from 'react';

import {
  EuiFlexGroup,
  EuiFlexItem,
  EuiProgress,
  EuiText,
  EuiToolTip,
} from '@elastic/eui';

const module = uiModules.get('discover/field_chooser');

function StringFieldProgressBar(props) {
  return (
    <EuiToolTip
      anchorClassName="dscProgressBarTooltip__anchor"
      content={props.count}
      delay="regular"
      position="right"
    >
      <EuiFlexGroup
        alignItems="center"
      >
        <EuiFlexItem>
          <EuiProgress
            value={props.percent}
Example #15
0
// copy of Kibana's ui/public/paginated_table/paginated_table.js
// but with the one-time binding removed from the scope columns object
// in the paginated_table.html template, to allow dynamic changes to
// the list of columns shown in the table.

import './row';

import './styles/main.less';
import 'ui/directives/paginate';
import 'ui/styles/pagination.less';
import _ from 'lodash';
import template from './paginated_table.html';

import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml');

module.directive('mlPaginatedTable', function ($filter) {
  const orderBy = $filter('orderBy');

  return {
    restrict: 'E',
    template,
    transclude: true,
    scope: {
      rows: '=',
      columns: '=',
      perPage: '=?',
      sortHandler: '=?',
      showSelector: '=?'
    },
/*
 * Wazuh app - File for data handler factory definitions
 * Copyright (C) 2018 Wazuh, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Find more information about this on the LICENSE file.
 */
import { uiModules } from 'ui/modules'

const app = uiModules.get('app/wazuh', []);

/**
 * Main function to build a data handler factory.
 * @param {*} DataHandler
 * @param {*} path
 */
const compose = (DataHandler, path) => {
    let dataHandler = new DataHandler();
    dataHandler.path = path;
    return dataHandler;
};


const agents   = DataHandler => compose(DataHandler, '/agents');
const simple   = DataHandler => new DataHandler();

app
Example #17
0
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { shortenDottedString } from '../../../../common/utils/shorten_dotted_string';
import headerHtml from './table_header.html';
import { uiModules } from 'ui/modules';
const module = uiModules.get('app/discover');


module.directive('kbnTableHeader', function () {
  return {
    restrict: 'A',
    scope: {
      columns: '=',
      sortOrder: '=',
      indexPattern: '=',
      onChangeSortOrder: '=?',
      onRemoveColumn: '=?',
      onMoveColumn: '=?',
    },
    template: headerHtml,
    controller: function ($scope, config) {
Example #18
0
import { VisualizeConstants } from 'plugins/kibana/visualize/visualize_constants';
import { UtilsBrushEventProvider } from 'ui/utils/brush_event';
import { FilterBarClickHandlerProvider } from 'ui/filter_bar/filter_bar_click_handler';
import { DashboardState } from './dashboard_state';
import { notify } from 'ui/notify';
import './panel/get_object_loaders_for_dashboard';
import { documentationLinks } from 'ui/documentation_links/documentation_links';
import { showCloneModal } from './top_nav/show_clone_modal';
import { migrateLegacyQuery } from 'ui/utils/migrateLegacyQuery';
import { QueryManagerProvider } from 'ui/query_manager';
import { ESC_KEY_CODE } from 'ui_framework/services';

const app = uiModules.get('app/dashboard', [
  'elasticsearch',
  'ngRoute',
  'kibana/courier',
  'kibana/config',
  'kibana/notify',
  'kibana/typeahead',
]);

uiRoutes
  .when(DashboardConstants.CREATE_NEW_DASHBOARD_URL, {
    template: dashboardTemplate,
    resolve: {
      dash: function (savedDashboards, courier) {
        return savedDashboards.get()
          .catch(courier.redirectWhenMissing({
            'dashboard': DashboardConstants.LANDING_PAGE_PATH
          }));
      }
    }
Example #19
0
import { uiModules } from 'ui/modules';
import { createLegacyClass } from 'ui/utils/legacy_class';
import { SavedObjectProvider } from 'ui/courier';
import {
  getTimeFilters,
  getMapZoom,
  getMapCenter,
  getLayerListRaw,
  getMapExtent,
  getRefreshConfig,
} from '../../selectors/map_selectors';
import { getIsDarkTheme } from '../../store/ui';
import { TileStyle } from '../../shared/layers/styles/tile_style';
import { convertMapExtentToEnvelope } from '../../elasticsearch_geo_utils';

const module = uiModules.get('app/gis');

module.factory('SavedGisMap', function (Private) {
  const SavedObject = Private(SavedObjectProvider);
  createLegacyClass(SavedGisMap).inherits(SavedObject);
  function SavedGisMap(id) {
    SavedGisMap.Super.call(this, {
      type: SavedGisMap.type,
      mapping: SavedGisMap.mapping,
      searchSource: SavedGisMap.searchsource,

      // if this is null/undefined then the SavedObject will be assigned the defaults
      id: id,

      // default values that will get assigned if the doc is new
      defaults: {
Example #20
0
import { uiModules } from 'ui/modules';
import { optOutOfGettingStarted } from './opt_out_helpers';

const app = uiModules.get('kibana');
app.directive('kbnGettingStartedOptOut', () => {
  return {
    restrict: 'A',
    link: (scope, element) =>  {
      element.on('click', () => {
        optOutOfGettingStarted();
      });
    }
  };
});
Example #21
0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import { uiModules } from 'ui/modules';
import { DevToolsRegistryProvider } from 'ui/registry/dev_tools';
import template from '../partials/dev_tools_app.html';
import '../styles/dev_tools_app.less';
import 'ui/kbn_top_nav';

uiModules
  .get('apps/dev_tools')
  .directive('kbnDevToolsApp', function (Private, $location) {
    const devToolsRegistry = Private(DevToolsRegistryProvider);

    return {
      restrict: 'E',
      replace: true,
      template,
      transclude: true,
      scope: {
        topNavConfig: '='
      },
      bindToController: true,
      controllerAs: 'kbnDevToolsApp',
      controller() {
        this.devTools = devToolsRegistry.inOrder;
Example #22
0
import './_saved_vis';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { uiModules } from 'ui/modules';
import { SavedObjectLoader } from 'ui/courier/saved_object/saved_object_loader';
import { savedObjectManagementRegistry } from '../../management/saved_object_registry';

const app = uiModules.get('app/visualize');

// Register this service with the saved object registry so it can be
// edited by the object editor.
savedObjectManagementRegistry.register({
  service: 'savedVisualizations',
  title: 'visualizations'
});

app.service('savedVisualizations', function (Promise, kbnIndex, SavedVis, Private, kbnUrl, $http, chrome) {
  const visTypes = Private(VisTypesRegistryProvider);

  const saveVisualizationLoader = new SavedObjectLoader(SavedVis, kbnIndex, kbnUrl, $http, chrome);

  saveVisualizationLoader.mapHitSource = function (source, id) {
    source.id = id;
    source.url = this.urlFor(id);

    let typeName = source.typeName;
    if (source.visState) {
      try { typeName = JSON.parse(source.visState).type; }
      catch (e) { /* missing typename handled below */ } // eslint-disable-line no-empty
    }

    if (!typeName || !visTypes.byName[typeName]) {
Example #23
0
import { toastNotifications } from 'ui/notify';
import 'ui/config';
import 'ui/url';
import 'ui/table_info';
import 'plugins/watcher/components/tool_bar_selected_count';
import 'plugins/watcher/services/watch';
import 'plugins/watcher/services/license';
import 'plugins/watcher/components/errors_display_modal';

import template from './watch_detail.html';
import errorsDisplayTemplate from 'plugins/watcher/components/errors_display_modal/errors_display_modal.html';
import '../watch_history';
import '../action_status_table';
import { REFRESH_INTERVALS } from 'plugins/watcher/../common/constants';

const app = uiModules.get('xpack/watcher');

app.directive('watchDetail', function ($injector, i18n) {
  const watchService = $injector.get('xpackWatcherWatchService');
  const licenseService = $injector.get('xpackWatcherLicenseService');

  const config = $injector.get('config');
  const kbnUrl = $injector.get('kbnUrl');
  const confirmModal = $injector.get('confirmModal');
  const $interval = $injector.get('$interval');

  const $filter = $injector.get('$filter');
  const orderBy = $filter('orderBy');
  const $modal = $injector.get('$modal');

  moment.tz.setDefault(config.get('dateFormat:tz'));
Example #24
0
import './agg_params';
import './agg_add';
import { Direction } from './keyboard_move';
import _ from 'lodash';
import { uiModules } from 'ui/modules';
import aggTemplate from './agg.html';
uiModules
.get('app/visualize')
.directive('visEditorAgg', function ($compile, $parse, $filter, Private, Notifier) {
  const notify = new Notifier({
    location: 'visAggGroup'
  });

  return {
    restrict: 'A',
    template: aggTemplate,
    require: 'form',
    link: function ($scope, $el, attrs, kbnForm) {
      $scope.editorOpen = !!$scope.agg.brandNew;

      $scope.$watch('editorOpen', function (open) {
        // make sure that all of the form inputs are "touched"
        // so that their errors propogate
        if (!open) kbnForm.$setTouched();
      });

      $scope.$watchMulti([
        '$index',
        'group.length'
      ], function () {
        $scope.aggIsTooLow = calcAggIsTooLow();
Example #25
0
import $ from 'jquery';
import _ from 'lodash';
import { uiModules } from 'ui/modules';

const SCROLLER_HEIGHT = 20;

/**
 * This directive adds a fixed horizontal scrollbar to the bottom of the window that proxies its scroll events
 * to the target element's real scrollbar. This is useful when the target element's horizontal scrollbar
 * might be waaaay down the page, like the doc table on Discover.
 */
uiModules
  .get('kibana')
  .directive('fixedScroll', function (debounce) {
    return {
      restrict: 'A',
      link: function ($scope, $el) {
        let $window = $(window);
        let $scroller = $('<div class="fixed-scroll-scroller">').height(SCROLLER_HEIGHT);


        /**
       * Remove the listeners bound in listen()
       * @type {function}
       */
        let unlisten = _.noop;

        /**
       * Listen for scroll events on the $scroller and the $el, sets unlisten()
       *
       * unlisten must be called before calling or listen() will throw an Error
Example #26
0
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

//MH TODO - I'm not 100% on managing dependencies. I added these 2 dependencies
// to the source code and it seems to work.
import d3 from 'd3';
import { distanceFromIntersectArea } from 'venn.js';

import { uiModules } from 'ui/modules';

uiModules.get('app/graph')
  .directive('venn', function () {
    return {
      scope: {
        venn: '=',
        vennKey: '=?',
        vennKeySize: '=?',
        vennMap: '=?'
      },
      restrict: 'AE',
      controller: function ($scope, $element) {
        $scope.$watch('venn', function () {
          const element = $element[0];
          //Remove current contents
          while (element.firstChild) {
            element.removeChild(element.firstChild);
          }
          const params = $scope.venn;
Example #27
0
import visualizeTemplate from 'ui/visualize/visualize.html';
import { VisRequestHandlersRegistryProvider } from 'ui/registry/vis_request_handlers';
import { VisResponseHandlersRegistryProvider } from 'ui/registry/vis_response_handlers';
import 'angular-sanitize';
import './visualization';
import './visualization_editor';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';

import { ResizeCheckerProvider } from 'ui/resize_checker';


import {
  isTermSizeZeroError,
} from '../elasticsearch_errors';

uiModules
  .get('kibana/directive', ['ngSanitize'])
  .directive('visualize', function ($timeout, Notifier, Private, timefilter, getAppState, Promise) {
    const notify = new Notifier({ location: 'Visualize' });
    const requestHandlers = Private(VisRequestHandlersRegistryProvider);
    const responseHandlers = Private(VisResponseHandlersRegistryProvider);
    const queryFilter = Private(FilterBarQueryFilterProvider);
    const ResizeChecker = Private(ResizeCheckerProvider);

    function getHandler(from, name) {
      if (typeof name === 'function') return name;
      return from.find(handler => handler.name === name).handler;
    }

    return {
      restrict: 'E',
      scope: {
Example #28
0
        <KuiTableRowCell>
          <MachineLearningJobStatusIcon status={props.state} />&nbsp;
          { capitalize(props.state) }
        </KuiTableRowCell>
        <KuiTableRowCell>{ numeral(props.data_counts.processed_record_count).format(LARGE_ABBREVIATED) }</KuiTableRowCell>
        <KuiTableRowCell>{ numeral(props.model_size_stats.model_bytes).format(LARGE_BYTES) }</KuiTableRowCell>
        <KuiTableRowCell>{ numeral(props.forecasts_stats.total).format(LARGE_ABBREVIATED) }</KuiTableRowCell>
        <KuiTableRowCell>
          { getNode(props.node) }
        </KuiTableRowCell>
      </KuiTableRow>
    );
  };
};

const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringMlListing', kbnUrl => {
  return {
    restrict: 'E',
    scope: {
      jobs: '=',
      pageIndex: '=',
      filterText: '=',
      sortKey: '=',
      sortOrder: '=',
      onNewState: '=',
    },
    link(scope, $el) {

      const getNoDataMessage = filterText => {
        if (filterText) {
Example #29
0
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import { uiModules } from 'ui/modules';

import { injectBanner } from './welcome_banner';

uiModules.get('xpack_main/hacks').run(injectBanner);
Example #30
0
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import React from 'react';
import { render } from 'react-dom';
import { isEmpty } from 'lodash';
import { uiModules } from 'ui/modules';
import { UpgradeFailure } from '../../../../components/upgrade_failure';

const app = uiModules.get('xpack/logstash');

app.directive('upgradeFailure', $injector => {
  const $route = $injector.get('$route');
  const kbnUrl = $injector.get('kbnUrl');

  return {
    link: (scope, el) => {
      const onRetry = () => {
        $route.updateParams({ retry: true });
        $route.reload();
      };
      const onClose = () => {
        scope.$evalAsync(kbnUrl.change('management/logstash/pipelines', {}));
      };
      const isNewPipeline = isEmpty(scope.pipeline.id);
      const isManualUpgrade = !!$route.current.params.retry;

      render(