fix(assistant): reboot = downtime honnête (≥3 min) + sévérité haute

Louis : un reboot coupe l'accès du client au moins 3 min (pas ~2). L'aperçu de
device_action(reboot) le dit désormais clairement et reboot/speed passent en
severity 'high' (l'ONU redémarre = vraie coupure), aux 2 chemins (TR-069 tech-3
+ SNMP tech-2). Rappel : le reboot ne part JAMAIS sans clic Confirmer humain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
louispaulb 2026-07-20 07:53:03 -04:00
parent 4f24179f4f
commit a580a49eed

View File

@ -303,13 +303,13 @@ const WRITES = {
// Repli REBOOT → TR-069 : les ONU tech-3 (TPLG, la plus grosse flotte) ne rebootent PAS via olt-ops (SNMP
// Raisecom = tech-2). On passe alors par GenieACS (devices.rebootBySerial). Autres actions : non exécutables.
if (action === 'reboot') {
return { title: META.device_action.title, preview: `Redémarrer le modem (TR-069) — ONU ${serial}${who} · le modem redémarre (~2 min hors ligne).`, severity: 'normal', params: { via: 'tr069', serial, action, idempotencyKey } }
return { title: META.device_action.title, preview: `Redémarrer le modem (TR-069) — ONU ${serial}${who} · ⚠ coupe l'accès du client au moins ~3 min (le temps que le modem redémarre et se reconnecte).`, severity: 'high', params: { via: 'tr069', serial, action, idempotencyKey } }
}
throw new Error(`« ${pl.label || action} » non exécutable pour ${serial}${(pl.warnings && pl.warnings.length) ? ' — ' + pl.warnings.join(' ') : ''}`)
}
const warn = (pl.warnings && pl.warnings.length) ? ' ⚠ ' + pl.warnings.join(' ') : ''
const preview = `${pl.label} — ONU ${pl.target.serial}${pl.target.olt ? ' · OLT ' + pl.target.olt : ''}${who}${(pl.effects && pl.effects.length) ? ' · ' + pl.effects.join(' ') : ''}${warn}`
const severity = /^(suspend|remove|replace|activate)$/.test(action) ? 'high' : 'normal'
const severity = /^(suspend|remove|replace|activate|reboot|speed)$/.test(action) ? 'high' : 'normal' // reboot/speed = l'ONU redémarre (coupure) ⇒ conséquent
return { title: META.device_action.title, preview, severity, params: { via: 'olt', serial, action, profileid: opts.profileid || '', new_sn: opts.new_sn || '', idempotencyKey } }
},
async exec (p, email) {