From 6fd0eb7a37e2ebe568c37673785161879bd2b1f7 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 11 Jun 2025 13:43:07 -0700 Subject: [PATCH 1/2] feat(gallery): add input for direct page navigation --- web/gallery.html | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/web/gallery.html b/web/gallery.html index a77fc2e..a88b239 100644 --- a/web/gallery.html +++ b/web/gallery.html @@ -208,7 +208,11 @@ - Page 1 +
+ Page + + of 1 +
@@ -525,6 +529,12 @@ document.getElementById('retryBtn').addEventListener('click', () => this.loadImages()); document.getElementById('prevPageBtn').addEventListener('click', () => this.previousPage()); document.getElementById('nextPageBtn').addEventListener('click', () => this.nextPage()); + document.getElementById('pageInput').addEventListener('change', (e) => this.goToPage(parseInt(e.target.value))); + document.getElementById('pageInput').addEventListener('keypress', (e) => { + if (e.key === 'Enter') { + this.goToPage(parseInt(e.target.value)); + } + }); // Settings modal event listeners document.getElementById('closeSettingsBtn').addEventListener('click', () => this.hideSettings()); @@ -2501,7 +2511,11 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`; document.getElementById('prevPageBtn').disabled = !hasPrev; document.getElementById('nextPageBtn').disabled = !hasNext; - document.getElementById('pageInfo').textContent = `Page ${this.currentPage} of ${totalPages}`; + document.getElementById('pageInfo').textContent = `of ${totalPages}`; + + const pageInput = document.getElementById('pageInput'); + pageInput.value = this.currentPage; + pageInput.max = totalPages; if (totalPages > 1) { document.getElementById('paginationControls').classList.remove('hidden'); @@ -2524,6 +2538,20 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`; this.loadImages(); } } + + goToPage(page) { + const totalPages = Math.ceil(this.total / this.limit); + if (isNaN(page) || page < 1 || page > totalPages) { + // Reset to current page if invalid input + document.getElementById('pageInput').value = this.currentPage; + return; + } + + if (page !== this.currentPage) { + this.currentPage = page; + this.loadImages(); + } + } } // Initialize gallery when page loads From f3d49a95d641f483cc1df475a1795ef9b602001c Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 11 Jun 2025 13:43:27 -0700 Subject: [PATCH 2/2] chore: bump version to 3.0.10 in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index eb7018c..2c9b98d 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.9" +version = "3.0.10" 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"]