Compare commits

...
Author SHA1 Message Date
ietm64 ac7648f9fe Passage v1.3.0-beta
Build & Push Images / build (web) (push) Successful in 2m14s
Qualité & Sécurité / Web (ESLint · angular-eslint + sonarjs) (push) Successful in 44s
Qualité & Sécurité / MegaLinter (PMD · Ruff · Bandit · gitleaks · hadolint) (push) Successful in 1m0s
Build & Push Images / build (brain) (push) Successful in 1m37s
Qualité & Sécurité / Trivy (CVE dépendances Maven / pip / npm) (push) Failing after 3m15s
Build & Push Images / build-switcher (push) Successful in 23s
Build & Push Images / build (core) (push) Successful in 4m22s
2026-10-17 15:47:14 +02:00
ietm64 d9a90f8412 Accès tablette : vérification du pare-feu sous Linux (ufw, firewalld)
Qualité & Sécurité / Web (ESLint · angular-eslint + sonarjs) (push) Successful in 43s
Qualité & Sécurité / MegaLinter (PMD · Ruff · Bandit · gitleaks · hadolint) (push) Successful in 48s
Qualité & Sécurité / Trivy (CVE dépendances Maven / pip / npm) (push) Failing after 51s
- Choix de l'accès au pare-feu selon le système (HostNetworkAccessConfig) :
  Windows (PowerShell, UAC), Linux, sinon pas de diagnostic.
- Linux, sans droits root : ufw détecté via /etc/ufw/ufw.conf, firewalld via
  systemctl ; firewalld dit si le port est ouvert (firewall-cmd
  --query-port). Règles ufw illisibles sans root : port « inconnu », jamais
  de faux « prêt ».
- Vérification du réseau : état du pare-feu Linux et commande exacte à lancer
  sur la machine (sudo ufw allow <port>/tcp, ou firewall-cmd), avec bouton
  « Copier ». Pas d'autorisation en un clic (serveur sans écran).
- Le diagnostic reçoit le port réglé de l'accès distant.

Vérifié : core clean verify (1228 tests, dont lecture de ufw.conf,
interprétation de firewall-cmd et verdicts Linux), web build + 342 vitest,
lint sans erreur.
À redéployer : core + web (mode bureau ; aucune migration).
2026-10-17 15:41:50 +02:00
ietm64 2e9632de49 Mobile et tablette : arborescence en navigation par niveaux
Qualité & Sécurité / Web (ESLint · angular-eslint + sonarjs) (push) Successful in 41s
Qualité & Sécurité / MegaLinter (PMD · Ruff · Bandit · gitleaks · hadolint) (push) Successful in 47s
Qualité & Sécurité / Trivy (CVE dépendances Maven / pip / npm) (push) Failing after 49s
Avant : sur téléphone, toucher un arc ouvrait sa page et refermait le volet ;
pour voir chapitres et scènes il fallait viser une flèche de 12 px.

- En mode tiroir (< 1024 px), un niveau à la fois : toucher un nœud qui a
  des enfants entre dedans sans quitter le volet, bouton « retour » vers le
  niveau parent ; seule une feuille (scène, page…) navigue et ferme le volet.
- En-tête de niveau : titre, « Ouvrir la fiche » et actions de création du
  nœud (« Nouveau chapitre », « Nouvelle scène », « Nouvelle page »…).
- Lignes de 48 px minimum, titres sur deux lignes au plus, compteur
  d'éléments, pastilles de readiness conservées ; glisser-déposer réservé à
  l'ordinateur ; volet de 400 px sur tablette.
- Le volet rouvert montre le niveau de la page courante (élément surligné) ;
  l'accueil de la section n'est pas pris pour la page courante.
- Campagnes et Lore (panneau Templates gardé à la racine). Ordinateur
  inchangé : arbre classique.

Vérifié : web build + 342 vitest (logique de navigation testée), lint sans
erreur, e2e 80/80 dont le parcours mobile hub → scène réécrit pour les
niveaux, essais au doigt à 375 et 768 px (campagne et Lore).
À redéployer : web.
2026-10-17 15:34:41 +02:00
ietm64 fbb1956e17 Accès tablette : détection des pare-feu tiers (Bitdefender, Norton…)
Qualité & Sécurité / Web (ESLint · angular-eslint + sonarjs) (push) Successful in 46s
Qualité & Sécurité / MegaLinter (PMD · Ruff · Bandit · gitleaks · hadolint) (push) Successful in 59s
Qualité & Sécurité / Trivy (CVE dépendances Maven / pip / npm) (push) Failing after 1m4s
Constat terrain : avec Bitdefender, la règle Windows était en place et la
vérification affichait « prêt » alors que le pare-feu de l'antivirus
filtrait encore les connexions de la tablette.

- Lecture du Centre de sécurité Windows (SecurityCenter2/FirewallProduct) :
  les pare-feu tiers déclarés sont remontés avec le diagnostic.
- Vérification du réseau : plus de « tout est prêt » trompeur quand un pare-feu
  tiers est présent — avertissement nommant le logiciel, consigne (réseau
  domestique, mode furtif désactivé, règle entrante pour DM Loremind) et lien
  vers la doc.

