Minified all CSS and JS script

This commit is contained in:
Donald Cheng Hong Zou
2021-12-30 15:21:25 -05:00
parent 7d9bf01d27
commit 06dd641274
9 changed files with 24 additions and 16 deletions

View File

@@ -1,5 +1,10 @@
let $body = $("body");
function roundN(value, digits) {
let tenToN = 10 ** digits;
return (Math.round(value * tenToN)) / tenToN;
}
// Progress Bar
let $progress_bar = $(".progress-bar");
function startProgressBar(){
@@ -13,9 +18,11 @@ function startProgressBar(){
stillLoadingProgressBar();
},300);
}
function stillLoadingProgressBar(){
$progress_bar.css("transition", "3s ease-in-out").css("width", "75%");
}
function endProgressBar(){
$progress_bar.css("transition", "0.3s ease-in-out").css("width","100%");
setTimeout(function(){
@@ -433,7 +440,7 @@ $body.on("click", ".display_mode", function(){
Array($(".peer_list").children()).forEach(function(child){
$(child).removeClass().addClass("col-sm-6 col-lg-4");
});
showToast("Displaying as Grid");
showToast("Displaying as Grids");
}
}
}

1
src/static/js/configuration.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -14,12 +14,7 @@ $(".conf_dropdown").change(function (){
}
})
});
// Ping Tools
$(".send_ping").click(function (){
$(this).attr("disabled","disabled")
$(this).html("Pinging...")

1
src/static/js/tools.min.js vendored Normal file
View File

@@ -0,0 +1 @@
$(".ip_dropdown").change(function(){$(".modal.show .btn").removeAttr("disabled")});$(".conf_dropdown").change(function(){$(".modal.show .ip_dropdown").html('<option value="none" selected="selected" disabled>Loading...');$.ajax({url:"/get_ping_ip",method:"POST",data:"config="+$(this).children("option:selected").val(),success:function(res){$(".modal.show .ip_dropdown").html("");$(".modal.show .ip_dropdown").append('<option value="none" selected="selected" disabled>Choose an IP');$(".modal.show .ip_dropdown").append(res)}})});$(".send_ping").click(function(){$(this).attr("disabled","disabled");$(this).html("Pinging...");$("#ping_modal .form-control").attr("disabled","disabled");$.ajax({method:"POST",data:"ip="+$(":selected",$("#ping_modal .ip_dropdown")).val()+"&count="+$("#ping_modal .ping_count").val(),url:"/ping_ip",success:function(res){$(".ping_result tbody").html("");html='<tr><th scope="row">Address</th><td>'+res["address"]+"</td></tr>"+'<tr><th scope="row">Is Alive</th><td>'+res["is_alive"]+"</td></tr>"+'<tr><th scope="row">Min RTT</th><td>'+res["min_rtt"]+"ms</td></tr>"+'<tr><th scope="row">Average RTT </th><td>'+res["avg_rtt"]+"ms</td></tr>"+'<tr><th scope="row">Max RTT</th><td>'+res["max_rtt"]+"ms</td></tr>"+'<tr><th scope="row">Package Sent</th><td>'+res["package_sent"]+"</td></tr>"+'<tr><th scope="row">Package Received</th><td>'+res["package_received"]+"</td></tr>"+'<tr><th scope="row">Package Loss</th><td>'+res["package_loss"]+"</td></tr>";$(".ping_result tbody").html(html);$(".send_ping").removeAttr("disabled");$(".send_ping").html("Ping");$("#ping_modal .form-control").removeAttr("disabled")}})});$(".send_traceroute").click(function(){$(this).attr("disabled","disabled");$(this).html("Tracing...");$("#traceroute_modal .form-control").attr("disabled","disabled");$.ajax({url:"/traceroute_ip",method:"POST",data:"ip="+$(":selected",$("#traceroute_modal .ip_dropdown")).val(),success:function(res){$(".traceroute_result tbody").html("");for(i in res){$(".traceroute_result tbody").append('<tr><th scope="row">'+res[i]["hop"]+"</th><td>"+res[i]["ip"]+"</td><td>"+res[i]["avg_rtt"]+"</td><td>"+res[i]["min_rtt"]+"</td><td>"+res[i]["max_rtt"]+"</td></tr>")}$(".send_traceroute").removeAttr("disabled");$(".send_traceroute").html("Traceroute");$("#traceroute_modal .form-control").removeAttr("disabled")}})});