Merge pull request #46 from dr-dolomite/development-socat
Added Improvements for BW Parsing, Improved Function Queuing for Simple Network and Fixed TTL Settings
This commit is contained in:
43
simpleadmin/script/ttl_script.sh
Normal file
43
simpleadmin/script/ttl_script.sh
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Check if the required parameters are provided
|
||||||
|
if [ "$#" -ne 2 ]; then
|
||||||
|
echo "Usage: $0 <enable|disable> <ttl_value>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Assign the provided parameters to variables
|
||||||
|
mode="$1"
|
||||||
|
ttl_value="$2"
|
||||||
|
|
||||||
|
# Check if iptables is still set
|
||||||
|
ttlcheck=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}')
|
||||||
|
|
||||||
|
# If TTL is still set, manually remove values
|
||||||
|
if [ ! -z "${ttlcheck}" ]; then
|
||||||
|
/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -D POSTROUTING -o rmnet+ -j TTL --ttl-set "${ttlcheck}" &>/dev/null || true
|
||||||
|
/opt/bin/sudo /usr/sbin/ip6tables -w 5 -t mangle -D POSTROUTING -o rmnet+ -j HL --hl-set "${ttlcheck}" &>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Handle the enable/disable mode
|
||||||
|
case "${mode}" in
|
||||||
|
enable)
|
||||||
|
# Echo TTL to file
|
||||||
|
echo "${ttl_value}" > /usrdata/simplefirewall/ttlvalue
|
||||||
|
|
||||||
|
# Set Start Service
|
||||||
|
/opt/bin/sudo /usrdata/simplefirewall/ttl-override start
|
||||||
|
;;
|
||||||
|
disable)
|
||||||
|
# Remove TTL value file
|
||||||
|
rm -f /usrdata/simplefirewall/ttlvalue
|
||||||
|
|
||||||
|
# Stop the service
|
||||||
|
/opt/bin/sudo /usrdata/simplefirewall/ttl-override stop
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid mode: ${mode}"
|
||||||
|
echo "Usage: $0 <enable|disable> <ttl_value>"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -1,62 +1,47 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PATH=/bin:/usr/sbin:/usr/bin:/sbin:/opt/sbin:/opt/bin:/usrdata/root/bin
|
PATH=/bin:/usr/sbin:/usr/bin:/sbin:/opt/sbin:/opt/bin:/usrdata/root/bin
|
||||||
|
|
||||||
# Get query
|
# Get query
|
||||||
QUERY_STRING=$(echo "${QUERY_STRING}" | sed 's/;//g')
|
QUERY_STRING=$(echo "${QUERY_STRING}" | sed 's/;//g')
|
||||||
|
|
||||||
if [ "${QUERY_STRING}" ]; then
|
if [ "${QUERY_STRING}" ]; then
|
||||||
|
export IFS="&"
|
||||||
export IFS="&"
|
for cmd in ${QUERY_STRING}; do
|
||||||
for cmd in ${QUERY_STRING}; do
|
if [ "$(echo $cmd | grep '=')" ]; then
|
||||||
|
key=$(echo $cmd | awk -F '=' '{print $1}')
|
||||||
if [ "$(echo $cmd | grep '=')" ]; then
|
value=$(echo $cmd | awk -F '=' '{print $2}')
|
||||||
key=$(echo $cmd | awk -F '=' '{print $1}')
|
eval $key=$value
|
||||||
value=$(echo $cmd | awk -F '=' '{print $2}')
|
fi
|
||||||
eval $key=$value
|
done
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setTTL=$(printf '%b\n' "${ttlvalue//%/\\x}")
|
# Convert ttlvalue to integer
|
||||||
|
if [ "${ttlvalue}" ]; then
|
||||||
if [ -n "${setTTL}" ]; then
|
ttlvalue_int=$(echo "${ttlvalue}" | sed 's/[^0-9]*//g')
|
||||||
# Stop Service To Remove Rules
|
|
||||||
/opt/bin/sudo /usrdata/simplefirewall/ttl-override stop
|
|
||||||
|
|
||||||
# Check iptables is still set
|
|
||||||
ttlcheck=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}')
|
|
||||||
|
|
||||||
# If TTL is still set manually remove values
|
|
||||||
if [ ! -z "${ttlcheck}" ]; then
|
|
||||||
/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -D POSTROUTING -o rmnet+ -j TTL --ttl-set ${ttlcheck} &>/dev/null || true
|
|
||||||
/opt/bin/sudo /usr/sbin/ip6tables -w 5 -t mangle -D POSTROUTING -o rmnet+ -j HL --hl-set ${ttlcheck} &>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Echo TTL to file
|
|
||||||
echo $setTTL > /usrdata/simplefirewall/ttlvalue
|
|
||||||
|
|
||||||
# Set Start Service
|
|
||||||
/opt/bin/sudo /usrdata/simplefirewall/ttl-override start
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Call the sh script with the appropriate parameters. If ttlvalue_int is not 0, then enable the script with the value of ttlvalue_int. If ttlvalue is disable, then disable the script.
|
||||||
|
|
||||||
|
if [ "${ttlvalue_int}" != 0 ]; then
|
||||||
# Check iptables for ttlvalue
|
/usrdata/simpleadmin/script/ttl_script.sh enable "${ttlvalue_int}"
|
||||||
ttlvalue=$(/opt/bin/sudo /usr/sbin/iptables -w 5 -t mangle -vnL | grep TTL | awk '{print $13}')
|
# Set ttlenabled to true
|
||||||
ttlenabled=true;
|
ttlenabled=true
|
||||||
|
# Set ttlvalue to the value of ttlvalue_int
|
||||||
# Set Variables
|
ttlvalue=$ttlvalue_int
|
||||||
if [ -z "${ttlvalue}" ]; then
|
elif [ "${ttlvalue_int}" = 0 ]; then
|
||||||
ttlvalue=0
|
/usrdata/simpleadmin/script/ttl_script.sh disable 0
|
||||||
|
# Set ttlenabled to false
|
||||||
ttlenabled=false
|
ttlenabled=false
|
||||||
|
# Set ttlvalue to 0
|
||||||
|
ttlvalue=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Content-type: text/json"
|
# Output the result in JSON format
|
||||||
|
|
||||||
|
echo "Content-type: text/json"
|
||||||
echo ""
|
echo ""
|
||||||
cat <<EOT
|
cat <<EOT
|
||||||
{
|
{
|
||||||
"isEnabled": $ttlenabled,
|
"isEnabled": $ttlenabled,
|
||||||
"ttl": $ttlvalue
|
"ttl": $ttlvalue
|
||||||
}
|
}
|
||||||
EOT
|
EOT
|
||||||
@@ -54,6 +54,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/console">Console</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a
|
<a
|
||||||
class="nav-link active"
|
class="nav-link active"
|
||||||
|
|||||||
@@ -59,6 +59,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/console">Console</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/deviceinfo.html"
|
<a class="nav-link" href="/deviceinfo.html"
|
||||||
>Device Information</a
|
>Device Information</a
|
||||||
@@ -718,7 +721,7 @@
|
|||||||
|
|
||||||
// Calculate the NR bandwidth
|
// Calculate the NR bandwidth
|
||||||
this.bandwidth =
|
this.bandwidth =
|
||||||
this.calculate_nr_bw(nr_bw).toString() + " MHz";
|
"NR " + this.calculate_nr_bw(nr_bw).toString() + " MHz";
|
||||||
|
|
||||||
// Parse the PCIs
|
// Parse the PCIs
|
||||||
this.pcc_pci = lines[27].split(",")[7].replace(/"/g, "");
|
this.pcc_pci = lines[27].split(",")[7].replace(/"/g, "");
|
||||||
@@ -792,9 +795,9 @@
|
|||||||
|
|
||||||
// Calculate the LTE bandwidth
|
// Calculate the LTE bandwidth
|
||||||
this.bandwidth =
|
this.bandwidth =
|
||||||
this.calculate_lte_bw(lte_bw_ul) +
|
"UL " + this.calculate_lte_bw(lte_bw_ul) +
|
||||||
" MHz / " +
|
" MHz / " +
|
||||||
this.calculate_lte_bw(lte_bw_dl) +
|
"DL " + this.calculate_lte_bw(lte_bw_dl) +
|
||||||
" MHz";
|
" MHz";
|
||||||
|
|
||||||
// Get the Cell ID
|
// Get the Cell ID
|
||||||
@@ -874,8 +877,8 @@
|
|||||||
// Calculate the LTE bandwidth
|
// Calculate the LTE bandwidth
|
||||||
this.bandwidth =
|
this.bandwidth =
|
||||||
this.calculate_lte_bw(lte_bw_ul) +
|
this.calculate_lte_bw(lte_bw_ul) +
|
||||||
" MHz / " +
|
" MHz, " +
|
||||||
this.calculate_lte_bw(lte_bw_dl) +
|
"NR " + this.calculate_lte_bw(lte_bw_dl) +
|
||||||
" MHz";
|
" MHz";
|
||||||
|
|
||||||
// Get the RSSI
|
// Get the RSSI
|
||||||
|
|||||||
@@ -62,6 +62,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/console">Console</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="deviceinfo.html"
|
<a class="nav-link" href="deviceinfo.html"
|
||||||
>Device Information</a
|
>Device Information</a
|
||||||
@@ -97,10 +100,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-subtitle" x-show="isGettingBands">
|
<h5 class="card-subtitle" x-show="isGettingBands === true">
|
||||||
Fetching supported bands...
|
Fetching supported bands...
|
||||||
</h5>
|
</h5>
|
||||||
<form id="checkboxForm" x-show="isLoading === false">
|
<form id="checkboxForm" x-show="isGettingBands === false">
|
||||||
<!-- Checkboxes will be populated here -->
|
<!-- Checkboxes will be populated here -->
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -407,122 +410,6 @@
|
|||||||
<script src="js/populate-checkbox.js"></script>
|
<script src="js/populate-checkbox.js"></script>
|
||||||
<script src="js/parse-settings.js"></script>
|
<script src="js/parse-settings.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function requestATInfo(atcmd) {
|
|
||||||
return fetch(
|
|
||||||
"/cgi-bin/get_atcommand?" +
|
|
||||||
new URLSearchParams({
|
|
||||||
atcmd: atcmd,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.then((response) => response.text())
|
|
||||||
.then((data) => {
|
|
||||||
return data;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error("Error:", error);
|
|
||||||
// Throw the error again to ensure it's propagated
|
|
||||||
throw error;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSupportedBands() {
|
|
||||||
const atcmd = 'AT+QNWPREFCFG="policy_band"';
|
|
||||||
return requestATInfo(atcmd).then((rawdata) => {
|
|
||||||
let { lte_bands, nsa_bands, sa_bands } = parseSupportedBands(rawdata);
|
|
||||||
|
|
||||||
return {
|
|
||||||
lte_bands: lte_bands,
|
|
||||||
nsa_bands: nsa_bands,
|
|
||||||
sa_bands: sa_bands,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseSupportedBands(rawdata) {
|
|
||||||
const data = rawdata;
|
|
||||||
const regex = /"([^"]+)",([0-9:]+)/g;
|
|
||||||
|
|
||||||
// Object to store the results
|
|
||||||
const bands = {};
|
|
||||||
|
|
||||||
let match;
|
|
||||||
while ((match = regex.exec(data)) !== null) {
|
|
||||||
const bandType = match[1];
|
|
||||||
const numbers = match[2].split(":").map(Number);
|
|
||||||
bands[bandType] = numbers;
|
|
||||||
}
|
|
||||||
|
|
||||||
// log all the bands
|
|
||||||
console.log("Bands", bands);
|
|
||||||
console.log("LTE Band: ", bands.lte_band);
|
|
||||||
console.log("NR5G Band NSA: ", bands.nsa_nr5g_band);
|
|
||||||
console.log("NR5G Band SA: ", bands.nr5g_band);
|
|
||||||
|
|
||||||
// Seperate the bands for each network mode
|
|
||||||
const lte_bands = bands.lte_band.join(":");
|
|
||||||
const nsa_bands = bands.nsa_nr5g_band.join(":");
|
|
||||||
const sa_bands = bands.nr5g_band.join(":");
|
|
||||||
|
|
||||||
return {
|
|
||||||
lte_bands,
|
|
||||||
nsa_bands,
|
|
||||||
sa_bands,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseLockedBands(rawdata) {
|
|
||||||
const data = rawdata;
|
|
||||||
const regex = /"([^"]+)",([0-9:]+)/g;
|
|
||||||
|
|
||||||
// Object to store the results
|
|
||||||
const bands = {};
|
|
||||||
|
|
||||||
let match;
|
|
||||||
while ((match = regex.exec(data)) !== null) {
|
|
||||||
const bandType = match[1];
|
|
||||||
const numbers = match[2].split(":").map(Number);
|
|
||||||
bands[bandType] = numbers;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Seperate the bands for each network mode
|
|
||||||
const locked_lte_bands = bands.lte_band.join(":");
|
|
||||||
const locked_nsa_bands = bands.nsa_nr5g_band.join(":");
|
|
||||||
const locked_sa_bands = bands.nr5g_band.join(":");
|
|
||||||
|
|
||||||
return {
|
|
||||||
locked_lte_bands,
|
|
||||||
locked_nsa_bands,
|
|
||||||
locked_sa_bands,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLockedBands() {
|
|
||||||
const atcmd =
|
|
||||||
'AT+QNWPREFCFG="lte_band";+QNWPREFCFG= "nsa_nr5g_band";+QNWPREFCFG= "nr5g_band"';
|
|
||||||
|
|
||||||
return requestATInfo(atcmd).then((rawdata) => {
|
|
||||||
const lockedBandsData = parseLockedBands(rawdata);
|
|
||||||
return lockedBandsData;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// function getCurrentSettings() {
|
|
||||||
// const atcmd =
|
|
||||||
// 'AT+QUIMSLOT?;+CGCONTRDP=1;+QNWLOCK="common/4g";+QNWLOCK="common/5g";+QNWPREFCFG="mode_pref";+QNWPREFCFG="nr5g_disable_mode";+QCAINFO';
|
|
||||||
|
|
||||||
// return requestATInfo(atcmd).then((rawdata) => {
|
|
||||||
// const settings = parseCurrentSettings(rawdata);
|
|
||||||
// return {
|
|
||||||
// sim: settings.sim,
|
|
||||||
// apn: settings.apn,
|
|
||||||
// cellLockStatus: settings.cellLockStatus,
|
|
||||||
// prefNetwork: settings.prefNetwork,
|
|
||||||
// nrModeControl: settings.nrModeControl,
|
|
||||||
// bands: settings.bands,
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
function cellLocking() {
|
function cellLocking() {
|
||||||
return {
|
return {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
@@ -570,42 +457,94 @@
|
|||||||
cellLockStatus: "Unknown",
|
cellLockStatus: "Unknown",
|
||||||
bands: "Fetching Bands...",
|
bands: "Fetching Bands...",
|
||||||
isGettingBands: false,
|
isGettingBands: false,
|
||||||
|
rawdata: null,
|
||||||
|
|
||||||
|
getSupportedBands() {
|
||||||
|
const atcmd = 'AT+QNWPREFCFG="policy_band"';
|
||||||
|
this.sendATcommand(atcmd)
|
||||||
|
.then((rawdata) => {
|
||||||
|
this.rawdata = rawdata;
|
||||||
|
this.parseSupportedBands(rawdata);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getLockedBands();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
parseSupportedBands(rawdata) {
|
||||||
|
const data = rawdata;
|
||||||
|
const regex = /"([^"]+)",([0-9:]+)/g;
|
||||||
|
|
||||||
|
// Object to store the results
|
||||||
|
const bands = {};
|
||||||
|
|
||||||
|
let match;
|
||||||
|
while ((match = regex.exec(data)) !== null) {
|
||||||
|
const bandType = match[1];
|
||||||
|
const numbers = match[2].split(":").map(Number);
|
||||||
|
bands[bandType] = numbers;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Seperate the bands for each network mode
|
||||||
|
this.lte_bands = bands.lte_band.join(":");
|
||||||
|
this.nsa_bands = bands.nsa_nr5g_band.join(":");
|
||||||
|
this.sa_bands = bands.nr5g_band.join(":");
|
||||||
|
},
|
||||||
|
|
||||||
|
getLockedBands() {
|
||||||
|
const atcmd =
|
||||||
|
'AT+QNWPREFCFG="lte_band";+QNWPREFCFG= "nsa_nr5g_band";+QNWPREFCFG= "nr5g_band"';
|
||||||
|
|
||||||
|
this.sendATcommand(atcmd)
|
||||||
|
.then((rawdata) => {
|
||||||
|
this.rawdata = rawdata;
|
||||||
|
this.parseLockedBands(rawdata);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
// Call current settings
|
||||||
|
this.getCurrentSettings();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
parseLockedBands(rawdata) {
|
||||||
|
const data = rawdata;
|
||||||
|
const regex = /"([^"]+)",([0-9:]+)/g;
|
||||||
|
|
||||||
|
// Object to store the results
|
||||||
|
const bands = {};
|
||||||
|
|
||||||
|
let match;
|
||||||
|
while ((match = regex.exec(data)) !== null) {
|
||||||
|
const bandType = match[1];
|
||||||
|
const numbers = match[2].split(":").map(Number);
|
||||||
|
bands[bandType] = numbers;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Seperate the bands for each network mode
|
||||||
|
this.locked_lte_bands = bands.lte_band.join(":");
|
||||||
|
this.locked_nsa_bands = bands.nsa_nr5g_band.join(":");
|
||||||
|
this.locked_sa_bands = bands.nr5g_band.join(":");
|
||||||
|
|
||||||
|
populateCheckboxes(
|
||||||
|
this.lte_bands,
|
||||||
|
this.nsa_bands,
|
||||||
|
this.sa_bands,
|
||||||
|
this.locked_lte_bands,
|
||||||
|
this.locked_nsa_bands,
|
||||||
|
this.locked_sa_bands,
|
||||||
|
this
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
// Function to populate checkboxes
|
// Function to populate checkboxes
|
||||||
const showPopulateCheckboxes = () => {
|
const showPopulateCheckboxes = () => {
|
||||||
Promise.all([getSupportedBands(), getLockedBands()])
|
this.isGettingBands = true;
|
||||||
.then(([supportedBandsData, lockedBandsData]) => {
|
this.getSupportedBands();
|
||||||
this.isGettingBands = true;
|
this.isGettingBands = false;
|
||||||
this.lte_bands = supportedBandsData.lte_bands;
|
|
||||||
this.nsa_bands = supportedBandsData.nsa_bands;
|
|
||||||
this.sa_bands = supportedBandsData.sa_bands;
|
|
||||||
this.locked_lte_bands = lockedBandsData.locked_lte_bands;
|
|
||||||
this.locked_nsa_bands = lockedBandsData.locked_nsa_bands;
|
|
||||||
this.locked_sa_bands = lockedBandsData.locked_sa_bands;
|
|
||||||
|
|
||||||
// Once both promises are resolved, call populateCheckboxes
|
// Add event listeners to checkboxes after populating them
|
||||||
populateCheckboxes(
|
addCheckboxListeners(this);
|
||||||
this.lte_bands,
|
|
||||||
this.nsa_bands,
|
|
||||||
this.sa_bands,
|
|
||||||
this.locked_lte_bands,
|
|
||||||
this.locked_nsa_bands,
|
|
||||||
this.locked_sa_bands,
|
|
||||||
this
|
|
||||||
);
|
|
||||||
|
|
||||||
this.isGettingBands = false;
|
|
||||||
|
|
||||||
// Add event listeners to checkboxes after populating them
|
|
||||||
addCheckboxListeners(this);
|
|
||||||
|
|
||||||
// Call current settings
|
|
||||||
this.getCurrentSettings();
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error("Error:", error);
|
|
||||||
// Handle errors if any
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function to track checkbox changes
|
// Function to track checkbox changes
|
||||||
@@ -628,18 +567,6 @@
|
|||||||
this.updatedLockedBands = newCheckedValues;
|
this.updatedLockedBands = newCheckedValues;
|
||||||
};
|
};
|
||||||
|
|
||||||
// // Function to get the current settings
|
|
||||||
// const getCurrentSettingsData = () => {
|
|
||||||
// getCurrentSettings().then((settings) => {
|
|
||||||
// this.sim = settings.sim;
|
|
||||||
// this.apn = settings.apn;
|
|
||||||
// this.cellLockStatus = settings.cellLockStatus;
|
|
||||||
// this.prefNetwork = settings.prefNetwork;
|
|
||||||
// this.nrModeControl = settings.nrModeControl;
|
|
||||||
// this.bands = settings.bands;
|
|
||||||
// });
|
|
||||||
// };
|
|
||||||
|
|
||||||
// Function to add event listener to network mode dropdown
|
// Function to add event listener to network mode dropdown
|
||||||
const addNetworkModeListener = () => {
|
const addNetworkModeListener = () => {
|
||||||
document
|
document
|
||||||
@@ -657,16 +584,15 @@
|
|||||||
const atcmd =
|
const atcmd =
|
||||||
'AT+QUIMSLOT?;+CGCONTRDP=1;+QNWLOCK="common/4g";+QNWLOCK="common/5g";+QNWPREFCFG="mode_pref";+QNWPREFCFG="nr5g_disable_mode";+QCAINFO';
|
'AT+QUIMSLOT?;+CGCONTRDP=1;+QNWLOCK="common/4g";+QNWLOCK="common/5g";+QNWPREFCFG="mode_pref";+QNWPREFCFG="nr5g_disable_mode";+QCAINFO';
|
||||||
|
|
||||||
this.sendATcommand(atcmd).then((rawdata) => {
|
this.sendATcommand(atcmd).then((rawdata) => {
|
||||||
const settings = parseCurrentSettings(rawdata);
|
const settings = parseCurrentSettings(rawdata);
|
||||||
this.sim = settings.sim;
|
this.sim = settings.sim;
|
||||||
this.apn = settings.apn;
|
this.apn = settings.apn;
|
||||||
this.cellLockStatus = settings.cellLockStatus;
|
this.cellLockStatus = settings.cellLockStatus;
|
||||||
this.prefNetwork = settings.prefNetwork;
|
this.prefNetwork = settings.prefNetwork;
|
||||||
this.nrModeControl = settings.nrModeControl;
|
this.nrModeControl = settings.nrModeControl;
|
||||||
this.bands = settings.bands;
|
this.bands = settings.bands;
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
lockSelectedBands() {
|
lockSelectedBands() {
|
||||||
// Get the updated this.currentNetworkMode = selectedMode; and this.updatedLockedBands = newCheckedValues;
|
// Get the updated this.currentNetworkMode = selectedMode; and this.updatedLockedBands = newCheckedValues;
|
||||||
|
|||||||
@@ -55,6 +55,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/console">Console</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/deviceinfo.html"
|
<a class="nav-link" href="/deviceinfo.html"
|
||||||
>Device Information</a
|
>Device Information</a
|
||||||
|
|||||||
@@ -63,6 +63,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/console">Console</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/deviceinfo.html"
|
<a class="nav-link" href="/deviceinfo.html"
|
||||||
>Device Information</a
|
>Device Information</a
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ remount_rw
|
|||||||
echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
||||||
mkdir $SIMPLE_ADMIN_DIR
|
mkdir $SIMPLE_ADMIN_DIR
|
||||||
mkdir $SIMPLE_ADMIN_DIR/systemd
|
mkdir $SIMPLE_ADMIN_DIR/systemd
|
||||||
|
mkdir $SIMPLE_ADMIN_DIR/script
|
||||||
mkdir $SIMPLE_ADMIN_DIR/console
|
mkdir $SIMPLE_ADMIN_DIR/console
|
||||||
mkdir $SIMPLE_ADMIN_DIR/console/menu
|
mkdir $SIMPLE_ADMIN_DIR/console/menu
|
||||||
mkdir $SIMPLE_ADMIN_DIR/console/services
|
mkdir $SIMPLE_ADMIN_DIR/console/services
|
||||||
@@ -130,6 +131,9 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
|||||||
mkdir $SIMPLE_ADMIN_DIR/www/js
|
mkdir $SIMPLE_ADMIN_DIR/www/js
|
||||||
cd $SIMPLE_ADMIN_DIR/systemd
|
cd $SIMPLE_ADMIN_DIR/systemd
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/systemd/lighttpd.service
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/systemd/lighttpd.service
|
||||||
|
sleep 1
|
||||||
|
cd $SIMPLE_ADMIN_DIR/script
|
||||||
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/script/ttl_script.sh
|
||||||
sleep 1
|
sleep 1
|
||||||
cd $SIMPLE_ADMIN_DIR/www
|
cd $SIMPLE_ADMIN_DIR/www
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/deviceinfo.html
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/deviceinfo.html
|
||||||
|
|||||||
Reference in New Issue
Block a user