fix: address the rc.14 review

Settings no longer makes a folder an archive on its own: a typed or
picked folder without archive.json is made one only after a
confirmation naming it, and Settings > Import keeps this PC's archive
folder and never creates one. A half-typed path or another PC's drive
letter could otherwise get .chronos and sidecars written unasked.

The server's structure check creates nothing in a root that lost its
archive.json (an unmounted disk's empty mount point) and reports it
unavailable; /health re-checks when its last check is over 10 s old,
so a fix on the host shows without a dashboard read.

The admin board reads the server newest first with Order off, counts
Published over the server's total, and a Shift range runs along the
lane picked in. Admin sizes keep number and unit together. A sent
workspace render whose file left exports/ is no longer listed as
missing. Desktop Board cards put their actions under the text while
the player is open. Start-up range errors name the CHRONOS_* variable;
the deploy guide documents the parallelism clamp and the log rule.

Refs #29 #31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-06 17:52:44 +01:00
1 parent 159a8e6939
commit 2c15ee0e09
25 files changed
+336 -53

No files matched your search

+16 -2
View File
@@ -24,8 +24,16 @@ commits follow Conventional Commits (release notes are generated from them by `C
### Changed ### Changed
- Video cards start with the preset ("4K archive · HEVC · 0:41 · 1.4 GB"); sizes keep number and unit together with a - Video cards start with the preset ("4K archive · HEVC · 0:41 · 1.4 GB"); sizes keep number and unit together with a
no-break space, in every culture. no-break space, in every culture.
- Typing a folder that is not yet an archive in Settings › Archive now creates the archive there, as Welcome's - Typing or picking a folder that is not yet an archive in Settings › Archive now offers to create the archive
*Create* does, instead of doing nothing. there, as Welcome's *Create* does, after a confirmation that names the folder; *Not now* only remembers it.
- Settings › Import keeps this PC's archive folder, like its workspace: another PC's drive letter can name one of this
PC's own folders.
- The admin board always reads the server newest first (*Order* is off there, its tooltip says why); *Published*
counts every render the server holds, *Workspace* those read so far ("+" while more can be read).
- `/health` checks the archive's tree again once its last check is over 10 seconds old, so a fix on the host shows
there without opening the dashboard.
- A server setting out of range stops the start with a message naming its `CHRONOS_*` variable (ports and logs
included).
- EULA §4 and BRIEF §21 say Chronos sends nothing about its use; BRIEF §7, §12.10, §14.8 and §14.9 describe the - EULA §4 and BRIEF §21 say Chronos sends nothing about its use; BRIEF §7, §12.10, §14.8 and §14.9 describe the
board and the archive's folder tree; §14.9 lists `CHRONOS_TRUSTED_PROXIES`; §19.6 points to the Unraid guide; §24 board and the archive's folder tree; §14.9 lists `CHRONOS_TRUSTED_PROXIES`; §19.6 points to the Unraid guide; §24
lists owner review 4 and phase 6. lists owner review 4 and phase 6.
@@ -40,6 +48,12 @@ commits follow Conventional Commits (release notes are generated from them by `C
- Creating or adopting an archive where its folders cannot be made fails with a clear, localised reason (drive or - Creating or adopting an archive where its folders cannot be made fails with a clear, localised reason (drive or
share unavailable, permission denied, read-only, a file in the way) instead of a generic error. share unavailable, permission denied, read-only, a file in the way) instead of a generic error.
- Settings files that still carry `AnonymousUsageCounts` load and are saved without it. - Settings files that still carry `AnonymousUsageCounts` load and are saved without it.
- rc.14 review: a sent workspace render whose file left `exports/` no longer shows on the desktop board as *Missing*
(its home holds it); a Shift range on the admin board runs along the lane picked in, as its cards are shown; a
server archive root that lost its `archive.json` (an unmounted disk's empty mount point) gets no folders, the
dashboard warns and `/health` says "missing"; the admin panel's sizes keep number and unit together too; desktop
Board cards put their actions under the text while the player is open, so titles and facts are no longer cut at
the window's smallest width.
## [0.1.0-rc.13] — 2026-11-05 ## [0.1.0-rc.13] — 2026-11-05
+5
View File
@@ -792,3 +792,8 @@ One line per decision: date · decision · alternative · reason.
| 2026-11-06 | The docs describe one update channel (stable releases), pre-releases installed by hand. | Document a pre-release channel | That is what the update check does: it asks for releases with `pre-release=false`. | | 2026-11-06 | The docs describe one update channel (stable releases), pre-releases installed by hand. | Document a pre-release channel | That is what the update check does: it asks for releases with `pre-release=false`. |
| 2026-11-06 | `CHRONOS_TRUSTED_PROXIES` is listed in BRIEF §14.9. | Leave it undocumented | The server already reads it and the compose file and Unraid template already offer it. | | 2026-11-06 | `CHRONOS_TRUSTED_PROXIES` is listed in BRIEF §14.9. | Leave it undocumented | The server already reads it and the compose file and Unraid template already offer it. |
| 2026-11-06 | rc.14 integration: the BRIEF §24 rows of owner review 4 name the sections actually amended (R1 §12.10, §14.8; R2 §21; R3 §7, §12.8, §14.8, §14.9), and §7, §12.10, §14.8 and the Docker guide gain the board and the archive's folder tree. | Keep the parcels' expected sections | The phase 6 parcel wrote the rows before the feature parcels landed. | | 2026-11-06 | rc.14 integration: the BRIEF §24 rows of owner review 4 name the sections actually amended (R1 §12.10, §14.8; R2 §21; R3 §7, §12.8, §14.8, §14.9), and §7, §12.10, §14.8 and the Docker guide gain the board and the archive's folder tree. | Keep the parcels' expected sections | The phase 6 parcel wrote the rows before the feature parcels landed. |
| 2026-11-06 | rc.14 review: Settings › Archive folder makes a folder without an archive one only after a confirmation naming it (*Create archive* / *Not now*, which only remembers the folder); Settings › Import never creates one and keeps this PC's archive folder. Supersedes the row "Settings › Archive folder creates an archive…". | Create silently, as the parcel did | A half-typed path commits on focus loss and an imported path can name the user's own photos: adopting either writes `.chronos` and sidecars there unasked (CLAUDE.md: explicit user action). |
| 2026-11-06 | The server's structure check makes nothing in a root without `archive.json` and reports it unavailable (`/health`: archive "missing"); `/health` re-checks once the last check is over 10 s old (`ServerArchive.HealthRecheck`). | Check only on dashboard reads; create in any existing root | An unmounted disk leaves an empty mount point whose underlying disk must not get `.chronos`; monitoring that only polls `/health` must see a fix without a dashboard read, throttled so a busy health probe stays cheap. |
| 2026-11-06 | The admin board reads the server with `sort=newest` and disables *Order* with a tooltip; *Published* shows the server's total, *Workspace* the loaded count with "+" while a cursor remains; a Shift range runs along the lane picked in (`selectableGrid`'s `order(el)`). | Re-sort the loaded page; one range over every card | The board must show the server's newest renders and honest counts, and a range must cover only the cards seen between the two clicks (a sent render is in both lanes). |
| 2026-11-06 | `CHRONOS_PARALLELISM` out of 1–64 stays clamped; the other range errors at start name the `CHRONOS_*` variable (`ServerOptions.VariableOf`). | Refuse every value out of range | Clamping parallelism is long-standing behaviour the admin panel relies on; the deploy guide documents the exception. |
| 2026-11-06 | Desktop Board cards move their quick actions to a row under the text while the player pane is open. | Stack the lanes; hide the actions | Keeps both lanes side by side and every action on the card; at 1200 px with the player the text column grows from about 80 px to the whole card. |
+7 -3
View File
@@ -61,14 +61,18 @@ docker compose up -d
- At every start the server lays out the archive's folder tree inside `/archive` (`.chronos/` with `locks`, `journal`, - At every start the server lays out the archive's folder tree inside `/archive` (`.chronos/` with `locks`, `journal`,
`staging`, `trash`, `trash/photos`, `trash/videos`), making only the missing folders and touching nothing that `staging`, `trash`, `trash/photos`, `trash/videos`), making only the missing folders and touching nothing that
exists. A folder it cannot make does not stop the start: the log warns, the dashboard shows *Archive incomplete* exists. A folder it cannot make does not stop the start: the log warns, the dashboard shows *Archive incomplete*
(the folder and reason in its tooltip) and `/health` reports archive "incomplete" until it can be made. (the folder and reason in its tooltip) and `/health` reports archive "incomplete" until it can be made. Both check
again by themselves (the dashboard at each read, `/health` when its last check is over 10 seconds old), so a fix on
the host needs no restart. A root without its `.chronos/archive.json` (an unmounted disk leaves an empty mount
point) gets no folders: the dashboard shows *Archive incomplete* and `/health` reports archive "missing".
## Environment variables ## Environment variables
Every server setting comes from, in order: its default, `/data/server.json`, then the environment. **A variable that is Every server setting comes from, in order: its default, `/data/server.json`, then the environment. **A variable that is
set fixes its setting:** the admin panel shows the field read-only and its tooltip names the variable. Leave a set fixes its setting:** the admin panel shows the field read-only and its tooltip names the variable. Leave a
variable unset to choose the value in the admin panel while the server runs. A value out of range stops the start variable unset to choose the value in the admin panel while the server runs. A value out of range stops the start
with a message naming the variable. with a message naming the variable, except `CHRONOS_PARALLELISM`, which is held to 1–64. The logs' total
(`CHRONOS_LOG_MAX_TOTAL_MB`) may not be below the log file size (`CHRONOS_LOG_MAX_FILE_MB`), unless it is 0.
| Variable | Default | Meaning | | Variable | Default | Meaning |
|---|---|---| |---|---|---|
@@ -220,7 +224,7 @@ a newer archive, run Archive › *Scan* so the index catches up with what the ar
| *Not a Chronos server* | Another service answers on that host port (on the owner's host 8443 is another service). Use the client address with the right public HTTPS port | | *Not a Chronos server* | Another service answers on that host port (on the owner's host 8443 is another service). Use the client address with the right public HTTPS port |
| The free space shown is the cache's (Unraid) or too small | A cached share reports its primary storage. Map the share's array view read-only to `/space` and set `CHRONOS_SPACE_PATH=/space` ([unraid.md](unraid.md#free-space-of-the-array)) | | The free space shown is the cache's (Unraid) or too small | A cached share reports its primary storage. Map the share's array view read-only to `/space` and set `CHRONOS_SPACE_PATH=/space` ([unraid.md](unraid.md#free-space-of-the-array)) |
| The container restarts at once, log: *… is not writable by PUID:PGID* | Give that user write access to the archive (or the named `.chronos` folder) on the host, or set `PUID`/`PGID` to its owner | | The container restarts at once, log: *… is not writable by PUID:PGID* | Give that user write access to the archive (or the named `.chronos` folder) on the host, or set `PUID`/`PGID` to its owner |
| Dashboard: *Archive incomplete*; `/health`: archive "incomplete" | A folder of the archive's tree cannot be made (share unavailable, permission denied, read-only, a file in the way; the tooltip names it). Fix it on the host; the next dashboard read checks again, no restart needed | | Dashboard: *Archive incomplete*; `/health`: archive "incomplete" | A folder of the archive's tree cannot be made (share unavailable, permission denied, read-only, a file in the way; the tooltip names it). Fix it on the host; the next dashboard read, or `/health` within 10 seconds, checks again, no restart needed |
| Log: *Database not reachable yet … retry* | PostgreSQL is starting, or `CHRONOS_DB_HOST` is wrong. Container names resolve only on a shared user-defined network; on Unraid's default bridge use the host's IP | | Log: *Database not reachable yet … retry* | PostgreSQL is starting, or `CHRONOS_DB_HOST` is wrong. Container names resolve only on a shared user-defined network; on Unraid's default bridge use the host's IP |
| A field in the admin panel is read-only | A variable sets it; its tooltip names it. Remove the variable to change it in the panel | | A field in the admin panel is read-only | A variable sets it; its tooltip names it. Remove the variable to change it in the panel |
| The client asks to trust a new fingerprint | `/data` was replaced or the self-signed certificate was renewed. Compare with the admin panel before accepting | | The client asks to trust a new fingerprint | `/data` was replaced or the self-signed certificate was renewed. Compare with the admin panel before accepting |
+2 -1
View File
@@ -1121,6 +1121,7 @@
<data name="Admin.Videos.Year.All" xml:space="preserve"><value>All years</value></data> <data name="Admin.Videos.Year.All" xml:space="preserve"><value>All years</value></data>
<data name="Admin.Videos.Sort" xml:space="preserve"><value>Sort</value></data> <data name="Admin.Videos.Sort" xml:space="preserve"><value>Sort</value></data>
<data name="Admin.Videos.Sort.Tip" xml:space="preserve"><value>Order of the videos</value></data> <data name="Admin.Videos.Sort.Tip" xml:space="preserve"><value>Order of the videos</value></data>
<data name="Admin.Videos.Sort.Board.Tip" xml:space="preserve"><value>The board always shows the newest first; the order applies to the cards and the list</value></data>
<data name="Admin.Videos.Sort.Newest" xml:space="preserve"><value>Newest</value></data> <data name="Admin.Videos.Sort.Newest" xml:space="preserve"><value>Newest</value></data>
<data name="Admin.Videos.Sort.Oldest" xml:space="preserve"><value>Oldest</value></data> <data name="Admin.Videos.Sort.Oldest" xml:space="preserve"><value>Oldest</value></data>
<data name="Admin.Videos.Sort.Largest" xml:space="preserve"><value>Largest</value></data> <data name="Admin.Videos.Sort.Largest" xml:space="preserve"><value>Largest</value></data>
@@ -1134,7 +1135,7 @@
<data name="Admin.Videos.Lane.Published" xml:space="preserve"><value>Published</value></data> <data name="Admin.Videos.Lane.Published" xml:space="preserve"><value>Published</value></data>
<data name="Admin.Videos.Lane.Published.Tip" xml:space="preserve"><value>Every render this server holds, newest first</value></data> <data name="Admin.Videos.Lane.Published.Tip" xml:space="preserve"><value>Every render this server holds, newest first</value></data>
<data name="Admin.Videos.Lane.Workspace" xml:space="preserve"><value>Workspace</value></data> <data name="Admin.Videos.Lane.Workspace" xml:space="preserve"><value>Workspace</value></data>
<data name="Admin.Videos.Lane.Workspace.Tip" xml:space="preserve"><value>Renders a PC's workspace made and sent here; those not sent yet stay on that PC</value></data> <data name="Admin.Videos.Lane.Workspace.Tip" xml:space="preserve"><value>Renders a PC's workspace made and sent here, among the videos loaded (+: more to load); those not sent yet stay on that PC</value></data>
<data name="Admin.Videos.State.Sent" xml:space="preserve"><value>Sent</value></data> <data name="Admin.Videos.State.Sent" xml:space="preserve"><value>Sent</value></data>
<data name="Admin.Videos.State.Sent.Tip" xml:space="preserve"><value>Sent from the workspace of {0}</value><comment>{0} a computer's name</comment></data> <data name="Admin.Videos.State.Sent.Tip" xml:space="preserve"><value>Sent from the workspace of {0}</value><comment>{0} a computer's name</comment></data>
<data name="Admin.Videos.Version" xml:space="preserve"><value>Version {0}</value><comment>{0} a project version number</comment></data> <data name="Admin.Videos.Version" xml:space="preserve"><value>Version {0}</value><comment>{0} a project version number</comment></data>
+4
View File
@@ -65,6 +65,10 @@
<data name="Settings.Analysis.StarsUnit" xml:space="preserve"><value>stars per megapixel</value></data> <data name="Settings.Analysis.StarsUnit" xml:space="preserve"><value>stars per megapixel</value></data>
<data name="Settings.Analysis.Width" xml:space="preserve"><value>Analysis width</value></data> <data name="Settings.Analysis.Width" xml:space="preserve"><value>Analysis width</value></data>
<data name="Settings.Analysis.WidthUnit" xml:space="preserve"><value>px long edge</value></data> <data name="Settings.Analysis.WidthUnit" xml:space="preserve"><value>px long edge</value></data>
<data name="Settings.Archive.CreateAction" xml:space="preserve"><value>Create archive</value></data>
<data name="Settings.Archive.CreateMessage" xml:space="preserve"><value>This folder is not an archive yet. Chronos can make it one, with all the archive's folders inside it, and add what it already holds.</value><comment>long</comment></data>
<data name="Settings.Archive.CreateSkip" xml:space="preserve"><value>Not now</value></data>
<data name="Settings.Archive.CreateTitle" xml:space="preserve"><value>Create an archive here?</value><comment>long</comment></data>
<data name="Settings.Archive.ExistingKept" xml:space="preserve"><value>Folders and files already in the archive keep their names.</value><comment>long</comment></data> <data name="Settings.Archive.ExistingKept" xml:space="preserve"><value>Folders and files already in the archive keep their names.</value><comment>long</comment></data>
<data name="Settings.Archive.Files" xml:space="preserve"><value>File names</value></data> <data name="Settings.Archive.Files" xml:space="preserve"><value>File names</value></data>
<data name="Settings.Archive.Folders" xml:space="preserve"><value>Folders</value></data> <data name="Settings.Archive.Folders" xml:space="preserve"><value>Folders</value></data>
+2
View File
@@ -770,6 +770,7 @@
<data name="Tooltips.Settings.CheckForUpdates" xml:space="preserve"><value>Look for a new release when Chronos starts · no data is sent</value></data> <data name="Tooltips.Settings.CheckForUpdates" xml:space="preserve"><value>Look for a new release when Chronos starts · no data is sent</value></data>
<data name="Tooltips.Settings.ClearCache" xml:space="preserve"><value>Delete the cache contents now</value></data> <data name="Tooltips.Settings.ClearCache" xml:space="preserve"><value>Delete the cache contents now</value></data>
<data name="Tooltips.Settings.ClearCacheAsk" xml:space="preserve"><value>Delete spilled frames and cached thumbnails; asks first</value></data> <data name="Tooltips.Settings.ClearCacheAsk" xml:space="preserve"><value>Delete spilled frames and cached thumbnails; asks first</value></data>
<data name="Tooltips.Settings.CreateArchiveHere" xml:space="preserve"><value>Make this folder an archive now, create its folders and queue a scan of what it holds</value></data>
<data name="Tooltips.Settings.DataFolder" xml:space="preserve"><value>Database, settings, logs and caches of this PC</value></data> <data name="Tooltips.Settings.DataFolder" xml:space="preserve"><value>Database, settings, logs and caches of this PC</value></data>
<data name="Tooltips.Settings.DataInOneDrive" xml:space="preserve"><value>Open the data folder in Explorer. OneDrive synchronises it, which can damage the index: exclude it from syncing</value></data> <data name="Tooltips.Settings.DataInOneDrive" xml:space="preserve"><value>Open the data folder in Explorer. OneDrive synchronises it, which can damage the index: exclude it from syncing</value></data>
<data name="Tooltips.Settings.DeepAfterImport" xml:space="preserve"><value>New cards and folders queue a deep analysis of what they import, in the background; each card can change it</value></data> <data name="Tooltips.Settings.DeepAfterImport" xml:space="preserve"><value>New cards and folders queue a deep analysis of what they import, in the background; each card can change it</value></data>
@@ -843,6 +844,7 @@
<data name="Tooltips.Settings.SelfTest" xml:space="preserve"><value>Encode a short synthetic clip with every encoder and report pass or fail and speed · about a minute</value></data> <data name="Tooltips.Settings.SelfTest" xml:space="preserve"><value>Encode a short synthetic clip with every encoder and report pass or fail and speed · about a minute</value></data>
<data name="Tooltips.Settings.SelfTestResult" xml:space="preserve"><value>Speed on the synthetic 1280×720 test clip</value></data> <data name="Tooltips.Settings.SelfTestResult" xml:space="preserve"><value>Speed on the synthetic 1280×720 test clip</value></data>
<data name="Tooltips.Settings.SoftwareOnly" xml:space="preserve"><value>Always the Microsoft software H.264 encoder; slower, identical everywhere</value></data> <data name="Tooltips.Settings.SoftwareOnly" xml:space="preserve"><value>Always the Microsoft software H.264 encoder; slower, identical everywhere</value></data>
<data name="Tooltips.Settings.SkipCreateArchive" xml:space="preserve"><value>Remember the folder and leave it as it is</value></data>
<data name="Tooltips.Settings.Stars" xml:space="preserve"><value>Stars per megapixel from which a night frame counts as a star field · Enter applies, Esc reverts</value></data> <data name="Tooltips.Settings.Stars" xml:space="preserve"><value>Stars per megapixel from which a night frame counts as a star field · Enter applies, Esc reverts</value></data>
<data name="Tooltips.Settings.StartWithWindows" xml:space="preserve"><value>Start minimised when you sign in to Windows, so inserted cards are noticed</value></data> <data name="Tooltips.Settings.StartWithWindows" xml:space="preserve"><value>Start minimised when you sign in to Windows, so inserted cards are noticed</value></data>
<data name="Tooltips.Settings.ThemeDark" xml:space="preserve"><value>Dark interface (default)</value></data> <data name="Tooltips.Settings.ThemeDark" xml:space="preserve"><value>Dark interface (default)</value></data>
+2 -1
View File
@@ -1113,6 +1113,7 @@
<data name="Admin.Videos.Year.All" xml:space="preserve"><value>Tutti gli anni</value></data> <data name="Admin.Videos.Year.All" xml:space="preserve"><value>Tutti gli anni</value></data>
<data name="Admin.Videos.Sort" xml:space="preserve"><value>Ordina</value></data> <data name="Admin.Videos.Sort" xml:space="preserve"><value>Ordina</value></data>
<data name="Admin.Videos.Sort.Tip" xml:space="preserve"><value>Ordine dei video</value></data> <data name="Admin.Videos.Sort.Tip" xml:space="preserve"><value>Ordine dei video</value></data>
<data name="Admin.Videos.Sort.Board.Tip" xml:space="preserve"><value>La bacheca mostra sempre prima i più recenti; l'ordine vale per le schede e l'elenco</value></data>
<data name="Admin.Videos.Sort.Newest" xml:space="preserve"><value>Più recenti</value></data> <data name="Admin.Videos.Sort.Newest" xml:space="preserve"><value>Più recenti</value></data>
<data name="Admin.Videos.Sort.Oldest" xml:space="preserve"><value>Meno recenti</value></data> <data name="Admin.Videos.Sort.Oldest" xml:space="preserve"><value>Meno recenti</value></data>
<data name="Admin.Videos.Sort.Largest" xml:space="preserve"><value>Più grandi</value></data> <data name="Admin.Videos.Sort.Largest" xml:space="preserve"><value>Più grandi</value></data>
@@ -1126,7 +1127,7 @@
<data name="Admin.Videos.Lane.Published" xml:space="preserve"><value>Pubblicati</value></data> <data name="Admin.Videos.Lane.Published" xml:space="preserve"><value>Pubblicati</value></data>
<data name="Admin.Videos.Lane.Published.Tip" xml:space="preserve"><value>Tutti i render di questo server, dal più recente</value></data> <data name="Admin.Videos.Lane.Published.Tip" xml:space="preserve"><value>Tutti i render di questo server, dal più recente</value></data>
<data name="Admin.Videos.Lane.Workspace" xml:space="preserve"><value>Spazio di lavoro</value></data> <data name="Admin.Videos.Lane.Workspace" xml:space="preserve"><value>Spazio di lavoro</value></data>
<data name="Admin.Videos.Lane.Workspace.Tip" xml:space="preserve"><value>Render fatti nello spazio di lavoro di un PC e inviati qui; quelli non ancora inviati restano su quel PC</value></data> <data name="Admin.Videos.Lane.Workspace.Tip" xml:space="preserve"><value>Render fatti nello spazio di lavoro di un PC e inviati qui, tra i video caricati (+: altri da caricare); quelli non ancora inviati restano su quel PC</value></data>
<data name="Admin.Videos.State.Sent" xml:space="preserve"><value>Inviato</value></data> <data name="Admin.Videos.State.Sent" xml:space="preserve"><value>Inviato</value></data>
<data name="Admin.Videos.State.Sent.Tip" xml:space="preserve"><value>Inviato dallo spazio di lavoro di {0}</value></data> <data name="Admin.Videos.State.Sent.Tip" xml:space="preserve"><value>Inviato dallo spazio di lavoro di {0}</value></data>
<data name="Admin.Videos.Version" xml:space="preserve"><value>Versione {0}</value></data> <data name="Admin.Videos.Version" xml:space="preserve"><value>Versione {0}</value></data>
+4
View File
@@ -65,6 +65,10 @@
<data name="Settings.Analysis.StarsUnit" xml:space="preserve"><value>stelle per megapixel</value></data> <data name="Settings.Analysis.StarsUnit" xml:space="preserve"><value>stelle per megapixel</value></data>
<data name="Settings.Analysis.Width" xml:space="preserve"><value>Larghezza di analisi</value></data> <data name="Settings.Analysis.Width" xml:space="preserve"><value>Larghezza di analisi</value></data>
<data name="Settings.Analysis.WidthUnit" xml:space="preserve"><value>px sul lato lungo</value></data> <data name="Settings.Analysis.WidthUnit" xml:space="preserve"><value>px sul lato lungo</value></data>
<data name="Settings.Archive.CreateAction" xml:space="preserve"><value>Crea archivio</value></data>
<data name="Settings.Archive.CreateMessage" xml:space="preserve"><value>Questa cartella non è ancora un archivio. Chronos può renderla tale, con tutte le cartelle dell'archivio al suo interno, e aggiungere ciò che contiene già.</value></data>
<data name="Settings.Archive.CreateSkip" xml:space="preserve"><value>Non ora</value></data>
<data name="Settings.Archive.CreateTitle" xml:space="preserve"><value>Creare un archivio qui?</value></data>
<data name="Settings.Archive.ExistingKept" xml:space="preserve"><value>Le cartelle e i file già nell'archivio mantengono i loro nomi.</value></data> <data name="Settings.Archive.ExistingKept" xml:space="preserve"><value>Le cartelle e i file già nell'archivio mantengono i loro nomi.</value></data>
<data name="Settings.Archive.Files" xml:space="preserve"><value>Nomi dei file</value></data> <data name="Settings.Archive.Files" xml:space="preserve"><value>Nomi dei file</value></data>
<data name="Settings.Archive.Folders" xml:space="preserve"><value>Cartelle</value></data> <data name="Settings.Archive.Folders" xml:space="preserve"><value>Cartelle</value></data>
+2
View File
@@ -841,6 +841,7 @@
<data name="Tooltips.Settings.CheckForUpdates" xml:space="preserve"><value>Cerca una nuova versione all'avvio di Chronos · nessun dato viene inviato</value></data> <data name="Tooltips.Settings.CheckForUpdates" xml:space="preserve"><value>Cerca una nuova versione all'avvio di Chronos · nessun dato viene inviato</value></data>
<data name="Tooltips.Settings.ClearCache" xml:space="preserve"><value>Elimina adesso il contenuto della cache</value></data> <data name="Tooltips.Settings.ClearCache" xml:space="preserve"><value>Elimina adesso il contenuto della cache</value></data>
<data name="Tooltips.Settings.ClearCacheAsk" xml:space="preserve"><value>Elimina fotogrammi temporanei e miniature in cache; prima chiede conferma</value></data> <data name="Tooltips.Settings.ClearCacheAsk" xml:space="preserve"><value>Elimina fotogrammi temporanei e miniature in cache; prima chiede conferma</value></data>
<data name="Tooltips.Settings.CreateArchiveHere" xml:space="preserve"><value>Rendi ora questa cartella un archivio, crea le sue cartelle e metti in coda la scansione di ciò che contiene</value></data>
<data name="Tooltips.Settings.DataFolder" xml:space="preserve"><value>Database, impostazioni, log e cache di questo PC</value></data> <data name="Tooltips.Settings.DataFolder" xml:space="preserve"><value>Database, impostazioni, log e cache di questo PC</value></data>
<data name="Tooltips.Settings.DataInOneDrive" xml:space="preserve"><value>Apri la cartella dati in Esplora file. OneDrive la sincronizza e così può danneggiare l'indice: escludila dalla sincronizzazione</value></data> <data name="Tooltips.Settings.DataInOneDrive" xml:space="preserve"><value>Apri la cartella dati in Esplora file. OneDrive la sincronizza e così può danneggiare l'indice: escludila dalla sincronizzazione</value></data>
<data name="Tooltips.Settings.DeepAfterImport" xml:space="preserve"><value>Schede e cartelle nuove accodano l'analisi profonda di ciò che importano, in background; ogni scheda può cambiarlo</value></data> <data name="Tooltips.Settings.DeepAfterImport" xml:space="preserve"><value>Schede e cartelle nuove accodano l'analisi profonda di ciò che importano, in background; ogni scheda può cambiarlo</value></data>
@@ -914,6 +915,7 @@
<data name="Tooltips.Settings.SelfTest" xml:space="preserve"><value>Codifica una breve clip sintetica con ogni encoder e ne riporta esito e velocità · circa un minuto</value></data> <data name="Tooltips.Settings.SelfTest" xml:space="preserve"><value>Codifica una breve clip sintetica con ogni encoder e ne riporta esito e velocità · circa un minuto</value></data>
<data name="Tooltips.Settings.SelfTestResult" xml:space="preserve"><value>Velocità sulla clip di prova sintetica 1280×720</value></data> <data name="Tooltips.Settings.SelfTestResult" xml:space="preserve"><value>Velocità sulla clip di prova sintetica 1280×720</value></data>
<data name="Tooltips.Settings.SoftwareOnly" xml:space="preserve"><value>Sempre l'encoder software H.264 di Microsoft; più lento, identico ovunque</value></data> <data name="Tooltips.Settings.SoftwareOnly" xml:space="preserve"><value>Sempre l'encoder software H.264 di Microsoft; più lento, identico ovunque</value></data>
<data name="Tooltips.Settings.SkipCreateArchive" xml:space="preserve"><value>Ricorda la cartella e lasciala com'è</value></data>
<data name="Tooltips.Settings.Stars" xml:space="preserve"><value>Stelle per megapixel da cui un fotogramma notturno conta come campo stellare · Invio applica, Esc annulla</value></data> <data name="Tooltips.Settings.Stars" xml:space="preserve"><value>Stelle per megapixel da cui un fotogramma notturno conta come campo stellare · Invio applica, Esc annulla</value></data>
<data name="Tooltips.Settings.StartWithWindows" xml:space="preserve"><value>Avvia ridotto a icona all’accesso a Windows, così le schede inserite vengono notate</value></data> <data name="Tooltips.Settings.StartWithWindows" xml:space="preserve"><value>Avvia ridotto a icona all’accesso a Windows, così le schede inserite vengono notate</value></data>
<data name="Tooltips.Settings.ThemeDark" xml:space="preserve"><value>Interfaccia scura (predefinita)</value></data> <data name="Tooltips.Settings.ThemeDark" xml:space="preserve"><value>Interfaccia scura (predefinita)</value></data>
@@ -405,12 +405,14 @@ public sealed class AppSettings
/// <summary> /// <summary>
/// Settings › Import: <paramref name="imported"/> with this PC's own values taken from these settings: the session, the /// Settings › Import: <paramref name="imported"/> with this PC's own values taken from these settings: the session, the
/// window and its rail, the sequence edited last, the first-run flag, and the workspace (its folder, the projects opened /// window and its rail, the sequence edited last, the first-run flag, the archive folder (another PC's drive letter can
/// last and when). Changes and returns <paramref name="imported"/>. /// name one of this PC's own folders), and the workspace (its folder, the projects opened last and when). Changes and
/// returns <paramref name="imported"/>.
/// </summary> /// </summary>
public AppSettings KeepLocalIn(AppSettings imported) public AppSettings KeepLocalIn(AppSettings imported)
{ {
ArgumentNullException.ThrowIfNull(imported); ArgumentNullException.ThrowIfNull(imported);
imported.LastArchivePath = LastArchivePath;
imported.ProtectedToken = ProtectedToken; imported.ProtectedToken = ProtectedToken;
imported.ServerUrl = ServerUrl; imported.ServerUrl = ServerUrl;
imported.Window = Window; imported.Window = Window;
+27 -10
View File
@@ -108,7 +108,7 @@ public sealed class SettingsViewModel : SectionViewModel
_s.LastArchivePath = v.Length == 0 ? null : Path.GetFullPath(v); _s.LastArchivePath = v.Length == 0 ? null : Path.GetFullPath(v);
Save(); Save();
UpdateArchiveFree(); UpdateArchiveFree();
_retarget = RetargetArchiveAsync(); _retarget = RetargetArchiveAsync(offerCreate: true);
}, () => Loc.L("Tooltips.Settings.ArchiveRoot")); }, () => Loc.L("Tooltips.Settings.ArchiveRoot"));
FolderTemplate = new EditableField(_s.FolderTemplate, v => NamingPreview.Validate(v, isFolder: true), v => FolderTemplate = new EditableField(_s.FolderTemplate, v => NamingPreview.Validate(v, isFolder: true), v =>
{ {
@@ -1166,11 +1166,13 @@ public sealed class SettingsViewModel : SectionViewModel
/// <summary> /// <summary>
/// The archive folder changed: an archive already there is registered as at start (relinked when it moved) and given /// The archive folder changed: an archive already there is registered as at start (relinked when it moved) and given
/// its rescan, and the rows show its settings; any other folder leaves them with this PC's defaults for new archives. /// its rescan, and the rows show its settings. A folder that is no archive yet becomes one in place, with the archive's
/// Later edits never reach the archive shown before. Returns the archive registered at that folder (null for none), /// whole layout (as Welcome's Create), only when <paramref name="offerCreate"/> and the user confirms it for that folder
/// even when another folder has been chosen since: edits made for this one go there. /// by name; otherwise the folder is only remembered and the rows keep this PC's defaults for new archives. Later edits
/// never reach the archive shown before. Returns the archive registered at that folder (null for none), even when
/// another folder has been chosen since: edits made for this one go there.
/// </summary> /// </summary>
private async Task<Archive?> RetargetArchiveAsync() private async Task<Archive?> RetargetArchiveAsync(bool offerCreate)
{ {
_archive = null; _archive = null;
var root = _s.LastArchivePath; var root = _s.LastArchivePath;
@@ -1180,8 +1182,8 @@ public sealed class SettingsViewModel : SectionViewModel
{ {
var opened = await Task.Run(async () => File.Exists(new ArchivePaths(root).ManifestPath) ? await archives.OpenAsync(root) : null); var opened = await Task.Run(async () => File.Exists(new ArchivePaths(root).ManifestPath) ? await archives.OpenAsync(root) : null);
if (opened is not null) await Shell.Services.QueueScanAsync(opened, full: false); if (opened is not null) await Shell.Services.QueueScanAsync(opened, full: false);
// A folder that is no archive yet becomes one in place, with the archive's whole layout (as Welcome's Create). // Never on its own: a folder the user typed half of, or one of their own folders, would become an archive and be scanned.
else await Shell.Services.ArchiveSetup.CreateAsync(root); else if (offerCreate && ConfirmCreateArchive(root)) await Shell.Services.ArchiveSetup.CreateAsync(root);
} }
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or NewerFormatException catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or NewerFormatException
or DatabaseException or ArgumentException or InvalidOperationException) or DatabaseException or ArgumentException or InvalidOperationException)
@@ -1193,6 +1195,21 @@ public sealed class SettingsViewModel : SectionViewModel
return await LoadArchiveAsync(root); return await LoadArchiveAsync(root);
} }
/// <summary>
/// The archive folder typed or picked holds no archive: the user confirms making it one, the folder named, before any
/// folder or file is written there. Declined, the folder is only remembered.
/// </summary>
private bool ConfirmCreateArchive(string root) => Shell.Services.Dialogs.Confirm(new ConfirmRequest
{
Heading = Loc.L("Settings.Archive.CreateTitle"),
Message = Loc.L("Settings.Archive.CreateMessage"),
Detail = root,
SafeText = Loc.L("Settings.Archive.CreateSkip"),
SafeToolTip = Loc.L("Tooltips.Settings.SkipCreateArchive"),
ActionText = Loc.L("Settings.Archive.CreateAction"),
ActionToolTip = Loc.L("Tooltips.Settings.CreateArchiveHere"),
});
/// <summary> /// <summary>
/// Archive › Reset section with an archive open writes the defaults into that archive's archive.json, which the server /// Archive › Reset section with an archive open writes the defaults into that archive's archive.json, which the server
/// and the other PCs share: the user confirms it for that archive by name first. /// and the other PCs share: the user confirms it for that archive by name first.
@@ -1756,11 +1773,11 @@ public sealed class SettingsViewModel : SectionViewModel
return; return;
} }
// Everything but the session, the window and its rail, the sequence edited last (another PC's ids mean nothing here), // Everything but the session, the window and its rail, the sequence edited last (another PC's ids mean nothing here),
// the first-run flag and the workspace, which is this PC's (its folder, the projects opened last and when). // the first-run flag, the archive folder and the workspace, which are this PC's (another PC's drives mean nothing here).
ApplyAll(_s.KeepLocalIn(imported)); ApplyAll(_s.KeepLocalIn(imported));
// Settings of a PC never rewrite the shared archive.json: the imported templates and sizes are the defaults of new // Settings of a PC never rewrite the shared archive.json: the imported templates and sizes are the defaults of new
// archives, and the rows show the own settings of the archive at the (possibly imported) archive folder. // archives, and the rows show the own settings of this PC's archive. An import never makes a folder an archive.
_retarget = RetargetArchiveAsync(); _retarget = RetargetArchiveAsync(offerCreate: false);
Shell.Notify(Loc.L("Settings.Import.Done")); Shell.Notify(Loc.L("Settings.Import.Done"));
} }
+31 -2
View File
@@ -109,6 +109,31 @@
<Setter Property="ContextMenu" Value="{StaticResource Menu.Video}" /> <Setter Property="ContextMenu" Value="{StaticResource Menu.Video}" />
<EventSetter Event="MouseDoubleClick" Handler="OnItemDoubleClick" /> <EventSetter Event="MouseDoubleClick" Handler="OnItemDoubleClick" />
</Style> </Style>
<!--
A Board card's text and its actions: beside each other, and the actions on a row of their own under the text while the
player pane narrows the lanes (rc.14 review: at the window's smallest width the text kept about 80 px).
-->
<Style x:Key="Panel.BoardText" TargetType="StackPanel">
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.IsPlayerOpen, RelativeSource={RelativeSource AncestorType=UserControl}}" Value="True">
<Setter Property="Grid.ColumnSpan" Value="2" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="Panel.BoardActions" TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Margin" Value="8,0,0,0" />
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.IsPlayerOpen, RelativeSource={RelativeSource AncestorType=UserControl}}" Value="True">
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Margin" Value="0,4,0,0" />
<Setter Property="HorizontalAlignment" Value="Left" />
</DataTrigger>
</Style.Triggers>
</Style>
<!-- A Board card: title, project and version, preset · codec · duration · size, kind · date, state chips, and its actions. --> <!-- A Board card: title, project and version, preset · codec · duration · size, kind · date, state chips, and its actions. -->
<DataTemplate x:Key="Template.BoardCard" DataType="{x:Type vid:VideoRowViewModel}"> <DataTemplate x:Key="Template.BoardCard" DataType="{x:Type vid:VideoRowViewModel}">
<Grid ToolTip="{Binding ToolTip}"> <Grid ToolTip="{Binding ToolTip}">
@@ -116,7 +141,11 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel> <Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Style="{StaticResource Panel.BoardText}">
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" TextTrimming="CharacterEllipsis" /> <TextBlock Text="{Binding Title}" FontWeight="SemiBold" TextTrimming="CharacterEllipsis" />
<TextBlock Style="{StaticResource Text.Secondary}" Text="{Binding ProjectText}" TextTrimming="CharacterEllipsis" Margin="0,2,0,0" <TextBlock Style="{StaticResource Text.Secondary}" Text="{Binding ProjectText}" TextTrimming="CharacterEllipsis" Margin="0,2,0,0"
Visibility="{Binding HasProject, Converter={StaticResource BoolToVisibility}}" /> Visibility="{Binding HasProject, Converter={StaticResource BoolToVisibility}}" />
@@ -125,7 +154,7 @@
<ItemsControl Margin="0,6,0,0" ItemsSource="{Binding States}" ItemTemplate="{StaticResource Template.Status}" ItemsPanel="{StaticResource Panel.Row}" <ItemsControl Margin="0,6,0,0" ItemsSource="{Binding States}" ItemTemplate="{StaticResource Template.Status}" ItemsPanel="{StaticResource Panel.Row}"
Focusable="False" ClipToBounds="True" /> Focusable="False" ClipToBounds="True" />
</StackPanel> </StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Top" Margin="8,0,0,0"> <StackPanel Style="{StaticResource Panel.BoardActions}">
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Play}" <Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Play}"
Command="{Binding DataContext.PlayCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}" Command="{Binding DataContext.PlayCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}"
ToolTip="{Binding PlayToolTip}" AutomationProperties.Name="{l:Loc Videos.Play}" /> ToolTip="{Binding PlayToolTip}" AutomationProperties.Name="{l:Loc Videos.Play}" />
+4 -1
View File
@@ -439,7 +439,10 @@ public static class VideoSources
foreach (var render in folder.ReadRenders().Entries) foreach (var render in folder.ReadRenders().Entries)
{ {
var path = folder.ExportFile(render.File); var path = folder.ExportFile(render.File);
entries.Add(FromWorkspace(render, project, path, File.Exists(path) || Directory.Exists(path))); var exists = File.Exists(path) || Directory.Exists(path);
// A sent render whose file left exports/ is safe at its home, whose entry stands for it: never "missing".
if (render.IsSent && !exists) continue;
entries.Add(FromWorkspace(render, project, path, exists));
} }
} }
catch (Exception ex) when (ex is IOException or InvalidDataException or UnauthorizedAccessException) catch (Exception ex) when (ex is IOException or InvalidDataException or UnauthorizedAccessException)
@@ -170,7 +170,8 @@ export class Selection {
* stop (the current item), arrows move along the reading direction and between rows, Home and End, Space selects * stop (the current item), arrows move along the reading direction and between rows, Home and End, Space selects
* (Shift+Space: the range from the last one picked), Enter opens, Ctrl+A selects everything shown, Esc clears the * (Shift+Space: the range from the last one picked), Enter opens, Ctrl+A selects everything shown, Esc clears the
* selection. A click on an item's check box selects (with Shift, a range), Ctrl+click too; a plain click opens. * selection. A click on an item's check box selects (with Shift, a range), Ctrl+click too; a plain click opens.
* The caller redraws through onChange after the selection changed. * The caller redraws through onChange after the selection changed. order(el) gives the keys a range runs along, in the
* order shown; el is the item picked, so a page with several groups (the videos board's lanes) can answer with its group.
*/ */
export function selectableGrid(host, { selection, order, open, onChange }) { export function selectableGrid(host, { selection, order, open, onChange }) {
let current = null; let current = null;
@@ -182,8 +183,9 @@ export function selectableGrid(host, { selection, order, open, onChange }) {
current = el.dataset.key; current = el.dataset.key;
el.focus(); el.focus();
}; };
const pick = (key, shift) => { const pick = (el, shift) => {
if (shift) selection.range(key, order()); const key = el.dataset.key;
if (shift) selection.range(key, order(el));
else selection.toggle(key); else selection.toggle(key);
onChange(); onChange();
}; };
@@ -201,7 +203,7 @@ export function selectableGrid(host, { selection, order, open, onChange }) {
if (e.target.closest("[data-check]") || e.ctrlKey || e.metaKey || e.shiftKey) { if (e.target.closest("[data-check]") || e.ctrlKey || e.metaKey || e.shiftKey) {
// A check box keeps its own click (a cancelled one would put its old state back after onChange drew the new one). // A check box keeps its own click (a cancelled one would put its old state back after onChange drew the new one).
if (!e.target.matches("input[data-check]")) e.preventDefault(); if (!e.target.matches("input[data-check]")) e.preventDefault();
pick(el.dataset.key, e.shiftKey); pick(el, e.shiftKey);
return; return;
} }
if (e.target.closest("a, button")) return; if (e.target.closest("a, button")) return;
@@ -223,7 +225,7 @@ export function selectableGrid(host, { selection, order, open, onChange }) {
case "End": next = list[list.length - 1]; break; case "End": next = list[list.length - 1]; break;
case " ": case " ":
e.preventDefault(); e.preventDefault();
pick(el.dataset.key, e.shiftKey); pick(el, e.shiftKey);
return; return;
case "Enter": case "Enter":
e.preventDefault(); e.preventDefault();
+35 -10
View File
@@ -103,6 +103,7 @@ export async function render(root, { api, setMeta, actions, onEvent }) {
for (const f of ["kind", "codec", "year", "sort"]) root.querySelector(`#${f}`).addEventListener("change", (e) => setFilter(f, e.target.value)); for (const f of ["kind", "codec", "year", "sort"]) root.querySelector(`#${f}`).addEventListener("change", (e) => setFilter(f, e.target.value));
root.querySelector("#clear").addEventListener("click", clearFilters); root.querySelector("#clear").addEventListener("click", clearFilters);
root.querySelectorAll("[data-view]").forEach((b) => b.addEventListener("click", () => { root.querySelectorAll("[data-view]").forEach((b) => b.addEventListener("click", () => {
const sortBefore = sortShown();
view = b.dataset.view; view = b.dataset.view;
root.querySelectorAll("[data-view]").forEach((x) => x.setAttribute("aria-pressed", String(x === b))); root.querySelectorAll("[data-view]").forEach((x) => x.setAttribute("aria-pressed", String(x === b)));
try { try {
@@ -110,13 +111,22 @@ export async function render(root, { api, setMeta, actions, onEvent }) {
} catch { } catch {
// Only this page keeps the view then. // Only this page keeps the view then.
} }
draw(); drawSort();
// The board reads the server newest first: the list read again in the order the view shows, as a new filter is
// (the selection could hold videos the new page does not show).
if (sortShown() !== sortBefore) {
selection.clear();
load();
} else draw();
})); }));
root.querySelector("#more").addEventListener("click", () => load(true)); root.querySelector("#more").addEventListener("click", () => load(true));
const grid = selectableGrid(itemsHost, { const grid = selectableGrid(itemsHost, {
selection, selection,
order: () => rows.map((v) => v.id), // On the board a range runs along the lane picked in, as its cards are shown (a sent render is in both lanes).
order: (el) => view === "board" && el?.closest(".board-lane")
? [...el.closest(".board-lane").querySelectorAll('[role="option"]')].map((e) => e.dataset.key)
: rows.map((v) => v.id),
open: (key) => play(rows.find((v) => v.id === key)), open: (key) => play(rows.find((v) => v.id === key)),
onChange: syncSelection, onChange: syncSelection,
}); });
@@ -148,10 +158,23 @@ export async function render(root, { api, setMeta, actions, onEvent }) {
return FILTERS.some((f) => f !== "sort" && filters[f]); return FILTERS.some((f) => f !== "sort" && filters[f]);
} }
/** The order read from the server: the board's lanes are newest first over every video, whatever Order says. */
function sortShown() {
return view === "board" ? "newest" : filters.sort;
}
/** On the board, Order is off and says why; the choice comes back with the cards or the list. */
function drawSort() {
const sort = root.querySelector("#sort");
sort.disabled = view === "board";
sort.dataset.i18nTitle = view === "board" ? "Admin.Videos.Sort.Board.Tip" : "Admin.Videos.Sort.Tip";
sort.title = t(sort.dataset.i18nTitle);
}
function listQuery(limit, after) { function listQuery(limit, after) {
const p = new URLSearchParams({ limit: String(limit) }); const p = new URLSearchParams({ limit: String(limit) });
for (const f of ["q", "kind", "codec", "year", "sequence"]) if (filters[f]) p.set(f, filters[f]); for (const f of ["q", "kind", "codec", "year", "sequence"]) if (filters[f]) p.set(f, filters[f]);
if (filters.sort !== "newest") p.set("sort", filters.sort); if (sortShown() !== "newest") p.set("sort", sortShown());
if (after) p.set("cursor", after); if (after) p.set("cursor", after);
return `/api/v1/videos?${p}`; return `/api/v1/videos?${p}`;
} }
@@ -310,18 +333,19 @@ export async function render(root, { api, setMeta, actions, onEvent }) {
} }
/** /**
* The two lanes, newest first whatever the order chosen, each with its count: Published holds every video shown, Workspace * The two lanes, newest first (the board reads the server in that order, sortShown), each with its count: Published holds
* those a PC's workspace sent here, again as cards of their own marked Sent. * every video, counted over the server (the server's total), Workspace those a PC's workspace sent here, again as cards
* of their own marked Sent, counted among the videos read so far ("12+" while more can be read).
*/ */
function boardHtml() { function boardHtml() {
const newest = [...rows].sort((a, b) => (Date.parse(b.created) - Date.parse(a.created)) || String(a.id).localeCompare(String(b.id))); const sent = rows.filter((v) => boardLane(v, serverName) === "workspace");
const sent = newest.filter((v) => boardLane(v, serverName) === "workspace"); const lane = (key, items, workspace, count) => `<section class="board-lane" aria-label="${attr(t(`Admin.Videos.Lane.${key}`))}">
const lane = (key, items, workspace) => `<section class="board-lane" aria-label="${attr(t(`Admin.Videos.Lane.${key}`))}">
<h2 class="board-head" title="${attr(t(`Admin.Videos.Lane.${key}.Tip`))}"><span>${escapeHtml(t(`Admin.Videos.Lane.${key}`))}</span> <h2 class="board-head" title="${attr(t(`Admin.Videos.Lane.${key}.Tip`))}"><span>${escapeHtml(t(`Admin.Videos.Lane.${key}`))}</span>
<span class="pill num">${escapeHtml(formatNumber(items.length))}</span></h2> <span class="pill num">${escapeHtml(count)}</span></h2>
<div class="board-cards">${items.length > 0 ? items.map((v) => itemHtml(v, workspace)).join("") <div class="board-cards">${items.length > 0 ? items.map((v) => itemHtml(v, workspace)).join("")
: `<p class="empty-lane">${escapeHtml(t("Admin.Videos.Empty"))}</p>`}</div></section>`; : `<p class="empty-lane">${escapeHtml(t("Admin.Videos.Empty"))}</p>`}</div></section>`;
return lane("Published", newest, false) + lane("Workspace", sent, true); return lane("Published", rows, false, formatNumber(total ?? rows.length))
+ lane("Workspace", sent, true, `${formatNumber(sent.length)}${cursor ? "+" : ""}`);
} }
function itemHtml(v, workspace = false) { function itemHtml(v, workspace = false) {
@@ -585,6 +609,7 @@ export async function render(root, { api, setMeta, actions, onEvent }) {
else if (e.type === "reconnected") refreshSoon(0); else if (e.type === "reconnected") refreshSoon(0);
}); });
drawFilters(); drawFilters();
drawSort();
await load(); await load();
} }
+2 -2
View File
@@ -12,7 +12,7 @@ export function formatNumber(n) {
return new Intl.NumberFormat(culture()).format(n ?? 0); return new Intl.NumberFormat(culture()).format(n ?? 0);
} }
/** 9.4 TB, 610 GB … (decimal units, like disk vendors and the desktop client). */ /** 9.4 TB, 610 GB … (decimal units, like disk vendors and the desktop client), number and unit held together by a no-break space. */
export function formatBytes(bytes) { export function formatBytes(bytes) {
const units = ["B", "KB", "MB", "GB", "TB", "PB"]; const units = ["B", "KB", "MB", "GB", "TB", "PB"];
let value = Number(bytes ?? 0); let value = Number(bytes ?? 0);
@@ -22,7 +22,7 @@ export function formatBytes(bytes) {
unit++; unit++;
} }
const digits = value >= 100 || unit === 0 ? 0 : 1; const digits = value >= 100 || unit === 0 ? 0 : 1;
return `${new Intl.NumberFormat(culture(), { maximumFractionDigits: digits }).format(value)} ${units[unit]}`; return `${new Intl.NumberFormat(culture(), { maximumFractionDigits: digits }).format(value)} ${units[unit]}`;
} }
export function formatTime(iso) { export function formatTime(iso) {
+9 -2
View File
@@ -80,8 +80,15 @@ public static class SystemEndpoints
{ {
var checks = new Dictionary<string, string>(StringComparer.Ordinal) var checks = new Dictionary<string, string>(StringComparer.Ordinal)
{ {
// "incomplete": a folder of the archive's layout could not be created (the dashboard says which and why). // "missing": the root or its archive.json is not there (an unmounted disk); "incomplete": a folder of the archive's
["archive"] = !Directory.Exists(options.ArchivePath) ? "missing" : archive.Structure is { IsComplete: false } ? "incomplete" : "ok", // layout could not be created (the dashboard says which and why). Checked again once the last check is older than
// HealthRecheck, so a fix on the host shows here without the dashboard.
["archive"] = archive.CheckStructure(archive.HealthRecheck) switch
{
{ Problem: Core.Archiving.ArchiveStructureProblem.Unavailable } => "missing",
{ IsComplete: false } => "incomplete",
_ => "ok",
},
["data"] = Directory.Exists(options.DataPath) ? "ok" : "missing", ["data"] = Directory.Exists(options.DataPath) ? "ok" : "missing",
}; };
using var timeout = CancellationTokenSource.CreateLinkedTokenSource(context.RequestAborted); using var timeout = CancellationTokenSource.CreateLinkedTokenSource(context.RequestAborted);
@@ -392,7 +392,7 @@ public sealed class ServerOptions
throw new InvalidOperationException("CHRONOS_TLS_MODE=pem requires CHRONOS_TLS_CERT and CHRONOS_TLS_KEY."); throw new InvalidOperationException("CHRONOS_TLS_MODE=pem requires CHRONOS_TLS_CERT and CHRONOS_TLS_KEY.");
// Port 0 asks the OS for a free port (used by the in-process test host). // Port 0 asks the OS for a free port (used by the in-process test host).
if (HttpPort is < 0 or > 65535 || HttpsPort is < 0 or > 65535) if (HttpPort is < 0 or > 65535 || HttpsPort is < 0 or > 65535)
throw new InvalidOperationException("Ports must be between 0 and 65535."); throw new InvalidOperationException("CHRONOS_HTTP_PORT and CHRONOS_HTTPS_PORT must be between 0 and 65535.");
if (PublicHttpPort is < 1 or > 65535 || PublicHttpsPort is < 1 or > 65535) if (PublicHttpPort is < 1 or > 65535 || PublicHttpsPort is < 1 or > 65535)
throw new InvalidOperationException("CHRONOS_PUBLIC_HTTP_PORT and CHRONOS_PUBLIC_HTTPS_PORT must be between 1 and 65535."); throw new InvalidOperationException("CHRONOS_PUBLIC_HTTP_PORT and CHRONOS_PUBLIC_HTTPS_PORT must be between 1 and 65535.");
try try
@@ -410,7 +410,7 @@ public sealed class ServerOptions
if (MaxUploadBytes < 1 || TokenLifetimeDays < 1 || JobHistoryDays < 1 || UploadRetentionHours < 1) if (MaxUploadBytes < 1 || TokenLifetimeDays < 1 || JobHistoryDays < 1 || UploadRetentionHours < 1)
throw new InvalidOperationException("Upload size, token lifetime, job history and upload retention must be positive."); throw new InvalidOperationException("Upload size, token lifetime, job history and upload retention must be positive.");
if (ServerLogging.Problem(LogRetentionDays, LogMaxFileMb, LogMaxTotalMb, AuditRetentionDays, DiagnosticsLogMb) is { } log) if (ServerLogging.Problem(LogRetentionDays, LogMaxFileMb, LogMaxTotalMb, AuditRetentionDays, DiagnosticsLogMb) is { } log)
throw new InvalidOperationException($"{log} is out of range: {ServerLogging.Ranges}."); throw new InvalidOperationException($"{VariableOf(log) ?? log} is out of range: {ServerLogging.Ranges}.");
if (!ServerLogging.IsLevel(LogLevel) || !ServerLogging.IsLevel(ConsoleLogLevel) || !Enum.IsDefined(LogRotation)) if (!ServerLogging.IsLevel(LogLevel) || !ServerLogging.IsLevel(ConsoleLogLevel) || !Enum.IsDefined(LogRotation))
throw new InvalidOperationException("CHRONOS_LOG_LEVEL, CHRONOS_LOG_CONSOLE_LEVEL or CHRONOS_LOG_ROTATION has an unknown value."); throw new InvalidOperationException("CHRONOS_LOG_LEVEL, CHRONOS_LOG_CONSOLE_LEVEL or CHRONOS_LOG_ROTATION has an unknown value.");
} }
+19 -3
View File
@@ -54,15 +54,31 @@ public sealed class ServerArchive(Archive archive)
public ArchiveStructureReport? Structure => _structure; public ArchiveStructureReport? Structure => _structure;
private volatile ArchiveStructureReport? _structure; private volatile ArchiveStructureReport? _structure;
private long _checkedAt = long.MinValue;
/// <summary>
/// How old the last <see cref="CheckStructure"/> may be when <c>/health</c> answers before it checks again: a fix made
/// on the host shows there without anyone opening the dashboard. Tests shorten it.
/// </summary>
public TimeSpan HealthRecheck { get; set; } = TimeSpan.FromSeconds(10);
/// <summary> /// <summary>
/// Creates the folders of the archive's layout that are missing (BRIEF §7) and remembers what it found /// Creates the folders of the archive's layout that are missing (BRIEF §7) and remembers what it found
/// (<see cref="Structure"/>): at start, and each time the dashboard is read, so a share that comes back heals. /// (<see cref="Structure"/>): at start, each time the dashboard is read and when <c>/health</c> finds the last check
/// older than <paramref name="maxAge"/>, so a share that comes back heals. A root that holds no <c>archive.json</c> (an
/// unmounted disk leaves an empty mount point) is reported unavailable and nothing is created there.
/// </summary> /// </summary>
public ArchiveStructureReport CheckStructure() /// <param name="maxAge">The last check is returned as it is while younger than this; null always checks.</param>
public ArchiveStructureReport CheckStructure(TimeSpan? maxAge = null)
{ {
var report = ArchiveStructure.Ensure(new ArchivePaths(Root)); if (maxAge is { } age && _structure is { } recent && Environment.TickCount64 - Interlocked.Read(ref _checkedAt) < (long)age.TotalMilliseconds)
return recent;
var paths = new ArchivePaths(Root);
var report = File.Exists(paths.ManifestPath)
? ArchiveStructure.Ensure(paths)
: new ArchiveStructureReport(paths.Root, [], ArchiveStructureProblem.Unavailable, paths.Root, null);
_structure = report; _structure = report;
Interlocked.Exchange(ref _checkedAt, Environment.TickCount64);
return report; return report;
} }
@@ -302,6 +302,55 @@ public sealed class SettingsScreenSmokeTests
Assert.Equal(edited, shell.Services.Settings.FileTemplate); Assert.Equal(edited, shell.Services.Settings.FileTemplate);
}); });
[Test]
public Task AFolderTypedAsTheArchiveFolderBecomesAnArchiveOnlyWhenTheUserConfirms() => ScreenHost.RunAsync(async () =>
{
// Rc.14 review: the folder may be half-typed or one of the user's own; nothing is written there unasked.
var dialogs = new AnsweringDialogs();
await using var app = await ScreenSmokeTests.SampleApp.StartAsync(dialogs: dialogs);
var shell = app.Shell;
var settings = shell.Settings;
shell.Navigate(SectionKey.Settings);
settings.Page = SettingsPage.Archive;
var mine = System.IO.Path.Combine(shell.Services.Environment.DataDirectory, "my-photos");
System.IO.Directory.CreateDirectory(mine);
var manifest = new Chronos.Core.Archiving.ArchivePaths(mine).ManifestPath;
settings.ArchiveRoot.Text = mine;
Assert.True(settings.ArchiveRoot.Commit());
await settings.ArchiveRetarget;
Assert.Count(1, dialogs.Asked);
Assert.Equal(mine, dialogs.Asked[0].Detail);
Assert.False(System.IO.File.Exists(manifest), "declined: the folder stays as it was");
Assert.Empty(System.IO.Directory.EnumerateFileSystemEntries(mine));
Assert.Equal(mine, shell.Services.Settings.LastArchivePath);
dialogs.Answer = true;
settings.ArchiveRoot.Text = string.Empty;
Assert.True(settings.ArchiveRoot.Commit());
await settings.ArchiveRetarget;
settings.ArchiveRoot.Text = mine;
Assert.True(settings.ArchiveRoot.Commit());
await settings.ArchiveRetarget;
Assert.Count(2, dialogs.Asked);
Assert.True(System.IO.File.Exists(manifest), "confirmed: the folder is an archive");
});
/// <summary>Dialogs that record each confirmation and give <see cref="Answer"/>.</summary>
private sealed class AnsweringDialogs : IAppDialogs
{
public bool Answer { get; set; }
public List<ConfirmRequest> Asked { get; } = [];
public string? PickFolder(string title, string? initialFolder = null) => null;
public string? PickJsonFile(string title) => null;
public bool Confirm(ConfirmRequest request)
{
Asked.Add(request);
return Answer;
}
public bool SignIn(string server, string? username, Func<string, string, Task<string?>> signIn) => false;
}
[Test] [Test]
public Task TheFirstRunDialogKeepsTheKeyboardInside() => ScreenHost.RunAsync(async () => public Task TheFirstRunDialogKeepsTheKeyboardInside() => ScreenHost.RunAsync(async () =>
{ {
@@ -27,7 +27,7 @@ namespace Chronos.App.Tests.Videos;
/// The Videos library's sources (owner review 1, R9; decision 20): this PC's, the server's and the workspace's renders /// The Videos library's sources (owner review 1, R9; decision 20): this PC's, the server's and the workspace's renders
/// merged by render id, the filters and the orders, the videos folder's checks, the player's fallback, and the copy's toast. /// merged by render id, the filters and the orders, the videos folder's checks, the player's fallback, and the copy's toast.
/// </summary> /// </summary>
public sealed class VideoSourcesTests public sealed class VideoSourcesTests(TestContext context)
{ {
private static readonly Guid Harbour = Guid.CreateVersion7(); private static readonly Guid Harbour = Guid.CreateVersion7();
private static readonly Guid Comet = Guid.CreateVersion7(); private static readonly Guid Comet = Guid.CreateVersion7();
@@ -261,6 +261,30 @@ public sealed class VideoSourcesTests
Assert.True(VideoSources.FromWorkspace(render.AsFailed("no"), project, @"C:\ws\exports\harbour.mp4", exists: false) is { IsUnsent: true, Missing: true }); Assert.True(VideoSources.FromWorkspace(render.AsFailed("no"), project, @"C:\ws\exports\harbour.mp4", exists: false) is { IsUnsent: true, Missing: true });
} }
[Test]
public void ASentRenderWhoseFileLeftTheWorkspaceIsNotListedAsMissing()
{
// Rc.14 review: its home holds it, and the home's entry stands for it; only a render not sent yet can be missing.
var store = new WorkspaceStore(context.CreateTempDirectory("ledger"));
var home = new BundleHome(BundleHome.ArchiveKind, Harbour);
var project = new WorkspaceEntry(Guid.CreateVersion7(), Harbour, "Social cut", false, home, "Harbour sunset", true, DateTimeOffset.UtcNow);
var folder = store.Project(project.ProjectId);
Directory.CreateDirectory(folder.ExportsDirectory);
WorkspaceRenderEntry Render(string file) => new(Guid.CreateVersion7(), Guid.CreateVersion7(), file, new string('a', 64), 8, "Instagram", "h264", 1080, 1920, 30, 12,
project.ProjectId, null, null, DateTimeOffset.UtcNow);
File.WriteAllText(folder.ExportFile("kept.mp4"), "rendered");
var kept = Render("kept.mp4").AsSent(DateTimeOffset.UtcNow);
var gone = Render("gone.mp4").AsSent(DateTimeOffset.UtcNow);
var lost = Render("lost.mp4");
folder.WriteRenders(WorkspaceRenders.Empty.With(kept).With(gone).With(lost));
var entries = VideoSources.ReadWorkspace(store, [project]);
Assert.Count(2, entries);
Assert.True(entries.Single(e => e.Id == kept.RenderId) is { IsWorkspaceSent: true, Missing: false });
Assert.True(entries.Single(e => e.Id == lost.RenderId) is { IsUnsent: true, Missing: true }, "a render not sent yet whose file is gone is missing");
Assert.False(entries.Any(e => e.Id == gone.RenderId));
}
[Test] [Test]
public void ACardStartsWithItsPresetAndKeepsSizesWhole() public void ACardStartsWithItsPresetAndKeepsSizesWhole()
{ {
@@ -131,10 +131,13 @@ public sealed class WorkspaceHostTests(TestContext context)
Assert.Equal(at, mine.WorkspaceOpened[project]); Assert.Equal(at, mine.WorkspaceOpened[project]);
// Import takes another PC's preferences and keeps this PC's projects. // Import takes another PC's preferences and keeps this PC's projects.
var theirs = new AppSettings { WorkspaceSizeLimitGb = 40, WorkspaceFolder = @"E:\Elsewhere" }; var theirs = new AppSettings { WorkspaceSizeLimitGb = 40, WorkspaceFolder = @"E:\Elsewhere", LastArchivePath = @"D:\Photos" };
theirs.WorkspaceOpened[Guid.CreateVersion7()] = at.AddDays(-3); theirs.WorkspaceOpened[Guid.CreateVersion7()] = at.AddDays(-3);
mine.LastArchivePath = @"F:\Chronos";
var imported = mine.KeepLocalIn(AppSettings.Parse(theirs.ToJson())!); var imported = mine.KeepLocalIn(AppSettings.Parse(theirs.ToJson())!);
Assert.Equal((40, @"D:\Fast\Workspace"), (imported.WorkspaceSizeLimitGb, imported.WorkspaceFolder)); Assert.Equal((40, @"D:\Fast\Workspace"), (imported.WorkspaceSizeLimitGb, imported.WorkspaceFolder));
// Another PC's archive folder can name one of this PC's own folders: this PC's stays.
Assert.Equal(@"F:\Chronos", imported.LastArchivePath);
Assert.Equal(at, imported.WorkspaceOpened.Values.Single()); Assert.Equal(at, imported.WorkspaceOpened.Values.Single());
Assert.Count(1, imported.WorkspaceOpened); Assert.Count(1, imported.WorkspaceOpened);
} }
@@ -116,11 +116,21 @@ public sealed partial class AdminVideosTests(TestContext context)
Assert.Contains(@"data-view=""board"" aria-pressed=""${view === ""board""}"" data-i18n-title=""Admin.Videos.View.Board.Tip""", page); Assert.Contains(@"data-view=""board"" aria-pressed=""${view === ""board""}"" data-i18n-title=""Admin.Videos.View.Board.Tip""", page);
Assert.Contains(@"return stored === ""list"" || stored === ""board"" ? stored : ""cards"";", page); Assert.Contains(@"return stored === ""list"" || stored === ""board"" ? stored : ""cards"";", page);
Assert.Contains(" board: `<svg", await server.Client.GetStringAsync("/admin/icons.js")); Assert.Contains(" board: `<svg", await server.Client.GetStringAsync("/admin/icons.js"));
// Two lanes, newest first whatever the order chosen, each with its count; Workspace holds the renders a PC's workspace // Two lanes, newest first whatever the order chosen: the board reads the server newest first, with Order off and
// sent here (a project named, produced by a machine other than this server), marked Sent. // saying why (rc.14 review: re-sorting the page read in another order left the newest out). Published counts the
Assert.Contains("const newest = [...rows].sort((a, b) => (Date.parse(b.created) - Date.parse(a.created))", page); // server's total; Workspace holds the renders a PC's workspace sent here (a project named, produced by a machine
Assert.Contains(@"return lane(""Published"", newest, false) + lane(""Workspace"", sent, true);", page); // other than this server), marked Sent, counted among those read ("+" while more can be read).
Assert.Contains(@"<span class=""pill num"">${escapeHtml(formatNumber(items.length))}</span>", page); Assert.Contains(@"return view === ""board"" ? ""newest"" : filters.sort;", page);
Assert.Contains(@"if (sortShown() !== ""newest"") p.set(""sort"", sortShown());", page);
Assert.Contains(@"sort.disabled = view === ""board"";", page);
Assert.Contains(@"""Admin.Videos.Sort.Board.Tip""", page);
Assert.Contains(@"return lane(""Published"", rows, false, formatNumber(total ?? rows.length))", page);
Assert.Contains(@"+ lane(""Workspace"", sent, true, `${formatNumber(sent.length)}${cursor ? ""+"" : """"}`);", page);
// A Shift range runs along the lane picked in, as its cards are shown.
Assert.Contains(@"order: (el) => view === ""board"" && el?.closest("".board-lane"")", page);
Assert.Contains("if (shift) selection.range(key, order(el));", await server.Client.GetStringAsync("/admin/pages/library/shared.js"));
// Sizes keep their number and unit together, as the desktop's (issue #28).
Assert.Contains(@"format(value)} ${units[unit]}`;", await server.Client.GetStringAsync("/admin/ui.js"));
Assert.Contains("export function boardLane(v, serverName)", page); Assert.Contains("export function boardLane(v, serverName)", page);
Assert.Contains(@"return v.projectId && producer && producer !== String(serverName ?? """") ? ""workspace"" : ""published"";", page); Assert.Contains(@"return v.projectId && producer && producer !== String(serverName ?? """") ? ""workspace"" : ""published"";", page);
Assert.Contains(@"${workspace ? sentChip(v) : """"}${stateChips(v)}", page); Assert.Contains(@"${workspace ? sentChip(v) : """"}${stateChips(v)}", page);
@@ -69,6 +69,47 @@ public sealed class ArchiveStructureStartupTests(TestContext context)
Assert.Equal("ok", health.Checks["archive"]); Assert.Equal("ok", health.Checks["archive"]);
} }
[Test]
public async Task HealthSeesAFixOnTheHostWithoutTheDashboard()
{
await using var server = await TestServer.StartAsync(context);
var archive = server.Services.GetRequiredService<ServerArchive>();
var paths = new ArchivePaths(server.Options.ArchivePath);
Directory.Delete(paths.TrashVideosDirectory);
File.WriteAllText(paths.TrashVideosDirectory, "in the way");
archive.HealthRecheck = TimeSpan.Zero;
var health = Assert.NotNull(await server.Client.GetFromJsonAsync("/health", ProtocolJson.Default.HealthStatus));
Assert.Equal("incomplete", health.Checks["archive"]);
File.Delete(paths.TrashVideosDirectory);
health = Assert.NotNull(await server.Client.GetFromJsonAsync("/health", ProtocolJson.Default.HealthStatus));
Assert.Equal("ok", health.Checks["archive"]);
Assert.True(Directory.Exists(paths.TrashVideosDirectory));
}
[Test]
public async Task ARootThatLostItsArchiveJsonGetsNoFolders()
{
// Rc.14 review: an unmounted disk leaves an empty mount point; nothing is written onto the disk beneath it.
await using var server = await TestServer.StartAsync(context);
var admin = await server.AdminAsync();
var paths = new ArchivePaths(server.Options.ArchivePath);
var manifest = File.ReadAllBytes(paths.ManifestPath);
File.Delete(paths.ManifestPath);
Directory.Delete(paths.TrashDirectory, recursive: true);
var problem = Assert.NotNull((await DashboardAsync(admin)).ArchiveProblem);
Assert.Equal("unavailable", problem.Code);
Assert.False(Directory.Exists(paths.TrashDirectory), "nothing created");
var health = Assert.NotNull(await server.Client.GetFromJsonAsync("/health", ProtocolJson.Default.HealthStatus));
Assert.Equal("missing", health.Checks["archive"]);
// The disk is back: the next look completes the layout.
File.WriteAllBytes(paths.ManifestPath, manifest);
Assert.Null((await DashboardAsync(admin)).ArchiveProblem);
Assert.Empty(ArchiveStructure.Missing(paths));
}
private static async Task<DashboardDto> DashboardAsync(HttpClient admin) private static async Task<DashboardDto> DashboardAsync(HttpClient admin)
{ {
using var response = await admin.GetAsync("/api/v1/server/dashboard"); using var response = await admin.GetAsync("/api/v1/server/dashboard");
@@ -52,6 +52,24 @@ public sealed partial class LoggingTests(TestContext context)
Assert.Equal((LogLevel.Debug, LogLevel.Warning, Chronos.Core.Diagnostics.LogLevel.Debug), (logging.FileLevel, logging.ConsoleLevel, CoreLog.MinimumLevel)); Assert.Equal((LogLevel.Debug, LogLevel.Warning, Chronos.Core.Diagnostics.LogLevel.Debug), (logging.FileLevel, logging.ConsoleLevel, CoreLog.MinimumLevel));
} }
[Test]
public void AValueOutOfRangeIsNamedByItsVariable()
{
// Rc.14 review: the start's message named the setting's property, which the deploy guide never mentions.
ServerOptions Load(params (string Name, string Value)[] variables)
{
var environment = new Dictionary<string, string?> { ["CHRONOS_DATA_PATH"] = context.CreateTempDirectory("ranges"), ["CHRONOS_DB"] = "postgres" };
foreach (var (name, value) in variables) environment[name] = value;
return ServerOptions.Load(environment);
}
var logs = Assert.Throws<InvalidOperationException>(() => Load(("CHRONOS_LOG_MAX_FILE_MB", "50"), ("CHRONOS_LOG_MAX_TOTAL_MB", "10")).Validate());
Assert.True(logs.Message.StartsWith("CHRONOS_LOG_MAX_TOTAL_MB is out of range", StringComparison.Ordinal), logs.Message);
var port = Assert.Throws<InvalidOperationException>(() => Load(("CHRONOS_HTTP_PORT", "70000")).Validate());
Assert.Contains("CHRONOS_HTTP_PORT", port.Message);
// Parallelism alone is held to its range instead.
Assert.Equal(ServerOptions.MaxParallelism, Load(("CHRONOS_PARALLELISM", "128")).Parallelism);
}
[Test] [Test]
public async Task TheFileLevelChangesWhileTheServerRuns() public async Task TheFileLevelChangesWhileTheServerRuns()
{ {