Skip to content

Commit

Permalink
Fix for missing function, link to node via node name
Browse files Browse the repository at this point in the history
  • Loading branch information
mcartmel authored and scroix committed Apr 1, 2024
1 parent 8e17763 commit b53ed50
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nodel-webui-js/src/nodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,20 @@ var setEvents = function(){
}
});
});
$('body').on('click','*[data-link-node]', function (e) {
e.stopPropagation(); e.preventDefault();
var ele = $(this);
var lnode = $(ele).data('link-node');
var newWindow = window.open(proto+'//'+host);
if(lnode!==''){
newWindow.location = proto+'//'+host+'/?filter='+lnode;
$.postJSON(proto+'//'+host+'/REST/nodeURLsForNode',JSON.stringify({'name':lnode}), function(data) {
if (!_.isUndefined(data[0]['address'])){
newWindow.location = data[0]['address'];
}
});
}
});
$('body').on('click','*[data-link-url]', function (e) {
e.stopPropagation(); e.preventDefault();
window.open($(this).data('link-url'));
Expand Down

0 comments on commit b53ed50

Please sign in to comment.