mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Changed dashboard urls from /dashboard/elasticsearch/<title> to dashboard/db/<title>, old urls will still work
This commit is contained in:
@@ -41,7 +41,7 @@ function (angular, _, config, $) {
|
||||
|
||||
var selectedDash = $scope.results.dashboards[$scope.selectedIndex];
|
||||
if (selectedDash) {
|
||||
$location.path("/dashboard/elasticsearch/" + selectedDash.id);
|
||||
$location.path("/dashboard/db/" + selectedDash.id);
|
||||
setTimeout(function() {
|
||||
$('body').click(); // hack to force dropdown to close;
|
||||
});
|
||||
@@ -54,7 +54,7 @@ function (angular, _, config, $) {
|
||||
|
||||
$scope.share = {
|
||||
title: title,
|
||||
url: baseUrl + '#dashboard/elasticsearch/' + encodeURIComponent(id)
|
||||
url: baseUrl + '#dashboard/db/' + encodeURIComponent(id)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
ng-class="{'selected': $index === selectedIndex }">
|
||||
<td><a ng-click="deleteDashboard(row.id)"><i class="icon-remove"></i></a></td>
|
||||
<td style="width:100%">
|
||||
<a href="#/dashboard/elasticsearch/{{row.id}}" bo-text="row.id"></a>
|
||||
<a href="#/dashboard/db/{{row.id}}" bo-text="row.id"></a>
|
||||
</td>
|
||||
<td style="white-space: nowrap; text-align: right;">
|
||||
<a ng-click="filterByTag(tag, $event)" ng-repeat="tag in row.tags" style="margin-right: 5px;" class="label label-tag">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
define([
|
||||
'./dashboard-from-es',
|
||||
'./dashboard-from-db',
|
||||
'./dashboard-from-file',
|
||||
'./dashboard-from-script',
|
||||
'./dashboard-default',
|
||||
],
|
||||
function () {});
|
||||
function () {});
|
||||
|
||||
@@ -8,17 +8,21 @@ function (angular) {
|
||||
|
||||
module.config(function($routeProvider) {
|
||||
$routeProvider
|
||||
.when('/dashboard/db/:id', {
|
||||
templateUrl: 'app/partials/dashboard.html',
|
||||
controller : 'DashFromDBProvider',
|
||||
})
|
||||
.when('/dashboard/elasticsearch/:id', {
|
||||
templateUrl: 'app/partials/dashboard.html',
|
||||
controller : 'DashFromElasticProvider',
|
||||
controller : 'DashFromDBProvider',
|
||||
})
|
||||
.when('/dashboard/temp/:id', {
|
||||
templateUrl: 'app/partials/dashboard.html',
|
||||
controller : 'DashFromElasticProvider',
|
||||
controller : 'DashFromDBProvider',
|
||||
});
|
||||
});
|
||||
|
||||
module.controller('DashFromElasticProvider', function($scope, $rootScope, datasourceSrv, $routeParams, alertSrv) {
|
||||
module.controller('DashFromDBProvider', function($scope, $rootScope, datasourceSrv, $routeParams, alertSrv) {
|
||||
|
||||
var db = datasourceSrv.getGrafanaDB();
|
||||
db.getDashboard($routeParams.id)
|
||||
@@ -141,7 +141,7 @@ function (angular, _, $, config, kbn, moment) {
|
||||
|
||||
return this._request('PUT', '/dashboard/' + encodeURIComponent(title), this.index, data)
|
||||
.then(function() {
|
||||
return { title: title, url: '/dashboard/elasticsearch/' + title };
|
||||
return { title: title, url: '/dashboard/db/' + title };
|
||||
}, function(err) {
|
||||
throw 'Failed to save to elasticsearch ' + err.data;
|
||||
});
|
||||
|
||||
@@ -243,7 +243,7 @@ function (angular, _, kbn, InfluxSeries) {
|
||||
}];
|
||||
|
||||
return this._influxRequest('POST', '/series', data).then(function() {
|
||||
return { title: title, url: '/dashboard/elasticsearch/' + title };
|
||||
return { title: title, url: '/dashboard/db/' + title };
|
||||
}, function(err) {
|
||||
throw 'Failed to save dashboard to InfluxDB: ' + err.data;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user