feat: desktop — connexion compte central + environnement prod/dev (#230)
Liaison d'appareil sur og/og-dev, validation du jeton draco et ouverture de la session de l'admin local. Sélecteur prod/dev (Configuration + premier lancement), admin local par défaut admin/chab30, sans impact sur le web Docker. Inclut BUG-126 (runtime python-embed/_pth + copie de backend/frontend + signature updater opt-in) et BUG-127 (retour /liaison même hôte).
This commit is contained in:
@@ -2170,6 +2170,31 @@
|
||||
racine chargés par l'application desktop.
|
||||
</p>
|
||||
|
||||
<!-- #230 — environnement central (prod/dev) -->
|
||||
<div class="desktop-env-row">
|
||||
<label
|
||||
for="cfg-desktop-environment"
|
||||
data-i18n="config.desktop_environment"
|
||||
>Environnement central</label>
|
||||
<select id="cfg-desktop-environment">
|
||||
<option value="prod" data-i18n="config.desktop_env_prod">Production (og.dracodev.net)</option>
|
||||
<option value="dev" data-i18n="config.desktop_env_dev">Développement (og-dev.dracodev.net)</option>
|
||||
</select>
|
||||
<span
|
||||
class="desktop-env-status"
|
||||
id="cfg-desktop-environment-status"
|
||||
></span>
|
||||
</div>
|
||||
<p
|
||||
class="config-description"
|
||||
data-i18n="config.desktop_environment_desc"
|
||||
>
|
||||
Site central utilisé pour la connexion
|
||||
centralisée et les liens inter-apps. Le
|
||||
backend desktop redémarre après le
|
||||
changement.
|
||||
</p>
|
||||
|
||||
<div
|
||||
id="desktop-roots-list"
|
||||
class="desktop-roots-list"
|
||||
@@ -4968,6 +4993,7 @@
|
||||
<li data-i18n="guide105.des_get">L'application desktop ObsiGate (Tauri) embarque le serveur Python : aucune installation de Docker nécessaire. Elle se télécharge sur la page des Releases du dépôt et se met à jour automatiquement (updater signé).</li>
|
||||
<li data-i18n="guide105.des_wizard">Au premier lancement, un assistant demande le dossier de vos vaults (ou crée un vault de démonstration). Chaque document peut être détaché en fenêtre native séparée.</li>
|
||||
<li data-i18n="guide105.des_data">Les données desktop restent dans le répertoire applicatif ; les vaults pointent sur vos dossiers existants. Toutes les fonctionnalités web (recherche, IA, partage) sont disponibles.</li>
|
||||
<li data-i18n="guide105.des_central">La connexion accepte le compte admin local ou votre compte central (approbation dans le navigateur). L'environnement central (production og.dracodev.net ou développement og-dev.dracodev.net) se choisit au premier lancement et dans Configuration → Vaults & dossiers (Desktop).</li>
|
||||
<li data-i18n="guide105.des_native">Menu système natif, raccourci global optionnel pour afficher/masquer la fenêtre et jumplist des vaults récents.</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
+224
-1
@@ -4,6 +4,12 @@ import { safeCreateIcons, escapeHtml } from './utils.js';
|
||||
import { showToast, closeHeaderMenu, closeMobileSidebar } from './ui.js';
|
||||
import { t, getLocale, setLocale } from './i18n.js';
|
||||
import { showWelcome } from './viewer.js';
|
||||
import {
|
||||
isTauriEnv,
|
||||
getDesktopSettings,
|
||||
desktopEnvironmentLabel,
|
||||
openExternalUrl,
|
||||
} from './desktop.js';
|
||||
|
||||
// ── Global logout handler for header dropdown onclick ────────────────────
|
||||
// Defined at module top level so it's always available, even if
|
||||
@@ -135,8 +141,14 @@ const AuthManager = {
|
||||
const u = new URL(rt);
|
||||
const okHost = u.hostname === "dracodev.net"
|
||||
|| u.hostname.endsWith(".dracodev.net");
|
||||
const sameHost = u.hostname === window.location.hostname;
|
||||
// #230 : la page publique /liaison (approbation d'appareil) renvoie
|
||||
// vers elle-même après connexion (`return_to` même hôte). On l'honore
|
||||
// pour que la liaison desktop reprenne après le login central ; les
|
||||
// autres retours même-hôte restent ignorés (pas de boucle).
|
||||
const sameHostLiaison = sameHost && u.pathname.startsWith("/liaison");
|
||||
if (u.protocol === "https:" && okHost
|
||||
&& u.hostname !== window.location.hostname) {
|
||||
&& (!sameHost || sameHostLiaison)) {
|
||||
window.location.replace(rt);
|
||||
return true;
|
||||
}
|
||||
@@ -922,6 +934,210 @@ function showRecoveryChallenge(username, rememberMe, loginForm, mfaSection) {
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Desktop — connexion avec un compte central (#230)
|
||||
// ---------------------------------------------------------------------------
|
||||
// Le backend desktop démarre une liaison d'appareil sur le site central
|
||||
// (og / og-dev), l'utilisateur approuve dans son navigateur, puis le backend
|
||||
// valide le jeton draco et ouvre la session de l'admin local. Aucun de ces
|
||||
// appels n'existe sur le web : tout est conditionné par isTauriEnv().
|
||||
|
||||
let _centralPollTimer = null;
|
||||
let _centralCancelled = false;
|
||||
|
||||
async function _jsonOrEmpty(res) {
|
||||
try { return await res.json(); } catch (e) { return {}; }
|
||||
}
|
||||
|
||||
function _centralSetStatus(text, isError) {
|
||||
const el = document.getElementById("login-central-status");
|
||||
if (!el) return;
|
||||
el.textContent = text || "";
|
||||
el.classList.toggle("error", !!isError);
|
||||
}
|
||||
|
||||
function _centralShowError(text) {
|
||||
_centralSetStatus(text, true);
|
||||
const el = document.getElementById("login-error");
|
||||
if (el) {
|
||||
el.textContent = text || "";
|
||||
if (text) el.classList.remove("hidden");
|
||||
else el.classList.add("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
function _centralResetPanel() {
|
||||
if (_centralPollTimer) {
|
||||
clearTimeout(_centralPollTimer);
|
||||
_centralPollTimer = null;
|
||||
}
|
||||
_centralCancelled = true;
|
||||
const panel = document.getElementById("login-central-panel");
|
||||
if (panel) panel.remove();
|
||||
const btn = document.getElementById("login-central-btn");
|
||||
if (btn) btn.disabled = false;
|
||||
}
|
||||
|
||||
async function _centralPollOnce(state) {
|
||||
if (_centralCancelled) return;
|
||||
let res;
|
||||
try {
|
||||
res = await fetch("/api/desktop/sso/poll", {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
demande_id: state.demande_id,
|
||||
code_appareil: state.code_appareil,
|
||||
remember_me: state.rememberMe,
|
||||
}),
|
||||
});
|
||||
} catch (e) {
|
||||
_centralShowError(t("auth.central_error"));
|
||||
_centralResetPanel();
|
||||
return;
|
||||
}
|
||||
const payload = await _jsonOrEmpty(res);
|
||||
if (_centralCancelled) return;
|
||||
if (!res.ok) {
|
||||
_centralShowError(payload.detail || t("auth.central_error"));
|
||||
_centralResetPanel();
|
||||
return;
|
||||
}
|
||||
if (payload.statut === "approuvee") {
|
||||
AuthManager.saveToken(payload);
|
||||
_centralResetPanel();
|
||||
const central = payload.central_user || {};
|
||||
const name = central.display_name || central.username;
|
||||
showToast(name ? t("auth.central_success", { name: name })
|
||||
: t("auth.central_success", { name: "" }), "success");
|
||||
await _onLoginSuccess();
|
||||
safeCreateIcons();
|
||||
return;
|
||||
}
|
||||
if (payload.statut === "en_attente") {
|
||||
if (Date.now() > state.deadline) {
|
||||
_centralShowError(t("auth.central_expired"));
|
||||
_centralResetPanel();
|
||||
return;
|
||||
}
|
||||
_centralSetStatus(t("auth.central_waiting"), false);
|
||||
_centralPollTimer = setTimeout(() => _centralPollOnce(state), 2000);
|
||||
return;
|
||||
}
|
||||
if (payload.statut === "refusee") {
|
||||
_centralShowError(t("auth.central_refused"));
|
||||
} else if (payload.statut === "expiree" || payload.statut === "livree") {
|
||||
_centralShowError(t("auth.central_expired"));
|
||||
} else {
|
||||
_centralShowError(t("auth.central_error"));
|
||||
}
|
||||
_centralResetPanel();
|
||||
}
|
||||
|
||||
async function startCentralLogin() {
|
||||
if (_centralPollTimer) return;
|
||||
const btn = document.getElementById("login-central-btn");
|
||||
if (btn) btn.disabled = true;
|
||||
const loginError = document.getElementById("login-error");
|
||||
if (loginError) loginError.classList.add("hidden");
|
||||
_centralSetStatus(t("auth.central_starting"), false);
|
||||
|
||||
let start;
|
||||
try {
|
||||
const res = await fetch("/api/desktop/sso/start", {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
});
|
||||
const payload = await _jsonOrEmpty(res);
|
||||
if (!res.ok) {
|
||||
_centralShowError(payload.detail || t("auth.central_error"));
|
||||
if (btn) btn.disabled = false;
|
||||
return;
|
||||
}
|
||||
start = payload;
|
||||
} catch (e) {
|
||||
_centralShowError(t("auth.central_error"));
|
||||
if (btn) btn.disabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const card = document.querySelector(".login-card");
|
||||
if (!card) return;
|
||||
const old = document.getElementById("login-central-panel");
|
||||
if (old) old.remove();
|
||||
const panel = document.createElement("div");
|
||||
panel.id = "login-central-panel";
|
||||
panel.className = "login-central-panel";
|
||||
panel.innerHTML =
|
||||
'<div>' + escapeHtml(t("auth.central_code")) + '</div>' +
|
||||
'<div class="login-central-code">' + escapeHtml(start.code_utilisateur || "") + '</div>' +
|
||||
'<p class="login-central-status" id="login-central-status"></p>' +
|
||||
'<div class="login-central-actions">' +
|
||||
'<button type="button" id="login-central-open">' + escapeHtml(t("auth.central_open")) + '</button>' +
|
||||
'<button type="button" id="login-central-cancel">' + escapeHtml(t("auth.central_cancel")) + '</button>' +
|
||||
'</div>';
|
||||
card.appendChild(panel);
|
||||
|
||||
const openBtn = document.getElementById("login-central-open");
|
||||
if (openBtn) {
|
||||
openBtn.addEventListener("click", () => openExternalUrl(start.url_liaison_absolue));
|
||||
}
|
||||
const cancelBtn = document.getElementById("login-central-cancel");
|
||||
if (cancelBtn) {
|
||||
cancelBtn.addEventListener("click", () => {
|
||||
_centralSetStatus("");
|
||||
_centralResetPanel();
|
||||
if (btn) btn.disabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
_centralCancelled = false;
|
||||
_centralSetStatus(t("auth.central_waiting"), false);
|
||||
await openExternalUrl(start.url_liaison_absolue);
|
||||
const rememberMe = document.getElementById("remember-me");
|
||||
const state = {
|
||||
demande_id: start.demande_id,
|
||||
code_appareil: start.code_appareil,
|
||||
rememberMe: rememberMe ? rememberMe.checked : true,
|
||||
deadline: Date.now() + Math.max(30, Number(start.expire_dans_s) || 600) * 1000,
|
||||
};
|
||||
_centralPollTimer = setTimeout(() => _centralPollOnce(state), 1500);
|
||||
}
|
||||
|
||||
async function initDesktopCentralLogin() {
|
||||
if (!isTauriEnv()) return;
|
||||
const card = document.querySelector(".login-card");
|
||||
const form = document.getElementById("login-form");
|
||||
if (!card || !form || document.getElementById("login-central")) return;
|
||||
|
||||
const box = document.createElement("div");
|
||||
box.id = "login-central";
|
||||
box.className = "login-central";
|
||||
box.innerHTML =
|
||||
'<button type="button" class="login-central-btn" id="login-central-btn">' +
|
||||
escapeHtml(t("auth.central_login")) + '</button>' +
|
||||
'<p class="login-central-hint" id="login-central-hint"></p>';
|
||||
form.insertAdjacentElement("afterend", box);
|
||||
|
||||
let settings;
|
||||
try { settings = await getDesktopSettings(); } catch (e) { settings = undefined; }
|
||||
const hint = document.getElementById("login-central-hint");
|
||||
if (hint) {
|
||||
if (settings && settings.central_url) {
|
||||
hint.textContent = desktopEnvironmentLabel(
|
||||
settings.environment, settings.central_url);
|
||||
} else {
|
||||
hint.textContent = t("auth.central_unavailable");
|
||||
}
|
||||
}
|
||||
const btn = document.getElementById("login-central-btn");
|
||||
if (btn) {
|
||||
if (!settings || !settings.central_url) btn.disabled = true;
|
||||
btn.addEventListener("click", startCentralLogin);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Login form handler
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -930,8 +1146,15 @@ function initLoginForm() {
|
||||
const form = document.getElementById("login-form");
|
||||
if (!form) return;
|
||||
|
||||
// Desktop uniquement : bouton « compte central » (#230).
|
||||
initDesktopCentralLogin();
|
||||
|
||||
form.addEventListener("submit", async (e) => {
|
||||
e.preventDefault();
|
||||
// Un login local annule toute tentative de connexion centralisée en cours.
|
||||
if (_centralPollTimer || document.getElementById("login-central-panel")) {
|
||||
_centralResetPanel();
|
||||
}
|
||||
const username = document.getElementById("login-username").value;
|
||||
const password = document.getElementById("login-password").value;
|
||||
const rememberMe = document.getElementById("remember-me").checked;
|
||||
|
||||
+24
-1
@@ -7,7 +7,7 @@ import { escapeHtml, safeCreateIcons } from './utils.js';
|
||||
import { showToast, closeHeaderMenu, closeMobileSidebar } from './ui.js';
|
||||
import { t, setLocale, getLocale } from './i18n.js';
|
||||
import { getModelCapabilities, renderCapabilityBadges, refreshAIPickers } from './ai.js';
|
||||
import { isTauriEnv, invoke, pickAndAddVault, pickAndAddDir, removeRoot } from './desktop.js';
|
||||
import { isTauriEnv, invoke, pickAndAddVault, pickAndAddDir, removeRoot, getDesktopSettings, setDesktopEnvironment } from './desktop.js';
|
||||
import { openSidebarChat, filterChatMessages as _filterChat } from './filechat.js';
|
||||
|
||||
let _recentTimestampTimer = null;
|
||||
@@ -800,6 +800,29 @@ async function renderDesktopRoots() {
|
||||
}
|
||||
section.style.display = "";
|
||||
if (navLink && navLink.parentElement) navLink.parentElement.style.display = "";
|
||||
|
||||
// #230 — environnement central prod/dev.
|
||||
const settings = await getDesktopSettings();
|
||||
const envSelect = document.getElementById("cfg-desktop-environment");
|
||||
const envStatus = document.getElementById("cfg-desktop-environment-status");
|
||||
if (envSelect && settings) {
|
||||
envSelect.value = settings.environment === "dev" ? "dev" : "prod";
|
||||
envSelect.disabled = false;
|
||||
if (envStatus) envStatus.textContent = "";
|
||||
envSelect.onchange = async () => {
|
||||
envSelect.disabled = true;
|
||||
if (envStatus) envStatus.textContent = t("desktop.env_restarting");
|
||||
const saved = await setDesktopEnvironment(envSelect.value);
|
||||
if (saved) {
|
||||
showToast(t("config.desktop_env_saved"), "success");
|
||||
await invoke("restart_backend");
|
||||
} else {
|
||||
envSelect.disabled = false;
|
||||
if (envStatus) envStatus.textContent = "";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const vaults = (await invoke("list_vaults")) || [];
|
||||
const dirs = (await invoke("list_dirs")) || [];
|
||||
const list = document.getElementById("desktop-roots-list");
|
||||
|
||||
+93
-4
@@ -12,6 +12,8 @@
|
||||
* Usage: import { initDesktopIntegration } from './desktop.js';
|
||||
*/
|
||||
|
||||
import { t } from './i18n.js';
|
||||
|
||||
// ── Detection ──────────────────────────────────────────────────────────────
|
||||
// window.__TAURI__ is injected by Tauri when app.withGlobalTauri === true.
|
||||
// window.__TAURI_INTERNALS__ is a secondary signal used by some Tauri builds.
|
||||
@@ -52,6 +54,54 @@ export async function getSystemTheme() {
|
||||
return 'light';
|
||||
}
|
||||
|
||||
// ── Environnement central (#230) ───────────────────────────────────────────
|
||||
// prod = https://og.dracodev.net, dev = https://og-dev.dracodev.net.
|
||||
// Persisté par le shell Rust (%APPDATA%/ObsiGate/config.json) et injecté au
|
||||
// backend embarqué en DRACO_* ; sans effet sur l'application web.
|
||||
|
||||
export function desktopEnvironmentLabel(env, centralUrl) {
|
||||
const key = env === 'dev' ? 'dev' : 'prod';
|
||||
const host = centralUrl || (key === 'dev'
|
||||
? 'https://og-dev.dracodev.net'
|
||||
: 'https://og.dracodev.net');
|
||||
return t('desktop.env_' + key) + ' — ' + host.replace(/^https?:\/\//, '');
|
||||
}
|
||||
|
||||
export async function getDesktopSettings() {
|
||||
if (!isTauriEnv()) return undefined;
|
||||
return await invoke('get_desktop_settings');
|
||||
}
|
||||
|
||||
export async function setDesktopEnvironment(environment) {
|
||||
if (!isTauriEnv()) return undefined;
|
||||
return await invoke('set_desktop_environment', { environment: environment });
|
||||
}
|
||||
|
||||
// Opens a URL in the user's default browser (Tauri shell plugin). Returns
|
||||
// false when unavailable (web), true otherwise.
|
||||
export async function openExternalUrl(url) {
|
||||
if (!isTauriEnv() || !url) return false;
|
||||
// Commande Rust : valide https://*.dracodev.net puis ouvre le navigateur
|
||||
// système (shell:allow-open). `true` = succès, `undefined` = échec IPC.
|
||||
const res = await invoke('open_external_url', { url: url });
|
||||
if (res === true) return true;
|
||||
try {
|
||||
const shell = window.__TAURI__ && window.__TAURI__.shell;
|
||||
if (shell && typeof shell.open === 'function') {
|
||||
await shell.open(url);
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[desktop] shell.open failed:', e);
|
||||
}
|
||||
try {
|
||||
window.open(url, '_blank', 'noopener');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Theme preference detection ─────────────────────────────────────────────
|
||||
// The real theme engine is themes.js: it persists the *mode* under
|
||||
// 'obsigate-theme-mode' (dark/light/high-contrast/sepia). Absence of that key
|
||||
@@ -235,7 +285,7 @@ export async function initDesktopWizard() {
|
||||
if (!shouldShowWizard({ hasVaultPath: wizardDone })) return;
|
||||
|
||||
// Defer so the app shell is fully rendered before injecting the banner.
|
||||
setTimeout(function () {
|
||||
setTimeout(async function () {
|
||||
if (document.getElementById('obsigate-desktop-wizard')) return;
|
||||
const banner = document.createElement('div');
|
||||
banner.id = 'obsigate-desktop-wizard';
|
||||
@@ -250,10 +300,44 @@ export async function initDesktopWizard() {
|
||||
|
||||
const text = document.createElement('span');
|
||||
text.style.cssText = 'flex:1;min-width:220px;font-size:13px;color:var(--text,#e6edf3);';
|
||||
text.textContent = 'Bienvenue dans ObsiGate Desktop. Choisissez le dossier de vos vaults Obsidian pour commencer.';
|
||||
text.textContent = t('desktop.wizard_text');
|
||||
|
||||
// #230 : choix prod/dev avant la première connexion. Persisté côté Rust ;
|
||||
// le backend redémarre pour recevoir les URL DRACO_* de l'environnement.
|
||||
const settings = await getDesktopSettings();
|
||||
const currentEnv = settings && settings.environment ? settings.environment : 'prod';
|
||||
const envWrap = document.createElement('label');
|
||||
envWrap.style.cssText = 'display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--text-2,#8b949e);min-width:190px;';
|
||||
const envLabel = document.createElement('span');
|
||||
envLabel.textContent = t('desktop.wizard_env_label');
|
||||
const envSelect = document.createElement('select');
|
||||
envSelect.id = 'desktop-wizard-environment';
|
||||
envSelect.style.cssText = 'padding:6px 8px;border-radius:6px;border:1px solid var(--border,#21262d);background:var(--bg-primary,#0d1117);color:var(--text,#e6edf3);font-size:13px;';
|
||||
[['prod', t('desktop.env_prod')], ['dev', t('desktop.env_dev')]].forEach(function (pair) {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = pair[0];
|
||||
opt.textContent = pair[1];
|
||||
envSelect.appendChild(opt);
|
||||
});
|
||||
envSelect.value = currentEnv === 'dev' ? 'dev' : 'prod';
|
||||
const envStatus = document.createElement('span');
|
||||
envSelect.addEventListener('change', async function () {
|
||||
envSelect.disabled = true;
|
||||
envStatus.textContent = t('desktop.env_restarting');
|
||||
const saved = await setDesktopEnvironment(envSelect.value);
|
||||
if (saved) {
|
||||
await invoke('restart_backend');
|
||||
} else {
|
||||
envSelect.disabled = false;
|
||||
envStatus.textContent = '';
|
||||
}
|
||||
});
|
||||
envWrap.appendChild(envLabel);
|
||||
envWrap.appendChild(envSelect);
|
||||
envWrap.appendChild(envStatus);
|
||||
|
||||
const pickBtn = document.createElement('button');
|
||||
pickBtn.textContent = 'Choisir mon dossier';
|
||||
pickBtn.textContent = t('desktop.wizard_pick');
|
||||
pickBtn.style.cssText = 'background:#7c3aed;color:#fff;border:none;border-radius:6px;padding:8px 14px;cursor:pointer;font-weight:600;font-size:13px;';
|
||||
pickBtn.addEventListener('click', async function () {
|
||||
const p = await pickAndAddVault();
|
||||
@@ -261,7 +345,7 @@ export async function initDesktopWizard() {
|
||||
});
|
||||
|
||||
const laterBtn = document.createElement('button');
|
||||
laterBtn.textContent = 'Plus tard';
|
||||
laterBtn.textContent = t('desktop.wizard_later');
|
||||
laterBtn.style.cssText = 'background:transparent;color:var(--text-2,#8b949e);border:1px solid var(--border,#21262d);border-radius:6px;padding:8px 14px;cursor:pointer;font-size:13px;';
|
||||
laterBtn.addEventListener('click', function () {
|
||||
dismissWizard();
|
||||
@@ -269,6 +353,7 @@ export async function initDesktopWizard() {
|
||||
});
|
||||
|
||||
banner.appendChild(text);
|
||||
banner.appendChild(envWrap);
|
||||
banner.appendChild(pickBtn);
|
||||
banner.appendChild(laterBtn);
|
||||
document.body.appendChild(banner);
|
||||
@@ -307,6 +392,10 @@ export default {
|
||||
getSystemTheme,
|
||||
hasExplicitThemeMode,
|
||||
syncSystemTheme,
|
||||
desktopEnvironmentLabel,
|
||||
getDesktopSettings,
|
||||
setDesktopEnvironment,
|
||||
openExternalUrl,
|
||||
defineBackendCrashBanner,
|
||||
pickVaultFolder,
|
||||
pickAndAddVault,
|
||||
|
||||
@@ -218,6 +218,17 @@
|
||||
"auth.session_expired": "Session expired, please sign in again",
|
||||
"auth.user_deleted": "User deleted",
|
||||
"auth.username": "Username",
|
||||
"auth.central_login": "Sign in with my central account",
|
||||
"auth.central_unavailable": "Central sign-in unavailable.",
|
||||
"auth.central_starting": "Preparing central sign-in…",
|
||||
"auth.central_code": "Code to approve on the central site:",
|
||||
"auth.central_open": "Open approval page",
|
||||
"auth.central_cancel": "Cancel",
|
||||
"auth.central_waiting": "Waiting for approval…",
|
||||
"auth.central_success": "Central account verified ({name}).",
|
||||
"auth.central_refused": "The link request was refused.",
|
||||
"auth.central_expired": "The request expired. Try again.",
|
||||
"auth.central_error": "Cannot reach the central site.",
|
||||
"auto.0257e77f": "🧰 Toolbox ▾",
|
||||
"auto.033a9ddf": "Default model",
|
||||
"auto.03a6e5b1": "The operators used are displayed as",
|
||||
@@ -542,6 +553,18 @@
|
||||
"desktop.add_vault": "📁 Add a vault",
|
||||
"desktop.add_dir": "📂 Add a folder",
|
||||
"desktop.roots_empty": "No vault or folder configured.",
|
||||
"desktop.env_prod": "Production (og.dracodev.net)",
|
||||
"desktop.env_dev": "Development (og-dev.dracodev.net)",
|
||||
"desktop.env_restarting": "Restarting the backend…",
|
||||
"desktop.wizard_text": "Welcome to ObsiGate Desktop. Choose your Obsidian vault folder and the central environment to get started.",
|
||||
"desktop.wizard_env_label": "Central environment",
|
||||
"desktop.wizard_pick": "Choose my folder",
|
||||
"desktop.wizard_later": "Later",
|
||||
"config.desktop_environment": "Central environment",
|
||||
"config.desktop_environment_desc": "Central site used for central sign-in and inter-app links. The desktop backend restarts after the change.",
|
||||
"config.desktop_env_prod": "Production (og.dracodev.net)",
|
||||
"config.desktop_env_dev": "Development (og-dev.dracodev.net)",
|
||||
"config.desktop_env_saved": "Environment saved. Restarting the backend…",
|
||||
"config.section_historique-recent-redemarrage-non-requis": "📋 Recent History\n No restart required",
|
||||
"config.section_indicateurs-visuels": "Indicateurs visuels",
|
||||
"config.section_intelligence-artificielle-dans-l-editeur": "🤖 AI in the Editor",
|
||||
@@ -2630,6 +2653,7 @@
|
||||
"guide105.des_get": "The ObsiGate desktop app (Tauri) embeds the Python server: no Docker install needed. Download it from the repository's Releases page; it auto-updates (signed updater).",
|
||||
"guide105.des_wizard": "On first launch a wizard asks for your vaults folder (or creates a demo vault). Any document can be detached into its own native window.",
|
||||
"guide105.des_data": "Desktop data stays in the app directory; vaults point at your existing folders. Every web feature (search, AI, sharing) is available.",
|
||||
"guide105.des_central": "Sign-in accepts the local admin account or your central account (approval in your browser). The central environment (production og.dracodev.net or development og-dev.dracodev.net) is chosen on first launch and in Configuration → Vaults & folders (Desktop).",
|
||||
"guide105.des_native": "Native system menu, optional global show/hide shortcut and a recents vault jumplist.",
|
||||
"guide105.api_intro": "ObsiGate exposes a REST API covering the whole application (vaults, files, search, backups, export, AI, sharing, admin), documented in OpenAPI 3.1:",
|
||||
"guide105.api_docs_url": "<code>/docs</code> — Swagger UI to try requests live.",
|
||||
|
||||
@@ -218,6 +218,17 @@
|
||||
"auth.session_expired": "Session expirée, veuillez vous reconnecter",
|
||||
"auth.user_deleted": "Utilisateur supprimé",
|
||||
"auth.username": "Nom d'utilisateur",
|
||||
"auth.central_login": "Se connecter avec mon compte central",
|
||||
"auth.central_unavailable": "Connexion centralisée indisponible.",
|
||||
"auth.central_starting": "Préparation de la connexion centralisée…",
|
||||
"auth.central_code": "Code à approuver sur le site central :",
|
||||
"auth.central_open": "Ouvrir la page d'approbation",
|
||||
"auth.central_cancel": "Annuler",
|
||||
"auth.central_waiting": "En attente de l'approbation…",
|
||||
"auth.central_success": "Compte central validé ({name}).",
|
||||
"auth.central_refused": "La liaison a été refusée.",
|
||||
"auth.central_expired": "La demande a expiré. Réessayez.",
|
||||
"auth.central_error": "Impossible de contacter le site central.",
|
||||
"auto.0257e77f": "🧰 Boîte ▾",
|
||||
"auto.033a9ddf": "Modèle par défaut",
|
||||
"auto.03a6e5b1": "Les opérateurs utilisés s'affichent sous forme\n de chips colorés :",
|
||||
@@ -542,6 +553,18 @@
|
||||
"desktop.add_vault": "📁 Ajouter un vault",
|
||||
"desktop.add_dir": "📂 Ajouter un dossier",
|
||||
"desktop.roots_empty": "Aucun vault ou dossier configuré.",
|
||||
"desktop.env_prod": "Production (og.dracodev.net)",
|
||||
"desktop.env_dev": "Développement (og-dev.dracodev.net)",
|
||||
"desktop.env_restarting": "Redémarrage du backend…",
|
||||
"desktop.wizard_text": "Bienvenue dans ObsiGate Desktop. Choisissez le dossier de vos vaults Obsidian et l'environnement central pour commencer.",
|
||||
"desktop.wizard_env_label": "Environnement central",
|
||||
"desktop.wizard_pick": "Choisir mon dossier",
|
||||
"desktop.wizard_later": "Plus tard",
|
||||
"config.desktop_environment": "Environnement central",
|
||||
"config.desktop_environment_desc": "Site central utilisé pour la connexion centralisée (compte central) et les liens inter-apps. Le backend desktop redémarre après le changement.",
|
||||
"config.desktop_env_prod": "Production (og.dracodev.net)",
|
||||
"config.desktop_env_dev": "Développement (og-dev.dracodev.net)",
|
||||
"config.desktop_env_saved": "Environnement enregistré. Redémarrage du backend…",
|
||||
"config.section_historique-recent-redemarrage-non-requis": "📋 Historique récent\n Redémarrage non requis",
|
||||
"config.section_indicateurs-visuels": "Indicateurs visuels",
|
||||
"config.section_intelligence-artificielle-dans-l-editeur": "🤖 Intelligence Artificielle dans l'Éditeur",
|
||||
@@ -2630,6 +2653,7 @@
|
||||
"guide105.des_get": "L'application desktop ObsiGate (Tauri) embarque le serveur Python : aucune installation de Docker nécessaire. Elle se télécharge sur la page des Releases du dépôt et se met à jour automatiquement (updater signé).",
|
||||
"guide105.des_wizard": "Au premier lancement, un assistant demande le dossier de vos vaults (ou crée un vault de démonstration). Chaque document peut être détaché en fenêtre native séparée.",
|
||||
"guide105.des_data": "Les données desktop restent dans le répertoire applicatif ; les vaults pointent sur vos dossiers existants. Toutes les fonctionnalités web (recherche, IA, partage) sont disponibles.",
|
||||
"guide105.des_central": "La connexion accepte le compte admin local ou votre compte central (approbation dans le navigateur). L'environnement central (production og.dracodev.net ou développement og-dev.dracodev.net) se choisit au premier lancement et dans Configuration → Vaults & dossiers (Desktop).",
|
||||
"guide105.des_native": "Menu système natif, raccourci global optionnel pour afficher/masquer la fenêtre et jumplist des vaults récents.",
|
||||
"guide105.api_intro": "ObsiGate expose une API REST couvrant toute l'application (vaults, fichiers, recherche, backups, export, IA, partage, admin), documentée en OpenAPI 3.1 :",
|
||||
"guide105.api_docs_url": "<code>/docs</code> — interface Swagger UI pour essayer les requêtes en direct.",
|
||||
|
||||
@@ -12879,6 +12879,111 @@ mark {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
/* ── #230 : Configuration — environnement central (prod/dev) ─────────────── */
|
||||
.desktop-env-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.desktop-env-row label {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
color: var(--text, #fff);
|
||||
}
|
||||
.desktop-env-row select {
|
||||
padding: 7px 10px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border, #333);
|
||||
background: var(--surface2, #1a1a2e);
|
||||
color: var(--text, #fff);
|
||||
font-family: inherit;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.desktop-env-status {
|
||||
font-size: 0.78rem;
|
||||
color: var(--text-muted, #888);
|
||||
}
|
||||
|
||||
/* ── #230 : écran de connexion — compte central (desktop) ────────────────── */
|
||||
.login-central {
|
||||
margin-top: 20px;
|
||||
padding-top: 18px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.login-central-btn {
|
||||
width: 100%;
|
||||
padding: 11px 18px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--accent, #818cf8);
|
||||
background: transparent;
|
||||
color: var(--accent, #818cf8);
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
font-family: inherit;
|
||||
cursor: pointer;
|
||||
transition: background 150ms, color 150ms;
|
||||
}
|
||||
.login-central-btn:hover:not(:disabled) {
|
||||
background: var(--accent, #818cf8);
|
||||
color: #fff;
|
||||
}
|
||||
.login-central-btn:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.login-central-hint {
|
||||
margin: 6px 0 0;
|
||||
font-size: 0.75rem;
|
||||
color: rgba(255, 255, 255, 0.45);
|
||||
text-align: center;
|
||||
}
|
||||
.login-central-panel {
|
||||
margin-top: 14px;
|
||||
padding: 14px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--border, #333);
|
||||
background: var(--surface2, #1a1a2e);
|
||||
font-size: 0.85rem;
|
||||
color: var(--text, #fff);
|
||||
}
|
||||
.login-central-code {
|
||||
margin: 8px 0 10px;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.14em;
|
||||
text-align: center;
|
||||
color: var(--accent, #818cf8);
|
||||
}
|
||||
.login-central-status {
|
||||
margin: 8px 0 0;
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-muted, #888);
|
||||
}
|
||||
.login-central-status.error {
|
||||
color: var(--danger, #f87171);
|
||||
}
|
||||
.login-central-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.login-central-actions button {
|
||||
flex: 1;
|
||||
padding: 8px 10px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border, #333);
|
||||
background: transparent;
|
||||
color: var(--text, #fff);
|
||||
font-family: inherit;
|
||||
font-size: 0.8rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
[data-theme="light"] .login-central-hint {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
/* MFA Disable card */
|
||||
.mfa-disable-card {
|
||||
padding: 16px; border-radius: 10px;
|
||||
|
||||
Reference in New Issue
Block a user