- Added plugin base and loader for backend extensibility - Implemented application settings management with config persistence - Created Svelte-based frontend with Dashboard and Settings pages - Added API routes for plugins, tasks, and settings - Updated documentation and specifications - Improved project structure and developer tools
1.7 KiB
1.7 KiB
Web Application Settings Mechanism
This document describes the settings management system for the Superset Tools application.
Overview
The settings mechanism allows users to configure multiple Superset environments and global application settings (like backup storage) via the web UI.
Backend Architecture
Data Models
Configuration is structured using Pydantic models in backend/src/core/config_models.py:
Environment: Represents a Superset instance (URL, credentials).GlobalSettings: Global application parameters (e.g.,backup_path).AppConfig: The root configuration object.
Configuration Manager
The ConfigManager (backend/src/core/config_manager.py) handles:
- Persistence to
config.json. - CRUD operations for environments.
- Validation and logging.
API Endpoints
The settings API is available at /settings:
GET /settings: Retrieve all settings (passwords are masked).PATCH /settings/global: Update global settings.GET /settings/environments: List environments.POST /settings/environments: Add environment.PUT /settings/environments/{id}: Update environment.DELETE /settings/environments/{id}: Remove environment.POST /settings/environments/{id}/test: Test connection.
Frontend Implementation
The settings page is located at frontend/src/pages/Settings.svelte. It provides forms for managing global settings and Superset environments.
Integration
Existing plugins and utilities use the ConfigManager to fetch configuration:
superset_tool/utils/init_clients.py: Dynamically initializes Superset clients from the configured environments.BackupPlugin: Uses the configuredbackup_pathas the default storage location.