mirror of
https://github.com/samber/awesome-prometheus-alerts.git
synced 2026-06-24 02:17:00 +08:00
fix(clipboard): copy of multiple rules was broken
This commit is contained in:
parent
135d4b7c1a
commit
bbba46c41b
1 changed files with 3 additions and 3 deletions
|
|
@ -3,14 +3,14 @@ $(function () {
|
||||||
text: function (trigger) {
|
text: function (trigger) {
|
||||||
const id = trigger.getAttribute('data-clipboard-target-id');
|
const id = trigger.getAttribute('data-clipboard-target-id');
|
||||||
const html = $("#" + id + " .highlight");
|
const html = $("#" + id + " .highlight");
|
||||||
return html.text();
|
return html.text() + '\n';
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
var clipboardCategories = new ClipboardJS('.clipboard-multiple', {
|
var clipboardCategories = new ClipboardJS('.clipboard-multiple', {
|
||||||
text: function (trigger) {
|
text: function (trigger) {
|
||||||
const id = trigger.getAttribute('data-clipboard-target-id');
|
const id = trigger.getAttribute('data-clipboard-target-id');
|
||||||
const html = $("[id^=" + id + "] .highlight");
|
const html = $("[id^=" + id + "] .highlight");
|
||||||
return html.append("\n\n").text();
|
return Array.from(html.map((i, target) => $(target).text())).join('\n\n');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Loading…
Reference in a new issue