dieu chinh update tung doi tuong neu so luong <10

This commit is contained in:
2020-12-25 15:58:02 +07:00
parent dc75b88bd8
commit ddcf67ba9c
6 changed files with 130 additions and 15 deletions

View File

@@ -361,7 +361,7 @@ function _sync() {
}
common.modalBlock(true);
$("#progress-totals").html(lists.length);
$("#progress-form").removeClass("hidden");
$("#progress-form").removeClass("hidden");
totals = lists.length;
syncFeatureFromDevice(lists[0], lists);
}
@@ -372,7 +372,8 @@ function syncFeatureFromDevice(id, fullData) {
type: 'POST',
data: {
id: id,
ip: $("input[name='SyncIP']").val()
ip: $("input[name='SyncIP']").val(),
totals: totals
},
success: function (data) {
console.log(data, progress);
@@ -384,8 +385,12 @@ function syncFeatureFromDevice(id, fullData) {
$("#progress").html(percent + "%");
if (percent >= 100) {
common.modalBlock(false);
updateFeature();
progress = 0;
if (totals > 10) {
updateFeature();
progress = 0;
} else {
window.location.reload(true);
}
} else {
syncFeatureFromDevice(fullData[progress], fullData);
}
@@ -434,7 +439,8 @@ function syncFeature(id, fullData) {
url: $("input[name='sync_feature_url']").val(),
type: 'POST',
data: {
id: id
id: id,
totals: totals
},
success: function (data) {
console.log(data, progress);
@@ -446,8 +452,12 @@ function syncFeature(id, fullData) {
$("#progress").html(percent + "%");
if (percent >= 100) {
common.modalBlock(false);
updateFeature();
progress = 0;
if (totals > 10) {
updateFeature();
progress = 0;
} else {
window.location.reload(true);
}
} else {
syncFeature(fullData[progress], fullData);
}