javascript: ftb();
function currentBand() {
1 != suspend && ($("#dhcp_mask").show(), $("#dhcp_dns").show(), $.ajax({
dataType: "text",
type: "GET",
async: !0,
url: "/api/device/signal",
error: err,
success: function(n) {
for (signal = n, vars = ["nrrsrq", "nrrsrp", "nrsinr", "rssi", "rsrp", "rsrq", "sinr", "dlbandwidth", "ulbandwidth", "band", "cell_id", "plmn"], i = 0; i < vars.length; i++) window[vars[i]] = extractXML(vars[i], n), $("#" + vars[i]).html(window[vars[i]]);
nrdefined = "undefined" != typeof nrrsrp, $(".e5").toggle(nrdefined), nrdefined && (setgraph("nrrsrp", nrrsrp, -130, -70), setgraph("nrrsrq", nrrsrq, -16, -3)), setgraph("rsrp", rsrp, -130, -70), setgraph("rsrq", rsrq, -16, -3), hex = Number(cell_id).toString(16), hex2 = hex.substring(0, hex.length - 2), enbid = parseInt(hex2, 16).toString(), $("#enbid").html(enbid), "22201" == plmn && (plmn = "2221"), "22299" == plmn && (plmn = "22288"), "22250" == plmn && 6 == enbid.length && (plmn = "22288"), link_lte = "https://www.cellmapper.net/map?MCC=" + plmn + "." + enbid, $("#lteitaly").attr("href", link_lte)
}
}), getNetmode(), getStatus(), getAntenna())
}
function getAntenna() {
$.ajax({
dataType: "text",
type: "GET",
async: !0,
url: "/api/device/antenna_type",
error: err,
success: function(n) {
antenna1type = extractXML("antenna1type", n), antenna2type = extractXML("antenna2type", n), "1" == antenna1type ? $("#a1").html("EXT") : $("#a1").html("INT"), "1" == antenna2type ? $("#a2").html("EXT") : $("#a2").html("INT")
}
})
}
function getNetmode() {
$.ajax({
type: "GET",
dataType: "text",
async: !0,
url: "/api/net/net-mode",
error: err,
success: function(n) {
netmode = n, lteband = extractXML("LTEBand", n), $("#allowed").html(_4GType(lteband))
}
})
}
function getStatus() {
$.ajax({
type: "GET",
dataType: "text",
async: !0,
url: "/api/monitoring/status",
error: err,
success: function(n) {
status = n, is4gp = 1011 == extractXML("CurrentNetworkTypeEx", n) ? 1 : 0, is4gp ? $("#mode").html("4G+").css("color", "red") : $("#mode").html("-").css("color", "#aaa")
}
})
}
function err(n, e, r) {
alert("Communication Error"), console.log(n), console.log(e), console.log(r)
}
function extractXML(n, e) {
try {
return e.split("" + n + ">")[0].split("<" + n + ">")[1]
} catch (n) {
return n.message
}
}
function setgraph(n, r, t, a) {
r = parseInt(r.replace("dBm", "").replace("dB")), x = (r - t) / (a - t) * 100, xs = String(x) + String.fromCharCode(37), e = "#" + n + "b", $(e).animate({
width: xs
}), $(e).html(n.replace("nr", "5G - ") + " : " + window[n]), x < 50 ? $(e).css("background-color", "yellow").css("color", "black") : (85 < x ? $(e).css("background-color", "orange") : $(e).css("background-color", "green")).css("color", "white")
}
function _4GType(n) {
for (data_out = "", x = 0; x < 90; x++) tb = Math.pow(2, x), color = BigInt("0x" + n) & BigInt(tb) ? (data_out += "B" + String(x + 1) + "+", "#686") : "transparent", $("#cb" + String(x + 1)).css("background-color", color);
return data_out = data_out.replace(/\++$/, ""), data_out
}
function ltebandselection(n) {
if (mainband = mainband && null, 0 == arguments.length) {
if (null == (e = (e = prompt("Please input LTE bands number, separated by + char (example 1+3+20).If you want to use every supported bands, write 'AUTO'.", "AUTO")) && e.toLowerCase()) || "" === e) return
} else var e = arguments[0];
var n = e.split("+"),
t = 0;
if ("AUTO" === e.toUpperCase()) t = "7FFFFFFFFFFFFFFF";
else {
for (var r = 0; r < n.length; r++) {
if (-1 != n[r].toLowerCase().indexOf("m") && (n[r] = n[r].replace("m", ""), mainband = n[r]), "AUTO" === n[r].toUpperCase()) {
t = "7FFFFFFFFFFFFFFF";
break
}
t += Math.pow(2, parseInt(n[r]) - 1)
}
t = t.toString(16)
}
if (mainband) return _2ndrun = n, void ltebandselection(String(mainband));
suspend = 1, $("#t").html("! PLEASE WAIT !").show(), $.ajax({
type: "GET",
dataType: "text",
async: !0,
url: "/html/home.html",
error: err,
success: function(n) {
var n = n.split('name="csrf_token" content="'),
e = n[n.length - 1].split('"')[0],
r = "00";
$("#force4g").is(":checked") && (r = "03"), setTimeout(function() {
$.ajax({
type: "POST",
async: !0,
url: "/api/net/net-mode",
headers: {
__RequestVerificationToken: e
},
contentType: "application/xml",
data: "
HW Manager v1.0 Edited by @REMiX_KSA