garaga page 10
This commit is contained in:
@@ -394,20 +394,22 @@
|
||||
label.className = 'toggle-label';
|
||||
label.textContent = currentPower ? 'Ein' : 'Aus';
|
||||
|
||||
// State display
|
||||
const stateDisplay = document.createElement('div');
|
||||
stateDisplay.style.marginTop = '16px';
|
||||
stateDisplay.style.fontSize = '18px';
|
||||
stateDisplay.style.fontWeight = '600';
|
||||
stateDisplay.style.color = currentPower ? '#34c759' : '#666';
|
||||
stateDisplay.textContent = `Status: ${currentPower ? 'Eingeschaltet' : 'Ausgeschaltet'}`;
|
||||
|
||||
controlGroup.appendChild(toggleSwitch);
|
||||
controlGroup.appendChild(label);
|
||||
controlGroup.appendChild(stateDisplay);
|
||||
|
||||
card.appendChild(controlGroup);
|
||||
container.appendChild(card);
|
||||
|
||||
// State display as separate card
|
||||
const stateCard = document.createElement('div');
|
||||
stateCard.className = 'card';
|
||||
stateCard.style.textAlign = 'center';
|
||||
stateCard.innerHTML = `
|
||||
<div style="font-size: 18px; font-weight: 600; color: ${currentPower ? '#34c759' : '#666'};">
|
||||
Status: ${currentPower ? 'Eingeschaltet' : 'Ausgeschaltet'}
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(stateCard);
|
||||
}
|
||||
|
||||
function renderThreePhasePowerDisplay(container, device) {
|
||||
@@ -565,11 +567,15 @@
|
||||
toggleSwitch.className = `toggle-switch ${isOn ? 'on' : ''}`;
|
||||
label.textContent = isOn ? 'Ein' : 'Aus';
|
||||
|
||||
// Update state display
|
||||
const stateDisplay = section.querySelector('.control-group div:last-child');
|
||||
if (stateDisplay) {
|
||||
stateDisplay.style.color = isOn ? '#34c759' : '#666';
|
||||
stateDisplay.textContent = `Status: ${isOn ? 'Eingeschaltet' : 'Ausgeschaltet'}`;
|
||||
// Update state display in separate card
|
||||
const cards = section.querySelectorAll('.card');
|
||||
if (cards.length >= 3) { // Header, Control, State
|
||||
const stateCard = cards[2];
|
||||
stateCard.innerHTML = `
|
||||
<div style="font-size: 18px; font-weight: 600; color: ${isOn ? '#34c759' : '#666'};">
|
||||
Status: ${isOn ? 'Eingeschaltet' : 'Ausgeschaltet'}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user