本文整理匯總了TypeScript中app/plugins/sdk.MetricsPanelCtrl類的典型用法代碼示例。如果您正苦於以下問題:TypeScript MetricsPanelCtrl類的具體用法?TypeScript MetricsPanelCtrl怎麽用?TypeScript MetricsPanelCtrl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了MetricsPanelCtrl類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: updateTime
updateTime(range) {
let newEvent = true;
if (this.event) {
newEvent = false;
} else {
// init new event
this.event = new AnnotationEvent();
this.event.dashboardId = this.panelCtrl.dashboard.id;
this.event.panelId = this.panelCtrl.panel.id;
}
// update time
this.event.time = moment(range.from);
this.event.isRegion = false;
if (range.to) {
this.event.timeEnd = moment(range.to);
this.event.isRegion = true;
}
// newEvent means the editor is not visible
if (!newEvent) {
this.panelCtrl.render();
return;
}
this.popoverSrv.show({
element: this.elem[0],
classNames: 'drop-popover drop-popover--form',
position: 'bottom center',
openOn: null,
template: '<event-editor panel-ctrl="panelCtrl" event="event" close="dismiss()"></event-editor>',
onClose: this.editorClosed.bind(this),
model: {
event: this.event,
panelCtrl: this.panelCtrl,
},
});
this.panelCtrl.render();
}
示例2: updateTime
updateTime(range) {
if (!this.event) {
this.event = new AnnotationEvent();
this.event.dashboardId = this.panelCtrl.dashboard.id;
this.event.panelId = this.panelCtrl.panel.id;
}
// update time
this.event.time = moment(range.from);
this.event.isRegion = false;
if (range.to) {
this.event.timeEnd = moment(range.to);
this.event.isRegion = true;
}
this.panelCtrl.render();
}
示例3: updateTime
updateTime(range) {
if (!this.event) {
this.event = {};
this.event.dashboardId = this.panelCtrl.dashboard.id;
this.event.panelId = this.panelCtrl.panel.id;
}
// update time
this.event.time = range.from;
this.event.isRegion = false;
if (range.to) {
this.event.timeEnd = range.to;
this.event.isRegion = true;
}
this.panelCtrl.render();
}
示例4: editEvent
editEvent(event, elem?) {
this.event = event;
this.panelCtrl.render();
}
示例5: editorClosed
editorClosed() {
this.event = null;
this.editorOpen = false;
this.panelCtrl.render();
}
示例6: editorClosed
editorClosed() {
console.log('editorClosed');
this.event = null;
this.panelCtrl.render();
}
示例7:
.catch(() => {
this.panelCtrl.refresh();
this.close();
});
示例8: timeChanged
timeChanged() {
this.panelCtrl.render();
}
示例9:
this.annotationsSrv.saveAnnotationEvent(saveModel).then(() => {
this.panelCtrl.refresh();
this.close();
});