diff --git a/requirements.txt b/requirements.txt index db0f4b29..ffacb9d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,4 @@ icalevents python-socketio python-engineio websockets -websocket-client -requests \ No newline at end of file +websocket-client \ No newline at end of file diff --git a/src/config_manager.py b/src/config_manager.py index 4173d235..cf785c8b 100644 --- a/src/config_manager.py +++ b/src/config_manager.py @@ -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(): diff --git a/web_interface.py b/web_interface.py new file mode 100644 index 00000000..95fd77ff --- /dev/null +++ b/web_interface.py @@ -0,0 +1,62 @@ +from flask import Flask, render_template_string, request, redirect, url_for +import json # Added import for json +from src.config_manager import ConfigManager + +app = Flask(__name__) +config_manager = ConfigManager() + +CONFIG_TEMPLATE = """ + + +
+ +