Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for upload speed #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docker/standalone.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ function classifySpeed(value) {
if (value >= 10) return 2;
return 1;

}

function classifySpeedUl(value) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it classifySpeedUpload avoid short forms

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are made, kindly validate

if (value=="") return 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

if (value > 20) return 3;
if (value >= 5) return 2;
return 1;

}

function updateDlColor(value) {
Expand All @@ -76,7 +84,7 @@ function updateDlColor(value) {
function updateUlColor(value) {

const ul_text_element = document.getElementById("ulText");
const speed_classification = classifySpeed(value);
const speed_classification = classifySpeedUl(value);

switch (speed_classification){
case 3: ul_text_element.style.color = "#16A34A";
Expand Down
11 changes: 9 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
if (value >= 10) return 2;
return 1;

}

function classifySpeedUl(value) {
if (value=="") return 0;
if (value > 20) return 3;
if (value >= 5) return 2;
return 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are made, kindly validate


}

function updateDlColor(value) {
Expand All @@ -69,7 +77,7 @@
function updateUlColor(value) {

const ul_text_element = document.getElementById("ulText");
const speed_classification = classifySpeed(value);
const speed_classification = classifySpeedUl(value);

switch (speed_classification){
case 3: ul_text_element.style.color = "#16A34A";
Expand Down Expand Up @@ -202,7 +210,6 @@
updateUlColor(uiData.ulStatus);
}


updatePingColor(uiData.pingStatus);
updateJitterColor(uiData.jitterStatus);

Expand Down
Loading