Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

feat: add UI indicators and controls for library storage settings

LearningCircuitb7ae73fc32ef
diff --git a/src/local_deep_research/research_library/routes/library_routes.py b/src/local_deep_research/research_library/routes/library_routes.py
index 1edf67b6f9..e643c2aa11 100644
--- a/src/local_deep_research/research_library/routes/library_routes.py
+++ b/src/local_deep_research/research_library/routes/library_routes.py
@@ -136,6 +136,13 @@ def library_page():
username = session.get("username")
service = LibraryService(username)
+ # Get library settings
+ from ...utilities.db_utils import get_settings_manager
+ settings = get_settings_manager()
+ enable_pdf_storage = settings.get_setting("research_library.enable_pdf_storage", False)
+ enable_txt_storage = settings.get_setting("research_library.enable_txt_storage", False)
+ shared_library = settings.get_setting("research_library.shared_library", False)
+
# Get statistics
stats = service.get_library_stats()
@@ -160,6 +167,9 @@ def library_page():
unique_domains=unique_domains,
research_list=research_list,
storage_path=stats.get("storage_path", ""),
+ enable_pdf_storage=enable_pdf_storage,
+ enable_txt_storage=enable_txt_storage,
+ shared_library=shared_library,
)
@@ -170,6 +180,13 @@ def download_manager_page():
username = session.get("username")
service = LibraryService(username)
+ # Get library settings
+ from ...utilities.db_utils import get_settings_manager
+ settings = get_settings_manager()
+ enable_pdf_storage = settings.get_setting("research_library.enable_pdf_storage", False)
+ enable_txt_storage = settings.get_setting("research_library.enable_txt_storage", False)
+ shared_library = settings.get_setting("research_library.shared_library", False)
+
# Get research sessions with statistics
research_list = service.get_research_list_with_stats()
@@ -210,6 +227,9 @@ def download_manager_page():
total_resources=total_resources,
already_downloaded=already_downloaded,
available_to_download=available_to_download,
+ enable_pdf_storage=enable_pdf_storage,
+ enable_txt_storage=enable_txt_storage,
+ shared_library=shared_library,
)
diff --git a/src/local_deep_research/web/templates/pages/download_manager.html b/src/local_deep_research/web/templates/pages/download_manager.html
index 1e41f16e94..7b2547e6c3 100644
--- a/src/local_deep_research/web/templates/pages/download_manager.html
+++ b/src/local_deep_research/web/templates/pages/download_manager.html
@@ -16,6 +16,53 @@
</div>
</div>
+ <!-- Library Storage Settings Info -->
+ <div class="library-settings-info">
+ <div class="info-banner">
+ <div class="info-icon">
+ <i class="fas fa-info-circle"></i>
+ </div>
+ <div class="info-content">
+ <h4>Library Storage Settings</h4>
+ {% if not enable_pdf_storage %}
+ <p class="warning-message">
+ <i class="fas fa-exclamation-triangle"></i>
+ <strong>PDF downloads are currently disabled.</strong>
+ Only text extraction to the encrypted database is available for maximum privacy protection.
+ </p>
+ {% else %}
+ <p class="info-message">
+ <i class="fas fa-check-circle"></i>
+ PDF downloads are enabled. Files will be saved unencrypted to your library folder.
+ </p>
+ {% endif %}
+
+ {% if not enable_txt_storage %}
+ <p class="info-message">
+ <i class="fas fa-database"></i>
+ Text extraction saves to the encrypted database only. RAG/search integration is disabled.
+ </p>
+ {% else %}
+ <p class="warning-message">
+ <i class="fas fa-exclamation-triangle"></i>
+ Text files will be saved unencrypted to disk for RAG/search capabilities.
+ </p>
+ {% endif %}
+
+ {% if shared_library %}
+ <p class="warning-message">
+ <i class="fas fa-users"></i>
+ <strong>Shared Library Mode:</strong> All users share the same library directory.
+ </p>
+ {% endif %}
+
+ <a href="/settings#research-library" class="btn btn-sm btn-outline-primary settings-link">
+ <i class="fas fa-cog"></i> Configure Library Settings
+ </a>
+ </div>
+ </div>
+ </div>
+
<!-- Summary Stats -->
<div class="summary-stats">
<div class="stat-card">
@@ -258,7 +305,64 @@
display: flex;
justify-content: space-between;
align-items: center;
- margin-bottom: 30px;
+ margin-bottom: 20px;
+}
+
+/* Library Settings Info Banner */
+.library-settings-info {
+ margin-bottom: 25px;
+}
+
+.info-banner {
+ display: flex;
+ gap: 15px;
+ padding: 20px;
+ background: var(--bg-color, #f8f9fa);
+ border: 1px solid var(--border-color, #dee2e6);
+ border-radius: 8px;
+}
+
+.info-banner .info-icon {
+ font-size: 24px;
+ color: var(--primary-color, #0d6efd);
+ flex-shrink: 0;
+}
+
+.info-banner .info-content {
+ flex: 1;
+}
+
+.info-banner h4 {
+ margin: 0 0 10px 0;
+ font-size: 18px;
+ font-weight: 600;
+ color: var(--text-primary, #212529);
+}
+
+.info-banner p {
+ margin: 8px 0;
+ font-size: 14px;
+}
+
+.info-banner .warning-message {
+ color: var(--warning-color, #dc3545);
+ background: rgba(220, 53, 69, 0.1);
+ padding: 8px 12px;
+ border-radius: 4px;
+ border-left: 3px solid var(--warning-color, #dc3545);
+}
+
+.info-banner .info-message {
+ color: var(--info-color, #0dcaf0);
+ background: rgba(13, 202, 240, 0.1);
+ padding: 8px 12px;
+ border-radius: 4px;
+ border-left: 3px solid var(--info-color, #0dcaf0);
+}
+
+.info-banner .settings-link {
+ margin-top: 10px;
+ display: inline-block;
}
.summary-stats {
diff --git a/src/local_deep_research/web/templates/pages/library.html b/src/local_deep_research/web/templates/pages/library.html
index 02ca355bca..123795852a 100644
--- a/src/local_deep_research/web/templates/pages/library.html
+++ b/src/local_deep_research/web/templates/pages/library.html
@@ -11,11 +11,21 @@
<i class="fas fa-sync"></i> Sync Library
</button>
<div class="btn-group">
- <button class="btn btn-success" onclick="downloadAllNew()" title="Download all articles that haven't been downloaded yet">
+ <button class="btn btn-success"
+ {% if not enable_pdf_storage %}
+ disabled
+ title="PDF downloads are disabled for privacy. Enable PDF storage in Settings → Research Library"
+ data-toggle="tooltip"
+ {% else %}
+ onclick="downloadAllNew()"
+ title="Download all articles that haven't been downloaded yet"
+ {% endif %}>
<i class="fas fa-cloud-download-alt"></i> Download PDFs
</button>
- <button class="btn btn-info" onclick="downloadAllAsText()" title="Extract text from all PDFs for RAG">
- <i class="fas fa-file-alt"></i> Extract Text (RAG)
+ <button class="btn btn-info"
+ onclick="downloadAllAsText()"
+ title="Extract text from all PDFs for searchable database{% if not enable_txt_storage %} (saves to encrypted database only){% else %} and RAG integration{% endif %}">
+ <i class="fas fa-file-alt"></i> Extract Text{% if enable_txt_storage %} (RAG){% endif %}
</button>
</div>
<button class="btn btn-primary" onclick="window.location.href='/library/download-manager'">
@@ -38,6 +48,60 @@
</div>
</div>
+ <!-- Library Status Bar -->
+ <div class="library-status-bar">
+ <div class="status-item">
+ <span class="status-label">Storage Mode:</span>
+ {% if shared_library %}
+ <span class="badge badge-warning">
+ <i class="fas fa-users"></i> Shared Library
+ </span>
+ {% else %}
+ <span class="badge badge-success">
+ <i class="fas fa-user-lock"></i> Private Library
+ </span>
+ {% endif %}
+ </div>
+
+ <div class="status-item">
+ <span class="status-label">PDF Storage:</span>
+ <span class="badge {% if enable_pdf_storage %}badge-success{% else %}badge-secondary{% endif %}">
+ {% if enable_pdf_storage %}
+ <i class="fas fa-check-circle"></i> Enabled
+ {% else %}
+ <i class="fas fa-times-circle"></i> Disabled
+ {% endif %}
+ </span>
+ {% if not enable_pdf_storage %}
+ <span class="status-hint" title="PDF downloads are disabled for privacy. Enable in settings if needed.">
+ <i class="fas fa-info-circle"></i>
+ </span>
+ {% endif %}
+ </div>
+
+ <div class="status-item">
+ <span class="status-label">RAG Integration:</span>
+ <span class="badge {% if enable_txt_storage %}badge-success{% else %}badge-secondary{% endif %}">
+ {% if enable_txt_storage %}
+ <i class="fas fa-check-circle"></i> Active
+ {% else %}
+ <i class="fas fa-database"></i> Database Only
+ {% endif %}
+ </span>
+ {% if not enable_txt_storage %}
+ <span class="status-hint" title="Text files are stored in encrypted database only. Enable text file storage for RAG/ChromaDB integration.">
+ <i class="fas fa-info-circle"></i>
+ </span>
+ {% endif %}
+ </div>
+
+ <div class="status-item">
+ <a href="/settings#research-library" class="btn btn-sm btn-outline-primary">
+ <i class="fas fa-cog"></i> Configure Settings
+ </a>
+ </div>
+ </div>
+
<!-- Filters Section -->
<div class="filters-section">
<div class="filter-row">
@@ -201,7 +265,15 @@
<div class="pdf-modal-header">
<h2 id="pdf-title" class="pdf-title">PDF Viewer</h2>
<div class="pdf-header-actions">
- <button class="pdf-action-btn" onclick="downloadCurrentPDF()" title="Download PDF">
+ <button class="pdf-action-btn"
+ {% if enable_pdf_storage %}
+ onclick="downloadCurrentPDF()"
+ title="Download PDF"
+ {% else %}
+ disabled
+ title="PDF downloads are disabled. Enable in Settings → Research Library"
+ data-toggle="tooltip"
+ {% endif %}>
<i class="fas fa-download"></i>
</button>
<button class="pdf-action-btn" onclick="openPDFInNewTab()" title="Open in new tab">
@@ -320,7 +392,61 @@
display: flex;
justify-content: space-between;
align-items: center;
- margin-bottom: 30px;
+ margin-bottom: 20px;
+}
+
+/* Library Status Bar */
+.library-status-bar {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 20px;
+ align-items: center;
+ padding: 15px 20px;
+ background: var(--bg-color, #f8f9fa);
+ border: 1px solid var(--border-color, #dee2e6);
+ border-radius: 8px;
+ margin-bottom: 20px;
+}
+
+.library-status-bar .status-item {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.library-status-bar .status-label {
+ font-weight: 600;
+ color: var(--text-secondary, #6c757d);
+ font-size: 14px;
+}
+
+.library-status-bar .badge {
+ padding: 4px 10px;
+ font-size: 13px;
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+}
+
+.library-status-bar .badge-secondary {
+ background: #6c757d;
+ color: white;
+}
+
+.library-status-bar .badge-success {
+ background: #28a745;
+ color: white;
+}
+
+.library-status-bar .badge-warning {
+ background: #ffc107;
+ color: #212529;
+}
+
+.library-status-bar .status-hint {
+ color: var(--info-color, #0dcaf0);
+ font-size: 14px;
+ cursor: help;
}
.header-actions {
@@ -1204,6 +1330,10 @@ async function performSync() {
// Format dates on page load
document.addEventListener('DOMContentLoaded', function() {
+ // Initialize Bootstrap tooltips
+ $('[data-toggle="tooltip"]').tooltip();
+
+ // Initialize date formatting
document.querySelectorAll('.download-date').forEach(span => {
const dateStr = span.dataset.date;
if (dateStr) {