mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* 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:
committed by
Torkel Ödegaard
parent
8adaf99bff
commit
e8807f4bce
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user