refactor(): minor changes

This commit is contained in:
Torkel Ödegaard 2016-02-05 10:37:14 +01:00
parent f188900379
commit 273fbaac68
7 changed files with 8 additions and 12 deletions

View File

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

View File

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

View File

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

View File

@ -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-container">
<div class="page-wide"> <div class="page-wide">
@ -11,9 +11,9 @@
<th><strong>Snapshot url</strong></th> <th><strong>Snapshot url</strong></th>
<th style="width: 70px"></th> <th style="width: 70px"></th>
<th style="width: 25px"></th> <th style="width: 25px"></th>
</thead> </thead>
<tr ng-repeat="snapshot in ctrl.snapshots"> <tr ng-repeat="snapshot in ctrl.snapshots">
<td> <td>
<a href="dashboard/snapshot/{{snapshot.key}}">{{snapshot.name}}</a> <a href="dashboard/snapshot/{{snapshot.key}}">{{snapshot.name}}</a>

View File

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

View File

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

View File

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