Load color tag presets from an editable presets.json file

The presets move from app.js to presets.json, built into the binary and
served by /api/presets. PRESETS_FILE (default /data/presets.json) replaces
the list when present; it is read again each time Settings opens and the
built-in list is used if it is invalid. docs/presets.md (EN/FR) explains
each preset and the file format.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
cedricandClaude Opus 5.5 committed 2026-10-03 16:05:47 +02:00
1 parent 4225a2c870
commit 688a7dc2e6
14 files changed
+680 -126

No files matched your search

-22
View File
@@ -193,28 +193,6 @@
<button id="addTag" class="btn primary" type="button" data-i18n="addTag">+ Add tag</button>
<select id="presetTags" class="field" aria-label="Presets" data-i18n-aria="presetAria">
<option value="" data-i18n="presetPick">+ Preset…</option>
<optgroup label="HTTP/HTTPS">
<option value="http_status" data-i18n="preset_http_status">HTTP status codes</option>
<option value="http_methods" data-i18n="preset_http_methods">HTTP methods</option>
<option value="http_probes" data-i18n="preset_http_probes">Probes and attacks</option>
<option value="http_bots" data-i18n="preset_http_bots">Bots and scripts</option>
<option value="http_errors" data-i18n="preset_http_errors">TLS/HTTPS and proxy errors</option>
</optgroup>
<optgroup label="System" data-i18n-label="presetGroupSys">
<option value="sys_auth" data-i18n="preset_sys_auth">SSH and logins</option>
<option value="sys_sudo" data-i18n="preset_sys_sudo">sudo commands</option>
<option value="sys_kernel" data-i18n="preset_sys_kernel">Kernel: OOM, crashes, disks</option>
<option value="sys_systemd" data-i18n="preset_sys_systemd">systemd services</option>
<option value="sys_firewall" data-i18n="preset_sys_firewall">Firewall and fail2ban</option>
</optgroup>
<optgroup label="Applications" data-i18n-label="presetGroupApps">
<option value="app_docker" data-i18n="preset_app_docker">Docker and containers</option>
<option value="app_db" data-i18n="preset_app_db">Databases</option>
</optgroup>
<optgroup label="General" data-i18n-label="presetGroupGen">
<option value="gen_levels" data-i18n="preset_gen_levels">Log levels</option>
<option value="gen_ip" data-i18n="preset_gen_ip">IPv4 addresses</option>
</optgroup>
</select>
</span>
<button id="resetTags" class="btn ghost" type="button" data-i18n="resetTags">Restore default tags</button>