Fix: Preserve expanded state during refresh, format created_time
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
title: "GDM"
|
title: "GDM"
|
||||||
package_name: gommi_downloader_manager
|
package_name: gommi_downloader_manager
|
||||||
version: '0.2.6'
|
version: '0.2.7'
|
||||||
description: FlaskFarm 범용 다운로더 큐 - YouTube, 애니24, 링크애니, Anilife 지원
|
description: FlaskFarm 범용 다운로더 큐 - YouTube, 애니24, 링크애니, Anilife 지원
|
||||||
developer: projectdx
|
developer: projectdx
|
||||||
home: https://gitea.yommi.duckdns.org/projectdx/gommi_downloader_manager
|
home: https://gitea.yommi.duckdns.org/projectdx/gommi_downloader_manager
|
||||||
|
|||||||
3
model.py
3
model.py
@@ -57,6 +57,9 @@ class ModelDownloadItem(ModelBase):
|
|||||||
ret['meta'] = {}
|
ret['meta'] = {}
|
||||||
else:
|
else:
|
||||||
ret['meta'] = {}
|
ret['meta'] = {}
|
||||||
|
# Format created_time for frontend
|
||||||
|
if self.created_time:
|
||||||
|
ret['created_time'] = self.created_time.strftime('%Y-%m-%d %H:%M:%S')
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -520,6 +520,12 @@
|
|||||||
const container = document.getElementById('download_list');
|
const container = document.getElementById('download_list');
|
||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|
||||||
|
// Save expanded card IDs before re-rendering
|
||||||
|
const expandedIds = [];
|
||||||
|
container.querySelectorAll('.dl-card.expanded').forEach(function(card) {
|
||||||
|
expandedIds.push(card.id);
|
||||||
|
});
|
||||||
|
|
||||||
if (!items || items.length === 0) {
|
if (!items || items.length === 0) {
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
<div class="empty-state">
|
<div class="empty-state">
|
||||||
@@ -534,6 +540,12 @@
|
|||||||
html += createDownloadCard(item);
|
html += createDownloadCard(item);
|
||||||
});
|
});
|
||||||
container.innerHTML = html;
|
container.innerHTML = html;
|
||||||
|
|
||||||
|
// Restore expanded state
|
||||||
|
expandedIds.forEach(function(cardId) {
|
||||||
|
const card = document.getElementById(cardId);
|
||||||
|
if (card) card.classList.add('expanded');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDownloadCard(item) {
|
function createDownloadCard(item) {
|
||||||
|
|||||||
Reference in New Issue
Block a user