Ver Fonte

Update 'DiskInfo/index.php'

Yeung Alan há 5 anos atrás
pai
commit
42c73d2678
1 ficheiros alterados com 5 adições e 4 exclusões
  1. 5 4
      DiskInfo/index.php

+ 5 - 4
DiskInfo/index.php

@@ -219,7 +219,8 @@ $.get( "opr.php?opr=scan", function( data ) {
 				if(table["ata_smart_attributes"]["table"].length > 0){		
 					//for loop to find if something failed, then show warning
 					$(table["ata_smart_attributes"]["table"]).each(function(tindex, telement) {
-						if(!typeof telement["when_failed"] === "undefined"){
+						if(typeof telement["when_failed"] === "undefined"){
+						}else{
 							if(telement["when_failed"] !== ""){
 								smartstat[element["info_name"]] = "Warning";
 							}
@@ -283,15 +284,15 @@ $.get( "opr.php?opr=info&drive=" + active, function( data ) {
 	//check if SMART bad
 	smartstat[active] = "Unknown";
 	$(arr["ata_smart_attributes"]["table"]).each(function(index, element) {
-		if(!typeof element["when_failed"] === "undefined"){
+		if(typeof element["when_failed"] === "undefined"){
+		    var stat = "OK";
+		}else{
 			if(element["when_failed"] == ""){
 				var stat = "OK";
 			}else{
 				var stat = "Failed";
 				smartstat[active] = "Warning";
 			}
-		}else{
-			var stat = "OK";
 		}
 		
 		//prevent element undefined, check first