E2: interfaccia delle copie esterne

Impostazioni → Esportazione (cartella generale, stesso post in due account,
cartelle degli account), finestra della cartella delle copie (scelta nativa
o sottocartelle di /esporta, tipi, nomi come la libreria o schema suo con
anteprima), blocco «Copie esterne» nelle impostazioni dell'account con
«Esporta questo account» e il conto dei file non ancora copiati.

«Copia in…» con il riepilogo del piano e «Copia di nuovo anche i tolti o
superati» (spento), dal menu dell'icona CSV, dalla barra della selezione,
dall'account e dal visore; filtro «Copie» ricordato nell'indirizzo, segno
sulle tessere, righe delle copie nel pannello File con «Copia di nuovo».
Dashboard con la scheda Esportazione: avanzamento, Interrompi, Riprendi,
lavori recenti e resoconto. Testi in it.json, stili in febe.css.

Serve a usare dall'interfaccia il motore e le API delle copie esterne
della tappa E2 (§4.10).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-27 12:15:40 +01:00
1 parent 4a7925ad23
commit 2306f5a453
14 files changed
+1596 -33

No files matched your search

+43 -3
View File
@@ -23,9 +23,17 @@ const QUEUE_ROWS = 5;
const THUMBS = 8;
export default {
async mount(page) {
async mount(page, route) {
page.title(t('attivita.titolo'));
const tab = route && route.params && route.params.scheda === 'esportazione' ? 'esportazione' : 'motore';
page.tabs(dashboardTabs(tab));
// The tab «Esportazione» (spec §7.9, §10.3, tappa E2): the copies to external folders, not the engine.
if (tab === 'esportazione') {
const module = await import('./dashboard-export.js');
return module.mountExport(page);
}
const notice = h('div');
const exportNotice = h('div');
const now = h('div.ora-testo');
const preview = previewBox(page);
const today = h('section.blocco.oggi-basso');
@@ -43,7 +51,7 @@ export default {
h('section.cruscotto.pannello', preview.element, h('div.cruscotto-lato', now, budgets)),
suspended, today,
h('div.due-colonne.storia-coda', history.element, queue.element),
notice, incidents, alerts));
exportNotice, notice, incidents, alerts));
let latest = null;
page.onEngine((state) => {
@@ -62,11 +70,17 @@ export default {
async function loadSide() {
first.check();
try {
const [counts, history, recent] = await Promise.all([
const [counts, history, recent, exports] = await Promise.all([
api('/api/duplicates/count', { signal: page.signal }),
api('/api/engine/incidents', { signal: page.signal }),
api('/api/alerts', { signal: page.signal }),
// The copies are not the engine: without an answer the notice is simply not there.
api('/api/export', { signal: page.signal }).catch((error) => {
if (error.name === 'AbortError') throw error;
return null;
}),
]);
drawExportNotice(exportNotice, exports);
drawNotice(notice, counts);
drawIncidents(incidents, history);
drawAlerts(alerts, recent);
@@ -84,6 +98,15 @@ export default {
},
};
// ------------------------------------------------------------------------------------------------- tabs
/** «Motore» and «Esportazione» under the title (spec §7.9: the export has its own tab, never the red strip). */
function dashboardTabs(tab) {
const link = (key, href) => h(`a${tab === key ? '.qui' : ''}`, { href: withCarried(href), 'aria-current': tab === key ? 'page' : null }, t(`esportazione.dashboard.${key}`));
return h('nav.linguette.linguette-dashboard', { 'aria-label': t('esportazione.dashboard.linguette') },
link('motore', '/dashboard'), link('esportazione', '/dashboard/esportazione'));
}
// ------------------------------------------------------------------------------------------------- first start
/**
@@ -661,6 +684,23 @@ function drawNotice(box, counts) {
h('a.btn.piccolo', { href: withCarried('/doppioni') }, t('attivita.decidi'))));
}
/**
* A destination of the copies in pause, or copies left to resume (spec §4.10): an amber notice with the way to the tab
* «Esportazione». Never the red strip, which stays the engine's.
*/
function drawExportNotice(box, overview) {
if (!overview) {
box.replaceChildren();
return;
}
const paused = [overview.general, ...(overview.own || [])].filter((d) => d && (d.pausedAt || d.problem));
const items = paused.map((d) => t('esportazione.dashboard.cartellaInPausa', { cartella: d.label, problema: d.problem || t('esportazione.inPausa') }));
if (!paused.length && overview.unfinishedRuns) items.push(t('esportazione.dashboard.avvisoDaRiprendere', { n: overview.unfinishedRuns }));
fill(box, items.map((text) => h('div.avviso.ambra.avviso-azione', { style: { marginBottom: '10px' } }, icon('pause', 's'),
h('span', text),
h('a.btn.piccolo', { href: withCarried('/dashboard/esportazione') }, t('esportazione.apriEsportazione')))));
}
/** Recipes suspended after three problems in a row (unknown formats, targets not found): what to do, «Riattiva». */
function drawSuspended(box, state) {
const items = state.snapshot.suspendedRecipes || [];