Vérifié : core clean verify (1221 tests, dont la lecture réelle sur Windows
qui remonte bien « Bitdefender Pare-feu »), web build + 337 vitest, lint sans
erreur.
À redéployer : core + web (mode bureau ; aucune migration).
2026-10-17 15:08:12 +02:00
31 changed files with 1002 additions and 88 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ from app.infrastructure.ollama_model_installer import ensure_ollama_embedding_mo
app = FastAPI( app = FastAPI(
title="LoreMind Brain", title="LoreMind Brain",
description="Backend IA pour la génération de contenu narratif.", description="Backend IA pour la génération de contenu narratif.",
version="1.0.3", version="1.3.0-beta",
) )
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
+1 -1
View File
@@ -14,7 +14,7 @@
<groupId>com.loremind</groupId> <groupId>com.loremind</groupId>
<artifactId>loremind-core</artifactId> <artifactId>loremind-core</artifactId>
<version>1.0.3</version> <version>1.3.0-beta</version>
<name>LoreMind Core</name> <name>LoreMind Core</name>
<description>Backend Core - Architecture Hexagonale</description> <description>Backend Core - Architecture Hexagonale</description>
@@ -15,7 +15,13 @@ import java.util.Locale;
* @param publicNetworks réseaux connectés classés « Public » que le pare-feu ne laisse pas passer * @param publicNetworks réseaux connectés classés « Public » que le pare-feu ne laisse pas passer
* @param firewallAllowed une règle active autorise l'application sur les réseaux privés * @param firewallAllowed une règle active autorise l'application sur les réseaux privés
* @param firewallBlocked une règle active BLOQUE l'application (ex. « Annuler » dans la fenêtre Windows) * @param firewallBlocked une règle active BLOQUE l'application (ex. « Annuler » dans la fenêtre Windows)
* @param thirdPartyFirewalls pare-feu tiers présents : leurs réglages ne sont pas lisibles, donc {@code ready}
* ne peut pas être garanti — le front avertit l'utilisateur de les régler lui-même
* @param program exécutable concerné * @param program exécutable concerné
* @param platform {@code windows} ou {@code linux}
* @param linuxFirewall Linux : pare-feu actif ({@code ufw}, {@code firewalld}, {@code none})
* @param portOpen Linux : port autorisé ({@code null} = invérifiable sans droits administrateur)
* @param fixCommand Linux : commande à lancer pour ouvrir le port, ou {@code null}
*/ */
public record NetworkReadiness( public record NetworkReadiness(
boolean supported, boolean supported,
@@ -23,7 +29,12 @@ public record NetworkReadiness(
List<String> publicNetworks, List<String> publicNetworks,
boolean firewallAllowed, boolean firewallAllowed,
boolean firewallBlocked, boolean firewallBlocked,
String program List<String> thirdPartyFirewalls,
String program,
String platform,
String linuxFirewall,
Boolean portOpen,
String fixCommand
) { ) {
static final String PUBLIC = "Public"; static final String PUBLIC = "Public";
@@ -31,7 +42,10 @@ public record NetworkReadiness(
public static NetworkReadiness evaluate(NetworkSnapshot snapshot) { public static NetworkReadiness evaluate(NetworkSnapshot snapshot) {
if (snapshot == null || !snapshot.supported()) { if (snapshot == null || !snapshot.supported()) {
return new NetworkReadiness(false, false, List.of(), false, false, null); return new NetworkReadiness(false, false, List.of(), false, false, List.of(), null, null, null, null, null);
}
if (NetworkSnapshot.LINUX.equals(snapshot.platform())) {
return evaluateLinux(snapshot);
} }
List<NetworkSnapshot.FirewallRule> rules = snapshot.rules() == null ? List.of() : snapshot.rules(); List<NetworkSnapshot.FirewallRule> rules = snapshot.rules() == null ? List.of() : snapshot.rules();
boolean allowedPrivate = covers(rules, "Allow", PRIVATE); boolean allowedPrivate = covers(rules, "Allow", PRIVATE);
@@ -46,8 +60,31 @@ public record NetworkReadiness(
// Un réseau public n'est un obstacle que si le pare-feu ne l'ouvre pas explicitement. // Un réseau public n'est un obstacle que si le pare-feu ne l'ouvre pas explicitement.
List<String> blockingPublic = publicOpen ? List.of() : publicNetworks; List<String> blockingPublic = publicOpen ? List.of() : publicNetworks;
// « ready » ne porte que sur ce qui est lisible (Windows) ; un pare-feu tiers est signalé à part.
boolean ready = allowedPrivate && !blockedPrivate && blockingPublic.isEmpty(); boolean ready = allowedPrivate && !blockedPrivate && blockingPublic.isEmpty();
return new NetworkReadiness(true, ready, blockingPublic, allowedPrivate, blockedPrivate, snapshot.program()); List<String> thirdParty = snapshot.thirdPartyFirewalls() == null ? List.of() : snapshot.thirdPartyFirewalls();
return new NetworkReadiness(true, ready, blockingPublic, allowedPrivate, blockedPrivate, thirdParty,
snapshot.program(), NetworkSnapshot.WINDOWS, null, null, null);
}
/**
* Linux : prêt si aucun pare-feu (ufw, firewalld) n'est actif, ou si le port est ouvert.
* Port invérifiable (ufw sans droits root) : pas prêt, mais pas en erreur — le front
* affiche la commande « au cas où ».
*/
private static NetworkReadiness evaluateLinux(NetworkSnapshot s) {
String fw = s.linuxFirewall() == null ? "none" : s.linuxFirewall();
boolean ready = "none".equals(fw) || Boolean.TRUE.equals(s.portOpen());
return new NetworkReadiness(true, ready, List.of(), false, false, List.of(), null,
NetworkSnapshot.LINUX, fw, s.portOpen(), ready ? null : linuxCommand(fw, s.port()));
}
static String linuxCommand(String firewall, int port) {
return switch (firewall) {
case "ufw" -> "sudo ufw allow " + port + "/tcp";
case "firewalld" -> "sudo firewall-cmd --permanent --add-port=" + port + "/tcp && sudo firewall-cmd --reload";
default -> null;
};
} }
/** Une règle ACTIVE de cette action couvre-t-elle ce profil (« Any » couvre tout) ? */ /** Une règle ACTIVE de cette action couvre-t-elle ce profil (« Any » couvre tout) ? */
@@ -216,6 +216,11 @@ public class RemoteAccessService {
return deviceRepository.deleteById(deviceId); return deviceRepository.deleteById(deviceId);
} }
/** Port réseau réglé (ouvert ou non) : celui que le pare-feu doit laisser passer. */
public synchronized int configuredPort() {
return currentConfig().port();
}
/** Port du connecteur réseau ouvert, ou -1 (pour le filtre : qui vient « de l'extérieur » ?). */ /** Port du connecteur réseau ouvert, ou -1 (pour le filtre : qui vient « de l'extérieur » ?). */
public int lanPort() { public int lanPort() {
return lanConnector.runningPort(); return lanConnector.runningPort();
@@ -11,8 +11,31 @@ import java.util.List;
* @param program exécutable visé par les règles (DM Loremind.exe en bureau) * @param program exécutable visé par les règles (DM Loremind.exe en bureau)
* @param networks réseaux connectés * @param networks réseaux connectés
* @param rules règles entrantes du pare-feu pour ce programme * @param rules règles entrantes du pare-feu pour ce programme
* @param thirdPartyFirewalls pare-feu tiers déclarés à Windows (Bitdefender, Norton…) : ils filtrent
* EN PLUS du pare-feu Windows, avec leurs propres règles, illisibles d'ici
* @param platform {@code windows} ou {@code linux}
* @param linuxFirewall Linux : pare-feu actif détecté ({@code ufw}, {@code firewalld}, {@code none})
* @param port port réseau de l'accès distant (Linux : port à ouvrir)
* @param portOpen Linux : port autorisé par le pare-feu ; {@code null} = impossible à savoir sans
* droits administrateur (ex. règles ufw illisibles)
*/ */
public record NetworkSnapshot(boolean supported, String program, List<Network> networks, List<FirewallRule> rules) { public record NetworkSnapshot(boolean supported, String program, List<Network> networks, List<FirewallRule> rules,
List<String> thirdPartyFirewalls, String platform, String linuxFirewall,
int port, Boolean portOpen) {
public static final String WINDOWS = "windows";
public static final String LINUX = "linux";
/** Instantané Windows (réseaux, règles du pare-feu, pare-feu tiers). */
public NetworkSnapshot(boolean supported, String program, List<Network> networks, List<FirewallRule> rules,
List<String> thirdPartyFirewalls) {
this(supported, program, networks, rules, thirdPartyFirewalls, WINDOWS, null, 0, null);
}
/** Instantané Linux : pare-feu actif et état du port quand il est lisible. */
public static NetworkSnapshot linux(String linuxFirewall, int port, Boolean portOpen) {
return new NetworkSnapshot(true, null, List.of(), List.of(), List.of(), LINUX, linuxFirewall, port, portOpen);
}
/** Catégorie Windows : {@code Public}, {@code Private} ou {@code DomainAuthenticated}. */ /** Catégorie Windows : {@code Public}, {@code Private} ou {@code DomainAuthenticated}. */
public record Network(String name, String alias, String category) {} public record Network(String name, String alias, String category) {}
@@ -25,6 +48,6 @@ public record NetworkSnapshot(boolean supported, String program, List<Network> n
public record FirewallRule(String action, String profile, String enabled) {} public record FirewallRule(String action, String profile, String enabled) {}
public static NetworkSnapshot unsupported() { public static NetworkSnapshot unsupported() {
return new NetworkSnapshot(false, null, List.of(), List.of()); return new NetworkSnapshot(false, null, List.of(), List.of(), List.of());
} }
} }
@@ -12,8 +12,8 @@ public interface HostNetworkAccess {
/** Résultat de la demande d'autorisation dans le pare-feu. */ /** Résultat de la demande d'autorisation dans le pare-feu. */
enum FirewallFixOutcome { APPLIED, CANCELLED, FAILED, UNSUPPORTED } enum FirewallFixOutcome { APPLIED, CANCELLED, FAILED, UNSUPPORTED }
/** Lecture seule, sans droits administrateur. */ /** Lecture seule, sans droits administrateur. {@code port} : port réseau de l'accès distant. */
NetworkSnapshot inspect(); NetworkSnapshot inspect(int port);
/** /**
* Autorise l'application en entrée sur les réseaux privés. Passe par la confirmation * Autorise l'application en entrée sur les réseaux privés. Passe par la confirmation
@@ -0,0 +1,34 @@
package com.loremind.infrastructure.desktop;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.loremind.domain.remoteaccess.NetworkSnapshot;
import com.loremind.domain.remoteaccess.ports.HostNetworkAccess;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import java.util.Locale;
/**
* Mode bureau : choisit l'accès au pare-feu selon le système — Windows (PowerShell, UAC),
* Linux (ufw / firewalld, lecture sans root), sinon rien à vérifier (macOS…).
*/
@Configuration
@Profile("local")
public class HostNetworkAccessConfig {
@Bean
public HostNetworkAccess hostNetworkAccess(ObjectMapper objectMapper) {
String os = System.getProperty("os.name", "").toLowerCase(Locale.ROOT);
if (os.startsWith("windows")) return new WindowsHostNetworkAccess(objectMapper);
if (os.contains("linux")) return new LinuxHostNetworkAccess();
return new UnsupportedHostNetworkAccess();
}
/** Système sans vérification prise en charge : le front n'affiche pas de diagnostic. */
static final class UnsupportedHostNetworkAccess implements HostNetworkAccess {
@Override public NetworkSnapshot inspect(int port) { return NetworkSnapshot.unsupported(); }
@Override public FirewallFixOutcome allowThroughFirewall() { return FirewallFixOutcome.UNSUPPORTED; }
@Override public void openNetworkSettings() { /* rien à ouvrir */ }
}
}
@@ -0,0 +1,120 @@
package com.loremind.infrastructure.desktop;
import com.loremind.domain.remoteaccess.NetworkSnapshot;
import com.loremind.domain.remoteaccess.ports.HostNetworkAccess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
/**
* Pare-feu sous Linux (Debian, Ubuntu, Fedora…) pour l'accès distant, SANS droits root.
* <p>
* Ce qu'on peut savoir sans root : quel pare-feu est actif — {@code ufw} via
* {@code /etc/ufw/ufw.conf} (lisible par tous), {@code firewalld} via {@code systemctl} — et,
* pour firewalld seulement, si le port est ouvert ({@code firewall-cmd --query-port}, autorisé
* aux utilisateurs). Les règles d'ufw ne se lisent qu'en root : l'état du port reste alors
* inconnu et le front affiche la commande à lancer. Pas d'autorisation en un clic : sur un
* serveur sans écran, aucune fenêtre ne peut demander le mot de passe administrateur.
* <p>
* Choisie au démarrage par {@code HostNetworkAccessConfig} sous Linux.
*/
public class LinuxHostNetworkAccess implements HostNetworkAccess {
private static final Logger log = LoggerFactory.getLogger(LinuxHostNetworkAccess.class);
private static final long COMMAND_TIMEOUT_S = 10;
static final String UFW = "ufw";
static final String FIREWALLD = "firewalld";
static final String NONE = "none";
private final Path ufwConf;
public LinuxHostNetworkAccess() {
this(Path.of("/etc/ufw/ufw.conf"));
}
LinuxHostNetworkAccess(Path ufwConf) {
this.ufwConf = ufwConf;
}
@Override
public NetworkSnapshot inspect(int port) {
if (ufwEnabled(readQuietly(ufwConf))) {
// Règles d'ufw illisibles sans root : état du port inconnu.
return NetworkSnapshot.linux(UFW, port, null);
}
if ("active".equals(run(List.of("systemctl", "is-active", FIREWALLD)).output().trim())) {
return NetworkSnapshot.linux(FIREWALLD, port, firewalldPortOpen(port));
}
return NetworkSnapshot.linux(NONE, port, null);
}
@Override
public FirewallFixOutcome allowThroughFirewall() {
return FirewallFixOutcome.UNSUPPORTED;
}
@Override
public void openNetworkSettings() {
// Pas de réglage réseau « Public / Privé » à basculer sous Linux.
}
/** {@code firewall-cmd --query-port} : « yes » (0) / « no » (1) ; autre = inconnu. */
private Boolean firewalldPortOpen(int port) {
Result r = run(List.of("firewall-cmd", "--query-port=" + port + "/tcp"));
return interpretQuery(r.exitCode(), r.output());
}
static Boolean interpretQuery(int exitCode, String output) {
String out = output == null ? "" : output.trim().toLowerCase(Locale.ROOT);
if (exitCode == 0 && out.startsWith("yes")) return true;
if (exitCode == 1 && out.startsWith("no")) return false;
return null;
}
/** {@code ENABLED=yes} dans ufw.conf (guillemets et casse tolérés). */
static boolean ufwEnabled(String conf) {
if (conf == null) return false;
return conf.lines()
.map(String::trim)
.filter(l -> !l.startsWith("#"))
.map(l -> l.replace("\"", "").replace("'", "").replace(" ", ""))
.anyMatch(l -> l.equalsIgnoreCase("ENABLED=yes"));
}
private static String readQuietly(Path file) {
try {
return Files.isReadable(file) ? Files.readString(file, StandardCharsets.UTF_8) : null;
} catch (IOException e) {
return null;
}
}
private record Result(int exitCode, String output) {}
/** Commande système sans shell (pas d'interprétation), avec délai ; absente → code -1. */
private static Result run(List<String> command) {
try {
Process p = new ProcessBuilder(command).redirectErrorStream(true).start();
p.getOutputStream().close();
if (!p.waitFor(COMMAND_TIMEOUT_S, TimeUnit.SECONDS)) {
p.destroyForcibly();
return new Result(-1, "");
}
return new Result(p.exitValue(), new String(p.getInputStream().readAllBytes(), StandardCharsets.UTF_8));
} catch (IOException e) {
log.debug("Commande {} indisponible : {}", command.get(0), e.getMessage());
return new Result(-1, "");
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return new Result(-1, "");
}
}
}
@@ -6,8 +6,6 @@ import com.loremind.domain.remoteaccess.NetworkSnapshot;
import com.loremind.domain.remoteaccess.ports.HostNetworkAccess; import com.loremind.domain.remoteaccess.ports.HostNetworkAccess;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@@ -31,9 +29,9 @@ import java.util.concurrent.TimeUnit;
* Les scripts sont passés en {@code -EncodedCommand} (UTF-16LE base64) : aucun problème de * Les scripts sont passés en {@code -EncodedCommand} (UTF-16LE base64) : aucun problème de
* guillemets ni d'accents. Le seul paramètre variable est le chemin de l'exécutable, * guillemets ni d'accents. Le seul paramètre variable est le chemin de l'exécutable,
* fourni par le système (pas par l'utilisateur), et échappé pour une chaîne PowerShell. * fourni par le système (pas par l'utilisateur), et échappé pour une chaîne PowerShell.
* <p>
* Choisie au démarrage par {@code HostNetworkAccessConfig} sous Windows.
*/ */
@Component
@Profile("local")
public class WindowsHostNetworkAccess implements HostNetworkAccess { public class WindowsHostNetworkAccess implements HostNetworkAccess {
private static final Logger log = LoggerFactory.getLogger(WindowsHostNetworkAccess.class); private static final Logger log = LoggerFactory.getLogger(WindowsHostNetworkAccess.class);
@@ -52,7 +50,7 @@ public class WindowsHostNetworkAccess implements HostNetworkAccess {
} }
@Override @Override
public NetworkSnapshot inspect() { public NetworkSnapshot inspect(int port) {
String program = currentProgram(); String program = currentProgram();
if (!isWindows() || program == null) return NetworkSnapshot.unsupported(); if (!isWindows() || program == null) return NetworkSnapshot.unsupported();
try { try {
@@ -117,7 +115,12 @@ public class WindowsHostNetworkAccess implements HostNetworkAccess {
+ "([Environment]::ExpandEnvironmentVariables($_.Program) -ieq $p) } | Get-NetFirewallRule | " + "([Environment]::ExpandEnvironmentVariables($_.Program) -ieq $p) } | Get-NetFirewallRule | "
+ "Where-Object { $_.Direction.ToString() -eq 'Inbound' } | ForEach-Object { [pscustomobject]@{ " + "Where-Object { $_.Direction.ToString() -eq 'Inbound' } | ForEach-Object { [pscustomobject]@{ "
+ "action = $_.Action.ToString(); profile = $_.Profile.ToString(); enabled = $_.Enabled.ToString() } })\n" + "action = $_.Action.ToString(); profile = $_.Profile.ToString(); enabled = $_.Enabled.ToString() } })\n"
+ "[pscustomobject]@{ networks = $nets; rules = $rules } | ConvertTo-Json -Depth 4 -Compress\n"; // Pare-feu TIERS déclarés au Centre de sécurité (le pare-feu Windows n'y figure pas) :
// ils filtrent en plus de Windows, avec des règles qu'on ne peut pas lire.
+ "$fw = @(Get-CimInstance -Namespace root/SecurityCenter2 -ClassName FirewallProduct | "
+ "ForEach-Object { $_.displayName } | Where-Object { $_ -and $_ -notmatch 'Windows' })\n"
+ "[pscustomobject]@{ networks = $nets; rules = $rules; thirdPartyFirewalls = $fw } | "
+ "ConvertTo-Json -Depth 4 -Compress\n";
} }
/** /**
@@ -150,7 +153,11 @@ public class WindowsHostNetworkAccess implements HostNetworkAccess {
for (JsonNode r : array(root.path("rules"))) { for (JsonNode r : array(root.path("rules"))) {
rules.add(new NetworkSnapshot.FirewallRule(text(r, "action"), text(r, "profile"), text(r, "enabled"))); rules.add(new NetworkSnapshot.FirewallRule(text(r, "action"), text(r, "profile"), text(r, "enabled")));
} }
return new NetworkSnapshot(true, program, networks, rules); List<String> thirdParty = new ArrayList<>();
for (JsonNode f : array(root.path("thirdPartyFirewalls"))) {
if (f.isTextual() && !f.asText().isBlank()) thirdParty.add(f.asText());
}
return new NetworkSnapshot(true, program, networks, rules, thirdParty);
} }
/** ConvertTo-Json écrit un objet seul (pas un tableau) quand la liste n'a qu'un élément. */ /** ConvertTo-Json écrit un objet seul (pas un tableau) quand la liste n'a qu'un élément. */
@@ -61,14 +61,14 @@ public class RemoteAccessAdminController {
/** Une tablette peut-elle joindre ce PC ? (type de réseau, règle du pare-feu) */ /** Une tablette peut-elle joindre ce PC ? (type de réseau, règle du pare-feu) */
@GetMapping("/network-check") @GetMapping("/network-check")
public NetworkReadiness networkCheck() { public NetworkReadiness networkCheck() {
return NetworkReadiness.evaluate(hostNetworkAccess.inspect()); return NetworkReadiness.evaluate(hostNetworkAccess.inspect(remoteAccessService.configuredPort()));
} }
/** Ajoute la règle du pare-feu ; attend la réponse de l'utilisateur à la confirmation Windows (UAC). */ /** Ajoute la règle du pare-feu ; attend la réponse de l'utilisateur à la confirmation Windows (UAC). */
@PostMapping("/firewall-rule") @PostMapping("/firewall-rule")
public FirewallFixResponse allowThroughFirewall() { public FirewallFixResponse allowThroughFirewall() {
HostNetworkAccess.FirewallFixOutcome outcome = hostNetworkAccess.allowThroughFirewall(); HostNetworkAccess.FirewallFixOutcome outcome = hostNetworkAccess.allowThroughFirewall();
return new FirewallFixResponse(outcome, NetworkReadiness.evaluate(hostNetworkAccess.inspect())); return new FirewallFixResponse(outcome, NetworkReadiness.evaluate(hostNetworkAccess.inspect(remoteAccessService.configuredPort())));
} }
/** Ouvre les réglages réseau de Windows (pour passer un Wi-Fi « Public » en « Privé »). */ /** Ouvre les réglages réseau de Windows (pour passer un Wi-Fi « Public » en « Privé »). */
@@ -17,7 +17,7 @@ class NetworkReadinessTest {
private static final FirewallRule ALLOW_PRIVATE = new FirewallRule("Allow", "Private", "True"); private static final FirewallRule ALLOW_PRIVATE = new FirewallRule("Allow", "Private", "True");
private static NetworkReadiness eval(List<Network> networks, List<FirewallRule> rules) { private static NetworkReadiness eval(List<Network> networks, List<FirewallRule> rules) {
return NetworkReadiness.evaluate(new NetworkSnapshot(true, "C:\\DM Loremind.exe", networks, rules)); return NetworkReadiness.evaluate(new NetworkSnapshot(true, "C:\\DM Loremind.exe", networks, rules, List.of()));
} }
@Test @Test
@@ -71,9 +71,48 @@ class NetworkReadinessTest {
assertTrue(eval(List.of(HOME_PRIVATE), List.of(new FirewallRule("Allow", "Any", "True"))).ready()); assertTrue(eval(List.of(HOME_PRIVATE), List.of(new FirewallRule("Allow", "Any", "True"))).ready());
} }
@Test
void thirdPartyFirewall_isReported_withoutPretendingToKnowItsRules() {
// Cas réel du 2026-10-17 : Windows prêt, mais Bitdefender filtre en plus avec ses propres règles.
NetworkReadiness r = NetworkReadiness.evaluate(new NetworkSnapshot(true, "C:\\DM Loremind.exe",
List.of(HOME_PRIVATE), List.of(ALLOW_PRIVATE), List.of("Bitdefender Pare-feu")));
assertTrue(r.ready(), "Windows est prêt…");
assertEquals(List.of("Bitdefender Pare-feu"), r.thirdPartyFirewalls(), "…mais le pare-feu tiers est signalé");
}
@Test @Test
void publicNetwork_withoutName_usesInterfaceAlias() { void publicNetwork_withoutName_usesInterfaceAlias() {
NetworkReadiness r = eval(List.of(new Network(null, "Wi-Fi", "Public")), List.of(ALLOW_PRIVATE)); NetworkReadiness r = eval(List.of(new Network(null, "Wi-Fi", "Public")), List.of(ALLOW_PRIVATE));
assertEquals(List.of("Wi-Fi"), r.publicNetworks()); assertEquals(List.of("Wi-Fi"), r.publicNetworks());
} }
// --- Linux ---
@Test
void linux_withoutFirewall_isReady() {
NetworkReadiness r = NetworkReadiness.evaluate(NetworkSnapshot.linux("none", 8765, null));
assertTrue(r.ready());
assertEquals("linux", r.platform());
assertNull(r.fixCommand());
}
@Test
void linux_ufw_portUnknown_proposesTheCommand() {
NetworkReadiness r = NetworkReadiness.evaluate(NetworkSnapshot.linux("ufw", 8765, null));
assertFalse(r.ready());
assertNull(r.portOpen());
assertEquals("sudo ufw allow 8765/tcp", r.fixCommand());
}
@Test
void linux_firewalld_closedThenOpen() {
NetworkReadiness closed = NetworkReadiness.evaluate(NetworkSnapshot.linux("firewalld", 9000, false));
assertFalse(closed.ready());
assertEquals("sudo firewall-cmd --permanent --add-port=9000/tcp && sudo firewall-cmd --reload", closed.fixCommand());
NetworkReadiness open = NetworkReadiness.evaluate(NetworkSnapshot.linux("firewalld", 9000, true));
assertTrue(open.ready());
assertNull(open.fixCommand());
}
} }
@@ -0,0 +1,56 @@
package com.loremind.infrastructure.desktop;
import com.loremind.domain.remoteaccess.NetworkSnapshot;
import com.loremind.domain.remoteaccess.ports.HostNetworkAccess;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import java.nio.file.Files;
import java.nio.file.Path;
import static org.junit.jupiter.api.Assertions.*;
/**
* Test de {@link LinuxHostNetworkAccess} : lecture de ufw.conf, interprétation de
* {@code firewall-cmd --query-port}, et cas ufw actif sans droits root (port inconnu).
*/
class LinuxHostNetworkAccessTest {
@Test
void ufwEnabled_readsTheConfigFile() {
assertTrue(LinuxHostNetworkAccess.ufwEnabled("# commentaire\nENABLED=yes\nLOGLEVEL=low"));
assertTrue(LinuxHostNetworkAccess.ufwEnabled("ENABLED=\"yes\""));
assertFalse(LinuxHostNetworkAccess.ufwEnabled("ENABLED=no"));
assertFalse(LinuxHostNetworkAccess.ufwEnabled("#ENABLED=yes"));
assertFalse(LinuxHostNetworkAccess.ufwEnabled(null));
}
@Test
void firewalldQuery_yesNoOrUnknown() {
assertEquals(Boolean.TRUE, LinuxHostNetworkAccess.interpretQuery(0, "yes\n"));
assertEquals(Boolean.FALSE, LinuxHostNetworkAccess.interpretQuery(1, "no\n"));
// Refus D-Bus / commande absente : on ne prétend rien.
assertNull(LinuxHostNetworkAccess.interpretQuery(-1, ""));
assertNull(LinuxHostNetworkAccess.interpretQuery(11, "Authorization failed."));
}
@Test
void activeUfw_meansPortUnknownWithoutRoot(@TempDir Path dir) throws Exception {
Path conf = dir.resolve("ufw.conf");
Files.writeString(conf, "ENABLED=yes\n");
NetworkSnapshot s = new LinuxHostNetworkAccess(conf).inspect(8765);
assertTrue(s.supported());
assertEquals("linux", s.platform());
assertEquals("ufw", s.linuxFirewall());
assertEquals(8765, s.port());
assertNull(s.portOpen());
}
@Test
void noOneClickFixOnLinux() {
assertEquals(HostNetworkAccess.FirewallFixOutcome.UNSUPPORTED,
new LinuxHostNetworkAccess(Path.of("absent")).allowThroughFirewall());
}
}
@@ -33,6 +33,18 @@ class WindowsHostNetworkAccessTest {
assertEquals("Private", s.networks().get(0).category()); assertEquals("Private", s.networks().get(0).category());
assertEquals(2, s.rules().size()); assertEquals(2, s.rules().size());
assertEquals("Block", s.rules().get(1).action()); assertEquals("Block", s.rules().get(1).action());
assertTrue(s.thirdPartyFirewalls().isEmpty());
}
@Test
void parse_readsThirdPartyFirewalls_asSingleValueOrArray() throws Exception {
NetworkSnapshot one = WindowsHostNetworkAccess.parseSnapshot(mapper, "C:\\app.exe",
"{\"networks\":[],\"rules\":[],\"thirdPartyFirewalls\":\"Bitdefender Pare-feu\"}");
assertEquals(java.util.List.of("Bitdefender Pare-feu"), one.thirdPartyFirewalls());
NetworkSnapshot two = WindowsHostNetworkAccess.parseSnapshot(mapper, "C:\\app.exe",
"{\"networks\":[],\"rules\":[],\"thirdPartyFirewalls\":[\"Norton\",\"\"]}");
assertEquals(java.util.List.of("Norton"), two.thirdPartyFirewalls());
} }
@Test @Test
@@ -55,6 +67,7 @@ class WindowsHostNetworkAccessTest {
assertFalse(allow.contains("Public"), "la règle ne doit jamais ouvrir les réseaux publics"); assertFalse(allow.contains("Public"), "la règle ne doit jamais ouvrir les réseaux publics");
assertTrue(allow.contains("Remove-NetFirewallRule"), "les blocages de CE programme sont retirés"); assertTrue(allow.contains("Remove-NetFirewallRule"), "les blocages de CE programme sont retirés");
assertTrue(WindowsHostNetworkAccess.inspectScript(path).contains("ConvertTo-Json")); assertTrue(WindowsHostNetworkAccess.inspectScript(path).contains("ConvertTo-Json"));
assertTrue(WindowsHostNetworkAccess.inspectScript(path).contains("SecurityCenter2"));
} }
@Test @Test
@@ -66,8 +79,9 @@ class WindowsHostNetworkAccessTest {
@Test @Test
@EnabledOnOs(OS.WINDOWS) @EnabledOnOs(OS.WINDOWS)
void inspect_readsTheRealSystem_onWindows() { void inspect_readsTheRealSystem_onWindows() {
NetworkSnapshot s = new WindowsHostNetworkAccess(mapper).inspect(); NetworkSnapshot s = new WindowsHostNetworkAccess(mapper).inspect(8765);
assertTrue(s.supported(), "PowerShell doit répondre en lecture seule sur Windows"); assertTrue(s.supported(), "PowerShell doit répondre en lecture seule sur Windows");
assertNotNull(s.program()); assertNotNull(s.program());
assertNotNull(s.thirdPartyFirewalls());
} }
} }
+18 -7
View File
@@ -133,19 +133,30 @@ test.describe('Shell mobile (375 px)', () => {
await page.getByRole('button', { name: "Ouvrir l'arborescence" }).tap(); await page.getByRole('button', { name: "Ouvrir l'arborescence" }).tap();
await expect(tree).toBeVisible(); await expect(tree).toBeVisible();
// Déplie « Scènes » puis l'arc / le chapitre jusqu'à la scène, au doigt. // Navigation par niveaux : toucher une ligne qui a des enfants « entre » dedans
for (const label of [/Scènes/, new RegExp(arc.name), new RegExp(chapter.name)]) { // (sans quitter le volet), jusqu'à la scène. Mode plat ou arc/chapitre selon le seed.
const row = tree.locator('.tree-row', { has: page.locator('.tree-btn', { hasText: label }) }).first(); const sceneRow = tree.locator('.drill-row', { hasText: scene.name });
if (await tree.getByRole('button', { name: scene.name }).isVisible()) break; for (const label of ['Scènes', arc.name, chapter.name]) {
const chevron = row.locator('.chevron-btn'); if (await sceneRow.isVisible()) break;
if (await chevron.count()) await chevron.tap(); const row = tree.locator('.drill-row', { hasText: label }).first();
if (await row.count()) {
await row.tap();
await expect(tree.locator('.drill-back')).toBeVisible();
await expect(tree).toBeVisible();
}
} }
await tree.getByRole('button', { name: scene.name }).tap(); await sceneRow.tap();
await expect(page).toHaveURL(new RegExp(`/scenes/${scene.id}$`)); await expect(page).toHaveURL(new RegExp(`/scenes/${scene.id}$`));
await expect(page.getByRole('heading', { level: 1, name: scene.name })).toBeVisible(); await expect(page.getByRole('heading', { level: 1, name: scene.name })).toBeVisible();
await expect(tree).toBeHidden(); await expect(tree).toBeHidden();
await expectNoHorizontalScroll(page); await expectNoHorizontalScroll(page);
// En rouvrant le volet, on retrouve le niveau de la scène, surlignée ; « retour » remonte.
await page.getByRole('button', { name: "Ouvrir l'arborescence" }).tap();
await expect(tree.locator('.drill-row.active', { hasText: scene.name })).toBeVisible();
await tree.locator('.drill-back').tap();
await expect(tree.locator('.drill-row.active', { hasText: scene.name })).toHaveCount(0);
}); });
test('écran de séance : journal et horloges lisibles sans scroll horizontal', async ({ page, request }) => { test('écran de séance : journal et horloges lisibles sans scroll horizontal', async ({ page, request }) => {
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "loremind-web", "name": "loremind-web",
"version": "1.0.3", "version": "1.3.0-beta",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "loremind-web", "name": "loremind-web",
"version": "1.0.3", "version": "1.3.0-beta",
"dependencies": { "dependencies": {
"@angular/animations": "^21.2.17", "@angular/animations": "^21.2.17",
"@angular/cdk": "^21.2.14", "@angular/cdk": "^21.2.14",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "loremind-web", "name": "loremind-web",
"version": "1.0.3", "version": "1.3.0-beta",
"description": "LoreMind Frontend - Angular", "description": "LoreMind Frontend - Angular",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
@@ -38,7 +38,16 @@ export interface NetworkReadiness {
publicNetworks: string[]; publicNetworks: string[];
firewallAllowed: boolean; firewallAllowed: boolean;
firewallBlocked: boolean; firewallBlocked: boolean;
/** Pare-feu tiers (Bitdefender…) : ils filtrent en plus de Windows, réglages illisibles d'ici. */
thirdPartyFirewalls: string[];
program?: string | null; program?: string | null;
platform?: 'windows' | 'linux' | null;
/** Linux : pare-feu actif (ufw, firewalld) ou « none ». */
linuxFirewall?: string | null;
/** Linux : port autorisé ; null = invérifiable sans droits administrateur (ufw). */
portOpen?: boolean | null;
/** Linux : commande à lancer sur la machine pour ouvrir le port. */
fixCommand?: string | null;
} }
export type FirewallFixOutcome = 'APPLIED' | 'CANCELLED' | 'FAILED' | 'UNSUPPORTED'; export type FirewallFixOutcome = 'APPLIED' | 'CANCELLED' | 'FAILED' | 'UNSUPPORTED';
@@ -37,12 +37,37 @@
</div> </div>
@if (network?.supported) { @if (network?.supported) {
<div class="remote-block network-check" [class.ok]="network!.ready"> <div class="remote-block network-check" [class.ok]="allClear">
<h3>{{ 'remoteAccess.network.title' | translate }}</h3> <h3>{{ 'remoteAccess.network.title' | translate }}</h3>
@if (network!.ready) { @if (isLinux) {
<!-- Linux : état du pare-feu lisible sans root, sinon commande à lancer sur la machine. -->
@if (network!.ready) {
<p class="check-ok">
<lucide-icon [img]="CheckCircle2" [size]="16"></lucide-icon>
{{ (network!.linuxFirewall === 'none' ? 'remoteAccess.network.linuxNone' : 'remoteAccess.network.linuxOpen')
| translate: { fw: network!.linuxFirewall, port: s.port } }}
</p>
} @else {
<div class="check-item">
<p class="check-problem">
{{ (network!.portOpen === false ? 'remoteAccess.network.linuxClosed' : 'remoteAccess.network.linuxUnknown')
| translate: { fw: network!.linuxFirewall, port: s.port } }}
</p>
@if (network!.fixCommand) {
<div class="command-row">
<code class="command">{{ network!.fixCommand }}</code>
<button type="button" class="btn-secondary" (click)="copyFixCommand()">
<lucide-icon [img]="Copy" [size]="14"></lucide-icon>
{{ (copied ? 'remoteAccess.network.copied' : 'remoteAccess.network.copy') | translate }}
</button>
</div>
}
</div>
}
} @else if (network!.ready) {
<p class="check-ok"> <p class="check-ok">
<lucide-icon [img]="CheckCircle2" [size]="16"></lucide-icon> <lucide-icon [img]="CheckCircle2" [size]="16"></lucide-icon>
{{ 'remoteAccess.network.ready' | translate }} {{ (thirdPartyFirewalls.length > 0 ? 'remoteAccess.network.windowsReady' : 'remoteAccess.network.ready') | translate }}
</p> </p>
} @else { } @else {
@if (network!.publicNetworks.length > 0) { @if (network!.publicNetworks.length > 0) {
@@ -68,6 +93,15 @@
</div> </div>
} }
} }
@if (thirdPartyFirewalls.length > 0) {
<div class="check-item">
<p class="check-problem">{{ 'remoteAccess.network.thirdParty' | translate: { names: thirdPartyFirewalls.join(', ') } }}</p>
<p class="note">{{ 'remoteAccess.network.thirdPartyHowTo' | translate }}</p>
<a class="btn-link" [href]="'remoteAccess.network.docUrl' | translate" target="_blank" rel="noopener">
{{ 'remoteAccess.network.docLink' | translate }}
</a>
</div>
}
@if (fixMessage) { @if (fixMessage) {
<p class="fix-message" role="status">{{ fixMessage }}</p> <p class="fix-message" role="status">{{ fixMessage }}</p>
} }
@@ -231,3 +231,25 @@
&:disabled { opacity: 0.6; cursor: wait; } &:disabled { opacity: 0.6; cursor: wait; }
&:focus-visible { outline: 2px solid #6c63ff; border-radius: 4px; } &:focus-visible { outline: 2px solid #6c63ff; border-radius: 4px; }
} }
// Linux : commande d'ouverture du port, sélectionnable et copiable.
.command-row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem;
max-width: 100%;
}
.command {
flex: 1 1 260px;
min-width: 0;
padding: 0.55rem 0.75rem;
border-radius: 6px;
background: #0b0b16;
border: 1px solid #2a2a45;
color: #c7d2fe;
font-size: 0.85rem;
overflow-wrap: anywhere;
user-select: all;
}
@@ -3,7 +3,7 @@ import { FormsModule } from '@angular/forms';
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import { LucideAngularModule, Tablet, Trash2, RefreshCw, AlertCircle, ShieldCheck, CheckCircle2, Settings2 } from 'lucide-angular'; import { LucideAngularModule, Tablet, Trash2, RefreshCw, AlertCircle, ShieldCheck, CheckCircle2, Settings2, Copy } from 'lucide-angular';
import QRCode from 'qrcode'; import QRCode from 'qrcode';
import { import {
@@ -30,6 +30,8 @@ export class RemoteAccessSectionComponent implements OnInit, OnDestroy {
readonly ShieldCheck = ShieldCheck; readonly ShieldCheck = ShieldCheck;
readonly CheckCircle2 = CheckCircle2; readonly CheckCircle2 = CheckCircle2;
readonly Settings2 = Settings2; readonly Settings2 = Settings2;
readonly Copy = Copy;
copied = false;
private readonly remoteAccess = inject(RemoteAccessService); private readonly remoteAccess = inject(RemoteAccessService);
private readonly translate = inject(TranslateService); private readonly translate = inject(TranslateService);
@@ -188,8 +190,34 @@ export class RemoteAccessSectionComponent implements OnInit, OnDestroy {
this.remoteAccess.openNetworkSettings().subscribe({ error: () => undefined }); this.remoteAccess.openNetworkSettings().subscribe({ error: () => undefined });
} }
/** Vert seulement si rien ne bloque côté Windows ET qu'aucun pare-feu tiers n'échappe à la vérification. */
get allClear(): boolean {
return !!this.network && this.network.ready && this.thirdPartyFirewalls.length === 0;
}
get thirdPartyFirewalls(): string[] {
return this.network?.thirdPartyFirewalls ?? [];
}
get isLinux(): boolean {
return this.network?.platform === 'linux';
}
get firewallNeedsFix(): boolean { get firewallNeedsFix(): boolean {
return !!this.network && (!this.network.firewallAllowed || this.network.firewallBlocked); return !!this.network && !this.isLinux && (!this.network.firewallAllowed || this.network.firewallBlocked);
}
/** Linux : copie la commande d'ouverture du port (à lancer sur le serveur). */
async copyFixCommand(): Promise<void> {
const command = this.network?.fixCommand;
if (!command) return;
try {
await navigator.clipboard.writeText(command);
this.copied = true;
setTimeout(() => this.copied = false, 2000);
} catch {
this.copied = false; // presse-papiers indisponible : la commande reste lisible et sélectionnable
}
} }
/** Le QR code ouvre directement l'écran d'appairage avec le code pré-rempli. */ /** Le QR code ouvre directement l'écran d'appairage avec le code pré-rempli. */
@@ -13,61 +13,122 @@
} }
@if (!collapsed) { @if (!collapsed) {
@if (titleRoute) { <!-- Niveau ouvert en mode tiroir : son propre en-tête (retour, titre, actions). -->
<button @if (drawerMode && drillLevel; as level) {
type="button" <div class="drill-header">
class="sidebar-title sidebar-title--link" <button type="button" class="drill-back" (click)="drillBack()">
[class.active]="isTitleActive()" <lucide-icon [img]="ArrowLeft" [size]="18"></lucide-icon>
[title]="'secondarySidebar.backToCampaignHome' | translate" <span class="drill-back-label">{{ drillBackLabel }}</span>
(click)="clickTitle()"> </button>
<lucide-icon [img]="Home" [size]="14" class="sidebar-title-icon"></lucide-icon> <h2 #drillTitle class="drill-title" tabindex="-1">{{ level.label }}</h2>
<span class="sidebar-title-text">{{ title }}</span> @if (level.route || level.createActions?.length) {
</button> <div class="drill-actions">
} @else { @if (level.route) {
<h2 class="sidebar-title">{{ title }}</h2> <button type="button" class="drill-action" (click)="openDrillLevel()">
} <lucide-icon [img]="ExternalLink" [size]="15"></lucide-icon>
@if (createActions.length) { {{ 'treeDrill.open' | translate }}
<div class="actions-row"> </button>
@for (action of createActions; track action) { }
<button @for (a of level.createActions; track a.id) {
class="btn-pill" <button type="button" class="drill-action" (click)="runCreateAction($event, a)">
[class.primary]="action.variant === 'primary'" <lucide-icon [img]="iconForAction(a)" [size]="15"></lucide-icon>
[class.secondary]="action.variant === 'secondary'" {{ a.label }}
(click)="runAction(action)"> </button>
{{ action.label }} }
</button> </div>
} }
</div> </div>
} @else {
@if (titleRoute) {
<button
type="button"
class="sidebar-title sidebar-title--link"
[class.active]="isTitleActive()"
[title]="'secondarySidebar.backToCampaignHome' | translate"
(click)="clickTitle()">
<lucide-icon [img]="Home" [size]="14" class="sidebar-title-icon"></lucide-icon>
<span class="sidebar-title-text">{{ title }}</span>
</button>
} @else {
<h2 class="sidebar-title">{{ title }}</h2>
}
@if (createActions.length) {
<div class="actions-row">
@for (action of createActions; track action) {
<button
class="btn-pill"
[class.primary]="action.variant === 'primary'"
[class.secondary]="action.variant === 'secondary'"
(click)="runAction(action)">
{{ action.label }}
</button>
}
</div>
}
} }
<!-- cdkDropListGroup : connecte toutes les drop lists de l'arbre (déplacement d'un <!-- cdkDropListGroup : connecte toutes les drop lists de l'arbre (déplacement d'un
nœud d'une liste à l'autre). Chaque ligne est un <app-sidebar-tree-node> : nœud d'une liste à l'autre). Chaque ligne est un <app-sidebar-tree-node> :
comme c'est un VRAI composant déclaré statiquement dans la drop list, son comme c'est un VRAI composant déclaré statiquement dans la drop list, son
cdkDrag résout sa drop list par DI (impossible via un template outlet-é). --> cdkDrag résout sa drop list par DI (impossible via un template outlet-é). -->
<div class="tree"> @if (drawerMode) {
<div class="tree-list" cdkDropList <nav class="drill-list" [attr.aria-label]="drillLevel?.label || title">
id="sidebar-root" @for (item of drillRows; track item.id; let first = $first) {
[cdkDropListData]="rootDragData" @if (!drillLevel && item.sectionHeaderBefore) {
[cdkDropListConnectedTo]="dropListIds"
[cdkDropListDisabled]="!dndEnabled()"
[cdkDropListEnterPredicate]="rootEnterPredicate"
(cdkDropListDropped)="onDrop(null, $event)">
@for (item of items; track item.id; let first = $first) {
<!-- En-tête de section RENDU HORS du nœud (sinon il serait emporté par le
drag du premier item). C'est un élément non-déplaçable de la drop list. -->
@if (item.sectionHeaderBefore) {
<div class="tree-section-header" [class.first]="first">{{ item.sectionHeaderBefore }}</div> <div class="tree-section-header" [class.first]="first">{{ item.sectionHeaderBefore }}</div>
} }
@if (dndEnabled() && item.dragKind) { <button type="button" class="drill-row"
<app-sidebar-tree-node cdkDrag [cdkDragData]="item" cdkDragLockAxis="y" [class.active]="isActive(item)"
[item]="item" [level]="0"></app-sidebar-tree-node> [class.action]="item.isAction"
} @else { [attr.aria-current]="isActive(item) ? 'page' : null"
<app-sidebar-tree-node [item]="item" [level]="0"></app-sidebar-tree-node> (click)="tapDrillRow(item)">
} @if (iconFor(item); as icon) {
<lucide-icon [img]="icon" [size]="17" class="drill-icon"></lucide-icon>
}
@if (item.statusDot) {
<span class="status-dot"
[class.blocking]="item.statusDot === 'blocking'"
[class.recommended]="item.statusDot === 'recommended'"
[title]="item.statusDotTitle || (('readiness.dot.' + item.statusDot) | translate)"></span>
}
<span class="drill-label">{{ item.label }}</span>
@if (!item.isAction && drillCount(item); as count) {
<span class="drill-count">{{ count }}</span>
}
@if (canDrill(item)) {
<lucide-icon [img]="ChevronRight" [size]="18" class="drill-chevron"></lucide-icon>
}
</button>
} @empty {
<p class="drill-empty">{{ 'treeDrill.empty' | translate }}</p>
} }
</nav>
} @else {
<div class="tree">
<div class="tree-list" cdkDropList
id="sidebar-root"
[cdkDropListData]="rootDragData"
[cdkDropListConnectedTo]="dropListIds"
[cdkDropListDisabled]="!dndEnabled()"
[cdkDropListEnterPredicate]="rootEnterPredicate"
(cdkDropListDropped)="onDrop(null, $event)">
@for (item of items; track item.id; let first = $first) {
<!-- En-tête de section RENDU HORS du nœud (sinon il serait emporté par le
drag du premier item). C'est un élément non-déplaçable de la drop list. -->
@if (item.sectionHeaderBefore) {
<div class="tree-section-header" [class.first]="first">{{ item.sectionHeaderBefore }}</div>
}
@if (dndEnabled() && item.dragKind) {
<app-sidebar-tree-node cdkDrag [cdkDragData]="item" cdkDragLockAxis="y"
[item]="item" [level]="0"></app-sidebar-tree-node>
} @else {
<app-sidebar-tree-node [item]="item" [level]="0"></app-sidebar-tree-node>
}
}
</div>
</div> </div>
</div> }
<!-- Panneau bas (ex: Templates) ------------------------------------ --> <!-- Panneau bas (ex: Templates) : à la racine seulement en mode tiroir. -->
@if (bottomPanel) { @if (bottomPanel && !(drawerMode && drillLevel)) {
<section class="bottom-panel"> <section class="bottom-panel">
<div class="panel-header-row"> <div class="panel-header-row">
<button class="panel-header" (click)="togglePanel()"> <button class="panel-header" (click)="togglePanel()">
@@ -15,8 +15,10 @@
// Tiroir (shell < 1024 px) : largeur confortable au doigt, plafonnée par l'écran. // Tiroir (shell < 1024 px) : largeur confortable au doigt, plafonnée par l'écran.
&.drawer { &.drawer {
width: min(320px, 88vw); // Téléphone : presque tout l'écran ; tablette : assez large pour des titres sur une ligne.
width: min(400px, 88vw);
padding: 1rem 0.75rem; padding: 1rem 0.75rem;
overflow-y: auto;
} }
&.collapsed { &.collapsed {
@@ -264,3 +266,143 @@
.panel-header-action { width: 36px; height: 36px; } .panel-header-action { width: 36px; height: 36px; }
.panel-header, .panel-item { min-height: 40px; } .panel-header, .panel-item { min-height: 40px; }
} }
// --- Navigation par niveaux (mode tiroir) ------------------------------------------------
.drill-header {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid #1e1e3a;
}
.drill-back {
display: inline-flex;
align-items: center;
gap: 0.4rem;
align-self: flex-start;
max-width: 100%;
min-height: 44px;
padding: 0 0.6rem 0 0.25rem;
border: none;
border-radius: 8px;
background: transparent;
color: #a5b4fc;
font-size: 0.92rem;
cursor: pointer;
&:hover { background: rgba(138, 123, 200, 0.12); }
&:focus-visible { outline: 2px solid #6c63ff; }
}
.drill-back-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.drill-title {
margin: 0;
padding: 0 0.25rem;
font-size: 1.1rem;
font-weight: 700;
line-height: 1.3;
color: white;
overflow-wrap: anywhere;
&:focus { outline: none; }
}
.drill-actions {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.drill-action {
display: inline-flex;
align-items: center;
gap: 0.4rem;
min-height: 44px;
padding: 0 0.85rem;
border: 1px solid #2a2a45;
border-radius: 8px;
background: #161628;
color: #e5e7eb;
font-size: 0.88rem;
cursor: pointer;
&:hover { border-color: #6c63ff; }
&:focus-visible { outline: 2px solid #6c63ff; outline-offset: 2px; }
}
.drill-list {
display: flex;
flex-direction: column;
min-height: 0;
}
.drill-row {
display: flex;
align-items: center;
gap: 0.6rem;
width: 100%;
min-height: 48px;
padding: 0.55rem 0.5rem;
border: none;
border-bottom: 1px solid rgba(30, 30, 58, 0.8);
border-radius: 0;
background: transparent;
color: #e5e7eb;
font-size: 0.95rem;
text-align: left;
cursor: pointer;
&:hover { background: rgba(138, 123, 200, 0.08); }
&:focus-visible { outline: 2px solid #6c63ff; outline-offset: -2px; }
&.active { background: rgba(108, 99, 255, 0.16); color: white; }
&.action { color: #a5b4fc; }
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
&.blocking { background: #ef4444; }
&.recommended { background: #fb923c; }
}
}
.drill-icon { flex-shrink: 0; color: #9ca3af; }
// Titres longs : deux lignes au plus, puis points de suspension.
.drill-label {
flex: 1;
min-width: 0;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.35;
}
.drill-count {
flex-shrink: 0;
min-width: 1.6rem;
padding: 0.1rem 0.45rem;
border-radius: 999px;
background: #1f2937;
color: #9ca3af;
font-size: 0.75rem;
text-align: center;
font-variant-numeric: tabular-nums;
}
.drill-chevron { flex-shrink: 0; color: #6b7280; }
.drill-empty {
margin: 1rem 0.5rem;
color: #6b7280;
font-size: 0.88rem;
}
@@ -1,13 +1,15 @@
import { Component, Input, Output, EventEmitter, HostListener, OnDestroy, ElementRef, forwardRef } from '@angular/core'; import { Component, Input, Output, EventEmitter, HostListener, OnDestroy, ElementRef, ViewChild, forwardRef } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Router } from '@angular/router'; import { NavigationEnd, Router } from '@angular/router';
import { Subscription, filter } from 'rxjs';
import { TranslatePipe } from '@ngx-translate/core'; import { TranslatePipe } from '@ngx-translate/core';
import { CdkDropList, CdkDrag, CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; import { CdkDropList, CdkDrag, CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
import { LucideAngularModule, ChevronRight, ChevronDown, PanelLeftClose, PanelLeftOpen, Plus, FolderPlus, FilePlus, Home, LucideIconData } from 'lucide-angular'; import { LucideAngularModule, ChevronRight, ChevronDown, PanelLeftClose, PanelLeftOpen, Plus, FolderPlus, FilePlus, Home, ArrowLeft, ExternalLink, LucideIconData } from 'lucide-angular';
import { TreeItem, TreeCreateAction, SidebarAction, BottomPanel, BottomPanelItem, LayoutService, ReorderKind, SidebarReorderContext } from '../../services/layout.service'; import { TreeItem, TreeCreateAction, SidebarAction, BottomPanel, BottomPanelItem, LayoutService, ReorderKind, SidebarReorderContext } from '../../services/layout.service';
import { SidebarReorderService } from '../../services/sidebar-reorder.service'; import { SidebarReorderService } from '../../services/sidebar-reorder.service';
import { SidebarTreeNodeComponent } from './sidebar-tree-node.component'; import { SidebarTreeNodeComponent } from './sidebar-tree-node.component';
import { resolveIcon } from '../../lore/lore-icons'; import { resolveIcon } from '../../lore/lore-icons';
import { countLabel, hasChildren as nodeHasChildren, resolveStack, stackForActive } from './tree-drilldown';
@Component({ @Component({
selector: 'app-secondary-sidebar', selector: 'app-secondary-sidebar',
@@ -29,7 +31,21 @@ export class SecondarySidebarComponent implements OnDestroy {
* Mode tiroir (shell < 1024 px) : largeur fixée par le CSS, pas de repli 44 px * Mode tiroir (shell < 1024 px) : largeur fixée par le CSS, pas de repli 44 px
* ni de poignée de redimensionnement — le tiroir se ferme depuis la barre haute. * ni de poignée de redimensionnement — le tiroir se ferme depuis la barre haute.
*/ */
@Input() drawerMode = false; @Input() set drawerMode(value: boolean) {
this._drawerMode = value;
if (value) this.syncDrillToActive();
}
get drawerMode(): boolean { return this._drawerMode; }
private _drawerMode = false;
// --- Navigation par niveaux (mode tiroir : téléphone, tablette) ---------------------
// Un niveau à la fois au lieu de l'arbre indenté : toucher un nœud qui a des enfants
// « entre » dedans (sans naviguer ni fermer le tiroir), « retour » remonte. Seule une
// feuille (scène, page…) navigue — le tiroir se ferme alors au changement de route.
/** Pile des nœuds ouverts, de la racine vers le niveau affiché. */
drill: TreeItem[] = [];
@ViewChild('drillTitle') private drillTitle?: ElementRef<HTMLElement>;
private routerSub?: Subscription;
@Output() collapsedChange = new EventEmitter<boolean>(); @Output() collapsedChange = new EventEmitter<boolean>();
/** true = ouvert (on affiche les items) ; false = replié (titre seul). */ /** true = ouvert (on affiche les items) ; false = replié (titre seul). */
@@ -43,6 +59,8 @@ export class SecondarySidebarComponent implements OnDestroy {
readonly FolderPlus = FolderPlus; readonly FolderPlus = FolderPlus;
readonly FilePlus = FilePlus; readonly FilePlus = FilePlus;
readonly Home = Home; readonly Home = Home;
readonly ArrowLeft = ArrowLeft;
readonly ExternalLink = ExternalLink;
isCollapsed = false; isCollapsed = false;
@@ -79,6 +97,10 @@ export class SecondarySidebarComponent implements OnDestroy {
this._items = value ?? []; this._items = value ?? [];
this._buildDragMaps(); this._buildDragMaps();
this.autoExpandActiveAncestors(); this.autoExpandActiveAncestors();
// Arbre reconstruit (même ids, nouveaux objets) : on garde le niveau où l'on était.
this.drill = this.drill.length
? resolveStack(this._items, this.drill.map(n => n.id))
: resolveStack(this._items, stackForActive(this._items, i => this.isDrillActive(i)));
} }
get items(): TreeItem[] { return this._items; } get items(): TreeItem[] { return this._items; }
@@ -94,6 +116,10 @@ export class SecondarySidebarComponent implements OnDestroy {
private elementRef: ElementRef<HTMLElement>, private elementRef: ElementRef<HTMLElement>,
private reorderService: SidebarReorderService private reorderService: SidebarReorderService
) { ) {
// Après chaque navigation, le tiroir rouvert montre le niveau de la page courante.
this.routerSub = this.router.events
.pipe(filter(e => e instanceof NavigationEnd))
.subscribe(() => { if (this._drawerMode) this.syncDrillToActive(); });
try { try {
const stored = localStorage.getItem(SecondarySidebarComponent.WIDTH_STORAGE_KEY); const stored = localStorage.getItem(SecondarySidebarComponent.WIDTH_STORAGE_KEY);
const parsed = stored ? parseInt(stored, 10) : NaN; const parsed = stored ? parseInt(stored, 10) : NaN;
@@ -142,6 +168,7 @@ export class SecondarySidebarComponent implements OnDestroy {
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.routerSub?.unsubscribe();
// Sécurité : si le composant est détruit en plein drag, on restaure le curseur global. // Sécurité : si le composant est détruit en plein drag, on restaure le curseur global.
if (this.isResizing) { if (this.isResizing) {
document.body.style.userSelect = ''; document.body.style.userSelect = '';
@@ -149,6 +176,68 @@ export class SecondarySidebarComponent implements OnDestroy {
} }
} }
/** Niveau affiché : le dernier nœud ouvert, ou null à la racine. */
get drillLevel(): TreeItem | null {
return this.drill.length ? this.drill[this.drill.length - 1] : null;
}
/** Lignes du niveau affiché. */
get drillRows(): TreeItem[] {
return this.drillLevel ? this.drillLevel.children ?? [] : this._items;
}
/** Libellé du bouton retour : le niveau parent, ou le titre de la section. */
get drillBackLabel(): string {
return this.drill.length > 1 ? this.drill[this.drill.length - 2].label : this.title;
}
drillCount(item: TreeItem): string | null {
return countLabel(item);
}
canDrill(item: TreeItem): boolean {
return !item.isAction && nodeHasChildren(item);
}
/** Toucher une ligne : entrer si elle a des enfants, sinon ouvrir sa page. */
tapDrillRow(item: TreeItem): void {
if (this.canDrill(item)) {
this.drill = [...this.drill, item];
this.focusDrillTitle();
} else if (item.route) {
this.router.navigate([item.route]);
}
}
drillBack(): void {
this.drill = this.drill.slice(0, -1);
this.focusDrillTitle();
}
/** « Ouvrir la fiche » du niveau affiché (arc, chapitre, dossier…). */
openDrillLevel(): void {
const route = this.drillLevel?.route;
if (route) this.router.navigate([route]);
}
/**
* Page courante pour le choix du niveau. L'accueil de la section (route du titre) ne
* compte pas : un nœud qui y pointe (ex. « Parties » → hub) ouvrirait sinon le tiroir
* dans ce nœud au lieu de la racine.
*/
private isDrillActive(item: TreeItem): boolean {
return item.route !== this.titleRoute && this.isActive(item);
}
private syncDrillToActive(): void {
this.drill = resolveStack(this._items, stackForActive(this._items, i => this.isDrillActive(i)));
}
/** Lecteurs d'écran / clavier : le focus suit le changement de niveau. */
private focusDrillTitle(): void {
setTimeout(() => this.drillTitle?.nativeElement.focus());
}
runAction(action: SidebarAction): void { runAction(action: SidebarAction): void {
if (action.route) { this.router.navigate([action.route]); } if (action.route) { this.router.navigate([action.route]); }
} }
@@ -0,0 +1,51 @@
import { TreeItem } from '../../services/layout.service';
import { countLabel, findPath, resolveStack, stackForActive } from './tree-drilldown';
const scene = (id: string): TreeItem => ({ id, label: id, route: `/s/${id}` });
const tree = (): TreeItem[] => [
{ id: 'parties', label: 'Parties', children: [scene('p1')] },
{
id: 'arc1', label: 'Acte I', route: '/arc1', children: [
{ id: 'ch1', label: 'Chapitre 1', route: '/ch1', children: [scene('s1'), scene('s2')] },
{ id: 'ch2', label: 'Chapitre 2', route: '/ch2' }
]
},
{ id: 'npcs', label: 'PNJ', meta: '3', children: [{ id: 'new', label: '+ PNJ', isAction: true, route: '/new' }] },
{ id: 'tables', label: 'Tables', route: '/tables' }
];
describe('tree drill-down', () => {
it('finds the path from the root to a node', () => {
expect(findPath(tree(), 's2')?.map(n => n.id)).toEqual(['arc1', 'ch1', 's2']);
expect(findPath(tree(), 'nope')).toBeNull();
});
it('resolves a stack of ids against a rebuilt tree, stopping at what disappeared', () => {
expect(resolveStack(tree(), ['arc1', 'ch1']).map(n => n.id)).toEqual(['arc1', 'ch1']);
expect(resolveStack(tree(), ['arc1', 'gone', 'x']).map(n => n.id)).toEqual(['arc1']);
// ch2 n'a pas d'enfants : on ne peut pas « entrer » dedans.
expect(resolveStack(tree(), ['arc1', 'ch2']).map(n => n.id)).toEqual(['arc1']);
});
it('opens the level of the current page', () => {
// Sur une scène : on voit ses sœurs (le chapitre).
expect(stackForActive(tree(), i => i.id === 's2')).toEqual(['arc1', 'ch1']);
// Sur un arc : on voit son contenu.
expect(stackForActive(tree(), i => i.id === 'arc1')).toEqual(['arc1']);
// Sur une feuille racine, ou nulle part : la racine.
expect(stackForActive(tree(), i => i.id === 'tables')).toEqual([]);
expect(stackForActive(tree(), () => false)).toEqual([]);
});
it('prefers the deepest active node', () => {
expect(stackForActive(tree(), i => i.id === 'arc1' || i.id === 'ch1')).toEqual(['arc1', 'ch1']);
});
it('shows the given badge, else the number of real children', () => {
const [parties, arc1, npcs, tables] = tree();
expect(countLabel(parties)).toBe('1');
expect(countLabel(arc1)).toBe('2');
expect(countLabel(npcs)).toBe('3');
expect(countLabel(tables)).toBeNull();
});
});
@@ -0,0 +1,68 @@
import { TreeItem } from '../../services/layout.service';
/**
* Navigation PAR NIVEAUX dans l'arborescence (mode tiroir : téléphone, tablette).
* Au lieu d'un arbre indenté à minuscules chevrons, on affiche un niveau à la fois :
* toucher un nœud qui a des enfants « entre » dedans, un bouton retour remonte.
* Logique pure, sans Angular (testée en vitest).
*/
/** Chemin racine → nœud (inclus), ou null si l'id n'existe pas. */
export function findPath(items: TreeItem[], id: string): TreeItem[] | null {
for (const item of items) {
if (item.id === id) return [item];
const sub = findPath(item.children ?? [], id);
if (sub) return [item, ...sub];
}
return null;
}
/**
* Ré-résout une pile d'ids après une reconstruction de l'arbre (les objets changent,
* les ids restent) : on suit les ids niveau par niveau et on s'arrête au premier
* qui a disparu (nœud supprimé, ou plus d'enfants).
*/
export function resolveStack(items: TreeItem[], ids: string[]): TreeItem[] {
const stack: TreeItem[] = [];
let level = items;
for (const id of ids) {
const node = level.find(i => i.id === id);
if (!node || !hasChildren(node)) break;
stack.push(node);
level = node.children ?? [];
}
return stack;
}
/**
* Niveau à afficher pour la page courante : les ancêtres du nœud actif le plus
* profond, plus le nœud lui-même s'il a des enfants (sur la page d'un arc, on voit
* ses chapitres). Aucun nœud actif → racine.
*/
export function stackForActive(items: TreeItem[], isActive: (item: TreeItem) => boolean): string[] {
const path = deepestActivePath(items, isActive);
if (!path) return [];
const active = path[path.length - 1];
const containers = hasChildren(active) ? path : path.slice(0, -1);
return containers.map(n => n.id);
}
function deepestActivePath(items: TreeItem[], isActive: (item: TreeItem) => boolean): TreeItem[] | null {
for (const item of items) {
const sub = deepestActivePath(item.children ?? [], isActive);
if (sub) return [item, ...sub];
if (isActive(item)) return [item];
}
return null;
}
export function hasChildren(item: TreeItem): boolean {
return !!item.children && item.children.length > 0;
}
/** Compteur affiché à droite d'une ligne : le badge fourni, sinon le nombre d'enfants réels. */
export function countLabel(item: TreeItem): string | null {
if (item.meta) return item.meta;
const n = (item.children ?? []).filter(c => !c.isAction).length;
return n > 0 ? String(n) : null;
}
+16 -1
View File
@@ -2453,7 +2453,18 @@
"CANCELLED": "Confirmation cancelled: nothing was changed.", "CANCELLED": "Confirmation cancelled: nothing was changed.",
"FAILED": "The permission failed. You can try again, or add it manually (see the documentation).", "FAILED": "The permission failed. You can try again, or add it manually (see the documentation).",
"UNSUPPORTED": "This check is only available on Windows." "UNSUPPORTED": "This check is only available on Windows."
} },
"windowsReady": "The Windows firewall and the network type let the tablet through.",
"thirdParty": "{{names}} also filters connections on this PC, with its own rules that DM Loremind can't check. Until it allows it, the tablet will load forever.",
"thirdPartyHowTo": "In that software's firewall settings: classify your Wi-Fi as a home network (not public, stealth mode off), then add a rule allowing incoming connections for DM Loremind.",
"docLink": "See how to fix it",
"docUrl": "https://loremind-docs.igmlcreation.fr/en/docs/configuration/acces-tablette#the-tablet-loads-forever",
"linuxNone": "No ufw or firewalld firewall is active on this machine: nothing to open.",
"linuxOpen": "The firewall ({{fw}}) lets port {{port}} through.",
"linuxClosed": "The firewall ({{fw}}) blocks port {{port}}: other devices would load forever. Open it with this command on the machine:",
"linuxUnknown": "The {{fw}} firewall is active. DM Loremind can't read its rules without administrator rights: if you haven't already, open port {{port}} with this command on the machine:",
"copy": "Copy",
"copied": "Copied"
} }
}, },
"mobileShell": { "mobileShell": {
@@ -2509,5 +2520,9 @@
"chooseSystem": "Choose the campaign's system", "chooseSystem": "Choose the campaign's system",
"noRules": "The \"{{name}}\" system has no rules yet.", "noRules": "The \"{{name}}\" system has no rules yet.",
"addRules": "Add rules to the system" "addRules": "Add rules to the system"
},
"treeDrill": {
"open": "Open page",
"empty": "Nothing here yet."
} }
} }
+16 -1
View File
@@ -2453,7 +2453,18 @@
"CANCELLED": "Confirmation annulée : rien n'a été modifié.", "CANCELLED": "Confirmation annulée : rien n'a été modifié.",
"FAILED": "L'autorisation a échoué. Tu peux réessayer, ou l'ajouter à la main (voir la documentation).", "FAILED": "L'autorisation a échoué. Tu peux réessayer, ou l'ajouter à la main (voir la documentation).",
"UNSUPPORTED": "Cette vérification n'est disponible que sur Windows." "UNSUPPORTED": "Cette vérification n'est disponible que sur Windows."
} },
"windowsReady": "Le pare-feu Windows et le type de réseau laissent passer la tablette.",
"thirdParty": "{{names}} filtre aussi les connexions sur ce PC, avec ses propres règles que DM Loremind ne peut pas vérifier. Tant qu'il ne l'autorise pas, la tablette chargera sans fin.",
"thirdPartyHowTo": "Dans les réglages du pare-feu de ce logiciel : classe ton Wi-Fi en réseau domestique (pas public, sans mode furtif), puis ajoute une règle qui autorise DM Loremind en connexions entrantes.",
"docLink": "Voir la marche à suivre",
"docUrl": "https://loremind-docs.igmlcreation.fr/docs/configuration/acces-tablette#la-tablette-charge-sans-fin",
"linuxNone": "Aucun pare-feu ufw ou firewalld n'est actif sur cette machine : rien à ouvrir.",
"linuxOpen": "Le pare-feu ({{fw}}) laisse passer le port {{port}}.",
"linuxClosed": "Le pare-feu ({{fw}}) bloque le port {{port}} : les autres appareils chargeraient sans fin. Ouvre-le avec cette commande sur la machine :",
"linuxUnknown": "Le pare-feu {{fw}} est actif. DM Loremind ne peut pas lire ses règles sans droits administrateur : si ce n'est pas déjà fait, ouvre le port {{port}} avec cette commande sur la machine :",
"copy": "Copier",
"copied": "Copié"
} }
}, },
"mobileShell": { "mobileShell": {
@@ -2509,5 +2520,9 @@
"chooseSystem": "Choisir le système de la campagne", "chooseSystem": "Choisir le système de la campagne",
"noRules": "Le système « {{name}} » n'a pas encore de règles.", "noRules": "Le système « {{name}} » n'a pas encore de règles.",
"addRules": "Ajouter des règles au système" "addRules": "Ajouter des règles au système"
},
"treeDrill": {
"open": "Ouvrir la fiche",
"empty": "Rien ici pour le moment."
} }
} }
@@ -64,7 +64,18 @@
"CANCELLED": "Confirmation cancelled: nothing was changed.", "CANCELLED": "Confirmation cancelled: nothing was changed.",
"FAILED": "The permission failed. You can try again, or add it manually (see the documentation).", "FAILED": "The permission failed. You can try again, or add it manually (see the documentation).",
"UNSUPPORTED": "This check is only available on Windows." "UNSUPPORTED": "This check is only available on Windows."
} },
"windowsReady": "The Windows firewall and the network type let the tablet through.",
"thirdParty": "{{names}} also filters connections on this PC, with its own rules that DM Loremind can't check. Until it allows it, the tablet will load forever.",
"thirdPartyHowTo": "In that software's firewall settings: classify your Wi-Fi as a home network (not public, stealth mode off), then add a rule allowing incoming connections for DM Loremind.",
"docLink": "See how to fix it",
"docUrl": "https://loremind-docs.igmlcreation.fr/en/docs/configuration/acces-tablette#the-tablet-loads-forever",
"linuxNone": "No ufw or firewalld firewall is active on this machine: nothing to open.",
"linuxOpen": "The firewall ({{fw}}) lets port {{port}} through.",
"linuxClosed": "The firewall ({{fw}}) blocks port {{port}}: other devices would load forever. Open it with this command on the machine:",
"linuxUnknown": "The {{fw}} firewall is active. DM Loremind can't read its rules without administrator rights: if you haven't already, open port {{port}} with this command on the machine:",
"copy": "Copy",
"copied": "Copied"
} }
} }
} }
@@ -64,7 +64,18 @@
"CANCELLED": "Confirmation annulée : rien n'a été modifié.", "CANCELLED": "Confirmation annulée : rien n'a été modifié.",
"FAILED": "L'autorisation a échoué. Tu peux réessayer, ou l'ajouter à la main (voir la documentation).", "FAILED": "L'autorisation a échoué. Tu peux réessayer, ou l'ajouter à la main (voir la documentation).",
"UNSUPPORTED": "Cette vérification n'est disponible que sur Windows." "UNSUPPORTED": "Cette vérification n'est disponible que sur Windows."
} },
"windowsReady": "Le pare-feu Windows et le type de réseau laissent passer la tablette.",
"thirdParty": "{{names}} filtre aussi les connexions sur ce PC, avec ses propres règles que DM Loremind ne peut pas vérifier. Tant qu'il ne l'autorise pas, la tablette chargera sans fin.",
"thirdPartyHowTo": "Dans les réglages du pare-feu de ce logiciel : classe ton Wi-Fi en réseau domestique (pas public, sans mode furtif), puis ajoute une règle qui autorise DM Loremind en connexions entrantes.",
"docLink": "Voir la marche à suivre",
"docUrl": "https://loremind-docs.igmlcreation.fr/docs/configuration/acces-tablette#la-tablette-charge-sans-fin",
"linuxNone": "Aucun pare-feu ufw ou firewalld n'est actif sur cette machine : rien à ouvrir.",
"linuxOpen": "Le pare-feu ({{fw}}) laisse passer le port {{port}}.",
"linuxClosed": "Le pare-feu ({{fw}}) bloque le port {{port}} : les autres appareils chargeraient sans fin. Ouvre-le avec cette commande sur la machine :",
"linuxUnknown": "Le pare-feu {{fw}} est actif. DM Loremind ne peut pas lire ses règles sans droits administrateur : si ce n'est pas déjà fait, ouvre le port {{port}} avec cette commande sur la machine :",
"copy": "Copier",
"copied": "Copié"
} }
} }
} }
@@ -0,0 +1,6 @@
{
"treeDrill": {
"open": "Open page",
"empty": "Nothing here yet."
}
}
@@ -0,0 +1,6 @@
{
"treeDrill": {
"open": "Ouvrir la fiche",
"empty": "Rien ici pour le moment."
}
}