IP address not updated when <> used #626
This commit is contained in:
@@ -641,14 +641,6 @@ if ($ENABLED_DARKMODE === True) {
|
|||||||
<!-- page script ----------------------------------------------------------- -->
|
<!-- page script ----------------------------------------------------------- -->
|
||||||
<script defer>
|
<script defer>
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
|
||||||
function getMac(){
|
|
||||||
params = new Proxy(new URLSearchParams(window.location.search), {
|
|
||||||
get: (searchParams, prop) => searchParams.get(prop),
|
|
||||||
});
|
|
||||||
|
|
||||||
return params.mac
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
function getDevicesList()
|
function getDevicesList()
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<script>
|
|
||||||
deviceIP = getDeviceDataByMacAddress("<?php echo $_REQUEST["mac"]?>", "dev_LastIP")
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<?php if ($_REQUEST["mac"] == "Internet") { ?>
|
<?php if ($_REQUEST["mac"] == "Internet") { ?>
|
||||||
|
|
||||||
@@ -79,16 +77,16 @@
|
|||||||
<?= lang("DevDetail_Nmap_Scans_desc") ?>
|
<?= lang("DevDetail_Nmap_Scans_desc") ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(deviceIP, 'fast')">
|
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMacAddress(getMac(), 'dev_LastIP'), 'fast')">
|
||||||
<?= lang("DevDetail_Loading") ?>
|
<?= lang("DevDetail_Loading") ?>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(deviceIP, 'normal')">
|
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMacAddress(getMac(), 'dev_LastIP'), 'normal')">
|
||||||
<?= lang("DevDetail_Loading") ?>
|
<?= lang("DevDetail_Loading") ?>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(deviceIP, 'detail')">
|
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMacAddress(getMac(), 'dev_LastIP'), 'detail')">
|
||||||
<?= lang("DevDetail_Loading") ?>
|
<?= lang("DevDetail_Loading") ?>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(deviceIP, 'skipdiscovery')">
|
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMacAddress(getMac(), 'dev_LastIP'), 'skipdiscovery')">
|
||||||
<?= lang("DevDetail_Loading") ?>
|
<?= lang("DevDetail_Loading") ?>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -157,7 +155,7 @@
|
|||||||
$( "#tracerouteoutput" ).empty();
|
$( "#tracerouteoutput" ).empty();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
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"); },
|
beforeSend: function() { $('#tracerouteoutput').addClass("ajax_scripts_loading"); },
|
||||||
complete: function() { $('#tracerouteoutput').removeClass("ajax_scripts_loading"); },
|
complete: function() { $('#tracerouteoutput').removeClass("ajax_scripts_loading"); },
|
||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
@@ -172,7 +170,7 @@
|
|||||||
$( "#nslookupoutput" ).empty();
|
$( "#nslookupoutput" ).empty();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
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"); },
|
beforeSend: function() { $('#nslookupoutput').addClass("ajax_scripts_loading"); },
|
||||||
complete: function() { $('#nslookupoutput').removeClass("ajax_scripts_loading"); },
|
complete: function() { $('#nslookupoutput').removeClass("ajax_scripts_loading"); },
|
||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
@@ -182,20 +180,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
setTimeout(function(){
|
function initNmapButtons() {
|
||||||
document.getElementById('piamanualnmap_fast').innerHTML='<?= lang(
|
setTimeout(function(){
|
||||||
"DevDetail_Nmap_buttonFast"
|
document.getElementById('piamanualnmap_fast').innerHTML=getString(
|
||||||
) ?> (' + deviceIP +')';
|
"DevDetail_Nmap_buttonFast"
|
||||||
document.getElementById('piamanualnmap_normal').innerHTML='<?= lang(
|
) ;
|
||||||
"DevDetail_Nmap_buttonDefault"
|
document.getElementById('piamanualnmap_normal').innerHTML=getString(
|
||||||
) ?> (' + deviceIP +')';
|
"DevDetail_Nmap_buttonDefault"
|
||||||
document.getElementById('piamanualnmap_detail').innerHTML='<?= lang(
|
) ;
|
||||||
"DevDetail_Nmap_buttonDetail"
|
document.getElementById('piamanualnmap_detail').innerHTML=getString(
|
||||||
) ?> (' + deviceIP +')';
|
"DevDetail_Nmap_buttonDetail"
|
||||||
document.getElementById('piamanualnmap_skipdiscovery').innerHTML='<?= lang(
|
) ;
|
||||||
"DevDetail_Nmap_buttonSkipDiscovery"
|
document.getElementById('piamanualnmap_skipdiscovery').innerHTML=getString(
|
||||||
) ?> (' + deviceIP +')';
|
"DevDetail_Nmap_buttonSkipDiscovery"
|
||||||
}, 2000);
|
) ;
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
@@ -211,4 +211,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// init first time
|
||||||
|
initNmapButtons();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -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
|
// A function used to make the IP address orderable
|
||||||
|
|||||||
Reference in New Issue
Block a user