diff --git a/web/js/device.js b/web/js/device.js index 0343472c..e83e0f2d 100644 --- a/web/js/device.js +++ b/web/js/device.js @@ -656,7 +656,10 @@ function openAllDoorOfDevice(data) { success: function (data) { console.log(data.response); var html = ""; - html = " Mở " + data.totals + " cửa từ thiết bị " + data.IP + ".
"; + if (data.response.ErrorCode === "999") + html = " Mở " + data.totals + " cửa từ thiết bị " + data.IP + ".
"; + else + html = " Kết nối tới thiết bị " + data.IP + " thất bại.
"; $("#logs-response").prepend(html); progressOpenDoor++; var percent = parseInt(progressOpenDoor / totalsDoor * 100); @@ -723,7 +726,10 @@ function closeAllDoorOfDevice(data) { success: function (data) { console.log(data.response); var html = ""; - html = " Đóng " + data.totals + " cửa từ thiết bị " + data.IP + ".
"; + if (data.response.ErrorCode === "999") + html = " Đóng " + data.totals + " cửa từ thiết bị " + data.IP + ".
"; + else + html = " Kết nối tới thiết bị " + data.IP + " thất bại.
"; $("#logs-response").prepend(html); progressCloseDoor++; var percent = parseInt(progressCloseDoor / totalsDoorToClose * 100);