diff --git a/front/deviceDetails.php b/front/deviceDetails.php index 7f104abc..6a8bfb83 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -641,14 +641,6 @@ if ($ENABLED_DARKMODE === True) { + @@ -79,16 +77,16 @@ - - - - @@ -157,7 +155,7 @@ $( "#tracerouteoutput" ).empty(); $.ajax({ method: "GET", - url: "./php/server/traceroute.php?action=get&ip=" + deviceIP + "", + url: "./php/server/traceroute.php?action=get&ip=" + getDeviceDataByMacAddress(getMac(), 'dev_LastIP') + "", beforeSend: function() { $('#tracerouteoutput').addClass("ajax_scripts_loading"); }, complete: function() { $('#tracerouteoutput').removeClass("ajax_scripts_loading"); }, success: function(data, textStatus) { @@ -172,7 +170,7 @@ $( "#nslookupoutput" ).empty(); $.ajax({ method: "GET", - url: "./php/server/nslookup.php?action=get&ip=" + deviceIP + "", + url: "./php/server/nslookup.php?action=get&ip=" + getDeviceDataByMacAddress(getMac(), 'dev_LastIP') + "", beforeSend: function() { $('#nslookupoutput').addClass("ajax_scripts_loading"); }, complete: function() { $('#nslookupoutput').removeClass("ajax_scripts_loading"); }, success: function(data, textStatus) { @@ -182,20 +180,22 @@ } // ---------------------------------------------------------------- - setTimeout(function(){ - document.getElementById('piamanualnmap_fast').innerHTML=' (' + deviceIP +')'; - document.getElementById('piamanualnmap_normal').innerHTML=' (' + deviceIP +')'; - document.getElementById('piamanualnmap_detail').innerHTML=' (' + deviceIP +')'; - document.getElementById('piamanualnmap_skipdiscovery').innerHTML=' (' + deviceIP +')'; - }, 2000); + function initNmapButtons() { + setTimeout(function(){ + document.getElementById('piamanualnmap_fast').innerHTML=getString( + "DevDetail_Nmap_buttonFast" + ) ; + document.getElementById('piamanualnmap_normal').innerHTML=getString( + "DevDetail_Nmap_buttonDefault" + ) ; + document.getElementById('piamanualnmap_detail').innerHTML=getString( + "DevDetail_Nmap_buttonDetail" + ) ; + document.getElementById('piamanualnmap_skipdiscovery').innerHTML=getString( + "DevDetail_Nmap_buttonSkipDiscovery" + ) ; + }, 500); + } // ---------------------------------------------------------------- @@ -211,4 +211,7 @@ } }) } + + // init first time + initNmapButtons(); diff --git a/front/js/common.js b/front/js/common.js index beb7d818..643b66ca 100755 --- a/front/js/common.js +++ b/front/js/common.js @@ -785,6 +785,15 @@ function checkMacOrInternet(inputStr) { } } +// ----------------------------------------------------------------------------- +// Gte MAC from query string +function getMac(){ + params = new Proxy(new URLSearchParams(window.location.search), { + get: (searchParams, prop) => searchParams.get(prop), + }); + + return params.mac +} // ----------------------------------------------------------------------------- // A function used to make the IP address orderable