Updated apps
This commit is contained in:
@@ -92,6 +92,7 @@ export function renderHistoryEntry(entry: HistoryEntry, ctx: HistoryContext) {
|
||||
<div class="history-content">
|
||||
<div class="history-row">
|
||||
<strong>${t(entry.type, L)}</strong>
|
||||
${entry.auto ? html`<span class="history-auto-badge">${t("history_auto", L)}</span>` : nothing}
|
||||
${editable
|
||||
? html`<button class="history-edit-btn"
|
||||
title=${t("history_edit_button", L) || "Edit entry"}
|
||||
|
||||
@@ -55,9 +55,20 @@ export function renderTriggerProgress(row: TaskRow | MaintenanceTask) {
|
||||
}
|
||||
} else if (triggerType === "counter") {
|
||||
const target = tc.trigger_target_value || 1;
|
||||
// Use delta if available, otherwise current value
|
||||
const delta = row.trigger_current_delta ?? null;
|
||||
const val = delta ?? (row.trigger_current_value ?? null);
|
||||
let val: number | null;
|
||||
if (tc.trigger_delta_mode) {
|
||||
// Delta mode: NEVER fall back to the raw counter — a lifetime odometer
|
||||
// at 27,000 km with a 15,000 km interval would render as a full red
|
||||
// "27000/15000" bar right after adoption, before the baseline reaches
|
||||
// the read-model (issue #102). Compute from the baseline if the delta
|
||||
// itself isn't exposed yet; show nothing rather than lie.
|
||||
val = row.trigger_current_delta ?? null;
|
||||
if (val == null && row.trigger_baseline_value != null && row.trigger_current_value != null) {
|
||||
val = row.trigger_current_value - row.trigger_baseline_value;
|
||||
}
|
||||
} else {
|
||||
val = row.trigger_current_value ?? null;
|
||||
}
|
||||
if (val == null) return nothing;
|
||||
pct = Math.min(100, Math.max(0, (val / target) * 100));
|
||||
label = `${val.toFixed(1)} / ${target} ${unit}`;
|
||||
|
||||
@@ -375,9 +375,13 @@ export function renderOverviewTab(task: MaintenanceTask, ctx: TaskDetailContext)
|
||||
<div class="tab-content overview-tab">
|
||||
${renderKPIBar(task, ctx)}
|
||||
${renderTaskMeta(task, ctx)}
|
||||
${renderDaysProgress(task, ctx.lang)}
|
||||
${renderTriggerSection(task, ctx.sparkline)}
|
||||
${renderPredictionSection(task, L, ctx.features)}
|
||||
${task.battery_fleet_task
|
||||
? html`<maintenance-battery-fleet-section .hass=${ctx.hass}></maintenance-battery-fleet-section>`
|
||||
: html`
|
||||
${renderDaysProgress(task, ctx.lang)}
|
||||
${renderTriggerSection(task, ctx.sparkline)}
|
||||
${renderPredictionSection(task, L, ctx.features)}
|
||||
`}
|
||||
<div class="two-column-layout ${hasLeftColumn ? '' : 'single-column'}">
|
||||
${hasLeftColumn ? html`
|
||||
<div class="left-column">
|
||||
|
||||
Reference in New Issue
Block a user