From 43f10f7796d0502f2a926c3a527d9dd78211a251 Mon Sep 17 00:00:00 2001 From: master3395 Date: Mon, 26 Jan 2026 03:32:49 +0100 Subject: [PATCH] fix(plugins): Add null checks to toggleView function to prevent errors when no plugins installed - Add null checks for gridView, tableView, and storeView elements - Prevent 'Cannot read properties of null' errors when elements don't exist - Add null checks for viewBtns array access - Add function existence checks before calling setupStoreSearch, loadPluginStore, displayStorePlugins - Improve initialization code with better error handling - Fixes Plugin Store loading errors when no plugins are installed --- .../templates/pluginHolder/plugins.html | 330 ++++++++++++++++-- 1 file changed, 295 insertions(+), 35 deletions(-) diff --git a/pluginHolder/templates/pluginHolder/plugins.html b/pluginHolder/templates/pluginHolder/plugins.html index 1da5d079e..076abbc4d 100644 --- a/pluginHolder/templates/pluginHolder/plugins.html +++ b/pluginHolder/templates/pluginHolder/plugins.html @@ -654,6 +654,62 @@ border-color: #5856d6; } + /* Store Search Styles */ + .store-search-container { + padding: 15px; + background: var(--bg-secondary, #f8f9ff); + border-radius: 8px; + margin-bottom: 20px; + } + + .store-search-wrapper { + position: relative; + } + + .store-search-input { + width: 100%; + padding: 12px 15px 12px 45px; + border: 2px solid #e8e9ff; + border-radius: 8px; + font-size: 14px; + transition: all 0.3s ease; + background: white; + color: var(--text-primary, #2f3640); + } + + .store-search-input:focus { + outline: none; + border-color: #5856d6; + box-shadow: 0 0 0 3px rgba(88, 86, 214, 0.1); + } + + .store-search-input::placeholder { + color: #94a3b8; + } + + .clear-search-btn { + display: none; + position: absolute; + right: 10px; + top: 50%; + transform: translateY(-50%); + background: none; + border: none; + color: #64748b; + cursor: pointer; + padding: 5px; + font-size: 14px; + transition: color 0.2s; + } + + .clear-search-btn:hover { + color: #dc3545; + } + + .clear-search-btn.visible { + display: block; + } + .store-table-wrapper { overflow-x: auto; background: var(--bg-primary, white); @@ -995,7 +1051,12 @@ {% endif %}
-

{{ plugin.name }}{% if plugin.is_paid|default:False|default_if_none:False %} {% endif %}

+

+ {{ plugin.name }} + {% if plugin.is_paid|default:False|default_if_none:False %} {% endif %} + {% if plugin.is_new|default:False %} NEW{% endif %} + {% if plugin.is_stale|default:False %} STALE{% endif %} +

{{ plugin.type }} v{{ plugin.version }} @@ -1014,13 +1075,32 @@
- {% trans "Paid Plugin:" %} {% trans "Requires Patreon subscription to" %} "{{ plugin.patreon_tier|default:'CyberPanel Paid Plugin' }}" + {% if plugin.payment_type == 'paypal' %} + {% trans "Paid Plugin:" %} {% trans "Requires PayPal payment to access." %} + {% else %} + {% trans "Paid Plugin:" %} {% trans "Requires Patreon subscription to" %} "{{ plugin.patreon_tier|default:'CyberPanel Paid Plugin' }}" + {% endif %}
- {% if plugin.patreon_url %} - - - {% trans "Subscribe on Patreon" %} - + {% if plugin.payment_type == 'paypal' %} + {% if plugin.paypal_me_url %} + + + {% trans "Pay with PayPal.me" %} + + {% endif %} + {% if plugin.paypal_payment_link %} + + + {% trans "Pay with Payment Link" %} + + {% endif %} + {% else %} + {% if plugin.patreon_url %} + + + {% trans "Subscribe on Patreon" %} + + {% endif %} {% endif %}
{% endif %} @@ -1094,8 +1174,10 @@ + + @@ -1107,11 +1189,30 @@ {% for plugin in plugins %} + +
{% trans "Icon" %} {% trans "Plugin Name" %} {% trans "Version" %}{% trans "Pricing" %} {% trans "Modify Date" %} {% trans "Status" %} {% trans "Action" %}
+
+ {% if plugin.type == "Security" %} + + {% elif plugin.type == "Performance" %} + + {% elif plugin.type == "Utility" %} + + {% elif plugin.type == "Backup" %} + + {% else %} + + {% endif %} +
+
{{ plugin.name }} + {% if plugin.is_new|default:False %} NEW{% endif %} + {% if plugin.is_stale|default:False %} STALE{% endif %} {{ plugin.version }} + {% if plugin.is_paid|default:False|default_if_none:False %} {% else %} @@ -1233,16 +1334,27 @@ + + + + + +