Fixing tabs for Grafana 5 - #10082 (#10103)

* ux: Make new tabs responsive #10082

* ux: Add possibility to manipulate url in angular router outside of angular - and use it in the responsive navigation #10082
This commit is contained in:
Johannes Schill
2017-12-06 17:36:44 +01:00
committed by Torkel Ödegaard
parent 8adaf99bff
commit e8807f4bce
10 changed files with 109 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
///<reference path="../../headers/common.d.ts" />
import coreModule from '../../core/core_module';
import {appEvents} from 'app/core/core';
export class DataSourcesCtrl {
datasources: any;
@@ -11,13 +12,24 @@ export class DataSourcesCtrl {
private $scope,
private backendSrv,
private datasourceSrv,
private $location,
private navModelSrv) {
this.navModel = this.navModelSrv.getNav('cfg', 'datasources', 0);
this.navigateToUrl = this.navigateToUrl.bind(this);
backendSrv.get('/api/datasources').then(result => {
this.datasources = result;
});
appEvents.on('location-change', payload => {
this.navigateToUrl(payload.href);
});
}
navigateToUrl(url) {
// debugger;
this.$location.path(url);
this.$location.replace();
}
removeDataSourceConfirmed(ds) {