mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-30 23:03:03 -07:00
Merge pull request #1398 from luckylinux/fix-system-info-network
[reverse proxy] Use getApiBase() to get GraphQL Endpoint for System Information about Network
This commit is contained in:
@@ -336,13 +336,12 @@ function formatDataSize(bytes) {
|
|||||||
|
|
||||||
|
|
||||||
function loadInterfaces() {
|
function loadInterfaces() {
|
||||||
|
// Build base URL dynamically
|
||||||
|
const apiBase = getApiBase();
|
||||||
const apiToken = getSetting("API_TOKEN");
|
const apiToken = getSetting("API_TOKEN");
|
||||||
const host = window.location.hostname;
|
|
||||||
const protocol = window.location.protocol;
|
|
||||||
const port = getSetting("GRAPHQL_PORT");
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `${protocol}//${host}:${port}/nettools/interfaces`,
|
url: `${apiBase}/nettools/interfaces`,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": "Bearer " + apiToken,
|
"Authorization": "Bearer " + apiToken,
|
||||||
@@ -418,4 +417,4 @@ $(document).ready(function() {
|
|||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user