ux: progress on metrics tab changes

This commit is contained in:
Torkel Ödegaard
2017-08-31 16:38:49 +02:00
parent 84d4958a3c
commit eb0f5cc900
9 changed files with 112 additions and 89 deletions

View File

@@ -21,7 +21,7 @@ export class MetricsTabCtrl {
hasMinInterval: boolean;
hasCacheTimeout: boolean;
hasMaxDataPoints: boolean;
animateStart: boolean;
optionsOpen: boolean;
/** @ngInject */
constructor($scope, private $sce, private datasourceSrv, private backendSrv, private $timeout) {
@@ -85,19 +85,25 @@ export class MetricsTabCtrl {
}
toggleHelp() {
this.animateStart = false;
this.optionsOpen = false;
this.queryTroubleshooterOpen = false;
this.helpOpen = !this.helpOpen;
this.backendSrv.get(`/api/plugins/${this.current.meta.id}/markdown/help`).then(res => {
var md = new Remarkable();
this.helpHtml = this.$sce.trustAsHtml(md.render(res));
this.$timeout(() => {
this.animateStart = true;
}, 1);
});
}
toggleOptions() {
this.helpOpen = false;
this.queryTroubleshooterOpen = false;
this.optionsOpen = !this.optionsOpen;
}
toggleQueryTroubleshooter() {
this.helpOpen = false;
this.optionsOpen = false;
this.queryTroubleshooterOpen = !this.queryTroubleshooterOpen;
}
}