Commit 30ad784d by Torkel Ödegaard

Changed dashboard urls from /dashboard/elasticsearch/<title> to…

Changed dashboard urls from /dashboard/elasticsearch/<title> to dashboard/db/<title>, old urls will still work
parent 7be7b07c
......@@ -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">
......
define([
'./dashboard-from-es',
'./dashboard-from-db',
'./dashboard-from-file',
'./dashboard-from-script',
'./dashboard-default',
],
function () {});
\ No newline at end of file
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;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment