Skip to content

Commit

Permalink
Fix bands and improve chart.
Browse files Browse the repository at this point in the history
  • Loading branch information
the-harry committed Jan 9, 2024
1 parent 8949d9b commit 288cd1f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 40 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ If you wish to also install OpenWrt in a raspberry PI to use it as main router a

## FEATURES

#### New V3.0.2 screenshots
#### New V3.0.3 screenshot

![V3.0.2](https://github.com/ZTETool/ZTE-MU5001-HACK/assets/38408536/e1565d82-2e8a-4712-beeb-3b75f700551f)
![V3.0.3](https://github.com/ZTETool/ZTE-MU5001-HACK/assets/38408536/38f2494f-404b-49eb-82a9-b55e47f48e50)

- Live metrics
- All available menus of the router(hidden ones and the regular ones)
Expand Down
31 changes: 29 additions & 2 deletions src/chart.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ span.statusItem:nth-child(12) > b:nth-child(1) {
color: green;
}

#HACK_MENU, #HACK_MENU * {
#HACK_MENU div {
color: #ffffff;
}

#HACK_MENU span {
color: green;
}

#HACK_MENU a {
color: #ffffff;
}
Expand Down Expand Up @@ -136,10 +140,11 @@ span.statusItem:nth-child(12) > b:nth-child(1) {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: space-around;
margin: 0;
padding: 10px;
text-align: center;
justify-content: center;
align-items: center;
}

#HACK_MENU .metrics-box div,
Expand Down Expand Up @@ -175,3 +180,25 @@ span.statusItem:nth-child(12) > b:nth-child(1) {
flex-basis: content;
margin: 0;
}

#HACK_MENU a,
#HACK_MENU button,
#HACK_MENU .menu-item button,
#HACK_MENU .dropdown-content a {
color: #ff21ff;
}

#HACK_MENU .dropdown-content a:hover {
color: green;
}

#network_type {
font-size: 5vw;
font-weight: bold;
display: block;
width: 100%;
height: 100%;
text-align: center;
white-space: nowrap;
overflow: hidden;
}
12 changes: 6 additions & 6 deletions src/chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<div id="HACK_MENU">
<div class="centered">
<h2>
<a href="https://github.com/ZTETool/ZTE-MU5001-HACK" target="_blank">ZTE-MU5001-HACK V3.0.2</a>
<a href="https://github.com/ZTETool/ZTE-MU5001-HACK" target="_blank">ZTE-MU5001-HACK V3.0.3</a>
</h2>
<a onclick="softwareInfo()">Software version info</a> - <a href="#" onclick="setChart()">Start Chart</a>
<a onclick="softwareInfo()">Software version info</a> - <a href="#" onclick="setChart()">Click here to (re)start metrics</a>
</div>
<div class="chart-container">
<canvas id="metricsChart" height="400"></canvas>
Expand All @@ -21,9 +21,9 @@ <h2>
<div><span id="network_type">NO SIGNAL</span></div>
</div>
<div class="metrics-box">
<div>Main: <span id="lte_ca_pcell_band"></span>0<span id="lte_ca_pcell_bandwidth">0</span></div>
<div>Ca: <span id="lte_multi_ca_scell_info">0</span></div>
<div>Cell lock mode: <span id="earfcn_lock">0</span></div>
<div>MAIN:<span id="lte_ca_pcell_band"></span><span id="lte_ca_pcell_bandwidth">-</span></div>
<div id="ca">CA:<span id="lte_multi_ca_scell_info">-</span></div>
<div>Cell lock mode: <span id="earfcn_lock">-</span></div>
<div class="link-box">
<a onclick="extraBandsInfo()">Extra bands info</a>
<hr>
Expand All @@ -38,7 +38,7 @@ <h2>
<div id="HIDDEN_MENUS" class="menu">
<div class="menu-item info-item">
<div>WAN IP: <span id="wan_ipaddr">0.0.0.0</span></div>
<div>DNS SERVERS: <span id="dns_mode">0.0.0.0|0.0.0.0</span></div>
<div>DNS SERVERS: <span id="dns_mode">0.0.0.0, 0.0.0.0</span></div>
</div>

<div class="menu-item">
Expand Down
38 changes: 9 additions & 29 deletions src/hack.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var version = "V3.0.2";
var version = "V3.0.3";
var signal = "";
var chart;
var memory = {
Expand Down Expand Up @@ -74,21 +74,9 @@ function createLineChart(chartId) {
},
}
},
tooltips: {
callbacks: {
label: function(context) {
const datasetLabel = context.dataset.label || '';
const yLabel = context.parsed.y + ' dBm';
return `${datasetLabel}: ${yLabel}`;
},
title: function(tooltipItems) {
return `Time: ${tooltipItems[0].label}`;
}
}
},
elements: {
point: {
pointStyle: 'circle',
pointStyle: 'dash',
},
line: {
backgroundColor: gradient,
Expand Down Expand Up @@ -205,9 +193,9 @@ function getStatus() {
// fix the ids below

if ("ca_activated" == wan_lte_ca) {
$("#ca").parent().parent().css("border-color", "red");
$("#ca").parent().css("border-color", "red");
} else {
$("#ca").parent().parent().css("border-color", "#bbb");
$("#ca").parent().css("border-color", "#bbb");
}

if ("" != lte_multi_ca_scell_info) {
Expand All @@ -217,12 +205,7 @@ function getStatus() {
d = caV[i].split(",");
b = d[3];
w = d[5];
caTxt +=
'<span style="color:#b00;">B' +
b +
"</span>(@" +
w +
"Mhz)+";
caTxt += '<span style="color:#b00;">B' + b + "</span>(@" + w + "Mhz)+";
}
lteCaPcellBand = "B" + lte_ca_pcell_band;
} else {
Expand All @@ -231,23 +214,20 @@ function getStatus() {
}

if (data.nr5g_action_band) {
caTxt +=
'<span style="padding:5px;border-radius:3px;font-size:1.2em;background-color:#eef;color:red;font-weight:bold;">' +
data.nr5g_action_band +
"</span>";
caTxt += '<span style="padding:5px;border-radius:3px;font-size:1.2em;background-color:#eef;color:red;font-weight:bold;">' + data.nr5g_action_band + "</span>";
}

caTxt = caTxt.slice(0, -1);
lteMultiCaScellInfo = caTxt;
lte_multi_ca_scell_info = caTxt;

if ("manual" == dns_mode) {
dns_mode = prefer_dns_manual + " ," + standby_dns_manual;
}

dns_mode = dns_mode.replace(/,+$/, "");
dns_mode = '<span style="color:#b00;">' + dns_mode + "</span>";
dns_mode = '<span>' + dns_mode + "</span>";

lteCaPcellBandwidth =
lte_ca_pcell_bandwidth =
lte_ca_pcell_bandwidth && "(@" + lte_ca_pcell_bandwidth + "Mhz)";

for (i = 0; i < vars.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "ZTE-MU5001-HACK",
"version": "3.0.2",
"version": "3.0.3",
"description": "Enables hidden menus and metrics for the ZTE-MU5001 router.",
"permissions": [
"http://192.168.0.1/*",
Expand Down

0 comments on commit 288cd1f

Please sign in to comment.