mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Do not allow the legend nodes to trigger the node edit modal (#16026)
* Do not allow the legend nodes to trigger the node edit modal * Added newline to trigger github tests
This commit is contained in:
@@ -677,11 +677,22 @@
|
||||
function editNode(data, callback) {
|
||||
$("#devicesearch").val('');
|
||||
$("#devicesearch").trigger('change');
|
||||
if(data.id && isNaN(data.id) && data.id.endsWith("_mid")) {
|
||||
edge = network_edges.get((data.id.split("_")[0]) + "_to");
|
||||
editExistingEdge(edge, null);
|
||||
return;
|
||||
|
||||
// If we have an ID that is non numeric, we can check node type further
|
||||
if(data.id && isNaN(data.id)) {
|
||||
// Editing a mid point node triggers editing the edge
|
||||
if(data.id.endsWith("_mid")) {
|
||||
edge = network_edges.get((data.id.split("_")[0]) + "_to");
|
||||
editExistingEdge(edge, null);
|
||||
return;
|
||||
}
|
||||
|
||||
// Legend nodes cannot be edited
|
||||
if (data.id.startsWith("legend_") ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(data.id in node_device_map) {
|
||||
// Nodes is linked to a device
|
||||
$("#device_id").val(node_device_map[data.id].device_id);
|
||||
|
Reference in New Issue
Block a user