M6 Windows: composizione condivisa Febe.App per Server e Desktop; Febe per Windows (WPF) con l'interfaccia in WebView2, area di notifica, istanza unica, «Browser di Febe» su WebView2 con CDP filtrato (WebView2CdpSession) e ripieghi di S2 (composizione, Edge), guscio nativo, avvisi, spostamento verificato della cartella dei dati, icona del marchio; un solo Febe.exe, installatore NSIS e zip portabile; guida docs/windows.md e prove dal vivo S1–S3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mzbb6zeFTjT6Rp8b92AVkA
This commit is contained in:
73 files changed
+7914
-699
No files matched your search
@@ -64,7 +64,12 @@ public static class SettingsApi
|
||||
}
|
||||
|
||||
d.Import.LibrarySettingsChanged();
|
||||
(d.Services.GetService(typeof(Febe.Core.Library.LibraryIngest)) as Febe.Core.Library.LibraryIngest)?.Apply(new LibraryNaming(general, highlight), body.SetFileTime);
|
||||
if (d.Services.GetService(typeof(Febe.Core.Library.LibraryIngest)) is Febe.Core.Library.LibraryIngest ingest)
|
||||
{
|
||||
// The scheme and a new library folder (desktop) hold for the next downloads, without a restart.
|
||||
ingest.Apply(new LibraryNaming(general, highlight), body.SetFileTime);
|
||||
ingest.UseLayout(d.Library.Layout);
|
||||
}
|
||||
d.Changes.Publish(new LibraryChange(d.Clock.Now, null, "settings"));
|
||||
return ApiHttp.Json(await GeneralAsync(context, d, ct).ConfigureAwait(false), FebeJsonContext.Default.GeneralSettingsDto);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
@@ -27,6 +28,7 @@ public sealed class EmbeddedWwwroot : IFileProvider
|
||||
{
|
||||
}
|
||||
|
||||
[UnconditionalSuppressMessage("SingleFile", "IL3000:Avoid accessing Assembly file path when publishing as a single file", Justification = "In a single file the location is empty and the executable's own time is used instead.")]
|
||||
public EmbeddedWwwroot(Assembly assembly)
|
||||
{
|
||||
_assembly = assembly ?? throw new ArgumentNullException(nameof(assembly));
|
||||
@@ -48,8 +50,14 @@ public sealed class EmbeddedWwwroot : IFileProvider
|
||||
}
|
||||
}
|
||||
|
||||
// Embedded files change only with the assembly: its time is a good Last-Modified (and ETag) for all of them.
|
||||
// Embedded files change only with the assembly: its time is a good Last-Modified (and ETag) for all of them. In a
|
||||
// single-file executable (Windows) the assembly has no file of its own: the executable's time stands for it.
|
||||
var location = assembly.Location;
|
||||
if (string.IsNullOrEmpty(location))
|
||||
{
|
||||
location = Environment.ProcessPath ?? string.Empty;
|
||||
}
|
||||
|
||||
_lastModified = !string.IsNullOrEmpty(location) && File.Exists(location)
|
||||
? new DateTimeOffset(File.GetLastWriteTimeUtc(location), TimeSpan.Zero)
|
||||
: DateTimeOffset.UtcNow;
|
||||
|
||||
+11
-4
@@ -23,6 +23,13 @@ Qui sotto le convenzioni per chi continua il lavoro (composizione di Server e De
|
||||
|
||||
## Ospitare l'interfaccia (Server e Desktop)
|
||||
|
||||
Le due vesti non compongono più l'interfaccia a mano: lo fa **`Febe.App`** (`FebeApp.StartAsync(opzioni, piattaforma)`),
|
||||
la composizione condivisa di database, libreria, importazione, copie, browser, raccolta, scaricamenti, motore,
|
||||
collegamento (`BrowserConnectionService`), avvisi (`AlertDispatcher`, canali `IAlertChannel`) e interfaccia. Ciò che
|
||||
cambia sta in `IFebePlatform`: `Febe.Server/DockerPlatform` (password, Chromium su Xvfb, vista remota) e
|
||||
`Febe.Desktop.Core/DesktopPlatform` (gettone, 127.0.0.1 su porta scelta all'avvio, WebView2, guscio di Windows). Il
|
||||
modello qui sotto resta valido per chi ospita l'interfaccia da sé (prove, dimostrazione).
|
||||
|
||||
```csharp
|
||||
var app = FebeWebHost.Build(options, FebeListen.Any(8480) /* Docker */ or FebeListen.Loopback(0) /* Windows */, services =>
|
||||
{
|
||||
@@ -55,13 +62,13 @@ Tutti con un ripiego registrato con `TryAdd`; la composizione registra i propri
|
||||
|
||||
| Servizio | Ripiego | Chi lo sostituisce |
|
||||
|---|---|---|
|
||||
| `IConnectionService` (`Connection/`) | `UnavailableConnectionService`: stato `BrowserUnavailable`, «Collegati» e «Scollega» rispondono 400 con un messaggio italiano | Server (vista remota) e Desktop (finestra WebView2): l'implementazione vera e `/api/vista` sono di quel lavoro |
|
||||
| `IConnectionService` (`Connection/`) | `UnavailableConnectionService`: stato `BrowserUnavailable`, «Collegati» e «Scollega» rispondono 400 con un messaggio italiano | `Febe.App/BrowserConnectionService`, la stessa per le due vesti (in Windows porta in primo piano e nasconde la finestra «Browser di Febe»); `/api/vista` è della veste Docker |
|
||||
| `IConfigurationProblems` | `NoConfigurationProblems` (nessun problema) | Server: password mancante, cartelle non scrivibili… Se l'elenco non è vuoto l'interfaccia mostra solo la pagina di errore |
|
||||
| `IEngineSettingsControl` | `StoredEngineSettingsControl`: salva le impostazioni del motore nell'archivio | `new EngineHostSettingsControl(engineHost)`: le applica anche al motore che gira |
|
||||
| `IBrowserPreview` | `NoBrowserPreview` (nessuna anteprima) | Chi ha il browser: `GetLatestAsync` restituisce l'ultima schermata JPEG (`BrowserFrame`) con l'indirizzo |
|
||||
| `IIncidentHistory` | `StoredIncidentHistory` (dall'archivio) | Di solito nessuno |
|
||||
| `IAlertTestSender` (Core) | `TelegramNotAvailableYet`: nessun messaggio parte, la risposta lo dice | M8, l'invio vero dei messaggi Telegram |
|
||||
| `IDataFolderChange` | `FixedDataFolder`: la cartella dei dati non si cambia dall'interfaccia | Desktop (M6): sposta la cartella al riavvio |
|
||||
| `IDataFolderChange` | `FixedDataFolder`: la cartella dei dati non si cambia dall'interfaccia | Desktop: `DesktopDataFolderChange` registra la scelta e `DataFolderMove` sposta la cartella al prossimo avvio, con copia verificata (SHA-256) |
|
||||
| `ImportService` (Core) | `ImportHub` ne costruisce uno sulla libreria (Docker: solo sotto `FebeWebOptions.ImportRoot`, di serie `/importa`; desktop: qualsiasi cartella) | La composizione, se vuole opzioni diverse (ffmpeg, cartella sorgente) |
|
||||
|
||||
- `ImportHub.LibrarySettingsChanged()` va chiamato quando cambiano cartella o schema dei nomi (lo fa già
|
||||
@@ -128,8 +135,8 @@ Ogni altro indirizzo senza estensione risponde con `index.html`; `/api/…` scon
|
||||
|
||||
Il contratto con l'interfaccia è `Connection/PROTOCOLLO.md`. Lato server:
|
||||
|
||||
- `IConnectionService` lo registra la composizione (`Febe.Server/ServerConnectionService`, sul Chromium vero; con un
|
||||
problema di configurazione `UnavailableConnectionService`). Gli endpoint `/api/connection/*` lo usano.
|
||||
- `IConnectionService` lo registra la composizione (`Febe.App/BrowserConnectionService`, sul browser vero; con un
|
||||
problema di configurazione `Febe.App/ProblemConnectionService`). Gli endpoint `/api/connection/*` lo usano.
|
||||
- `IRemoteViewHost` (`Connection/RemoteView.cs`) apre una vista: `IRemoteViewConnection.ReadAsync` dà prima `meta` poi
|
||||
fotogrammi (i vecchi si scartano se la pagina è lenta), `MouseAsync`/`KeyAsync`/`NavigateAsync` portano i gesti al
|
||||
browser. Una vista alla volta: aprirne un'altra chiude la precedente. Senza `IRemoteViewHost` registrato,
|
||||
|
||||
@@ -81,6 +81,8 @@ export async function mountConnection(page) {
|
||||
h('ol.passi-collegamento', (Array.isArray(steps) ? steps : []).map((s, i) => h('li', h('span.numero', String(i + 1)), h('div', h('b', s.titolo), h('p', s.testo)))))),
|
||||
passwordNote(windows),
|
||||
h('div.avviso.ambra', icon('triangle-alert', 's'), h('span', t('impostazioni.collegamento.rischio'))),
|
||||
// Windows: one engine per account (spec §5) said before the login too; Docker keeps mockup 10 as it is.
|
||||
windows ? h('div.avviso', icon('info', 's'), h('span', t('impostazioni.collegamento.unMotore'))) : null,
|
||||
message,
|
||||
h('div.molla'),
|
||||
h('div.bottoni-collegamento',
|
||||
|
||||
Reference in new issue
Block a user