2022-09-18 19:27:23 +03:00
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/get/settings",
|
|
|
|
type: "GET",
|
|
|
|
success: function(data){
|
|
|
|
if(data["autostart"] === 1) {
|
|
|
|
$("#autorunSwitch").attr("checked", "true");
|
|
|
|
$("#autorunText").text("On");
|
|
|
|
}
|
2022-09-19 16:55:29 +03:00
|
|
|
if(data["autochangewallpaper"] === 1) {
|
|
|
|
$("#autosetWallpaperSwitch").attr("checked", "true");
|
|
|
|
$("#autosetWallpaperText").text("On");
|
|
|
|
}
|
2022-09-18 19:27:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
$("#autorunSwitch").click(function(){
|
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/get/settings",
|
|
|
|
type: "GET",
|
|
|
|
success: function(data){
|
|
|
|
if(data["autostart"] === 1){
|
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/update/settings",
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
autostart: 0
|
|
|
|
},
|
|
|
|
success: function(){
|
2022-09-21 10:47:08 +03:00
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/update/del/startapp",
|
|
|
|
type: "POST",
|
|
|
|
success: function(data){
|
|
|
|
$(".toast-body").text(data.message);
|
|
|
|
let toastLiveExample = document.getElementById('liveToast')
|
|
|
|
let toast = new bootstrap.Toast(toastLiveExample)
|
|
|
|
toast.show()
|
|
|
|
if(data.status) {
|
|
|
|
$("#autorunSwitch").removeAttr("checked");
|
|
|
|
$("#autorunText").text("Off");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2022-09-18 19:27:23 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/update/settings",
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
autostart: 1
|
|
|
|
},
|
|
|
|
success: function(){
|
2022-09-21 10:47:08 +03:00
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/update/add/startapp",
|
|
|
|
type: "POST",
|
|
|
|
success: function(data){
|
|
|
|
$(".toast-body").text(data.message);
|
|
|
|
let toastLiveExample = document.getElementById('liveToast')
|
|
|
|
let toast = new bootstrap.Toast(toastLiveExample)
|
|
|
|
toast.show()
|
|
|
|
if(data.status) {
|
|
|
|
$("#autorunSwitch").attr("checked", "true");
|
|
|
|
$("#autorunText").text("On");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2022-09-18 19:27:23 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2022-09-19 16:55:29 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
$("#autosetWallpaperSwitch").click(function(){
|
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/get/settings",
|
|
|
|
type: "GET",
|
|
|
|
success: function(data){
|
|
|
|
if(data["autochangewallpaper"] === 1){
|
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/update/settings",
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
autochangewallpaper: 0
|
|
|
|
},
|
|
|
|
success: function(){
|
|
|
|
$("#autosetWallpaperSwitch").removeAttr("checked");
|
|
|
|
$("#autosetWallpaperText").text("Off");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
$.ajax({
|
|
|
|
url: "http://localhost:8080/api/update/settings",
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
autochangewallpaper: 1
|
|
|
|
},
|
|
|
|
success: function(){
|
|
|
|
$("#autosetWallpaperSwitch").attr("checked", "true");
|
|
|
|
$("#autosetWallpaperText").text("On");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2022-09-18 19:27:23 +03:00
|
|
|
})
|