update button add feature - control logs site

This commit is contained in:
2020-12-24 13:57:24 +07:00
parent 492651570e
commit b26814bb97
6 changed files with 120 additions and 8 deletions

View File

@@ -8,4 +8,27 @@ function _search(e) {
location = location + "&type=" + $("select[name='TypeSearch']").val();
location = location + "&gender=" + $("select[name='GenderSearch']").val();
window.location = location;
}
}
function _useFeature(e) {
common.modalBlock(true);
$.ajax({
url: $(e).attr("data-href"),
type: 'POST',
data: {
id: $(e).val()
},
success: function (data) {
common.modalBlock(false);
if (data.status) {
alert("Đã thêm hình ảnh mẫu!");
} else {
alert(data.text);
}
},
error: function (jqXHR, textStatus, errorThrown) {
common.modalBlock(false);
common.ajaxError();
}
});
}

View File

@@ -525,7 +525,7 @@ function _syncToServer() {
syncFeatureToServer(lists[i]);
}
}
var error = 0;
function syncFeatureToServer(id) {
$.ajax({
url: $("input[name='sync_feature_to_server_url']").val(),
@@ -534,6 +534,10 @@ function syncFeatureToServer(id) {
id: id
},
success: function (data) {
if (data.status != 10000) {
error++;
console.log(error);
}
progressToServer++;
$("#progress-current").html(parseInt($("#progress-current").html()) + 1);
var percent = parseInt(progressToServer / totalsToServer * 100);