feat: URLs publiques de l'écosystème par configuration — dev/prod sans noms en dur #223
CI / lint (push) Successful in 3m11s
CI / security (push) Failing after 1m55s
CI / test (push) Successful in 5m23s
CI / build (push) Successful in 2m35s
CI / e2e (push) Successful in 18m24s

This commit is contained in:
Spark
2026-10-25 18:10:59 +00:00
parent 287afa1537
commit f29a22886a
21 changed files with 608 additions and 33 deletions
+7 -1
View File
@@ -23,6 +23,12 @@
kanbante: "#0d9488",
};
/* Base TikTak fournie par l'hôte via window.DRACO_URLS (contrat
* d'injection dracodev-commons, #223) ; repli = défaut officiel. */
function baseTikTak() {
return (window.DRACO_URLS && window.DRACO_URLS.tiktak) || "https://tiktak.dracodev.net";
}
function t(key, fallback) {
try {
var v = window.t && window.t(key);
@@ -92,7 +98,7 @@
t("draco.links.projected", "Tâche TikTak projetée")));
var ouvrir = el("a", "btn-action draco-liens-ouvrir",
t("draco.links.openInTikTak", "Ouvrir dans TikTak"));
ouvrir.href = "https://tiktak.dracodev.net/?task=" + tid[1];
ouvrir.href = baseTikTak() + "/?task=" + tid[1];
ouvrir.target = "_blank";
ouvrir.rel = "noopener";
bandeau.appendChild(ouvrir);
+7 -2
View File
@@ -32,7 +32,10 @@
* configuré / exécuteur non configuré sont affichés tels quels. */
(function () {
"use strict";
var API = "https://agent.dracodev.net";
/* URL du service : fournie par l'hôte via window.DRACO_URLS
* (contrat d'injection dracodev-commons, #223) — le repli est le
* défaut officiel ; aucun nom d'environnement n'est figé ici. */
var API = (window.DRACO_URLS && window.DRACO_URLS.agent) || "https://agent.dracodev.net";
var convId = null;
var convKind = null; // 'principale' | 'parallele'
var convTitre = "";
@@ -56,7 +59,9 @@
/* ── Console web (même service, surimpression pleine page) ─── */
function appHote() {
var h = (window.location.hostname || "").split(".")[0];
/* Premier label de l'hôte, suffixe d'environnement éventuel
* retiré (ex. « og-dev » → « og » en dev, #223). */
var h = (window.location.hostname || "").split(".")[0].replace(/-dev$/, "");
var correspondance = { tiktak: "tiktak", flowdeck: "flowdeck",
kanbante: "kanbante", og: "obsigate" };
return correspondance[h] || null;
+10
View File
@@ -397,6 +397,16 @@
localement ; la recherche focus la recherche native
d'ObsiGate ; Alertes unifiées et Spark arrivent avec la
fédération / l'agent commun (phases suivantes). */
/* #223 : les href des onglets portent les défauts officiels ;
l'hôte les réécrit depuis window.DRACO_URLS (injecté par le
backend depuis sa configuration) quand il est présent. */
(function () {
if (!window.DRACO_URLS) return;
document.querySelectorAll(".draco-apptab").forEach(function (a) {
var u = window.DRACO_URLS[a.dataset.app];
if (u) a.href = u.replace(/\/$/, "") + "/";
});
})();
window.DRACO_BAR_CONFIG = {
current: "obsigate",
domain: (function () { try { return localStorage.getItem("draco_domain") || "pro"; } catch (e) { return "pro"; } })(),