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


TypeScript sdk.MetricsPanelCtrl類代碼示例

本文整理匯總了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();
  }
開發者ID:navedalam,項目名稱:grafana,代碼行數:41,代碼來源:event_manager.ts

示例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();
  }
開發者ID:PaulMest,項目名稱:grafana,代碼行數:17,代碼來源:event_manager.ts

示例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();
  }
開發者ID:grafana,項目名稱:grafana,代碼行數:18,代碼來源:event_manager.ts

示例4: editEvent

 editEvent(event, elem?) {
   this.event = event;
   this.panelCtrl.render();
 }
開發者ID:PaulMest,項目名稱:grafana,代碼行數:4,代碼來源:event_manager.ts

示例5: editorClosed

 editorClosed() {
   this.event = null;
   this.editorOpen = false;
   this.panelCtrl.render();
 }
開發者ID:PaulMest,項目名稱:grafana,代碼行數:5,代碼來源:event_manager.ts

示例6: editorClosed

 editorClosed() {
   console.log('editorClosed');
   this.event = null;
   this.panelCtrl.render();
 }
開發者ID:navedalam,項目名稱:grafana,代碼行數:5,代碼來源:event_manager.ts

示例7:

 .catch(() => {
   this.panelCtrl.refresh();
   this.close();
 });
開發者ID:GPegel,項目名稱:grafana,代碼行數:4,代碼來源:event_editor.ts

示例8: timeChanged

 timeChanged() {
   this.panelCtrl.render();
 }
開發者ID:casaria,項目名稱:grafana-trillium-src-fork,代碼行數:3,代碼來源:event_editor.ts

示例9:

 this.annotationsSrv.saveAnnotationEvent(saveModel).then(() => {
   this.panelCtrl.refresh();
   this.close();
 });
開發者ID:casaria,項目名稱:grafana-trillium-src-fork,代碼行數:4,代碼來源:event_editor.ts


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