本文整理汇总了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;未经允许,请勿转载。 |
请发表评论