prometheus/web/ui/static/js/config.js
Stafford Williams 328d81999a /config: Added Copy to clipboard button for /config (#4410)
* added `Copy to clipboard` button

Signed-off-by: Stafford Williams <[email protected]>

* generate vsfdata

Signed-off-by: Stafford Williams <[email protected]>

* new lines

Signed-off-by: Stafford Williams <[email protected]>

* single newline

Signed-off-by: Stafford Williams <[email protected]>
2018-11-27 16:05:26 +08:00

13 lines
363 B
JavaScript

function init() {
$("#copyToClipboard").on("click", function () {
var range = document.createRange();
range.selectNode(document.getElementById("config_yaml"));
window.getSelection().empty();
window.getSelection().addRange(range);
document.execCommand("copy");
window.getSelection().empty();
});
}
$(init);