no message

This commit is contained in:
2025-06-18 11:50:50 +02:00
parent f0ea20a36c
commit 1a88308d45
2 changed files with 108 additions and 126 deletions

View File

@@ -3,57 +3,40 @@
<head>
<meta charset="utf-8">
<style>
.bar-container {
width: 100%;
background: #eee;
border-radius: 4px;
overflow: hidden;
height: 18px;
margin-bottom: 8px;
}
html, body { margin: 0; padding: 4px; background: transparent; }
.bar-container { width: 100%; background: #eee; border-radius: 4px; overflow: hidden; height: 20px; margin-bottom: 10px; }
.bar { height: 100%; float: left; }
.bar-cons { background: #4CAF50; }
.bar-feed { background: #8BC34A; }
.bar-pv { background: #FF9800; }
.bar-grid { background: #FF5722; }
.label {
font-size: 0.9em;
margin: 4px 0;
}
.bar-cons { background: #4CAF50; }
.bar-feed { background: #8BC34A; }
.bar-pv { background: #FF9800; }
.bar-grid { background: #FF5722; }
.label { font-size: 0.9em; margin-bottom: 4px; color: #333; }
</style>
</head>
<body>
<div class="label" id="prodLabel"></div>
<div class="bar-container">
<div class="bar bar-cons" id="barCons"></div>
<div class="bar bar-feed" id="barFeed"></div>
<div id="pv_visu">
<div class="label" id="prodLabel"></div>
<div class="bar-container">
<div class="bar bar-cons" id="barCons"></div>
<div class="bar bar-feed" id="barFeed"></div>
</div>
<div class="label" id="consLabel"></div>
<div class="bar-container">
<div class="bar bar-pv" id="barPV"></div>
<div class="bar bar-grid" id="barGrid"></div>
</div>
</div>
<div class="label" id="consLabel"></div>
<div class="bar-container">
<div class="bar bar-pv" id="barPV"></div>
<div class="bar bar-grid" id="barGrid"></div>
</div>
<script>
function Apply(data) {
document.getElementById('prodLabel').innerText =
"Produktion: " + data.value.prod + " kWh";
document.getElementById('barCons').style.width = data.prodCons + "%";
document.getElementById('barFeed').style.width = data.prodFeed + "%";
document.getElementById('consLabel').innerText =
"Verbrauch: " + data.value.cons + " kWh";
document.getElementById('barPV').style.width = data.consPV + "%";
document.getElementById('barGrid').style.width = data.consGrid + "%";
document.getElementById('prodLabel').innerText = 'Produktion: ' + data.value.prod + ' kWh';
document.getElementById('barCons').style.width = data.prodCons + '%';
document.getElementById('barFeed').style.width = data.prodFeed + '%';
document.getElementById('consLabel').innerText = 'Verbrauch: ' + data.value.cons + ' kWh';
document.getElementById('barPV').style.width = data.consPV + '%';
document.getElementById('barGrid').style.width = data.consGrid + '%';
}
function handleMessage(msg) {
if (msg) Apply(msg);
}
// Initial-Update anstoßen
requestAction('update', true);
function handleMessage(msg) { Apply(msg); }
// Kein initialer requestAction nötig, weil GetVisualizationTile bereits Daten injiziert
</script>
</body>
</html>