2023-05-21 19:14:28 +00:00
|
|
|
function setAreaByUrl(url){
|
2023-05-13 18:24:58 +00:00
|
|
|
response = makeRequest(url);
|
|
|
|
setInfoSection(response);
|
|
|
|
}
|
2023-05-21 19:14:28 +00:00
|
|
|
function setDatabaseVersion() {
|
|
|
|
url = '/api/database_version.php';
|
|
|
|
setAreaByUrl(url);
|
|
|
|
}
|
2023-05-13 18:24:58 +00:00
|
|
|
|
|
|
|
function makeRequest(url){
|
2023-05-10 00:50:37 +00:00
|
|
|
var request = new XMLHttpRequest();
|
2023-05-13 18:24:58 +00:00
|
|
|
request.open("GET", url, false);
|
2023-05-10 00:50:37 +00:00
|
|
|
request.send(null);
|
|
|
|
return request.responseText;
|
|
|
|
}
|
|
|
|
|
2023-05-13 18:24:58 +00:00
|
|
|
function setCrontabStats(){
|
2023-05-15 21:55:42 +00:00
|
|
|
url = "/api/crontab_stats.php";
|
2023-05-21 19:14:28 +00:00
|
|
|
setAreaByUrl(url);
|
2023-05-13 18:24:58 +00:00
|
|
|
}
|
|
|
|
|
2023-05-10 00:50:37 +00:00
|
|
|
function setInfoSection (string) {
|
|
|
|
var info_section = document.getElementById("content");
|
2023-05-13 18:24:58 +00:00
|
|
|
info_section.innerHTML = string;
|
2023-05-10 02:42:20 +00:00
|
|
|
}
|
|
|
|
|
2023-05-13 18:24:58 +00:00
|
|
|
function getTable(name){
|
2023-05-21 19:14:28 +00:00
|
|
|
url = "/api/table.php?name="+name;
|
|
|
|
setAreaByUrl(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
function listTables(){
|
|
|
|
url="/api/table.php?action=list";
|
|
|
|
setAreaByUrl(url);
|
2023-05-13 18:24:58 +00:00
|
|
|
}
|
2023-05-15 21:45:18 +00:00
|
|
|
|
|
|
|
function getCrontabs (){
|
2023-05-15 21:55:42 +00:00
|
|
|
url = "/api/table.php?name='crontabs'&columns=crontab_path,crontab_created_timestamp,crontab_modified_timestamp";
|
2023-05-21 19:14:28 +00:00
|
|
|
setAreaByUrl(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
function listCrontabs(){
|
|
|
|
url = "/api/crontab.php?action=list";
|
|
|
|
setAreaByUrl(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
function loadCrontab (id){
|
|
|
|
url = "/api/crontab_view.php?id="+id;
|
|
|
|
setAreaByUrl(url);
|
2023-05-15 21:45:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function test (){
|
2023-05-15 21:55:42 +00:00
|
|
|
url = "/api/crontab_view.php?name=0hourly";
|
2023-05-21 19:14:28 +00:00
|
|
|
setAreaByUrl(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
function update_crons () {
|
|
|
|
url = "/api/update.php?target=crontabs";
|
|
|
|
setAreaByUrl(url);
|
2023-05-15 21:45:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function triggerPopup(info_to_get){
|
|
|
|
const modal = document.querySelector('dialog');
|
|
|
|
|
|
|
|
document.querySelector("#popup_button").addEventListener("click", () => {modal.showModal();});
|
2023-05-15 21:55:42 +00:00
|
|
|
}
|