update config

This commit is contained in:
2020-12-10 17:04:41 +07:00
parent 94215e4e80
commit 483e0fa349
9 changed files with 189 additions and 15 deletions

View File

@@ -56,6 +56,7 @@ function saveStep1(e) {
}
});
}
function saveStep2(e) {
var cfgLists = $(".editform");
var cfg = [];
@@ -86,4 +87,34 @@ function saveStep2(e) {
common.ajaxError();
}
});
}
function SaveConfigDevice(e) {
var server_api = $("input[name='server_api']").val();
var device_id = $("input[name='device_id']").val();
if (server_api === "" || device_id === "") {
alert("Hãy nhập đủ thông tin");
return;
}
common.modalBlock(true);
$.ajax({
url: $(e).attr("data-href"),
type: 'POST',
data: {
server_api: server_api,
device_id: device_id
},
success: function (data) {
if (data) {
notification.success("Đã lưu cấu hình!", 2000);
} else {
notification.success("Lưu cấu hình thất bại!", 2000);
}
common.modalBlock(false);
},
error: function (jqXHR, textStatus, errorThrown) {
common.modalBlock(false);
common.ajaxError();
}
});
}