mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
Merge pull request #976 from cvc90/NetAlertX-Changing-absolute-path-url-to-relative-path-url-in-common.js-file
Some checks are pending
docker / docker_dev (push) Waiting to run
Some checks are pending
docker / docker_dev (push) Waiting to run
Changed the "absolute URL" target to "relative URL" in common.js
This commit is contained in:
@@ -115,9 +115,9 @@ function cacheSettings()
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if(!getCache('completedCalls').includes('cacheSettings'))
|
if(!getCache('completedCalls').includes('cacheSettings'))
|
||||||
{
|
{
|
||||||
$.get('/php/server/query_json.php', { file: 'table_settings.json', nocache: Date.now() }, function(resSet) {
|
$.get('php/server/query_json.php', { file: 'table_settings.json', nocache: Date.now() }, function(resSet) {
|
||||||
|
|
||||||
$.get('/php/server/query_json.php', { file: 'plugins.json', nocache: Date.now() }, function(resPlug) {
|
$.get('php/server/query_json.php', { file: 'plugins.json', nocache: Date.now() }, function(resPlug) {
|
||||||
|
|
||||||
pluginsData = resPlug["data"];
|
pluginsData = resPlug["data"];
|
||||||
settingsData = resSet["data"];
|
settingsData = resSet["data"];
|
||||||
@@ -225,7 +225,7 @@ function cacheStrings() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Fetch strings and translations from plugins
|
// Fetch strings and translations from plugins
|
||||||
$.get('/php/server/query_json.php', { file: 'table_plugins_language_strings.json', nocache: Date.now() })
|
$.get('php/server/query_json.php', { file: 'table_plugins_language_strings.json', nocache: Date.now() })
|
||||||
.done((pluginRes) => {
|
.done((pluginRes) => {
|
||||||
const data = pluginRes["data"];
|
const data = pluginRes["data"];
|
||||||
|
|
||||||
@@ -737,7 +737,7 @@ function forceLoadUrl(relativeUrl) {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function navigateToDeviceWithIp (ip) {
|
function navigateToDeviceWithIp (ip) {
|
||||||
|
|
||||||
$.get('/php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(res) {
|
$.get('php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(res) {
|
||||||
|
|
||||||
devices = res["data"];
|
devices = res["data"];
|
||||||
|
|
||||||
@@ -959,7 +959,7 @@ function cacheDevices()
|
|||||||
|
|
||||||
// if(!getCache('completedCalls').includes('cacheDevices'))
|
// if(!getCache('completedCalls').includes('cacheDevices'))
|
||||||
// {
|
// {
|
||||||
$.get('/php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(data) {
|
$.get('php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(data) {
|
||||||
|
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
|
|
||||||
@@ -1325,7 +1325,7 @@ function clearCache() {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Function to check if cache needs to be refreshed because of setting changes
|
// Function to check if cache needs to be refreshed because of setting changes
|
||||||
function checkSettingChanges() {
|
function checkSettingChanges() {
|
||||||
$.get('/php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
|
$.get('php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
|
||||||
const importedMilliseconds = parseInt(appState["settingsImported"] * 1000);
|
const importedMilliseconds = parseInt(appState["settingsImported"] * 1000);
|
||||||
const lastReloaded = parseInt(sessionStorage.getItem(sessionStorageKey + '_time'));
|
const lastReloaded = parseInt(sessionStorage.getItem(sessionStorageKey + '_time'));
|
||||||
|
|
||||||
@@ -1380,7 +1380,7 @@ async function waitForGraphQLServer() {
|
|||||||
// Returns 1 if running, 0 otherwise
|
// Returns 1 if running, 0 otherwise
|
||||||
async function isGraphQLServerRunning() {
|
async function isGraphQLServerRunning() {
|
||||||
try {
|
try {
|
||||||
const response = await $.get('/php/server/query_json.php', { file: 'app_state.json', nocache: Date.now()});
|
const response = await $.get('php/server/query_json.php', { file: 'app_state.json', nocache: Date.now()});
|
||||||
console.log("graphQLServerStarted: " + response["graphQLServerStarted"]);
|
console.log("graphQLServerStarted: " + response["graphQLServerStarted"]);
|
||||||
setCache("graphQLServerStarted", response["graphQLServerStarted"]);
|
setCache("graphQLServerStarted", response["graphQLServerStarted"]);
|
||||||
return response["graphQLServerStarted"];
|
return response["graphQLServerStarted"];
|
||||||
|
|||||||
Reference in New Issue
Block a user