Spaces:
Running
Running
File size: 1,911 Bytes
d646dd7 bb59211 d646dd7 bb59211 d646dd7 bb59211 d646dd7 849e0ae d646dd7 bb59211 d646dd7 bb59211 d646dd7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | {% extends "base.html" %}
{% block title %}Trash - Data Acquisition{% endblock %}
{% block content %}
<div class="flex-1 flex flex-col p-6 overflow-auto hide-scrollbar max-w-3xl mx-auto w-full">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-semibold"><iconify-icon icon="ant-design:delete-outlined" class="icon-md"></iconify-icon> <span id="trash-title" data-i18n="trash_title">{{ t('trash_title') }}</span></h2>
<button onclick="purgeTrash()"
class="bg-red-800 hover:bg-red-700 text-red-200 text-sm px-4 py-1.5 rounded">
<iconify-icon icon="ant-design:delete-outlined" class="icon-sm"></iconify-icon> <span id="trash-purge-btn" data-i18n="purge_all">{{ t('purge_all') }}</span>
</button>
</div>
<div id="trash-list" class="space-y-2">
<div class="p-4 text-center text-gray-500 text-sm" data-i18n="loading">{{ t('loading') }}</div>
</div>
</div>
<script src="/static/js/app.js?v={{ asset_version }}"></script>
<script>
// 本页只需要维护【页面标题】。
//
// ★ 这里原先还手动设 nav-review / nav-trash 的 textContent —— 但 base.html 里
// **从来没有这两个 id**(侧边栏的导航文案是 data-i18n 属性、由 i18n.js 翻的),于是
// getElementById 返回 null,每次 DOMContentLoaded 都抛
// TypeError: Cannot set properties of null (setting 'textContent')
// 那两个导航文案现在由 i18n.js 的 applyTranslations() 按 data-i18n 处理,
// 这段手写逻辑纯属多余 —— 删掉,只留标题。
function _applyTrashTitle() {
document.title = t('trash_title') + ' - Data Acquisition';
}
document.addEventListener('DOMContentLoaded', _applyTrashTitle);
// 切语言时标题也跟着变(i18n.js 的 setLang 会派发这个事件)
window.addEventListener('egodata:lang', _applyTrashTitle);
</script>
{% endblock %}
|