mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-06 16:22:12 -05:00
FE: refactor API call in restartBackend function to use dynamic URL and token
This commit is contained in:
@@ -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` }),
|
||||
|
||||
Reference in New Issue
Block a user