Fix Saving Changes in Devices Page.

This commit is contained in:
netalertx-fedora
2026-01-09 12:37:54 +01:00
parent 730e8b856f
commit 82041f391f
2 changed files with 7 additions and 8 deletions

View File

@@ -354,9 +354,7 @@ function setDeviceData(direction = '', refreshCallback = '') {
showSpinner();
const apiToken = getSetting("API_TOKEN"); // dynamic token
const host = window.location.hostname;
const protocol = window.location.protocol;
const port = getSetting("GRAPHQL_PORT");
const apiBase = getApiBase();
mac = $('#NEWDEV_devMac').val();
@@ -404,7 +402,7 @@ function setDeviceData(direction = '', refreshCallback = '') {
$.ajax({
url: `${protocol}//${host}:${port}/device/${encodeURIComponent(mac)}`,
url: `${apiBase}/device/${encodeURIComponent(mac)}`,
type: "POST",
headers: {
"Authorization": "Bearer " + apiToken,
@@ -503,4 +501,4 @@ if (!$('#panDetails:visible').length) {
}
</script>
</script>