FE: update API calls to use new endpoint; enhance settings form submission tests

This commit is contained in:
Jokob @NetAlertX
2026-01-11 03:14:41 +00:00
parent 3cb55eb35c
commit c8c70d27ff
6 changed files with 221 additions and 387 deletions

View File

@@ -1339,11 +1339,19 @@ function updateApi(apiEndpoints)
// value has to be in format event|param. e.g. run|ARPSCAN
action = `${getGuid()}|update_api|${apiEndpoints}`
// Get data from the server
const apiToken = getSetting("API_TOKEN");
const apiBaseUrl = getApiBase();
const url = `${apiBaseUrl}/logs/add-to-execution-queue`;
$.ajax({
method: "POST",
url: "php/server/util.php",
data: { function: "addToExecutionQueue", action: action },
url: url,
headers: {
"Authorization": "Bearer " + apiToken,
"Content-Type": "application/json"
},
data: JSON.stringify({ action: action }),
success: function(data, textStatus) {
console.log(data)
}
@@ -1581,8 +1589,12 @@ function restartBackend() {
// Execute
$.ajax({
method: "POST",
url: "php/server/util.php",
data: { function: "addToExecutionQueue", action: `${getGuid()}|cron_restart_backend` },
url: "/logs/add-to-execution-queue",
headers: {
"Authorization": "Bearer " + getApiToken(),
"Content-Type": "application/json"
},
data: JSON.stringify({ action: `${getGuid()}|cron_restart_backend` }),
success: function(data, textStatus) {
// showModalOk ('Result', data );