FE: refactor API call in restartBackend function to use dynamic URL and token

This commit is contained in:
Jokob @NetAlertX
2026-01-11 03:18:24 +00:00
parent 63222f4503
commit 2bdf25ca59

View File

@@ -1586,12 +1586,16 @@ function restartBackend() {
modalEventStatusId = 'modal-message-front-event'
const apiToken = getSetting("API_TOKEN");
const apiBaseUrl = getApiBase();
const url = `${apiBaseUrl}/logs/add-to-execution-queue`;
// Execute
$.ajax({
method: "POST",
url: "/logs/add-to-execution-queue",
url: url,
headers: {
"Authorization": "Bearer " + getSetting("API_TOKEN"),
"Authorization": "Bearer " + apiToken,
"Content-Type": "application/json"
},
data: JSON.stringify({ action: `${getGuid()}|cron_restart_backend` }),