mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-11-25 23:16:18 +01:00
feat(eosdash): plan page with EMS plan timeline and persisted settings (#1460)
* feat(eosdash): plan page with EMS plan timeline and persisted settings Fixes: - SolutionCard no longer appends to the module-level solution_excludes list on every render (the list grew without limit). - All EOSdash pages: keep the scroll position after htmx actions instead of jumping to the bottom; Bokeh() reserves the plot height. - Default visible PV column pvforecast_power_w -> pvforecast_ac_energy_wh (the old column no longer exists). - All EOSdash pages: remove w-screen from components.Page (horizontal scrollbar). - Solution chart: energy is the main axis; the always empty power axis is only shown with power columns. Typo "Electricty" fixed. Features: - EMS plan timeline per device, plan table as collapsible section. - Solution chart rework: KPI row, legend, totals view, value axes for the displayed columns only, units menu, currency from the timezone, aligned time axes with the timeline, themed tooltips, system font. - Per-column and per-command settings: visibility, alias, color, style; device aliases. - New config section eosdash.plan (server/dash/dashsettings.py) stores the plan page settings in the EOS configuration; docs regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: SchaafAlexander <86607129+SchaafAlexander@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7554e2dc47
commit
527c26d424
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
|
||||
import psutil
|
||||
import uvicorn
|
||||
from fasthtml.common import Base, FileResponse, JSONResponse
|
||||
from fasthtml.common import Base, FileResponse, JSONResponse, Script
|
||||
from loguru import logger
|
||||
from monsterui.core import FastHTML, Theme
|
||||
from starlette.middleware import Middleware
|
||||
@@ -197,6 +197,39 @@ if not favicon_filepath.exists():
|
||||
hdrs = (
|
||||
*BokehJS,
|
||||
Theme.green.headers(highlightjs=True),
|
||||
# Keep the scroll position when a control on the page replaces the page content.
|
||||
# Without this the content is shorter for a moment (plots not yet rendered,
|
||||
# sections closed) and the browser clamps the scroll position to the bottom.
|
||||
Script("""
|
||||
(function () {
|
||||
let saved = null;
|
||||
function scroller(el) {
|
||||
for (let e = el.parentElement; e; e = e.parentElement) {
|
||||
const overflowY = getComputedStyle(e).overflowY;
|
||||
if (overflowY === "auto" || overflowY === "scroll") return e;
|
||||
}
|
||||
return document.scrollingElement;
|
||||
}
|
||||
document.addEventListener("htmx:beforeSwap", (evt) => {
|
||||
const target = evt.detail.target;
|
||||
const elt = (evt.detail.requestConfig && evt.detail.requestConfig.elt) || evt.detail.elt;
|
||||
saved = null;
|
||||
// Only for controls inside the page content, navigation still starts at the top
|
||||
if (!target || target.id !== "page-content" || !elt || !target.contains(elt)) return;
|
||||
const s = scroller(target);
|
||||
saved = { target: target, s: s, top: s.scrollTop };
|
||||
target.style.minHeight = target.offsetHeight + "px";
|
||||
});
|
||||
document.addEventListener("htmx:afterSettle", () => {
|
||||
if (!saved) return;
|
||||
const { target, s, top } = saved;
|
||||
saved = null;
|
||||
s.scrollTop = top;
|
||||
// Give the plots time to render before the content may shrink again
|
||||
setTimeout(() => { target.style.minHeight = ""; }, 1500);
|
||||
});
|
||||
})();
|
||||
"""),
|
||||
)
|
||||
|
||||
# The EOSdash application
|
||||
|
||||
Reference in New Issue
Block a user