diff --git a/branding/ui-icons/icons.py b/branding/ui-icons/icons.py
index c10a1875..d135e731 100644
--- a/branding/ui-icons/icons.py
+++ b/branding/ui-icons/icons.py
@@ -176,17 +176,22 @@ svg.append('')
with write(os.path.join(here, "icons.svg")) as f:
f.write("\n".join(svg))
-# The web admin's icons (its own names -> this set's), as inline SVG strings for app.js and the pages.
-WEB = {"dashboard": "Library", "users": "Users", "archive": "Archive", "jobs": "Jobs", "settings": "Settings", "logs": "Logs",
- "menu": "Menu", "power": "Power", "moon": "Moon", "refresh": "Refresh", "close": "Close", "plus": "Plus", "copy": "Copy",
- "search": "Search"}
+# The web admin's icons (its own names -> this set's), as inline SVG strings for app.js and the pages. The dashboard keeps
+# the four tiles of mockup Admin.html, so the panel's Library (owner review 2, R6) is drawn as a photo.
+WEB = {"dashboard": "Library", "library": "Image", "users": "Users", "archive": "Archive", "jobs": "Jobs", "settings": "Settings",
+ "logs": "Logs", "menu": "Menu", "power": "Power", "moon": "Moon", "refresh": "Refresh", "close": "Close", "plus": "Plus",
+ "copy": "Copy", "search": "Search", "grid": "ViewGrid", "list": "ViewList", "trash": "Delete", "upload": "Upload",
+ "download": "Download", "back": "Back", "previous": "ChevronLeft", "next": "ChevronRight", "star": "Star",
+ "starFilled": "StarFilled", "hero": "Hero", "image": "Image", "warning": "Warning"}
STROKE = 'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"'
with write(os.path.join(here, "..", "..", "src", "Chronos.Server", "Admin", "web", "icons.js")) as f:
f.write("// Generated by branding/ui-icons/icons.py (same 16-px set as the desktop apps). Do not edit by hand.\n")
+ f.write("// Glyphs that point along the reading direction carry class=\"directional\" (mirrored in right-to-left pages, admin.css).\n")
f.write("export const icons = {\n")
for key, name in WEB.items():
stroke, fill = I[name]
paths = (f'' if fill else "") + (f'' if stroke else "")
- f.write(f' {key}: ``,\n')
+ mirror = ' class="directional"' if name in DIRECTIONAL else ""
+ f.write(f' {key}: ``,\n')
f.write("};\n")
print(len(I), "icons,", len(WEB), "web icons")
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 8b0a6590..656ef75b 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -85,10 +85,10 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S
| `Ui/Controls` | `ChronosWindow` (chrome, language direction), `NavRail`, `JobBar`, `ToastHost`, `Field` (placeholder, icon, error), `Chip`, `AutoSlider`, `StatusGlyph`, `EmptyState`, `Icon`, `Bidi` (right-to-left rules), `Motion` (animations off for screenshots) |
| `Ui/Interop` | DWM calls of the window chrome; `TrayIcon` (`Shell_NotifyIconW`: the Uploader's tray, the client's Windows notifications) |
| `Ui/Visuals` | `DrawingElement` (hover readout, item keyboard and activation) and its charts (`BarChart`, `SeriesChart`, `StackedBar`, `HeatmapStrip`, `TimelineBands`), `Filmstrip`, `PreviewViewport`, `CurveEditor`, `SequenceCard`, `VirtualizingWrapPanel`, `SegmentedControl`, `SplitButton` |
-| `Server/Api`, `Server/Events` | Endpoint groups (`XxxEndpoints.Map`; `ScheduleEndpoints`: `/api/v1/schedules`; `LibraryEndpoints`: sequence thumbnail, photo delete, bulk delete/retag/jobs; `TrashEndpoints`: list, restore, empty), API errors, the WebSocket `EventHub` |
+| `Server/Api`, `Server/Events` | Endpoint groups (`XxxEndpoints.Map`; `ScheduleEndpoints`: `/api/v1/schedules`; `LibraryEndpoints`: the Library filters' facets, sequence thumbnail, photo delete, bulk delete/retag/jobs; `TrashEndpoints`: list, restore, empty), API errors, the WebSocket `EventHub` |
| `Server/Security` | Accounts, password hashing, tokens, session cookies, login guard, access rules, audit log |
| `Server/Storage`, `Server/Jobs` | Archive and processing modules, uploads (`UploadMaintenance`: recovery at start, and the sweep that is the `uploads` clean-up step), render store; `JobEngineHost`, `SchedulerHost` (the `Scheduler` on the engine, started after it; archive.json read every 10 minutes whatever the scan schedule does; every schedule change and run published as a `scheduleChanged` event) and `ServerScheduleHost` (time zone, archive refreshed from archive.json, system schedules), render node service, monitor and availability |
-| `Server/Hosting`, `Server/Admin/web` | `ServerHost`, `ServerLogging` (console and file levels the logging filters read at every line, the file sink's limits, the engine's level; applied again when Settings › Logs is saved), certificates, discovery beacon, embedded static files, Windows service (start and stop failures in the Application event log); the admin panel (ES modules, one per page; `schedules.js` is the Jobs page's Scheduled tab) |
+| `Server/Hosting`, `Server/Admin/web` | `ServerHost`, `ServerLogging` (console and file levels the logging filters read at every line, the file sink's limits, the engine's level; applied again when Settings › Logs is saved), certificates, discovery beacon, embedded static files, Windows service (start and stop failures in the Application event log); the admin panel (ES modules, one per page; `schedules.js` is the Jobs page's Scheduled tab; the Library's views in `pages/library/`: `sequence.js` a sequence and its photo viewer, `trash.js` the archive's trash, `shared.js` cards, selection and grid keyboard; the web upload `upload.js` is imported on demand) |
### 2.5 Hosts
diff --git a/i18n/en/Admin.resx b/i18n/en/Admin.resx
index 4a9f8fd1..36352a24 100644
--- a/i18n/en/Admin.resx
+++ b/i18n/en/Admin.resx
@@ -10,6 +10,7 @@
Running forVersion{0} changed the archive layoutlong
+ {0} deleted {1}long{0} started {1}long{0} signed in · {1}longfailed sign-in as {0}long
@@ -24,6 +25,8 @@
{0} deleted {1}long{0} edited a sequence · {1}long{0} changed the server settingslong
+ {0} emptied the trash · {1}long
+ {0} restored {1} from the trashlong{0} created user {1}long{0} deleted user {1}long{0} changed a user · {1}long
@@ -52,6 +55,8 @@
ScanLook for new and changed sequences on diskSequences
+ Trash
+ Open the archive's trash: deleted sequences and photos, to restore or erase for goodunverifiedunverifiedVerify
@@ -70,9 +75,13 @@
SaveSave the changes on the serverSaved.
+ Type the number shown: how many photos go
+ Type the number above firstType the name above firstType {0} to confirmlongType the name exactly as shown to confirm
+ Type the word exactly as shown; upper or lower case does not matter
+ Type the word above firstRecent activityAll logsOpen the audit log
@@ -201,6 +210,130 @@
Jobs the server queues by itself on a schedule: see, create and change themTargetLanguage of this panel
+ Add
+ Tags to add, separated by commas
+ All cameras
+ Any status
+ All tags
+ All years
+ Apply
+ Change the tags of the selected sequences
+ {0}: {1}long; {0} a sequence's title, {1} why it cannot move
+ Show only the sequences of this camera model
+ Clear filters
+ Show every sequence again
+ Deselect everything · Esc
+ Camera
+ Date
+ Photos
+ Sequence
+ Size
+ {0} sequence
+ {0} sequences
+ Bytes
+ Camera
+ First photo
+ Last photo
+ Photos
+ Tags
+ Title
+ Delete…
+ Move the selected sequences into the archive's trash; a list shows what goes first
+ {0} other sequence cannot move; the list says why.long
+ {0} other sequences cannot move; the list says why.long
+ {0} sequence, {1} ({2}), moves to the archive's trash; it can be restored until the trash is emptied.long
+ {0} sequences, {1} ({2}), move to the archive's trash; they can be restored until the trash is emptied.long
+ Move to trash
+ Move them into the archive's trash; nothing is erased
+ Delete {0} sequence?long
+ Delete {0} sequences?long
+ {0} sequence moved to the trash ({1})long
+ {0} sequences moved to the trash ({1})long
+ No sequences yet
+ Export CSV
+ Save the selected sequences as a CSV file: title, camera, photos, size, dates and tags
+ {0} sequence exportedlong
+ {0} sequences exportedlong
+ Analysed
+ With errors
+ Without proxies
+ Not analysed
+ Not rendered
+ Not verified
+ With proxies
+ Rendered
+ Verified
+ With warnings
+ Analyse
+ Queue the light analysis of the selected sequences
+ Proxies
+ Queue building the proxies of the selected sequences
+ Thumbnails
+ Queue drawing the thumbnails of the selected sequences again
+ Verify
+ Queue a verify: every original of the selected sequences is read again and its SHA-256 compared
+ Job queued.
+ No sequences match the filters
+ Type at least one tag to add or remove.long
+ Nothing queued.
+ None of the selected sequences can move to the trash.long
+ Enter or click opens the sequence; Space selects it, Shift+Space selects a range
+ Read the list again
+ Remove
+ Tags to remove, separated by commas; upper or lower case does not matter
+ Tags…
+ Add tags to the selected sequences or remove tags from them
+ Tags of {0} sequencelong
+ Tags of {0} sequenceslong
+ Tags changed on {0} sequencelong
+ Tags changed on {0} sequenceslong
+ Search title, camera, tag
+ Show the sequences whose title, camera or a tag contains this text
+ Select or deselect; with Shift, every sequence from the last one picked
+ Select all {0}
+ Select every sequence of these filters, also those not loaded yet
+ {0} selected
+ {0} selected
+ Selection
+ Sequences
+ Showing {0} of {1}
+ {0} skipped
+ {0} skipped
+ Most photos
+ Newest first
+ Oldest first
+ Largest first
+ Order of the sequences
+ Title
+ Analysed
+ The light analysis is done
+ Errors
+ Some photos are missing or damaged; a verify tells which
+ No proxies
+ No proxies yet: select it and choose Proxies
+ Not analysed
+ Not analysed yet: select it and choose Analyse
+ Proxies
+ Proxies are built for viewing and editing
+ Videos rendered from this sequence, listed on its page
+ {0} render
+ {0} renders
+ Show only the sequences in this state
+ Verified
+ Every original matched its SHA-256 at the last verify
+ The analysis found something to look at, such as flicker or gaps
+ {0} warning
+ {0} warnings
+ Show only the sequences with this tag
+ A tag has at most 64 characters.long
+ Trash
+ Deleted sequences and photos: restore them, or empty the trash
+ Upload
+ Upload photos from this computer into a new or an existing sequence
+ View
+ Show the sequences as cards
+ Show the sequences as a list
+ Show only the sequences whose first photo was taken in this yearWrong user name or password.longOnly administrators can use this panel.longPassword
@@ -210,6 +343,7 @@
UserYour user name on this serverArchive layout
+ Photos deletedJob startedSign-inFailed sign-in
@@ -225,6 +359,8 @@
Sequence editedDiagnostics exportedServer settings
+ Trash emptied
+ Restored from trashUser createdUser deletedUser changed
@@ -272,6 +408,8 @@
Show the menu names · Ctrl+BJobsQueue, history and render nodes
+ Library
+ Sequences and photos: browse, view, delete, restore from the trash, mass operationsLogsRecent log lines and downloadsSettings
@@ -433,6 +571,95 @@
{0} at {1}WhenWhen it runs; times are in the server's time zone ({0})
+ Add photos
+ Upload photos from this computer into this sequence
+ Add tag
+ Type a tag and press Enter; commas separate several
+ Library
+ Back to the list, with its filters
+ Deselect
+ Deselect every photo · Esc
+ Close the viewer · Esc
+ The sequence's cover
+ Delete…
+ Move the whole sequence into the archive's trash
+ The sequence, its {0} photo ({1}) and its renders move to the archive's trash; restore it from there until the trash is emptied.long
+ The sequence, its {0} photos ({1}) and its renders move to the archive's trash; restore it from there until the trash is emptied.long
+ Move the sequence into the archive's trash; nothing is erased
+ Delete…
+ Move the selected photos into the archive's trash; the thumbnails, proxies and analysis follow
+ {0} photo ({1}) moves to the archive's trash; restore it from there until the trash is emptied.long
+ {0} photos ({1}) move to the archive's trash; restore them from there until the trash is emptied.long
+ Move to trash
+ Move the photos into the archive's trash; nothing is erased
+ Delete {0} photo?long
+ Delete {0} photos?long
+ Delete {0}?long
+ {0} moved to the trash.long
+ Sequence
+ Download
+ Save the original file of this photo, as it is in the archive
+ Aperture
+ Camera
+ Taken
+ Resolution
+ Exposure
+ Flags
+ Focal length
+ Folder
+ Format
+ Interval
+ ISO
+ Lens
+ Photos
+ SHA-256
+ Size
+ Span
+ Status
+ Taken
+ Changed
+ damaged
+ duplicate
+ excluded
+ missing
+ This sequence is no longer in the librarylong
+ Show the next 500 photos
+ Next photo · →
+ No photos yet
+ No renders yet
+ Notes
+ Free notes on the sequence, saved when you leave the field
+ Select exactly one photo first
+ {0} · Enter or click opens the viewer; Space selects, Shift+Space selects a range
+ Photos
+ {0} photo moved to the trashlong
+ {0} photos moved to the trashlong
+ {0} / {1}invariant; a photo's number, then how many the sequence has
+ Previous photo · ←
+ Rate it {0} out of 5
+ Rating
+ Remove the tag {0}
+ Made
+ Download
+ Save this video
+ Length
+ Preset
+ Size
+ Video
+ Renders
+ Select all
+ Select every photo shown · Ctrl+A
+ Select or deselect; with Shift, every photo from the last one picked
+ Set cover
+ Show this photo on the sequence's card in every Library
+ Select one or more photos first
+ {0} star
+ {0} stars
+ Tags
+ Title
+ Title of the sequence; empty shows its date and camera · Enter saves, Esc reverts
+ A sequence has at most 50 tags.long
+ Rated {0} out of 5; choose it again to clear the ratingAboutKeep audit (days)Age limit of the Audit log clean-up schedule: older audit entries are deleted; 0: kept forever
@@ -511,6 +738,46 @@
Sign outSign out of the admin panelSwitch between light and dark
+ Library
+ Back to the Library
+ Deleted
+ Deleted by
+ Trash emptied.long
+ Empty…
+ Erase everything in the trash for good; a list shows what goes first
+ {0} file ({1}) is erased for good.long
+ {0} files ({1}) are erased for good.long
+ Empty trash
+ Erase every entry listed, for good
+ The trash was not emptied; the job's log says why.long
+ This cannot be undone.long
+ Emptying the trash: job queued.long
+ Empty the trash?long
+ emptythe word typed to confirm emptying the trash, lower case
+ The trash is being emptied
+ {0} entry
+ {0} entries
+ The trash is empty
+ {0} file stays in the trash: it no longer matches its record.long
+ {0} files stay in the trash: they no longer match their record.long
+ Kind
+ Photos
+ Replaced
+ Sequence
+ The trash is empty
+ Photos
+ {0} · {1} · {2}invariant; an entry's kind, title and size
+ Restore
+ Put the photos back into their sequence (a new one if it is gone); each is checked against its SHA-256 first
+ Put the sequence back into its folder and the library; its photos are checked against their SHA-256 first
+ {0} photo restored into a new sequence.long
+ {0} photos restored into a new sequence.long
+ {0} photo is back in {1}.long
+ {0} photos are back in {1}.long
+ {0} is back in the library.long
+ Sequence
+ Size
+ Trash{0} account{0} accountsActive
diff --git a/i18n/it/Admin.it.resx b/i18n/it/Admin.it.resx
index 6686fe74..e00c17f8 100644
--- a/i18n/it/Admin.it.resx
+++ b/i18n/it/Admin.it.resx
@@ -10,6 +10,7 @@
In esecuzione daVersione{0} ha modificato l'organizzazione dell'archivio
+ {0} ha eliminato {1}long{0} ha avviato {1}{0} ha effettuato l'accesso · {1}accesso fallito come {0}
@@ -24,6 +25,8 @@
{0} ha eliminato {1}{0} ha modificato una sequenza · {1}{0} ha modificato le impostazioni del server
+ {0} ha svuotato il cestino · {1}long
+ {0} ha ripristinato {1} dal cestinolong{0} ha creato l'utente {1}{0} ha eliminato l'utente {1}{0} ha modificato un utente · {1}
@@ -52,6 +55,8 @@
ScansionaCerca sequenze nuove e modificate sul discoSequenze
+ Cestino
+ Apri il cestino dell'archivio: sequenze e foto eliminate, da ripristinare o cancellare per semprenon verificatanon verificateVerifica
@@ -70,9 +75,13 @@
SalvaSalva le modifiche sul serverSalvato.
+ Digita il numero mostrato: quante foto vengono spostate
+ Prima digita il numero qui sopraPrima digita il nome qui sopraDigita {0} per confermareDigita il nome esattamente come mostrato per confermare
+ Digita la parola come mostrata; maiuscole e minuscole non contano
+ Prima digita la parola qui sopraAttività recentiTutti i logApri il registro di controllo
@@ -201,6 +210,130 @@
Job che il server mette in coda da solo secondo una pianificazione: visualizzali, creali e modificaliOggettoLingua di questo pannello
+ Aggiungi
+ Tag da aggiungere, separati da virgole
+ Tutte le fotocamere
+ Qualsiasi stato
+ Tutti i tag
+ Tutti gli anni
+ Applica
+ Cambia i tag delle sequenze selezionate
+ {0}: {1}long
+ Mostra solo le sequenze di questo modello di fotocamera
+ Azzera filtri
+ Mostra di nuovo tutte le sequenze
+ Deseleziona tutto · Esc
+ Fotocamera
+ Data
+ Foto
+ Sequenza
+ Dimensione
+ {0} sequenza
+ {0} sequenze
+ Byte
+ Fotocamera
+ Prima foto
+ Ultima foto
+ Foto
+ Tag
+ Titolo
+ Elimina…
+ Sposta le sequenze selezionate nel cestino dell'archivio; prima un elenco mostra cosa viene spostato
+ {0} altra sequenza non può essere spostata; l'elenco dice perché.long
+ Altre {0} sequenze non possono essere spostate; l'elenco dice perché.long
+ {0} sequenza, {1} ({2}), va nel cestino dell'archivio; si può ripristinare finché il cestino non viene svuotato.long
+ {0} sequenze, {1} ({2}), vanno nel cestino dell'archivio; si possono ripristinare finché il cestino non viene svuotato.long
+ Sposta nel cestino
+ Spostale nel cestino dell'archivio; nulla viene cancellato
+ Eliminare {0} sequenza?long
+ Eliminare {0} sequenze?long
+ {0} sequenza spostata nel cestino ({1})long
+ {0} sequenze spostate nel cestino ({1})long
+ Ancora nessuna sequenza
+ Esporta CSV
+ Salva le sequenze selezionate in un file CSV: titolo, fotocamera, foto, dimensione, date e tag
+ {0} sequenza esportatalong
+ {0} sequenze esportatelong
+ Analizzate
+ Con errori
+ Senza proxy
+ Non analizzate
+ Non renderizzate
+ Non verificate
+ Con proxy
+ Renderizzate
+ Verificate
+ Con avvisi
+ Analizza
+ Metti in coda l'analisi leggera delle sequenze selezionate
+ Proxy
+ Metti in coda la creazione dei proxy delle sequenze selezionate
+ Miniature
+ Metti in coda il ridisegno delle miniature delle sequenze selezionate
+ Verifica
+ Metti in coda una verifica: ogni originale delle sequenze selezionate viene riletto e il suo SHA-256 confrontato
+ Job in coda.
+ Nessuna sequenza corrisponde ai filtri
+ Digita almeno un tag da aggiungere o togliere.long
+ Nulla in coda.
+ Nessuna delle sequenze selezionate può andare nel cestino.long
+ Invio o clic apre la sequenza; Spazio la seleziona, Maiusc+Spazio seleziona un intervallo
+ Rileggi l'elenco
+ Togli
+ Tag da togliere, separati da virgole; maiuscole e minuscole non contano
+ Tag…
+ Aggiungi tag alle sequenze selezionate o toglili
+ Tag di {0} sequenzalong
+ Tag di {0} sequenzelong
+ Tag cambiati su {0} sequenzalong
+ Tag cambiati su {0} sequenzelong
+ Cerca titolo, fotocamera, tag
+ Mostra le sequenze il cui titolo, fotocamera o un tag contiene questo testo
+ Seleziona o deseleziona; con Maiusc, tutte le sequenze dall'ultima scelta
+ Seleziona tutte ({0})
+ Seleziona tutte le sequenze di questi filtri, anche quelle non ancora caricate
+ {0} selezionata
+ {0} selezionate
+ Selezione
+ Sequenze
+ Mostrate {0} di {1}
+ {0} saltata
+ {0} saltate
+ Più foto
+ Più recenti
+ Meno recenti
+ Più grandi
+ Ordine delle sequenze
+ Titolo
+ Analizzata
+ L'analisi leggera è fatta
+ Errori
+ Alcune foto mancano o sono danneggiate; una verifica dice quali
+ Senza proxy
+ Ancora nessun proxy: selezionala e scegli Proxy
+ Non analizzata
+ Non ancora analizzata: selezionala e scegli Analizza
+ Proxy
+ I proxy per la visione e il montaggio sono pronti
+ Video renderizzati da questa sequenza, elencati nella sua pagina
+ {0} render
+ {0} render
+ Mostra solo le sequenze in questo stato
+ Verificata
+ Ogni originale corrispondeva al suo SHA-256 all'ultima verifica
+ L'analisi ha trovato qualcosa da controllare, come sfarfallio o pause
+ {0} avviso
+ {0} avvisi
+ Mostra solo le sequenze con questo tag
+ Un tag ha al massimo 64 caratteri.long
+ Cestino
+ Sequenze e foto eliminate: ripristinale o svuota il cestino
+ Carica
+ Carica foto da questo computer in una sequenza nuova o esistente
+ Vista
+ Mostra le sequenze come schede
+ Mostra le sequenze come elenco
+ Mostra solo le sequenze la cui prima foto è stata scattata in quest'annoNome utente o password errati.Solo gli amministratori possono usare questo pannello.Password
@@ -210,6 +343,7 @@
UtenteIl tuo nome utente su questo serverOrganizzazione archivio
+ Foto eliminateJob avviatoAccessoAccesso fallito
@@ -225,6 +359,8 @@
Sequenza modificataDiagnostica esportataImpostazioni server
+ Cestino svuotato
+ Ripristino dal cestinoUtente creatoUtente eliminatoUtente modificato
@@ -271,6 +407,8 @@
Mostra i nomi del menu · Ctrl+BAttivitàCoda, cronologia e nodi di rendering
+ Libreria
+ Sequenze e foto: sfoglia, guarda, elimina, ripristina dal cestino, operazioni di massaLogUltime righe di log e downloadImpostazioni
@@ -432,6 +570,94 @@
{0} alle {1}QuandoQuando parte; gli orari sono nel fuso orario del server ({0})
+ Aggiungi foto
+ Carica foto da questo computer in questa sequenza
+ Aggiungi tag
+ Digita un tag e premi Invio; le virgole ne separano più di uno
+ Libreria
+ Torna all'elenco, con i suoi filtri
+ Deseleziona
+ Deseleziona tutte le foto · Esc
+ Chiudi il visualizzatore · Esc
+ La copertina della sequenza
+ Elimina…
+ Sposta l'intera sequenza nel cestino dell'archivio
+ La sequenza, la sua {0} foto ({1}) e i suoi render vanno nel cestino dell'archivio; ripristinala da lì finché il cestino non viene svuotato.long
+ La sequenza, le sue {0} foto ({1}) e i suoi render vanno nel cestino dell'archivio; ripristinala da lì finché il cestino non viene svuotato.long
+ Sposta la sequenza nel cestino dell'archivio; nulla viene cancellato
+ Elimina…
+ Sposta le foto selezionate nel cestino dell'archivio; miniature, proxy e analisi si aggiornano
+ {0} foto ({1}) va nel cestino dell'archivio; ripristinala da lì finché il cestino non viene svuotato.long
+ {0} foto ({1}) vanno nel cestino dell'archivio; ripristinale da lì finché il cestino non viene svuotato.long
+ Sposta nel cestino
+ Sposta le foto nel cestino dell'archivio; nulla viene cancellato
+ Eliminare {0} foto?long
+ Eliminare {0} foto?long
+ Eliminare {0}?long
+ {0} spostata nel cestino.long
+ Sequenza
+ Scarica
+ Salva il file originale di questa foto, com'è nell'archivio
+ Diaframma
+ Fotocamera
+ Scattata
+ Risoluzione
+ Esposizione
+ Segnalazioni
+ Focale
+ Cartella
+ Formato
+ Intervallo
+ ISO
+ Obiettivo
+ Foto
+ SHA-256
+ Dimensione
+ Durata
+ Stato
+ Scattata
+ Modificata
+ danneggiata
+ duplicata
+ esclusa
+ mancante
+ Questa sequenza non è più nella librerialong
+ Mostra le 500 foto successive
+ Foto successiva · →
+ Ancora nessuna foto
+ Ancora nessun render
+ Note
+ Note libere sulla sequenza, salvate quando lasci il campo
+ Prima seleziona una sola foto
+ {0} · Invio o clic apre il visualizzatore; Spazio seleziona, Maiusc+Spazio seleziona un intervallo
+ Foto
+ {0} foto spostata nel cestinolong
+ {0} foto spostate nel cestinolong
+ Foto precedente · ←
+ Dai voto {0} su 5
+ Voto
+ Togli il tag {0}
+ Creato
+ Scarica
+ Salva questo video
+ Durata
+ Preset
+ Dimensione
+ Video
+ Render
+ Seleziona tutte
+ Seleziona tutte le foto mostrate · Ctrl+A
+ Seleziona o deseleziona; con Maiusc, tutte le foto dall'ultima scelta
+ Imposta copertina
+ Mostra questa foto sulla scheda della sequenza in ogni Libreria
+ Prima seleziona una o più foto
+ {0} stella
+ {0} stelle
+ Tag
+ Titolo
+ Titolo della sequenza; vuoto mostra data e fotocamera · Invio salva, Esc annulla
+ Una sequenza ha al massimo 50 tag.long
+ Voto {0} su 5; sceglilo di nuovo per togliere il votoInformazioniConserva controllo (giorni)Limite di età della pianificazione Pulizia registro controllo: le voci più vecchie vengono eliminate; 0: conservate per sempre
@@ -510,6 +736,45 @@
EsciEsci dal pannello di amministrazioneAlterna tema chiaro e scuro
+ Libreria
+ Torna alla Libreria
+ Eliminato
+ Eliminato da
+ Cestino svuotato.long
+ Svuota…
+ Cancella per sempre tutto il contenuto del cestino; prima un elenco mostra cosa viene cancellato
+ {0} file ({1}) viene cancellato per sempre.long
+ {0} file ({1}) vengono cancellati per sempre.long
+ Svuota cestino
+ Cancella per sempre ogni voce dell'elenco
+ Il cestino non è stato svuotato; il log del job dice perché.long
+ Non si può annullare.long
+ Svuotamento del cestino: job in coda.long
+ Svuotare il cestino?long
+ svuota
+ Il cestino si sta svuotando
+ {0} voce
+ {0} voci
+ Il cestino è vuoto
+ {0} file resta nel cestino: non corrisponde più al suo record.long
+ {0} file restano nel cestino: non corrispondono più al loro record.long
+ Tipo
+ Foto
+ Sostituite
+ Sequenza
+ Il cestino è vuoto
+ Foto
+ Ripristina
+ Rimetti le foto nella loro sequenza (una nuova se non c'è più); prima ognuna viene controllata con il suo SHA-256
+ Rimetti la sequenza nella sua cartella e nella libreria; prima le sue foto vengono controllate con il loro SHA-256
+ {0} foto ripristinata in una nuova sequenza.long
+ {0} foto ripristinate in una nuova sequenza.long
+ {0} foto è di nuovo in {1}.long
+ {0} foto sono di nuovo in {1}.long
+ {0} è di nuovo nella libreria.long
+ Sequenza
+ Dimensione
+ Cestino{0} account{0} accountAttivo
diff --git a/src/Chronos.Data/Repositories/SequenceRepository.cs b/src/Chronos.Data/Repositories/SequenceRepository.cs
index 5ca128fe..e8bb053f 100644
--- a/src/Chronos.Data/Repositories/SequenceRepository.cs
+++ b/src/Chronos.Data/Repositories/SequenceRepository.cs
@@ -1,3 +1,4 @@
+using System.Globalization;
using Chronos.Core.Imaging;
using Chronos.Core.Model;
@@ -103,6 +104,15 @@ public sealed record CameraBucket(string? Make, string? Model, int Sequences, lo
public sealed record FormatBucket(ImageFileFormat Format, long Photos, long Bytes);
+///
+/// A value a Library filter offers, as takes it (a year, an exact camera model, a tag), and
+/// how many sequences have it; is a camera model's make, for its label.
+///
+public sealed record ArchiveFacet(string Value, int Sequences, string? Make = null);
+
+/// The years of first capture, camera models and tags of an archive's sequences (owner review 2, R6: the panel's filters).
+public sealed record ArchiveFacets(IReadOnlyList Years, IReadOnlyList Cameras, IReadOnlyList Tags);
+
/// Health counters: sequences needing attention and flagged frames.
public sealed record ArchiveHealth(
int Unverified,
@@ -389,6 +399,32 @@ public sealed class SequenceRepository
}, cancellationToken);
}
+ ///
+ /// What the Library's filters offer for : years of first capture (newest first), camera
+ /// models (most sequences first; one entry per model, as the camera filter matches the model alone) and the tags in use
+ /// (by name). Only sequence rows are read, never frames.
+ ///
+ public Task GetFacetsAsync(Guid archiveId, CancellationToken cancellationToken = default)
+ {
+ DbParam[] args = [archiveId];
+ var year = _db.Sql.Year("s.first_capture");
+ return _db.RunAsync(async session =>
+ {
+ var years = await session.QueryListAsync(
+ $"SELECT {year}, count(*) FROM sequences s WHERE s.archive_id = $1 AND s.first_capture IS NOT NULL GROUP BY 1 ORDER BY 1 DESC", args,
+ r => new ArchiveFacet(r.GetInt32(0).ToString(CultureInfo.InvariantCulture), r.GetInt32(1)), cancellationToken).ConfigureAwait(false);
+ var cameras = await session.QueryListAsync(
+ "SELECT s.camera_model, MIN(s.camera_make), count(*) FROM sequences s " +
+ "WHERE s.archive_id = $1 AND s.camera_model IS NOT NULL AND s.camera_model <> '' GROUP BY s.camera_model ORDER BY 3 DESC, 1", args,
+ r => new ArchiveFacet(r.GetString(0), r.GetInt32(2), r.GetStringOrNull(1)), cancellationToken).ConfigureAwait(false);
+ var tags = await session.QueryListAsync(
+ "SELECT MIN(t.name), count(*) FROM sequence_tags st JOIN tags t ON t.id = st.tag_id JOIN sequences s ON s.id = st.sequence_id " +
+ "WHERE s.archive_id = $1 GROUP BY t.name_key ORDER BY t.name_key", args,
+ r => new ArchiveFacet(r.GetString(0), r.GetInt32(1)), cancellationToken).ConfigureAwait(false);
+ return new ArchiveFacets(years, cameras, tags);
+ }, cancellationToken);
+ }
+
///
/// The sequences of a rolling verification checks next (owner review 2, R10): those never
/// verified first, then the longest unverified, at most . With
diff --git a/src/Chronos.Protocol/Library.cs b/src/Chronos.Protocol/Library.cs
index 00bfe776..6c1ed3ef 100644
--- a/src/Chronos.Protocol/Library.cs
+++ b/src/Chronos.Protocol/Library.cs
@@ -65,3 +65,15 @@ public sealed record BulkItemResult(Guid Id, string Outcome, string? Reason = nu
/// and the job a bulk job request queued (null when nothing was queued).
///
public sealed record BulkResultDto(IReadOnlyList Items, int Ok, int Skipped, bool DryRun, int Photos = 0, long Bytes = 0, JobDto? Job = null);
+
+///
+/// A value a Library filter offers: as GET /api/v1/sequences takes it (year, camera,
+/// tag), the sequences that have it, and the label a menu shows when it differs (a camera model with its make).
+///
+public sealed record FacetDto(string Value, int Sequences, string? Label = null);
+
+///
+/// GET /api/v1/sequences/facets (owner review 2, R6): the years of first capture (newest first), camera models (most
+/// sequences first) and tags in use (by name) of the archive's sequences, for the admin panel's Library filters.
+///
+public sealed record LibraryFacetsDto(IReadOnlyList Years, IReadOnlyList Cameras, IReadOnlyList Tags);
diff --git a/src/Chronos.Protocol/ProtocolJson.cs b/src/Chronos.Protocol/ProtocolJson.cs
index 852d511c..e68f6d1e 100644
--- a/src/Chronos.Protocol/ProtocolJson.cs
+++ b/src/Chronos.Protocol/ProtocolJson.cs
@@ -86,4 +86,5 @@ namespace Chronos.Protocol;
[JsonSerializable(typeof(BulkJobsRequest))]
[JsonSerializable(typeof(BulkItemResult))]
[JsonSerializable(typeof(BulkResultDto))]
+[JsonSerializable(typeof(LibraryFacetsDto))]
public sealed partial class ProtocolJson : JsonSerializerContext;
diff --git a/src/Chronos.Server/Admin/web/admin.css b/src/Chronos.Server/Admin/web/admin.css
index a4706f71..3cfe4e52 100644
--- a/src/Chronos.Server/Admin/web/admin.css
+++ b/src/Chronos.Server/Admin/web/admin.css
@@ -25,6 +25,8 @@
--error: light-dark(#c42b1c, #f0625d);
--shadow: light-dark(rgba(0, 0, 0, .18), rgba(0, 0, 0, .4));
--scrim: light-dark(rgba(0, 0, 0, .25), rgba(0, 0, 0, .6));
+ /* Badges drawn over photos (counts, numbers, the cover mark) read the same on light and dark pages. */
+ --on-photo: rgba(0, 0, 0, .6);
--radius: 6px;
--radius-card: 8px;
--font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
@@ -293,6 +295,115 @@ dialog.dialog p { margin: 0; color: var(--text-muted); }
.toast { width: 420px; max-width: calc(100vw - 48px); padding: 12px 14px; color: var(--text); background: var(--card); border: 1px solid var(--stroke); border-inline-start: 3px solid var(--accent); border-radius: var(--radius-card); box-shadow: 0 4px 16px var(--shadow); }
.toast.error { border-inline-start-color: var(--error); }
+/* Directional glyphs (icons.js) point along the reading direction; inside a left-to-right island (photos, time) they do not turn. */
+svg.directional:dir(rtl) { transform: scaleX(-1); }
+.btn svg, .tag svg { flex: none; }
+dialog.dialog .dialog-list { margin: 0; padding-block: 8px; padding-inline: 28px 12px; max-height: 200px; overflow: auto; border: 1px solid var(--stroke);
+ border-radius: var(--radius); background: var(--bg); font-size: 12px; overflow-wrap: anywhere; }
+dialog.dialog .dialog-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+dialog.dialog .field-label strong { color: var(--text); }
+
+/* Library (owner review 2, R6): toolbar, cards (DESIGN §4: 16:9 thumbnail, count badge, check box on hover or selection,
+ selected = accent border and glow), list rows, the selection's bar, a sequence's photos and the photo viewer. */
+.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
+.toolbar .input.small { height: 32px; max-width: 200px; }
+.toolbar select.active { border-color: var(--accent); color: var(--accent); }
+.seq-items { min-width: 0; }
+.seq-items.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; padding: 16px; }
+.seq-items > .empty { grid-column: 1 / -1; }
+/* Shift+click picks a range: it selects no text. */
+.seq-card, .seq-row, .frame { position: relative; cursor: pointer; outline: none; user-select: none; }
+.seq-card { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius-card); overflow: hidden; }
+.seq-card:hover { border-color: var(--stroke-strong); }
+.seq-card:focus-visible, .seq-row:focus-visible, .frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+.seq-card[aria-selected="true"], .frame[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-selected); }
+.thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--card-pressed); overflow: hidden; }
+.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); }
+.thumb .placeholder svg { width: 28px; height: 28px; }
+.thumb img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }
+.thumb img.failed { visibility: hidden; }
+.seq-check { position: absolute; top: 8px; inset-inline-start: 8px; width: 18px; height: 18px; z-index: 1; opacity: 0; cursor: pointer; }
+.seq-card:hover .seq-check, .seq-card:focus-visible .seq-check, .frame:hover .seq-check, .frame:focus-visible .seq-check,
+.selecting .seq-check, [aria-selected="true"] > .seq-check { opacity: 1; }
+.seq-card .count { position: absolute; top: 8px; inset-inline-end: 8px; padding: 0 6px; border-radius: 8px; background: var(--on-photo); color: #fff; font-size: 11px; }
+.seq-card .info { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; min-width: 0; }
+.seq-card .facts { font-size: 12px; color: var(--text-muted); }
+.chips-row { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; color: var(--text-muted); }
+.st { white-space: nowrap; }
+.st.ok { color: var(--success); }
+.st.off { color: var(--text-faint); }
+.st.warn { color: var(--warning); }
+.st.err { color: var(--error); }
+/* List: the rows are one grid's subgrids, so every column fits its widest cell (as .table). */
+.seq-items.rows { display: grid; grid-template-columns: max-content 64px minmax(160px, 2fr) minmax(80px, 1fr) max-content max-content max-content; column-gap: 12px; }
+.seq-items.rows > .seq-head, .seq-items.rows > .seq-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 0 18px; }
+.seq-items.rows > .seq-head { font-size: 11px; color: var(--text-muted); padding-block: 10px; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
+.seq-items.rows > .empty { grid-column: 1 / -1; }
+.seq-row { min-height: 52px; border-bottom: 1px solid var(--stroke); }
+.seq-row:hover { background: var(--card-hover); }
+.seq-row[aria-selected="true"] { background: var(--accent-selected); }
+.seq-row .seq-check { position: static; opacity: 1; }
+.seq-row .thumb { width: 64px; border-radius: 4px; }
+.seq-row .thumb .placeholder svg { width: 16px; height: 16px; }
+@media (max-width: 900px) {
+ .seq-items.rows { grid-template-columns: max-content 64px minmax(120px, 1fr) max-content; }
+ .seq-items.rows .col-camera, .seq-items.rows .col-size, .seq-items.rows .col-date { display: none; }
+}
+/* The selection's actions stay in view at the foot of the window while the list scrolls. */
+.mass-bar { position: sticky; bottom: 16px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px;
+ background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-card); box-shadow: 0 4px 16px var(--shadow); }
+/* A sequence: cover, editable fields and facts side by side, stacked on narrow screens. */
+.seq-detail { grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) minmax(220px, 320px); gap: 20px; align-items: start; }
+.seq-cover .thumb { border-radius: var(--radius); }
+.input.heading { height: 38px; font-size: 18px; font-weight: 600; border-color: transparent; background: transparent; padding-inline: 8px; margin-inline-start: -8px; }
+.input.heading:hover { border-color: var(--stroke); }
+.input.heading:focus { background: var(--card); }
+textarea.input.notes { height: auto; min-height: 64px; padding: 6px 10px; resize: vertical; font: inherit; }
+.tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
+.tag-list { display: contents; }
+.tag { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding-inline: 10px 2px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--card); color: var(--text); font-size: 12px; }
+.tag-editor .input.small { width: 140px; }
+.btn.tiny { width: 20px; min-width: 20px; height: 20px; border-radius: 10px; }
+.btn.tiny svg { width: 12px; height: 12px; }
+.stars { display: flex; gap: 2px; }
+.btn.star { color: var(--text-faint); }
+.btn.star[aria-pressed="true"] { color: var(--sun); border-color: transparent; box-shadow: none; }
+.seq-facts, .viewer-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 12px; }
+.seq-facts > div, .viewer-meta > div { display: contents; }
+.seq-facts dt, .viewer-meta dt { color: var(--text-muted); }
+.seq-facts dd, .viewer-meta dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
+.panel-head.wrap { flex-wrap: wrap; }
+.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 12px 18px; }
+.frame-grid > .frame-empty { grid-column: 1 / -1; }
+/* Thousands of photos: the browser lays out and paints only those near the view. */
+.frame { content-visibility: auto; contain-intrinsic-size: auto 90px; border: 1px solid var(--stroke); border-radius: var(--radius); overflow: hidden; background: var(--card); }
+.frame .thumb { aspect-ratio: 3 / 2; }
+.frame-no { position: absolute; bottom: 4px; inset-inline-end: 4px; padding: 0 5px; border-radius: 6px; background: var(--on-photo); color: #fff; font-size: 10px; }
+.frame-badge { position: absolute; top: 4px; inset-inline-end: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 11px; background: var(--on-photo); color: #fff; }
+.frame-badge.hero { color: var(--sun); }
+.frame-badge.warn { top: auto; bottom: 4px; inset-inline: 4px auto; color: var(--warning); }
+.table.renders { grid-template-columns: minmax(100px, 1.4fr) max-content max-content max-content max-content max-content; }
+.table.trash { grid-template-columns: max-content minmax(140px, 2fr) max-content max-content minmax(60px, 1fr) max-content max-content; }
+.table.trash.fit-1 { grid-template-columns: max-content minmax(120px, 2fr) max-content max-content max-content max-content; }
+.table.trash.fit-1 .col-by { display: none; }
+dialog.viewer { width: min(1100px, calc(100vw - 32px)); padding: 16px 18px; }
+dialog.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px 16px; }
+.viewer-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; }
+.viewer-stage { position: relative; display: grid; place-items: center; min-height: 240px; max-height: 72vh; background: #000; border-radius: var(--radius); overflow: hidden; }
+.viewer-stage img { max-width: 100%; max-height: 72vh; object-fit: contain; display: block; }
+.viewer-stage img.failed { display: none; }
+.viewer-stage .placeholder { position: absolute; color: var(--text-faint); }
+.viewer-stage img:not(.failed) + .placeholder { display: none; }
+.viewer-meta { align-content: start; }
+dialog.viewer .buttons { grid-column: 1 / -1; }
+@media (max-width: 900px) {
+ .seq-detail { grid-template-columns: minmax(0, 1fr); }
+ dialog.viewer[open] { grid-template-columns: minmax(0, 1fr); }
+}
+@media (forced-colors: active) {
+ .seq-card[aria-selected="true"], .frame[aria-selected="true"], .seq-row[aria-selected="true"] { outline: 3px solid Highlight; }
+}
+
/* About: the last group of Settings (owner review 2); #/about scrolls to it below the sticky header and focuses its heading. */
.about { scroll-margin-block-start: 84px; }
.about h2:focus { outline: none; }
diff --git a/src/Chronos.Server/Admin/web/api.js b/src/Chronos.Server/Admin/web/api.js
index bff92602..1a72f455 100644
--- a/src/Chronos.Server/Admin/web/api.js
+++ b/src/Chronos.Server/Admin/web/api.js
@@ -17,14 +17,20 @@ function csrfToken() {
return m ? decodeURIComponent(m[1]) : "";
}
-async function request(method, url, body) {
+/**
+ * One API call. The body is JSON (any value), raw bytes (a Blob, sent as application/octet-stream) or nothing. A call
+ * aborted through signal rejects with the browser's AbortError, which callers tell apart from an ApiFailure.
+ */
+async function request(method, url, body, signal) {
const headers = { Accept: "application/json", "Accept-Language": culture() };
- if (body !== undefined) headers["Content-Type"] = "application/json";
+ const raw = body instanceof Blob;
+ if (body !== undefined) headers["Content-Type"] = raw ? "application/octet-stream" : "application/json";
if (method !== "GET") headers["X-CSRF-Token"] = csrfToken();
let res;
try {
- res = await fetch(url, { method, headers, credentials: "same-origin", body: body === undefined ? undefined : JSON.stringify(body) });
- } catch {
+ res = await fetch(url, { method, headers, credentials: "same-origin", signal, body: body === undefined ? undefined : raw ? body : JSON.stringify(body) });
+ } catch (err) {
+ if (err?.name === "AbortError") throw err;
throw new ApiFailure(0, "unreachable", "");
}
if (res.status === 401 && url !== "/api/v1/auth/login") {
@@ -49,6 +55,8 @@ export const api = {
put: (url, body) => request("PUT", url, body),
patch: (url, body) => request("PATCH", url, body),
del: (url) => request("DELETE", url),
+ /** PUT of raw bytes (an upload chunk) with the session's CSRF header, like every other call; abortable through signal. */
+ putBytes: (url, blob, signal) => request("PUT", url, blob, signal),
user: () => currentUser,
/** Restores the session from the cookie; null when signed out. */
diff --git a/src/Chronos.Server/Admin/web/app.js b/src/Chronos.Server/Admin/web/app.js
index 4f56400d..9364b522 100644
--- a/src/Chronos.Server/Admin/web/app.js
+++ b/src/Chronos.Server/Admin/web/app.js
@@ -5,8 +5,9 @@ import { icons } from "./icons.js";
import { escapeHtml, attr, errorText, nativeName, formatNumber, fitColumns } from "./ui.js";
const app = document.getElementById("app");
-// The menu: its pages from the top, then the ones docked at its foot above the account (owner review 2).
-const topPages = ["dashboard", "users", "archive", "jobs", "logs"];
+// The menu: its pages from the top, then the ones docked at its foot above the account (owner review 2). The Library
+// manages sequences and photos without editing them (owner review 2, R6).
+const topPages = ["dashboard", "library", "users", "archive", "jobs", "logs"];
const bottomPages = ["settings"];
const pages = [...topPages, ...bottomPages];
/** Routes of old bookmarks and where they open now: About is the last group of Settings (owner review 2). */
diff --git a/src/Chronos.Server/Admin/web/audit.js b/src/Chronos.Server/Admin/web/audit.js
index 47287fa2..d3fd5d61 100644
--- a/src/Chronos.Server/Admin/web/audit.js
+++ b/src/Chronos.Server/Admin/web/audit.js
@@ -61,6 +61,19 @@ export function detailText(entry) {
const shown = [scheduleNameIn(parts), scheduleAction(action), recurrence ? recurrenceText(recurrence) : code];
return (off ? [...shown, t("Admin.Schedules.Off")] : shown).join(" · ");
}
+ // Owner review 2, R6: "3 · photos-", " · Harbour sunset", "2 · 1048576 · ".
+ case "frames_deleted": {
+ const [count] = details.split(" · ");
+ return /^\d+$/.test(count) ? plural("Admin.Dashboard.PhotoCount", Number(count)) : details;
+ }
+ case "trash_restored": {
+ const [, ...title] = details.split(" · ");
+ return title.length > 0 ? title.join(" · ") : details;
+ }
+ case "trash_emptied": {
+ const [count, size] = details.split(" · ");
+ return /^\d+$/.test(count) && /^\d+$/.test(size ?? "") ? `${plural("Admin.Trash.EntryCount", Number(count))} · ${formatBytes(Number(size))}` : details;
+ }
default:
return details;
}
diff --git a/src/Chronos.Server/Admin/web/icons.js b/src/Chronos.Server/Admin/web/icons.js
index 572fc470..691c28d1 100644
--- a/src/Chronos.Server/Admin/web/icons.js
+++ b/src/Chronos.Server/Admin/web/icons.js
@@ -1,11 +1,13 @@
// Generated by branding/ui-icons/icons.py (same 16-px set as the desktop apps). Do not edit by hand.
+// Glyphs that point along the reading direction carry class="directional" (mirrored in right-to-left pages, admin.css).
export const icons = {
dashboard: ``,
+ library: ``,
users: ``,
archive: ``,
- jobs: ``,
+ jobs: ``,
settings: ``,
- logs: ``,
+ logs: ``,
menu: ``,
power: ``,
moon: ``,
@@ -14,4 +16,17 @@ export const icons = {
plus: ``,
copy: ``,
search: ``,
+ grid: ``,
+ list: ``,
+ trash: ``,
+ upload: ``,
+ download: ``,
+ back: ``,
+ previous: ``,
+ next: ``,
+ star: ``,
+ starFilled: ``,
+ hero: ``,
+ image: ``,
+ warning: ``,
};
diff --git a/src/Chronos.Server/Admin/web/pages/archive.js b/src/Chronos.Server/Admin/web/pages/archive.js
index c3caa124..a85593ed 100644
--- a/src/Chronos.Server/Admin/web/pages/archive.js
+++ b/src/Chronos.Server/Admin/web/pages/archive.js
@@ -1,4 +1,5 @@
-// Archive (BRIEF §14.8): naming templates, proxy policy, scan/rebuild/verify/maintenance, statistics.
+// Archive (BRIEF §14.8): naming templates, proxy policy, scan/rebuild/verify/maintenance, statistics, and the way to the
+// archive's trash (the Library's trash view, owner review 2, R6).
import { t, plural, applyStrings } from "../i18n.js";
import { escapeHtml, attr, formatBytes, formatNumber, bar, storageTip, writeVolumeLine, columns, toast, errorText, emptyState, markInvalid, clearInvalid, invalidText, escapeReverts } from "../ui.js";
@@ -46,7 +47,8 @@ export async function render(root, { api, setMeta }) {
-
${ACTIONS.map((a) => ``).join("")}
+
${ACTIONS.map((a) => ``).join("")}
+
${statsTable(stats.byCamera.slice(0, 8).map((c) => ({ label: c.key || "—", count: c.count, bytes: c.bytes })), "cameras-title")
|| ``}
diff --git a/src/Chronos.Server/Admin/web/pages/library.js b/src/Chronos.Server/Admin/web/pages/library.js
new file mode 100644
index 00000000..62a508a7
--- /dev/null
+++ b/src/Chronos.Server/Admin/web/pages/library.js
@@ -0,0 +1,555 @@
+// Library (owner review 2, R6; BRIEF §14.8): the panel browses, views and deletes sequences and photos and runs mass
+// operations on them, but never edits a video (no settings, no render). #/library lists the sequences with filters in the
+// address, #/library?id= opens one (library/sequence.js), #/library?view=trash the archive's trash (library/trash.js).
+import { t, plural, applyStrings } from "../i18n.js";
+import { escapeHtml, attr, formatBytes, formatNumber, toast, errorText, confirmDialog, formDialog, markInvalid, emptyState, routeParams, redraw } from "../ui.js";
+import { icons } from "../icons.js";
+import { BULK_LIMIT, factsLine, captureText, cameraLabel, statusChips, lazyImage, watchImages, Selection, selectableGrid, chunks, saveFile, sequencesCsv, today, tagList, coverUrl } from "./library/shared.js";
+import { renderSequence } from "./library/sequence.js";
+import { renderTrash } from "./library/trash.js";
+
+const VIEW_KEY = "chronos.admin.library.view";
+const PAGE = 100;
+/** The Status menu: its value in the address and the listing's query parameters. */
+const STATUS_FILTERS = {
+ analysed: "status=analyzedLight",
+ "not-analysed": "status=-analyzedLight",
+ proxies: "status=proxiesBuilt",
+ "no-proxies": "status=-proxiesBuilt",
+ rendered: "rendered=true",
+ "not-rendered": "rendered=false",
+ verified: "status=verified",
+ "not-verified": "status=-verified",
+ warnings: "status=hasWarnings",
+ errors: "status=hasErrors",
+};
+const SORTS = ["newest", "oldest", "title", "frameCount", "size"];
+const JOBS = ["analyse", "proxies", "thumbnails", "verify"];
+const FILTERS = ["q", "year", "camera", "status", "tag", "sort"];
+
+/** The list's address the last time it was shown, so a sequence's Back returns to the same filters. */
+let listHash = "#/library";
+/** upload.js of the web upload, once asked for: the module, or null when this server has none. */
+let uploadModule;
+
+/**
+ * The web upload (owner review 2, R3) lives in its own module; the Library offers it only when that module loads, so
+ * the page works on a panel without it.
+ */
+export async function loadUpload() {
+ if (uploadModule === undefined) {
+ try {
+ const m = await import("../upload.js");
+ uploadModule = typeof m.openUpload === "function" ? m : null;
+ } catch {
+ uploadModule = null;
+ }
+ }
+ return uploadModule;
+}
+
+export async function render(root, context) {
+ const params = routeParams();
+ if (params.get("view") === "trash") return renderTrash(root, context, { back: listHash });
+ const id = params.get("id");
+ if (id) return renderSequence(root, context, id, { back: listHash, loadUpload });
+ listHash = location.hash || "#/library";
+ return renderList(root, context, params);
+}
+
+async function renderList(root, { api, setMeta, actions, onEvent }, params) {
+ const filters = Object.fromEntries(FILTERS.map((f) => [f, params.get(f) ?? ""]));
+ if (!SORTS.includes(filters.sort)) filters.sort = "newest";
+ if (!Object.hasOwn(STATUS_FILTERS, filters.status)) filters.status = "";
+ let view = storedView();
+ let rows = [];
+ let cursor = null;
+ let total = 0;
+ let facets = { years: [], cameras: [], tags: [] };
+ /** Every sequence of the filter, once "Select all" fetched them; null otherwise. */
+ let matching = null;
+ let generation = 0;
+ const selection = new Selection();
+ let refreshTimer = null;
+
+ actions.innerHTML = `
+
+ ${icons.trash}
+ `;
+ applyStrings(actions);
+ actions.querySelector("#refresh").addEventListener("click", () => load());
+ loadUpload().then((upload) => {
+ const button = actions.querySelector("#upload");
+ if (!upload || !button.isConnected) return;
+ button.hidden = false;
+ button.title = t("Admin.Library.Upload.Tip");
+ button.addEventListener("click", () => upload.openUpload({ api, onDone: () => load() }));
+ });
+
+ root.innerHTML = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+ applyStrings(root);
+ const itemsHost = root.querySelector("#items");
+ const mass = root.querySelector("#mass");
+
+ let searchTimer = null;
+ root.querySelector("#q").addEventListener("input", (e) => {
+ clearTimeout(searchTimer);
+ searchTimer = setTimeout(() => setFilter("q", e.target.value.trim()), 300);
+ });
+ for (const f of ["year", "camera", "status", "tag", "sort"]) root.querySelector(`#${f}`).addEventListener("change", (e) => setFilter(f, e.target.value));
+ root.querySelectorAll("[data-view]").forEach((b) => b.addEventListener("click", () => {
+ view = b.dataset.view;
+ root.querySelectorAll("[data-view]").forEach((x) => x.setAttribute("aria-pressed", String(x === b)));
+ try {
+ localStorage.setItem(VIEW_KEY, view);
+ } catch {
+ // Only this page keeps the view then.
+ }
+ draw();
+ }));
+ root.querySelector("#more").addEventListener("click", () => load(true));
+
+ // One grid object for the page: the host stays, its items are redrawn.
+ const grid = selectableGrid(itemsHost, {
+ selection,
+ order: () => rows.map((r) => r.id),
+ open: (key) => {
+ location.hash = `#/library?id=${encodeURIComponent(key)}`;
+ },
+ onChange: syncSelection,
+ });
+
+ function setFilter(name, value) {
+ if (filters[name] === value) return;
+ filters[name] = value;
+ // The address keeps the filters (no hashchange: the page stays), so Back from a sequence finds them again.
+ const query = new URLSearchParams(Object.entries(filters).filter(([k, v]) => v && !(k === "sort" && v === "newest")));
+ listHash = `#/library${query.size ? `?${query}` : ""}`;
+ history.replaceState(null, "", listHash);
+ selection.clear();
+ matching = null;
+ load();
+ }
+
+ function listQuery(limit, after) {
+ const p = new URLSearchParams({ limit: String(limit), sort: filters.sort });
+ for (const f of ["q", "year", "camera", "tag"]) if (filters[f]) p.set(f, filters[f]);
+ if (after) p.set("cursor", after);
+ const status = STATUS_FILTERS[filters.status];
+ return `/api/v1/sequences?${p}${status ? `&${status}` : ""}`;
+ }
+
+ async function load(more = false) {
+ const mine = ++generation;
+ try {
+ const [page, f] = await Promise.all([
+ api.get(listQuery(PAGE, more ? cursor : null)),
+ more ? Promise.resolve(facets) : api.get("/api/v1/sequences/facets").catch(() => facets),
+ ]);
+ if (mine !== generation || !root.isConnected) return;
+ facets = f;
+ if (!more) total = page.total ?? page.items.length;
+ cursor = page.nextCursor;
+ if (more) {
+ rows = rows.concat(page.items);
+ appendItems(page.items);
+ } else {
+ rows = page.items;
+ drawFilters();
+ draw();
+ }
+ } catch (err) {
+ toast(errorText(err), true);
+ return;
+ }
+ setMeta(plural("Admin.Library.Count", total));
+ drawFoot();
+ }
+
+ /** The loaded rows again, as many as are shown (live updates); the selection and the keyboard place stay. */
+ async function refreshVisible() {
+ const mine = ++generation;
+ try {
+ const [page, f] = await Promise.all([
+ api.get(listQuery(Math.min(Math.max(rows.length, PAGE), BULK_LIMIT), null)),
+ api.get("/api/v1/sequences/facets").catch(() => facets),
+ ]);
+ if (mine !== generation || !root.isConnected) return;
+ total = page.total ?? total;
+ facets = f;
+ drawFilters();
+ rows = page.items;
+ cursor = page.nextCursor;
+ const known = new Set(rows.map((r) => r.id));
+ if (!matching) selection.set([...selection.ids].filter((id) => known.has(id)));
+ const focused = itemsHost.contains(document.activeElement);
+ draw();
+ grid.restore(focused);
+ setMeta(plural("Admin.Library.Count", total));
+ drawFoot();
+ } catch {
+ // The next event or Refresh tries again.
+ }
+ }
+
+ function drawFilters() {
+ const option = (value, label, chosen) => ``;
+ // A value of the address the archive no longer has stays in its menu, so the filter shows what the list does.
+ const withChosen = (list, chosen) => (chosen && !list.some((f) => f.value === chosen) ? [{ value: chosen, sequences: 0 }, ...list] : list);
+ const counted = (f, label) => `${label ?? f.label ?? f.value} (${formatNumber(f.sequences)})`;
+ root.querySelector("#year").innerHTML = option("", t("Admin.Library.AnyYear"), filters.year) +
+ withChosen(facets.years, filters.year).map((f) => option(f.value, counted(f), filters.year)).join("");
+ root.querySelector("#camera").innerHTML = option("", t("Admin.Library.AnyCamera"), filters.camera) +
+ withChosen(facets.cameras, filters.camera).map((f) => option(f.value, counted(f), filters.camera)).join("");
+ root.querySelector("#tag").innerHTML = option("", t("Admin.Library.AnyTag"), filters.tag) +
+ withChosen(facets.tags, filters.tag).map((f) => option(f.value, counted(f), filters.tag)).join("");
+ root.querySelector("#status").innerHTML = option("", t("Admin.Library.AnyStatus"), filters.status) +
+ Object.keys(STATUS_FILTERS).map((s) => option(s, t(`Admin.Library.Filter.${pascal(s)}`), filters.status)).join("");
+ root.querySelectorAll(".toolbar select").forEach((s) => s.classList.toggle("active", s.id !== "sort" && s.value !== ""));
+ }
+
+ function draw() {
+ itemsHost.className = `seq-items ${view === "list" ? "rows" : "cards"}`;
+ itemsHost.setAttribute("role", "listbox");
+ itemsHost.setAttribute("aria-multiselectable", "true");
+ itemsHost.setAttribute("aria-label", t("Admin.Library.Sequences"));
+ if (rows.length === 0) {
+ itemsHost.removeAttribute("role");
+ itemsHost.removeAttribute("aria-multiselectable");
+ const filtered = FILTERS.some((f) => f !== "sort" && filters[f]);
+ itemsHost.innerHTML = filtered
+ ? emptyState("Admin.Library.NoMatch", ``)
+ : emptyState("Admin.Library.Empty", ``);
+ applyStrings(itemsHost);
+ itemsHost.querySelector("#clear")?.addEventListener("click", clearFilters);
+ itemsHost.querySelector("#scan")?.addEventListener("click", scan);
+ syncSelection();
+ return;
+ }
+ const head = view === "list" ? `