mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-02 16:22:20 -07:00
Refactor network API calls to use centralized authentication context and improve cache handling
- Removed redundant getApiToken function and replaced its usage with getAuthContext in network-api.js, network-events.js, and network-init.js. - Updated cache handling in network-events.js and network-init.js to use CACHE_KEYS constants for better maintainability. - Introduced cache.js for centralized cache management functions and constants, including cache initialization and retrieval. - Added app-init.js for application lifecycle management, including cache orchestration and initialization checks. - Created app_config.php to securely fetch API token and GraphQL port from configuration. - Improved error handling and logging throughout the codebase for better debugging and maintenance.
This commit is contained in:
@@ -43,7 +43,10 @@
|
||||
<script src="lib/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
|
||||
<script src="lib/datatables.net/js/dataTables.select.min.js"></script>
|
||||
|
||||
<script>window.NAX_APP_VERSION = "<?php echo trim(file_exists('/app/.VERSION') ? file_get_contents('/app/.VERSION') : 'dev'); ?>";</script>
|
||||
<script src="js/cache.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
||||
<script src="js/common.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
||||
<script src="js/app-init.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
||||
<script src="js/sse_manager.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
||||
<script src="js/api.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
||||
<script src="js/modal.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
||||
|
||||
Reference in New Issue
Block a user