refactor(): minor changes

pull/3990/head
Torkel Ödegaard 10 years ago
parent f188900379
commit 273fbaac68
  1. 2
      pkg/api/index.go
  2. 2
      public/app/core/routes/all.js
  3. 7
      public/app/features/panel/metrics_panel_ctrl.ts
  4. 2
      public/app/features/snapshot/partials/snapshots.html
  5. 1
      public/app/plugins/datasource/prometheus/query_ctrl.ts
  6. 1
      public/app/plugins/panel/graph/module.ts
  7. 1
      public/app/plugins/panel/singlestat/module.ts

@ -62,7 +62,7 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
Text: "Snapshots",
Icon: "fa fa-fw fa-camera-retro",
Icon: "fa-fw icon-gf icon-gf-snapshot",
Url: "/dashboard/snapshots",
})

@ -138,7 +138,7 @@ define([
controller : 'ResetPasswordCtrl',
})
.when('/dashboard/snapshots', {
templateUrl: 'app/features/snapshot/partials/snapshots.html',
templateUrl: 'public/app/features/snapshot/partials/snapshots.html',
controller : 'SnapshotsCtrl',
controllerAs: 'ctrl',
})

@ -47,10 +47,6 @@ class MetricsPanelCtrl extends PanelCtrl {
this.datasources = this.datasourceSrv.getMetricSources();
}
refresh() {
this.getData();
}
refreshData(data) {
// null op
return this.$q.when(data);
@ -61,13 +57,14 @@ class MetricsPanelCtrl extends PanelCtrl {
return data;
}
getData() {
refresh() {
// ignore fetching data if another panel is in fullscreen
if (this.otherPanelInFullscreenMode()) { return; }
// if we have snapshot data use that
if (this.panel.snapshotData) {
if (this.loadSnapshot) {
this.updateTimeRange();
this.loadSnapshot(this.panel.snapshotData);
}
return;

@ -1,4 +1,4 @@
<navbar icon="fa fa-fw fa-camera-retro" title="Dashboard snapshots"></navbar>
<navbar icon="icon-gf icon-gf-snapshot" title="Dashboard snapshots"></navbar>
<div class="page-container">
<div class="page-wide">

@ -9,6 +9,7 @@ import {QueryCtrl} from 'app/features/panel/panel';
class PrometheusQueryCtrl extends QueryCtrl {
static templateUrl = 'public/app/plugins/datasource/prometheus/partials/query.editor.html';
metric: any;
resolutions: any;
oldTarget: any;

@ -152,7 +152,6 @@ class GraphCtrl extends MetricsPanelCtrl {
}
loadSnapshot(snapshotData) {
this.updateTimeRange();
this.annotationsPromise = this.annotationsSrv.getAnnotations(this.dashboard);
this.dataHandler(snapshotData);
}

@ -79,7 +79,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
}
loadSnapshot(snapshotData) {
this.updateTimeRange();
this.dataHandler(snapshotData);
}

Loading…
Cancel
Save