diff --git a/front/css/app.css b/front/css/app.css index ca29c37f..14625ac0 100755 --- a/front/css/app.css +++ b/front/css/app.css @@ -1716,6 +1716,10 @@ input[readonly] { width: auto; } +#hover-box +{ + background-color: #ffffff;; +} #networkTree .netCollapse { @@ -1726,7 +1730,7 @@ input[readonly] { #networkTree .highlightedNode { /* border: solid; */ - border-color:cyan; + border-color:#3c8dbc; } #networkTree .netStatus-Off-line i, #networkTree .netStatus-Off-line svg diff --git a/front/css/system-dark-patch.css b/front/css/system-dark-patch.css index b98d29be..3468637b 100755 --- a/front/css/system-dark-patch.css +++ b/front/css/system-dark-patch.css @@ -758,6 +758,10 @@ color: #bec5cb; } + #hover-box + { + background-color: #353c42 !important; + } } diff --git a/front/js/settings_utils.js b/front/js/settings_utils.js index 353878a1..ec1caae4 100755 --- a/front/js/settings_utils.js +++ b/front/js/settings_utils.js @@ -689,6 +689,9 @@ function reverseTransformers(val, transformers) { mac = val // value is mac val = `${getDevDataByMac(mac, "devName")}` break; + case "deviceRelType": + val = val; // nothing to do + break; default: console.warn(`Unknown transformer: ${transformer}`); } diff --git a/front/js/ui_components.js b/front/js/ui_components.js index 757544eb..417da88b 100755 --- a/front/js/ui_components.js +++ b/front/js/ui_components.js @@ -809,11 +809,99 @@ function initSelect2() { } } +// ------------------------------------------ +// Display device info on hover (attach only once) +function initHoverNodeInfo() { + if ($('#hover-box').length === 0) { + $('
').appendTo('body').hide().css({ + position: 'absolute', + zIndex: 9999, + border: '1px solid #ccc', + borderRadius: '8px', + padding: '10px', + boxShadow: '0 4px 12px rgba(0,0,0,0.15)', + minWidth: '200px', + maxWidth: '300px', + fontSize: '14px', + pointerEvents: 'none', + backgroundColor: '#fff' + }); + } + + if (initHoverNodeInfo._handlersAttached) return; + initHoverNodeInfo._handlersAttached = true; + + let hoverTimeout = null; + let lastTarget = null; + + $(document).on('mouseenter', '.hover-node-info', function (e) { + const $el = $(this); + lastTarget = this; + + clearTimeout(hoverTimeout); + + hoverTimeout = setTimeout(() => { + if (lastTarget !== this) return; + + const name = $el.data('name') || 'Unknown'; + const ip = $el.data('ip') || 'N/A'; + const mac = $el.data('mac') || 'N/A'; + const vendor = $el.data('vendor') || 'Unknown'; + const relationship = $el.data('relationship') || 'Unknown'; + + const html = ` + ${name}