Skip to content

Commit

Permalink
Allow templating dash url
Browse files Browse the repository at this point in the history
  • Loading branch information
hifi committed Dec 1, 2023
1 parent 46e0410 commit 81ef3b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ const utils = {
}

if(data.annotations.hasOwnProperty("dashboard_url")) {
parts.push('| <a href="', data.annotations.dashboard_url, '">🚦 Dashboard</a>')
let url = data.annotations.dashboard_url.replace(/\$([a-z0-9_]+)/g, function(_, label) {
return data.labels[label] || "";
});

parts.push('| <a href="', url, '">🚦 Dashboard</a>');
}

if(data.annotations.hasOwnProperty("runbook_url")) {
Expand Down

0 comments on commit 81ef3b8

Please sign in to comment.