mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-04 09:11:34 -07: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'
|
modalEventStatusId = 'modal-message-front-event'
|
||||||
|
|
||||||
|
const apiToken = getSetting("API_TOKEN");
|
||||||
|
const apiBaseUrl = getApiBase();
|
||||||
|
const url = `${apiBaseUrl}/logs/add-to-execution-queue`;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/logs/add-to-execution-queue",
|
url: url,
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": "Bearer " + getSetting("API_TOKEN"),
|
"Authorization": "Bearer " + apiToken,
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
data: JSON.stringify({ action: `${getGuid()}|cron_restart_backend` }),
|
data: JSON.stringify({ action: `${getGuid()}|cron_restart_backend` }),
|
||||||
|
|||||||
Reference in New Issue
Block a user