Added copy button to some flow values

This commit is contained in:
Matteo Biscosi 2022-02-07 12:27:31 +01:00
parent a6f3e54921
commit e2c5f6ace3
2 changed files with 25 additions and 3 deletions

View file

@ -4988,6 +4988,14 @@ function add_delete_obs_point_button()
return button
end
function print_copy_button(id, data)
print('<button style="" class="btn btn-sm border ms-1" data-placement="bottom" id="btn-copy-' .. id ..'" data="' .. data .. '"><i class="fas fa-copy"></i></button>')
end
function print_js_copy_button(id)
print("$('#btn-copy-" .. id .. "').click(function(e) { NtopUtils.copyToClipboard($(this).attr('data'), '" .. i18n('copied') .. "', '" .. i18n('request_failed_message') .. "', $(this));});")
end
--
-- IMPORTANT
-- Leave it at the end so it can use the functions