feat: 2,3,7,8,9 - search/sort, Docker, log viewer, .tsb backup
- Dashboard browser: search box + sort dropdown (name/category/author) - Dockerfile + docker-compose.yml - Debug page: log viewer button (/api/logs) - Settings: .tsb full backup export (dashboards+scenes+config) - F1 composite dashboard previously included
This commit is contained in:
@@ -57,6 +57,14 @@ const PageDashboard = {
|
||||
themes = themes.filter(t => this._isGameSupported(t));
|
||||
}
|
||||
|
||||
const searchQuery = document.getElementById('dash-search')?.value?.toLowerCase() || '';
|
||||
if (searchQuery) {
|
||||
themes = themes.filter(t => (t.name||'').toLowerCase().includes(searchQuery) || (t.description||'').toLowerCase().includes(searchQuery) || (t.author||'').toLowerCase().includes(searchQuery));
|
||||
}
|
||||
|
||||
const sortBy = document.getElementById('dash-sort')?.value || 'name';
|
||||
themes.sort((a, b) => (a[sortBy]||'').localeCompare(b[sortBy]||''));
|
||||
|
||||
if (themes.length === 0) {
|
||||
gridEl.innerHTML = this._emptyHtml('当前游戏没有兼容的仪表盘');
|
||||
return;
|
||||
@@ -115,6 +123,9 @@ const PageDashboard = {
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('dash-search')?.addEventListener('input', () => this._loadThemes());
|
||||
document.getElementById('dash-sort')?.addEventListener('change', () => this._loadThemes());
|
||||
|
||||
document.getElementById('btn-import-dashboard')?.addEventListener('click', () => {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
@@ -188,6 +199,14 @@ const PageDashboard = {
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboard-main">
|
||||
<div style="display:flex;gap:8px;margin-bottom:12px;align-items:center">
|
||||
<input id="dash-search" type="text" placeholder="搜索仪表盘..." style="flex:1;max-width:300px">
|
||||
<select id="dash-sort" style="width:120px">
|
||||
<option value="name">名称</option>
|
||||
<option value="category">分类</option>
|
||||
<option value="author">作者</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="dash-theme-grid" class="theme-grid"></div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
Reference in New Issue
Block a user