当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript chrome.getUiSettingsClient函数代码示例

本文整理汇总了TypeScript中ui/chrome.getUiSettingsClient函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getUiSettingsClient函数的具体用法?TypeScript getUiSettingsClient怎么用?TypeScript getUiSettingsClient使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getUiSettingsClient函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: fetchFirstLastSeenHost

 async function fetchFirstLastSeenHost() {
   updateLoading(true);
   return apolloClient
     .query<GetHostFirstLastSeenQuery.Query, GetHostFirstLastSeenQuery.Variables>({
       query: HostFirstLastSeenGqlQuery,
       fetchPolicy: 'cache-first',
       variables: {
         sourceId,
         hostName,
         defaultIndex: chrome.getUiSettingsClient().get(DEFAULT_INDEX_KEY),
       },
     })
     .then(
       result => {
         updateLoading(false);
         updateFirstSeen(get('data.source.HostFirstLastSeen.firstSeen', result));
         updateLastSeen(get('data.source.HostFirstLastSeen.lastSeen', result));
         updateErrorMessage(null);
         return result;
       },
       error => {
         updateLoading(false);
         updateErrorMessage(error.message);
         return error;
       }
     );
 }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例2: fetchLastEventTime

 async function fetchLastEventTime() {
   updateLoading(true);
   return apolloClient
     .query<GetLastEventTimeQuery.Query, GetLastEventTimeQuery.Variables>({
       query: LastEventTimeGqlQuery,
       fetchPolicy: 'cache-first',
       variables: {
         sourceId,
         indexKey,
         details,
         defaultIndex: chrome.getUiSettingsClient().get(DEFAULT_INDEX_KEY),
       },
     })
     .then(
       result => {
         updateLoading(false);
         updateLastSeen(get('data.source.LastEventTime.lastSeen', result));
         updateErrorMessage(null);
         updateCurrentIndexKey(currentIndexKey);
         return result;
       },
       error => {
         updateLoading(false);
         updateErrorMessage(error.message);
         return error;
       }
     );
 }
开发者ID:,项目名称:,代码行数:28,代码来源:

示例3: getIndexPattern

export async function getIndexPattern(
  savedVis: VisSavedObject
): Promise<StaticIndexPattern | undefined> {
  if (savedVis.vis.type.name !== 'metrics') {
    return savedVis.vis.indexPattern;
  }

  const config = chrome.getUiSettingsClient();
  const savedObjectsClient = chrome.getSavedObjectsClient();
  const defaultIndex = config.get('defaultIndex');

  if (savedVis.vis.params.index_pattern) {
    const indexPatternObjects = await savedObjectsClient.find({
      type: 'index-pattern',
      fields: ['title', 'fields'],
      search: `"${savedVis.vis.params.index_pattern}"`,
      searchFields: ['title'],
    });
    const [indexPattern] = indexPatternObjects.savedObjects.map(getFromSavedObject);
    return indexPattern;
  }

  const savedObject = await savedObjectsClient.get('index-pattern', defaultIndex);
  return getFromSavedObject(savedObject);
}
开发者ID:elastic,项目名称:kibana,代码行数:25,代码来源:get_index_pattern.ts

示例4: compose

export function compose(): FrontendLibs {
  const api = new AxiosRestAPIAdapter(chrome.getXsrfToken(), chrome.getBasePath());
  const esAdapter = new RestElasticsearchAdapter(api, INDEX_NAMES.BEATS);

  const tags = new TagsLib(new RestTagsAdapter(api), getSupportedConfig());
  const tokens = new RestTokensAdapter(api);
  const beats = new BeatsLib(new RestBeatsAdapter(api), {
    tags,
  });

  const framework = new FrameworkLib(
    new KibanaFrameworkAdapter(
      PLUGIN.ID,
      management,
      routes,
      chrome.getBasePath,
      onKibanaReady,
      XPackInfoProvider,
      chrome.getUiSettingsClient()
    )
  );

  const libs: FrontendLibs = {
    framework,
    elasticsearch: new ElasticsearchLib(esAdapter),
    tags,
    tokens,
    beats,
  };
  return libs;
}
开发者ID:gingerwizard,项目名称:kibana,代码行数:31,代码来源:kibana.ts

示例5:

 showSavedObject: savedObject => {
   if (chrome.getUiSettingsClient().get('visualize:enableLabs')) {
     return true;
   }
   const typeName: string = JSON.parse(savedObject.attributes.visState).type;
   const visType = visTypes.byName[typeName];
   return visType.stage !== 'experimental';
 },
开发者ID:spalger,项目名称:kibana,代码行数:8,代码来源:visualize_embeddable_factory.ts

示例6:

// import 'monaco-editor/esm/vs/basic-languages/less/less.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/msdax/msdax.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/objective-c/objective-c.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/php/php.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/postiats/postiats.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/pug/pug.contribution.js';
// import 'monaco-editor/esm/vs/basic-languages/python/python.contribution.js';
import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
import chrome from 'ui/chrome';

const IS_DARK_THEME = chrome.getUiSettingsClient().get('theme:darkMode');

const themeName = IS_DARK_THEME ? darkTheme : lightTheme;

const syntaxTheme = {
  keyword: themeName.euiColorAccent,
  comment: themeName.euiColorMediumShade,
  delimiter: themeName.euiColorSecondary,
  string: themeName.euiColorPrimary,
  number: themeName.euiColorWarning,
  regexp: themeName.euiColorPrimary,
  types: `${IS_DARK_THEME ? themeName.euiColorVis5 : themeName.euiColorVis9}`,
  annotation: themeName.euiColorLightShade,
  tag: themeName.euiColorAccent,
  symbol: themeName.euiColorDanger,
  foreground: themeName.euiColorDarkestShade,
开发者ID:elastic,项目名称:kibana,代码行数:31,代码来源:monaco.ts

示例7: fetchIndexPatterns

 * 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 chrome from 'ui/chrome';
import { getFromSavedObject } from 'ui/index_patterns/static_utils';

const config = chrome.getUiSettingsClient();

export async function fetchIndexPatterns(indexPatternStrings: string[]) {
  const quotedIndexPatternStrings = indexPatternStrings.map(
    indexPatternString => `"${indexPatternString}"`
  );
  const searchString = quotedIndexPatternStrings.join(' | ');
  const indexPatternsFromSavedObjects = await chrome.getSavedObjectsClient().find({
    type: 'index-pattern',
    fields: ['title', 'fields'],
    search: `"${searchString}"`,
    searchFields: ['title'],
  });

  const exactMatches = indexPatternsFromSavedObjects.savedObjects.filter(savedObject => {
    return indexPatternStrings.includes(savedObject.attributes.title as string);
开发者ID:elastic,项目名称:kibana,代码行数:31,代码来源:fetch_index_patterns.ts

示例8: getSuggestionsProvider

/*
 * Licensed to Elasticsearch B.V. under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * 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 chrome from 'ui/chrome';
import { kfetch } from 'ui/kfetch';
import { getSuggestionsProvider } from './value_suggestions';

export const getSuggestions = getSuggestionsProvider(chrome.getUiSettingsClient(), kfetch);
开发者ID:elastic,项目名称:kibana,代码行数:24,代码来源:index.ts


注:本文中的ui/chrome.getUiSettingsClient函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。