Update v2026.5.41 — helpers getAdminConfig/getEvOrigins/getGroupId/getSupportIds/getDayBounds

2026-04-27 02:14:06 +02:00
parent 3893a08f4e
commit 5b31b6c8a0
+14
@@ -112,6 +112,20 @@ Utilisateur clique sur l'icône
| `detectTeamFromEV` (paramétrable depuis v2026.5.40) | Liste les membres d'un groupe ; accepte un `groupId` en argument pour basculer entre SI-CSS / SI-EXT |
| `evFetch` | Wrapper fetch avec headers EV (Referer, X-Requested-With) |
## Helpers de lecture de config (v2026.5.41)
Côté `background.js`, tous les hardcodes runtime ont été remplacés par des helpers qui lisent `admin_config` à chaque appel :
| Helper | Retourne | Fallback |
|---|---|---|
| `getAdminConfig()` | objet `cfg` complet | `{}` |
| `getEvOrigins()` | tableau d'origines à surveiller | `DEFAULT_EV_ORIGINS` (2 défauts hardcodés) |
| `getGroupId()` | string group_id | `DEFAULT_GROUP_ID = "191"` (SI-CSS) |
| `getSupportIds()` | CSV des clés de `cfg.team` | `""` (lève `no_team_configured` côté `fetchPlanningXml`) |
| `getDayBounds()` | `{ start, end }` heures | `{ start: 8, end: 18 }` |
`fetchPlanningXml()` lève `Error("no_team_configured")` quand `getSupportIds()` retourne une chaîne vide → le viewer affiche un message invitant à configurer Paramètres → Équipe.
## Configuration persistée
`chrome.storage.local["admin_config"]` :