diff --git a/Makefile b/Makefile index 657a310..f0dcef3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TAILWIND_VERSION := 3.4.17 +TAILWIND_VERSION := 4.1.18 TAILWIND_CLI := ./tailwindcss UNAME_S := $(shell uname -s) UNAME_M := $(shell uname -m) diff --git a/py/api/admin.py b/py/api/admin.py index f96d9c3..2e0db4e 100644 --- a/py/api/admin.py +++ b/py/api/admin.py @@ -1065,6 +1065,7 @@ class AdminRoutesMixin: prompt_text.strip(), "scanned", ["auto-scanned"], + None, f"Auto-scanned from {os.path.basename(png_file)}", prompt_hash, ) diff --git a/py/api/prompts.py b/py/api/prompts.py index ed7b337..4157e6d 100644 --- a/py/api/prompts.py +++ b/py/api/prompts.py @@ -5,6 +5,25 @@ import json from aiohttp import web +try: + from ...utils.validators import ( + validate_prompt_text, + validate_rating, + validate_tags, + validate_category, + sanitize_input, + ) + from ...utils.hashing import generate_prompt_hash +except ImportError: + from utils.validators import ( + validate_prompt_text, + validate_rating, + validate_tags, + validate_category, + sanitize_input, + ) + from utils.hashing import generate_prompt_hash + class PromptRoutesMixin: """Mixin providing prompt-related API endpoints.""" @@ -491,14 +510,6 @@ class PromptRoutesMixin: async def save_prompt(self, request): """Save a new prompt with metadata and duplicate detection.""" try: - from utils.validators import ( - validate_prompt_text, - validate_rating, - validate_tags, - validate_category, - sanitize_input, - ) - data = await request.json() text = data.get("text", "").strip() @@ -524,8 +535,6 @@ class PromptRoutesMixin: text = sanitize_input(text) - from utils.hashing import generate_prompt_hash - prompt_hash = generate_prompt_hash(text) existing = await self._run_in_executor( @@ -608,8 +617,6 @@ class PromptRoutesMixin: async def update_prompt(self, request): """Update prompt text.""" try: - from utils.validators import validate_prompt_text, sanitize_input - prompt_id = int(request.match_info["prompt_id"]) data = await request.json() new_text = data.get("text", "").strip() @@ -654,8 +661,6 @@ class PromptRoutesMixin: async def update_prompt_rating(self, request): """Update prompt rating.""" try: - from utils.validators import validate_rating - prompt_id = int(request.match_info["prompt_id"]) data = await request.json() rating = data.get("rating") diff --git a/pyproject.toml b/pyproject.toml index 15519b5..038207d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "promptmanager" description = "A powerful ComfyUI custom node that extends the standard text encoder with persistent prompt storage, advanced search capabilities, and an automatic image gallery system using SQLite." -version = "3.0.34" +version = "3.0.35" license = {file = "LICENSE"} dependencies = ["# Core dependencies for PromptManager", "# Note: Most dependencies are already included with ComfyUI", "# Already included with Python standard library:", "# - sqlite3", "# - hashlib", "# - json", "# - datetime", "# - os", "# - typing", "# - threading", "# - uuid", "# Required for gallery functionality:", "watchdog>=2.1.0 # For file system monitoring", "Pillow>=8.0.0 # For image metadata extraction (usually included with ComfyUI)", "# Optional dependencies for enhanced search functionality:", "# fuzzywuzzy[speedup]>=0.18.0 # For fuzzy string matching (optional)", "# sqlalchemy>=1.4.0 # For advanced ORM features (optional)", "# Development dependencies (optional):", "# pytest>=6.0.0 # For running tests", "# black>=22.0.0 # For code formatting", "# flake8>=4.0.0 # For linting", "# mypy>=0.910 # For type checking"] diff --git a/tailwind.config.js b/tailwind.config.js deleted file mode 100644 index bb8b02d..0000000 --- a/tailwind.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - content: ["./web/**/*.html", "./web/js/**/*.js"], - darkMode: 'class', - theme: { - extend: { - colors: { - gray: { 850: '#1f2937', 875: '#1a202c', 925: '#0f172a' } - } - } - }, -} diff --git a/web/admin.html b/web/admin.html index f05083f..c3b923e 100644 --- a/web/admin.html +++ b/web/admin.html @@ -1,165 +1,29 @@ - + PromptManager - Admin Dashboard + + - - +
-
+
-
-
- 🔍 -
-
-

- PromptManager Admin Dashboard -

-

Manage and organize your AI prompts with powerful search and editing tools

-
+
+

+ PromptManager Admin +

-
@@ -169,51 +33,39 @@
-
+
-
-
+
+
-

Total Prompts

-

-

-
-
- 📝 +

Total Prompts

+

-

-
+
-

Categories

-

-

-
-
- 📁 +

Categories

+

-

-
-

Unique Tags

-

-

-
-
- 🏷️ +

Unique Tags

+

-

-
+
-

Avg Rating

-

-

-
-
- ⭐ +

Avg Rating

+

-

@@ -222,32 +74,32 @@
-
-
+
+
-
-
+
+
- - + +
- -
- - + +
- - @@ -257,83 +109,83 @@
-
-
-
@@ -342,61 +194,60 @@
-
+
-
+
-
-
-

Recent Prompts

-
- - - per page + per page
- Loading... + Loading...
-
-

Loading prompts...

+
+

Loading prompts...

-