feat: type de jauge configurable (compact / standard)
- ServerConfig: champ gauge_type (défaut "compact") - CSS: classes .gs-* pour la BatteryGauge standard (label + bar 9px + gloss interne) - Grid: helper renderGaugeRow() — sélectionne compact ou standard selon la config - Grid: rerenderAll() pour appliquer le changement sans recharger la page - Popup config serveur: select "Type de jauge" dans la section Affichage des tuiles Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -312,6 +312,11 @@ const Popups = (() => {
|
||||
<input type="range" class="scfg-slider" min="10" max="18" value="${cfg.font_size ?? 13}"
|
||||
oninput="this.nextElementSibling.textContent=this.value+'px'" id="s-font">
|
||||
<span class="scfg-val">${cfg.font_size ?? 13}px</span></div>
|
||||
<div class="scfg-row"><label>Type de jauge</label>
|
||||
<select class="scfg-select" id="s-gauge-type">
|
||||
<option value="compact" ${(cfg.gauge_type ?? 'compact') === 'compact' ? 'selected' : ''}>Compact</option>
|
||||
<option value="standard" ${(cfg.gauge_type ?? 'compact') === 'standard' ? 'selected' : ''}>Standard</option>
|
||||
</select></div>
|
||||
</div>
|
||||
<div style="display:flex;flex-direction:column;gap:8px">
|
||||
<div class="scfg-sec-title">SEUILS D'ALERTE</div>
|
||||
@@ -372,11 +377,14 @@ const Popups = (() => {
|
||||
warn_disk: parseInt(document.getElementById('s-warn-disk')?.value ?? 75),
|
||||
retention_days: parseInt(document.getElementById('s-retention')?.value ?? 30),
|
||||
chart_duration_min: parseInt(document.getElementById('s-chart-dur')?.value ?? 30),
|
||||
gauge_type: document.getElementById('s-gauge-type')?.value ?? 'compact',
|
||||
};
|
||||
const prevGaugeType = App.serverConfig?.gauge_type ?? 'compact';
|
||||
await API.putServerConfig(cfg);
|
||||
App.serverConfig = cfg;
|
||||
document.documentElement.style.setProperty('--tile-min', cfg.tile_min_width + 'px');
|
||||
document.body.style.fontSize = cfg.font_size + 'px';
|
||||
if (cfg.gauge_type !== prevGaugeType) Grid.rerenderAll();
|
||||
hideSrvCfg();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user