doi co che dong bo giua cac thiet bi
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user