修复按钮不清空筛选的BUG

This commit is contained in:
CN-JS-HuiBai
2026-04-05 22:29:01 +08:00
parent e8e23c5af8
commit 469ef9e448
2 changed files with 10 additions and 1 deletions

View File

@@ -292,7 +292,7 @@
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</div>
<button id="btnResetSort" class="btn-icon-sm" title="重置排序">
<button id="btnResetSort" class="btn-icon-sm" title="重置筛选与排序">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path>

View File

@@ -759,6 +759,15 @@
currentSort = { column: 'up', direction: 'desc' };
localStorage.removeItem('serverListSort');
// Clear filters
if (dom.serverSearchFilter) {
dom.serverSearchFilter.value = '';
}
if (dom.sourceFilter) {
dom.sourceFilter.value = 'all';
}
currentSourceFilter = 'all';
// Update UI headers
const headers = document.querySelectorAll('.server-table th.sortable');
headers.forEach(th => {