refactor(logging): AzLogs v1.4.1 with dynamic storage and utilities
Enhance logging system with configurable module names and dynamic localStorage keys to avoid conflicts between multiple plugin instances. - Add LOG_MODULE_NAME and DEFAULT_LOGGER_NAME to web/log_system/config.js - Update logger.js to use dynamic storage keys based on module name - Change window property from ResolutionMasterLogger to dynamic key - Add PyDoc metadata to core/log_system/config.py - Add JSDoc metadata blocks to all web log_system files Reorganize web utilities: - Move css-loader.js from web/ to web/utils/ - Add ErrorHandler.js for centralized error handling - Add ResourceManager.js for stylesheet and template loading rename: web/css-loader.js => web/utils/css-loader.js
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* CSS Loader
|
||||
* Loads all CSS files for the resolution master components
|
||||
*/
|
||||
|
||||
import { addStylesheet, getUrl } from "./ResourceManager.js";
|
||||
import { createModuleLogger } from "../log_system/LoggerUtils.js";
|
||||
|
||||
const log = createModuleLogger('CSSLoader');
|
||||
|
||||
/**
|
||||
* Loads all CSS files for the application
|
||||
*/
|
||||
export function loadAllStyles() {
|
||||
try {
|
||||
log.info('Loading CSS files...');
|
||||
|
||||
// Load all CSS files using getUrl for proper path resolution
|
||||
const cssFiles = [
|
||||
'./css/css-variables.css', // CSS Custom Properties - MUST BE FIRST!
|
||||
'./css/common-components.css', // Shared component styles using cascade
|
||||
'./css/aspect-ratio-columns.css', // Shared aspect ratio column styles
|
||||
'./css/preset-manager-dialog.css',
|
||||
'./css/searchable-dropdown.css',
|
||||
'./css/rename-dialog.css',
|
||||
'./css/json-editor-dialog.css',
|
||||
'./css/preset-ui-components.css',
|
||||
'./css/preset-list-renderer.css',
|
||||
'./css/preset-add-view.css',
|
||||
'./css/drag-drop.css'
|
||||
];
|
||||
|
||||
cssFiles.forEach(file => {
|
||||
addStylesheet(getUrl(file));
|
||||
log.debug(`Loaded: ${file}`);
|
||||
});
|
||||
|
||||
log.info('All CSS files loaded successfully');
|
||||
} catch (error) {
|
||||
log.error('Error loading CSS files:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this function when the ResolutionMaster node is actually created/used
|
||||
* to load styles only when needed, preventing global UI interference
|
||||
*/
|
||||
export function loadStylesWhenNeeded() {
|
||||
loadAllStyles();
|
||||
}
|
||||
Reference in New Issue
Block a user