mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
Merge pull request #12844 from grafana/10705_dash_links
Use uid when linking to dashboards internally in a dashboard
This commit is contained in:
commit
8dbc75ceea
@ -144,8 +144,8 @@ export class DashLinksContainerCtrl {
|
||||
if (dash.id !== currentDashId) {
|
||||
memo.push({
|
||||
title: dash.title,
|
||||
url: 'dashboard/' + dash.uri,
|
||||
target: link.target,
|
||||
url: dash.url,
|
||||
target: link.target === '_self' ? '' : link.target,
|
||||
icon: 'fa fa-th-large',
|
||||
keepTime: link.keepTime,
|
||||
includeVars: link.includeVars,
|
||||
|
@ -77,6 +77,10 @@ export class LinkSrv {
|
||||
info.target = link.targetBlank ? '_blank' : '_self';
|
||||
info.href = this.templateSrv.replace(link.url || '', scopedVars);
|
||||
info.title = this.templateSrv.replace(link.title || '', scopedVars);
|
||||
} else if (link.url) {
|
||||
info.href = link.url;
|
||||
info.title = this.templateSrv.replace(link.title || '', scopedVars);
|
||||
info.target = link.targetBlank ? '_blank' : '';
|
||||
} else if (link.dashUri) {
|
||||
info.href = 'dashboard/' + link.dashUri + '?';
|
||||
info.title = this.templateSrv.replace(link.title || '', scopedVars);
|
||||
|
@ -39,7 +39,12 @@ export class PanelLinksEditorCtrl {
|
||||
backendSrv.search({ query: link.dashboard }).then(function(hits) {
|
||||
var dashboard = _.find(hits, { title: link.dashboard });
|
||||
if (dashboard) {
|
||||
link.dashUri = dashboard.uri;
|
||||
if (dashboard.url) {
|
||||
link.url = dashboard.url;
|
||||
} else {
|
||||
// To support legacy url's
|
||||
link.dashUri = dashboard.uri;
|
||||
}
|
||||
link.title = dashboard.title;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user