From b030073be7747582ed7a3706a83c0a84a626208b Mon Sep 17 00:00:00 2001 From: dongpd Date: Wed, 11 Nov 2020 13:53:30 +0700 Subject: [PATCH] =?UTF-8?q?ch=E1=BB=89nh=20log=20th=C3=B4ng=20b=C3=A1o=20k?= =?UTF-8?q?hi=20kh=C3=B4ng=20c=C3=B3=20k=E1=BA=BFt=20n=E1=BB=91i=20t?= =?UTF-8?q?=E1=BB=9Bi=20thi=E1=BA=BFt=20b=E1=BB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/js/device.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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);