Fix some JS errors

This commit is contained in:
Michael Steenbeek 2018-12-04 10:22:59 +01:00 committed by Franco Fichtner
parent fada24d7c3
commit 69cc3895e6
6 changed files with 22 additions and 32 deletions

View File

@ -67,11 +67,11 @@ POSSIBILITY OF SUCH DAMAGE.
title: "{{ lang._('Flush ARP Table') }}",
message: "{{ lang._('Flush the ARP cache manually, in case your ARP cache contains invalid data.') }}",
buttons: [{
label: "<?= gettext("Close");?>",
label: "<?= gettext('Close');?>",
action: function(dialogRef) {
dialogRef.close();
}}, {
label: "<?= gettext("Flush ARP Table");?>",
label: "<?= gettext('Flush ARP Table');?>",
action: function(dialogRef) {
ajaxCall("/api/diagnostics/interface/flushArp", {}, function (data, status) {
$("#refresh").click();

View File

@ -439,7 +439,7 @@ POSSIBILITY OF SUCH DAMAGE.
});
if (total > 0) {
var ndx = Math.floor( Math.log(total) / Math.log(kb) );
var total = (total / Math.pow(kb, ndx)).toFixed(2) + ' ' + fileSizeTypes[ndx];
total = (total / Math.pow(kb, ndx)).toFixed(2) + ' ' + fileSizeTypes[ndx];
}
$("#total_interface_"+measure+" > td:eq(1)").html(total_in);
$("#total_interface_"+measure+" > td:eq(2)").html(total_out);

View File

@ -156,19 +156,10 @@
case "is_resolvable":
show_line("pac\\.match\\.hostname");
break;
case "dns_domain_is":
show_line("pac\\.match\\.hostname");
break;
case "dns_domain_levels":
show_line("pac\\.match\\.domain_level_from");
show_line("pac\\.match\\.domain_level_to");
break;
case "dns_domain_is":
show_line("pac\\.match\\.hostname");
break;
case "dns_domain_is":
show_line("pac\\.match\\.hostname");
break;
case "weekday_range":
show_line("pac\\.match\\.weekday_from");
show_line("pac\\.match\\.weekday_to");

View File

@ -200,17 +200,17 @@ function clearFormValidation(parent) {
*/
function ajaxCall(url, sendData, callback) {
return $.ajax({
type: "POST",
type: 'POST',
url: url,
dataType:"json",
contentType: "application/json",
dataType:'json',
contentType: 'application/json',
complete: function(data, status) {
if ( callback == null ) {
null;
} else if ( "responseJSON" in data ) {
callback(data['responseJSON'],status);
} else {
callback(data,status);
if (callback != null) {
if ('responseJSON' in data) {
callback(data['responseJSON'], status);
} else {
callback(data, status);
}
}
},
data: JSON.stringify(sendData)
@ -226,17 +226,17 @@ function ajaxCall(url, sendData, callback) {
*/
function ajaxGet(url,sendData,callback) {
return $.ajax({
type: "GET",
type: 'GET',
url: url,
dataType:"json",
contentType: "application/json",
dataType:'json',
contentType: 'application/json',
complete: function(data,status) {
if ( callback == null ) {
null;
} else if ( "responseJSON" in data ) {
callback(data['responseJSON'],status);
} else {
callback({},status);
if (callback != null) {
if ('responseJSON' in data) {
callback(data['responseJSON'], status);
} else {
callback({}, status);
}
}
},
data: sendData

View File

@ -487,7 +487,7 @@ function addTimeRange(){
var firstprint = false;
var tempFriendlyMonthArray = monthstr.split(",");
var tempFriendlyDayArray = daystr.split(",");
var currentDay, firstDay, nextDay, currentMonth, nextMonth, firstDay, firstMonth = "";
var currentDay, firstDay, nextDay, firstMonth = 0;
for (var k=0; k<tempFriendlyMonthArray.length; k++){
tempstr = tempFriendlyMonthArray[k];
if (tempstr != ""){

View File

@ -1471,7 +1471,6 @@ include("head.inc");
}
case "pppoe":
case "pptp":
case "ppp":
$("#mtu_calc").show();
break;
default: