當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript DashboardModel.DashboardModel類代碼示例

本文整理匯總了TypeScript中app/features/dashboard/state/DashboardModel.DashboardModel的典型用法代碼示例。如果您正苦於以下問題:TypeScript DashboardModel類的具體用法?TypeScript DashboardModel怎麽用?TypeScript DashboardModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DashboardModel類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: PanelModel

const replacePanel = (dashboard: DashboardModel, newPanel: PanelModel, oldPanel: PanelModel) => {
  const index = dashboard.panels.findIndex(panel => {
    return panel.id === oldPanel.id;
  });

  const deletedPanel = dashboard.panels.splice(index, 1);
  dashboard.events.emit('panel-removed', deletedPanel);

  newPanel = new PanelModel(newPanel);
  newPanel.id = oldPanel.id;

  dashboard.panels.splice(index, 0, newPanel);
  dashboard.sortPanelsByGridPos();
  dashboard.events.emit('panel-added', newPanel);
};
開發者ID:gnydick,項目名稱:grafana,代碼行數:15,代碼來源:panel.ts

示例2: removePanel

export const removePanel = (dashboard: DashboardModel, panel: PanelModel, ask: boolean) => {
  // confirm deletion
  if (ask !== false) {
    const text2 = panel.alert ? 'Panel includes an alert rule, removing panel will also remove alert rule' : null;
    const confirmText = panel.alert ? 'YES' : null;

    appEvents.emit('confirm-modal', {
      title: 'Remove Panel',
      text: 'Are you sure you want to remove this panel?',
      text2: text2,
      icon: 'fa-trash',
      confirmText: confirmText,
      yesText: 'Remove',
      onConfirm: () => removePanel(dashboard, panel, false),
    });
    return;
  }
  dashboard.removePanel(panel);
};
開發者ID:gnydick,項目名稱:grafana,代碼行數:19,代碼來源:panel.ts

示例3:

export const duplicatePanel = (dashboard: DashboardModel, panel: PanelModel) => {
  dashboard.duplicatePanel(panel);
};
開發者ID:gnydick,項目名稱:grafana,代碼行數:3,代碼來源:panel.ts

示例4:

 return this.$q.all(promises).then(() => {
   this.dashboard.startRefresh();
 });
開發者ID:bergquist,項目名稱:grafana,代碼行數:3,代碼來源:variable_srv.ts

示例5: removeVariable

 removeVariable(variable) {
   const index = _.indexOf(this.variables, variable);
   this.variables.splice(index, 1);
   this.templateSrv.updateIndex();
   this.dashboard.updateSubmenuVisibility();
 }
開發者ID:bergquist,項目名稱:grafana,代碼行數:6,代碼來源:variable_srv.ts

示例6: addVariable

 addVariable(variable) {
   this.variables.push(variable);
   this.templateSrv.updateIndex();
   this.dashboard.updateSubmenuVisibility();
 }
開發者ID:bergquist,項目名稱:grafana,代碼行數:5,代碼來源:variable_srv.ts

示例7:

 return this.$q.all(promises).then(() => {
   if (emitChangeEvents) {
     this.$rootScope.appEvent('template-variable-value-updated');
     this.dashboard.startRefresh();
   }
 });
開發者ID:gnydick,項目名稱:grafana,代碼行數:6,代碼來源:variable_srv.ts


注:本文中的app/features/dashboard/state/DashboardModel.DashboardModel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。