當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。