diff --git a/extensions/Servers/Proxmox/views/help.blade.php b/extensions/Servers/Proxmox/views/help.blade.php index d8c0a1159..992dc687e 100644 --- a/extensions/Servers/Proxmox/views/help.blade.php +++ b/extensions/Servers/Proxmox/views/help.blade.php @@ -8,9 +8,46 @@ 'reference': false }, searchQuery: '', - matchesQuery(label) { + matchesQuery(label, keywords = '') { if (!this.searchQuery) return true; - return label.toLowerCase().includes(this.searchQuery.toLowerCase()); + const query = this.searchQuery.toLowerCase(); + const labelLower = label.toLowerCase(); + const keywordsLower = keywords.toLowerCase(); + return labelLower.includes(query) || keywordsLower.includes(query); + }, + sectionMatchesContent(sectionId) { + if (!this.searchQuery) return true; + const query = this.searchQuery.toLowerCase(); + const sectionElement = document.querySelector(`[data-section-id='${sectionId}']`); + if (!sectionElement) return false; + const textContent = sectionElement.textContent.toLowerCase(); + return textContent.includes(query); + }, + shouldShowSection(sectionId, label, keywords = '') { + if (!this.searchQuery) return true; + return this.matchesQuery(label, keywords) || this.sectionMatchesContent(sectionId); + }, + init() { + this.$watch('searchQuery', (value) => { + if (value) { + // Auto-expand categories when searching + Object.keys(this.expandedCategories).forEach(key => { + this.expandedCategories[key] = true; + }); + // Auto-switch to first matching section + const sections = ['overview', 'quick-start', 'boot-settings', 'network', 'subdomain', 'cloud-init', 'display', 'statistics', 'system', 'backups', 'console', 'bgp', 'glossary', 'rfc-standards', 'troubleshooting']; + for (const section of sections) { + const sectionElement = document.querySelector(`[data-section-id='${section}']`); + if (sectionElement) { + const textContent = sectionElement.textContent.toLowerCase(); + if (textContent.includes(value.toLowerCase())) { + this.activeSection = section; + break; + } + } + } + } + }); } }"> @@ -49,14 +86,14 @@