From c89703531c88e3c12eba5e7e8da8b3a896030f72 Mon Sep 17 00:00:00 2001 From: SamiAhmed7777 Date: Mon, 10 Mar 2025 01:20:20 -0700 Subject: [PATCH] feat: Add theme customizer plugin --- .../plugins/theme_customizer/__init__.py | 34 ++++++ .../components/ThemeCustomizer.svelte | 109 ++++++++++++++++++ .../theme_customizer/ThemeCustomizer.svelte | 109 ++++++++++++++++++ 3 files changed, 252 insertions(+) create mode 100644 backend/open_webui/plugins/theme_customizer/__init__.py create mode 100644 backend/open_webui/plugins/theme_customizer/components/ThemeCustomizer.svelte create mode 100644 src/lib/plugins/theme_customizer/ThemeCustomizer.svelte diff --git a/backend/open_webui/plugins/theme_customizer/__init__.py b/backend/open_webui/plugins/theme_customizer/__init__.py new file mode 100644 index 000000000..45bddbe69 --- /dev/null +++ b/backend/open_webui/plugins/theme_customizer/__init__.py @@ -0,0 +1,34 @@ +from fastapi import FastAPI + +class ThemeCustomizerPlugin: + def __init__(self): + self.name = "theme_customizer" + self.description = "Theme customization plugin for OpenWebUI" + self.version = "1.0.0" + self.author = "SamiAhmed7777" + + def setup(self) -> None: + """Setup any initial plugin state.""" + pass + + def register(self, app: FastAPI) -> None: + """Register the theme customizer plugin with OpenWebUI.""" + # Register frontend components + if not hasattr(app.state, "plugin_components"): + app.state.plugin_components = {} + + # Theme Customization Component + app.state.plugin_components["theme_customizer"] = { + "name": "ThemeCustomizer", + "path": "/plugins/theme_customizer/components/ThemeCustomizer.svelte", + "settings": { + "section": "general", # This will make it appear under General + "title": "Theme Customization", + "icon": "palette", + "description": "Customize colors, fonts, and appearance", + "order": 300 # This will place it after the general settings + } + } + +# Create plugin instance +plugin = ThemeCustomizerPlugin() \ No newline at end of file diff --git a/backend/open_webui/plugins/theme_customizer/components/ThemeCustomizer.svelte b/backend/open_webui/plugins/theme_customizer/components/ThemeCustomizer.svelte new file mode 100644 index 000000000..36db4a634 --- /dev/null +++ b/backend/open_webui/plugins/theme_customizer/components/ThemeCustomizer.svelte @@ -0,0 +1,109 @@ + + + +

Theme Customization

+ +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + +
+ +
+ +