fix(админка): свежие файлы без ручной чистки кеша, скелетон вместо «Загрузки»
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import htm from '/static/admin2/vendor/htm.module.js';
|
||||
import { api } from '/static/admin2/api.js';
|
||||
import { Drawer } from '/static/admin2/ui/drawer.js';
|
||||
import { Toast } from '/static/admin2/ui/toast.js';
|
||||
import { Loading } from '/static/admin2/ui/loading.js';
|
||||
|
||||
const html = htm.bind(h);
|
||||
const rub = (v) => v == null ? '—' : Number(v).toLocaleString('ru-RU',
|
||||
@@ -116,7 +117,7 @@ export function CustomerDrawer({ email, onClose, onDeleted, onChanged }) {
|
||||
${error ? html`<p class="error" role="alert">${error}</p>` : null}
|
||||
${notice ? html`<${Toast} message=${notice} onUndo=${undoId ? undo : null}
|
||||
onClose=${() => { setNotice(''); setUndoId(null); }} />` : null}
|
||||
${!card ? html`<p class="note">Загрузка…</p>` : html`
|
||||
${!card ? html`<${Loading} rows={2} />` : html`
|
||||
<nav class="tabs">${TABS.map(([k, label]) => html`
|
||||
<button type="button" key=${k} class=${k === tab ? 'tab active' : 'tab'}
|
||||
onClick=${() => { setRows([]); setTab(k); }}>${label}</button>`)}</nav>
|
||||
@@ -148,7 +149,7 @@ export function CustomerDrawer({ email, onClose, onDeleted, onChanged }) {
|
||||
<div><span>Сообщений</span><b>${card.activity.messages}</b></div>
|
||||
<div><span>Файлов</span><b>${card.activity.files}${card.activity.files_capped ? '+' : ''}</b></div>
|
||||
</div>` : html`<div class="tab-body">${loading
|
||||
? html`<p class="note">Загрузка…</p>`
|
||||
? html`<${Loading} rows={2} />`
|
||||
: rows.length === 0 ? html`<p class="note">Пусто.</p>`
|
||||
: html`<pre class="json">${JSON.stringify(rows.slice(0, 20), null, 2)}</pre>`}</div>`}
|
||||
`}
|
||||
|
||||
Reference in New Issue
Block a user