mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-03 08:41:35 -07:00
Merge pull request #1397 from luckylinux/fix-events
[reverse proxy] Use getApiBase() to get GraphQL Endpoint for events
This commit is contained in:
@@ -23,11 +23,9 @@ showSpinner()
|
|||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
const protocol = window.location.protocol.replace(':', '');
|
|
||||||
const host = window.location.hostname;
|
|
||||||
const apiToken = getSetting("API_TOKEN");
|
const apiToken = getSetting("API_TOKEN");
|
||||||
const port = getSetting("GRAPHQL_PORT");
|
const apiBase = getApiBase();
|
||||||
const graphqlUrl = `${protocol}://${host}:${port}/graphql`;
|
const graphqlUrl = `${apiBase}/graphql`;
|
||||||
|
|
||||||
$('#appevents-table').DataTable({
|
$('#appevents-table').DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
|
|||||||
@@ -160,11 +160,10 @@ function periodChanged() {
|
|||||||
function getEventsTotals() {
|
function getEventsTotals() {
|
||||||
stopTimerRefreshData();
|
stopTimerRefreshData();
|
||||||
|
|
||||||
const protocol = window.location.protocol.replace(":", "");
|
// Build API URL
|
||||||
const host = window.location.hostname;
|
const apiBase = getApiBase();
|
||||||
const port = getSetting("GRAPHQL_PORT");
|
|
||||||
const apiToken = getSetting("API_TOKEN");
|
const apiToken = getSetting("API_TOKEN");
|
||||||
const url = `${protocol}://${host}:${port}/sessions/totals?period=${encodeURIComponent(period)}`;
|
const url = `${apiBase}/sessions/totals?period=${encodeURIComponent(period)}`;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url,
|
url,
|
||||||
@@ -207,11 +206,9 @@ function getEvents(type) {
|
|||||||
table.column(7).visible(config.sesionCols);
|
table.column(7).visible(config.sesionCols);
|
||||||
|
|
||||||
// Build API URL
|
// Build API URL
|
||||||
const protocol = window.location.protocol.replace(":", "");
|
const apiBase = getApiBase();
|
||||||
const host = window.location.hostname;
|
|
||||||
const port = getSetting("GRAPHQL_PORT");
|
|
||||||
const apiToken = getSetting("API_TOKEN");
|
const apiToken = getSetting("API_TOKEN");
|
||||||
const url = `${protocol}://${host}:${port}/sessions/session-events?type=${encodeURIComponent(type)}&period=${encodeURIComponent(period)}`;
|
const url = `${apiBase}/sessions/session-events?type=${encodeURIComponent(type)}&period=${encodeURIComponent(period)}`;
|
||||||
|
|
||||||
table.clear().draw(); // Clear old rows
|
table.clear().draw(); // Clear old rows
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user