• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript chrome.getKibanaVersion函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createPanelState

export function createPanelState(
  id: string,
  type: string,
  panelIndex: string,
  currentPanels: PanelState[]
) {
  const { x, y } = findTopLeftMostOpenSpace(
    DEFAULT_PANEL_WIDTH,
    DEFAULT_PANEL_HEIGHT,
    currentPanels
  );
  return {
    gridData: {
      w: DEFAULT_PANEL_WIDTH,
      h: DEFAULT_PANEL_HEIGHT,
      x,
      y,
      i: panelIndex.toString(),
    },
    version: chrome.getKibanaVersion(),
    panelIndex: panelIndex.toString(),
    type,
    id,
    embeddableConfig: {},
  };
}
开发者ID:elastic,项目名称:kibana,代码行数:26,代码来源:panel_state.ts


示例2: convertPanelDataPre_6_3

  // 6.3 changed the panel dimensions to allow finer control over sizing
  // 1) decrease column height from 100 to 20.
  // 2) increase rows from 12 to 48
  // Need to scale pre 6.3 panels so they maintain the same layout
  public static convertPanelDataPre_6_3(
    panel: {
      gridData: GridData;
      version: string;
    },
    useMargins: boolean
  ) {
    ['w', 'x', 'h', 'y'].forEach(key => {
      if (!_.has(panel.gridData, key)) {
        throw new Error(
          i18n.translate(
            'kbn.dashboard.panel.unableToMigratePanelDataForSixThreeZeroErrorMessage',
            {
              defaultMessage:
                'Unable to migrate panel data for "6.3.0" backwards compatibility, panel does not contain expected field: {key}',
              values: { key },
            }
          )
        );
      }
    });

    // see https://github.com/elastic/kibana/issues/20635 on why the scale factor changes when margins are being used
    const heightScaleFactor = useMargins
      ? PANEL_HEIGHT_SCALE_FACTOR_WITH_MARGINS
      : PANEL_HEIGHT_SCALE_FACTOR;

    panel.gridData.w = panel.gridData.w * PANEL_WIDTH_SCALE_FACTOR;
    panel.gridData.x = panel.gridData.x * PANEL_WIDTH_SCALE_FACTOR;
    panel.gridData.h = panel.gridData.h * heightScaleFactor;
    panel.gridData.y = panel.gridData.y * heightScaleFactor;
    panel.version = chrome.getKibanaVersion();

    return panel;
  }
开发者ID:njd5475,项目名称:kibana,代码行数:39,代码来源:panel_utils.ts


示例3: compose

export function compose(): FrontendLibs {
  const api = new AxiosRestAPIAdapter(chrome.getXsrfToken(), chrome.getBasePath());
  const esAdapter = new RestElasticsearchAdapter(api, INDEX_NAMES.BEATS);
  const elasticsearchLib = new ElasticsearchLib(esAdapter);
  const configBlocks = new ConfigBlocksLib(
    new RestConfigBlocksAdapter(api),
    translateConfigSchema(configBlockSchemas)
  );
  const tags = new TagsLib(new RestTagsAdapter(api), elasticsearchLib);
  const tokens = new RestTokensAdapter(api);
  const beats = new BeatsLib(new RestBeatsAdapter(api), elasticsearchLib);

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

  const libs: FrontendLibs = {
    framework,
    elasticsearch: elasticsearchLib,
    tags,
    tokens,
    beats,
    configBlocks,
  };
  return libs;
}
开发者ID:elastic,项目名称:kibana,代码行数:34,代码来源:kibana.ts


示例4: convertPanelDataPre_6_1

  // 6.1 switched from gridster to react grid. React grid uses different variables for tracking layout
  public static convertPanelDataPre_6_1(panel: any): PanelState {
    ['col', 'row'].forEach(key => {
      if (!_.has(panel, key)) {
        throw new Error(
          i18n.translate('kbn.dashboard.panel.unableToMigratePanelDataForSixOneZeroErrorMessage', {
            defaultMessage:
              'Unable to migrate panel data for "6.1.0" backwards compatibility, panel does not contain expected field: {key}',
            values: { key },
          })
        );
      }
    });

    panel.gridData = {
      x: panel.col - 1,
      y: panel.row - 1,
      w: panel.size_x || DEFAULT_PANEL_WIDTH,
      h: panel.size_y || DEFAULT_PANEL_HEIGHT,
      i: panel.panelIndex.toString(),
    };
    panel.version = chrome.getKibanaVersion();
    panel.panelIndex = panel.panelIndex.toString();
    delete panel.size_x;
    delete panel.size_y;
    delete panel.row;
    delete panel.col;

    return panel;
  }
开发者ID:njd5475,项目名称:kibana,代码行数:30,代码来源:panel_utils.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript chrome.getUiSettingsClient函数代码示例发布时间:2022-05-25
下一篇:
TypeScript chrome.getInjected函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap