doi co che dong bo giua cac thiet bi

This commit is contained in:
2020-12-25 11:10:35 +07:00
parent 86afa3a430
commit dc75b88bd8
2 changed files with 14 additions and 6 deletions

View File

@@ -361,14 +361,12 @@ function _sync() {
}
common.modalBlock(true);
$("#progress-totals").html(lists.length);
$("#progress-form").removeClass("hidden");
$("#progress-form").removeClass("hidden");
totals = lists.length;
for (var i = 0; i < lists.length; i++) {
syncFeatureFromDevice(lists[i]);
}
syncFeatureFromDevice(lists[0], lists);
}
function syncFeatureFromDevice(id) {
function syncFeatureFromDevice(id, fullData) {
$.ajax({
url: $("input[name='sync_feature_from_device_url']").val(),
type: 'POST',
@@ -377,6 +375,7 @@ function syncFeatureFromDevice(id) {
ip: $("input[name='SyncIP']").val()
},
success: function (data) {
console.log(data, progress);
progress++;
$("#progress-current").html(parseInt($("#progress-current").html()) + 1);
var percent = parseInt(progress / totals * 100);
@@ -387,6 +386,8 @@ function syncFeatureFromDevice(id) {
common.modalBlock(false);
updateFeature();
progress = 0;
} else {
syncFeatureFromDevice(fullData[progress], fullData);
}
},
error: function (jqXHR, textStatus, errorThrown) {