mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-17 08:00:13 +01:00
feat: consolidate card data into optimized format for faster queries and reduced file sizes
This commit is contained in:
parent
5753bb19f8
commit
f70ffca23e
24 changed files with 2903 additions and 135 deletions
|
|
@ -43,8 +43,9 @@
|
|||
<div class="muted" id="themes-stale-line" style="margin-top:.25rem; display:none; color:#f87171;"></div>
|
||||
</div>
|
||||
</details>
|
||||
<div style="margin-top:.75rem;">
|
||||
<div style="margin-top:.75rem; display:flex; gap:.5rem; flex-wrap:wrap;">
|
||||
<button type="button" id="btn-refresh-themes" class="action-btn" onclick="refreshThemes()">Refresh Themes Only</button>
|
||||
<button type="button" id="btn-rebuild-cards" class="action-btn" onclick="rebuildCards()">Rebuild Card Files</button>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
|
|
@ -214,6 +215,30 @@
|
|||
})
|
||||
.finally(function(){ if (btn) btn.disabled = false; });
|
||||
};
|
||||
window.rebuildCards = function(){
|
||||
var btn = document.getElementById('btn-rebuild-cards');
|
||||
if (btn) btn.disabled = true;
|
||||
if (btn) btn.textContent = 'Rebuilding...';
|
||||
fetch('/setup/rebuild-cards', { method: 'POST', headers: { 'Content-Type': 'application/json' } })
|
||||
.then(function(r){
|
||||
if (!r.ok) throw new Error('Rebuild failed');
|
||||
return r.json();
|
||||
})
|
||||
.then(function(data){
|
||||
if (btn) btn.textContent = 'Rebuild Complete!';
|
||||
setTimeout(function(){
|
||||
if (btn) btn.textContent = 'Rebuild Card Files';
|
||||
if (btn) btn.disabled = false;
|
||||
}, 2000);
|
||||
})
|
||||
.catch(function(err){
|
||||
if (btn) btn.textContent = 'Rebuild Failed';
|
||||
setTimeout(function(){
|
||||
if (btn) btn.textContent = 'Rebuild Card Files';
|
||||
if (btn) btn.disabled = false;
|
||||
}, 2000);
|
||||
});
|
||||
};
|
||||
setInterval(poll, 3000);
|
||||
poll();
|
||||
pollThemes();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue