33800 Docs

← Retour

Task : Phase 3B - 01-index.sh Dynamique

Date : 13/01/2026 13:42 Duree : ~20 min Statut : TERMINE


Objectif

Migrer 01-index.sh (page principale du dashboard) pour utiliser config.json.


Realisations

1. Injection CONFIG dans JavaScript

Ajout au debut du script JS :

const CONFIG = { ... };  // depuis config.json
const nameMap = Object.fromEntries(
    Object.entries(CONFIG.hosts).map(([k, v]) => [k, v.label])
);
function getHostIP(host) { ... }
function getServicePort(service) { ... }

2. Suppression nameMap Hardcode

Avant :

const nameMap = { 'pve': 'PVE', 'proxmox1': 'Proxmox', ... };

Apres : Genere dynamiquement depuis CONFIG.hosts

3. Migration Liens Hardcodes

Element Avant Apres
Alerte nginx ssh 192.168.1.104 ssh ' + getHostIP('nginx') + '
Lien ComfyUI http://192.168.1.30:8188 http://${getHostIP('win11')}:${getServicePort('comfyui')}

4. Footer Dynamique

Footer genere depuis config.json (sections Infrastructure et Services). Sections Documentation et Monitoring restent statiques (liens internes).

5. Deploiement Shortlinks/Assets

Avant :

scp ... gouroubleu@192.168.1.104:/tmp/

Apres :

local nginx_ip=$(get_host_ip "nginx")
scp ... ${deploy_user}@${nginx_ip}:/tmp/

Fichiers Modifies

Fichier Lignes modifiees
01-index.sh ~85-110 (injection CONFIG)
01-index.sh ~275 (suppression nameMap)
01-index.sh ~321 (alerte nginx)
01-index.sh ~917 (lien ComfyUI)
01-index.sh ~1289-1365 (footer + deploiement)

Tests

./generate.sh  # OK
curl dashboard.33800.nowhere84.com | grep "const CONFIG"  # OK
curl dashboard.33800.nowhere84.com | grep "const nameMap"  # OK - genere dynamiquement
curl dashboard.33800.nowhere84.com | grep -A 10 '<footer'  # OK - IPs depuis config.json

Impact


Reste a Faire (Phase 3B - autres scripts)

Effort restant : ~2h