Added interfaces input and output name formatting (#5953)

This commit is contained in:
MatteoBiscosi 2022-03-14 17:06:16 +01:00
parent ef86a08137
commit 1a9cf6aaac
2 changed files with 18 additions and 5 deletions

View file

@ -5021,6 +5021,17 @@ function add_delete_obs_point_button()
return button
end
function format_portidx_name(cached_dev, portidx)
local port_info = cached_dev["interfaces"][tostring(portidx)]
local idx_name = portidx
if port_info then
idx_name = portidx .. "[" .. shortenString(port_info["name"]) .. "]"
end
return idx_name
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>')
print("<script>$('#btn-copy-" .. id .. "').click(function(e) { NtopUtils.copyToClipboard($(this).attr('data'), '" .. i18n('copied') .. "', '" .. i18n('request_failed_message') .. "', $(this));});</script>")