first add of webui

This commit is contained in:
Chuck
2025-05-31 11:38:40 -05:00
parent b319b2de30
commit 4066d30195
3 changed files with 77 additions and 2 deletions

View File

@@ -38,6 +38,20 @@ class ConfigManager:
print(f"Error loading configuration: {str(e)}")
raise
def save_config(self, config_data: Dict[str, Any]) -> None:
"""Save configuration to the main JSON file."""
try:
with open(self.config_path, 'w') as f:
json.dump(config_data, f, indent=4)
self.config = config_data # Update the in-memory config
print(f"Configuration successfully saved to {os.path.abspath(self.config_path)}")
except IOError as e:
print(f"Error writing configuration to file {os.path.abspath(self.config_path)}: {e}")
raise
except Exception as e:
print(f"An unexpected error occurred while saving configuration: {str(e)}")
raise
def _deep_merge(self, target: Dict, source: Dict) -> None:
"""Deep merge source dict into target dict."""
for key, value in source.items():