UPDATE MONITORING
This commit is contained in:
parent
dad3d4f519
commit
a3a114417e
@ -44,7 +44,7 @@ export default function PowerMonitoringPage() {
|
||||
...prev["room_1"],
|
||||
"Lampu 1": backendData.lampu1 === "on",
|
||||
"Lampu 2": backendData.lampu2 === "on",
|
||||
"AC 1": backendData.ac === "on",
|
||||
"AC": backendData.ac === "on",
|
||||
"Proyektor": backendData.projector === "on",
|
||||
}
|
||||
}));
|
||||
@ -73,7 +73,7 @@ export default function PowerMonitoringPage() {
|
||||
initialStatus[`room_${room.id}`] = {
|
||||
"Lampu 1": false,
|
||||
"Lampu 2": false,
|
||||
"AC 1": false,
|
||||
"AC": false,
|
||||
"Proyektor": false,
|
||||
};
|
||||
});
|
||||
@ -109,7 +109,7 @@ export default function PowerMonitoringPage() {
|
||||
|
||||
// Mapping nama device untuk backend
|
||||
let backendDevice = "";
|
||||
if (deviceName === 'AC 1') backendDevice = "ac";
|
||||
if (deviceName === 'AC') backendDevice = "ac";
|
||||
else if (deviceName === 'Proyektor') backendDevice = "projector";
|
||||
else if (deviceName === 'Lampu 1') backendDevice = "lampu1";
|
||||
else if (deviceName === 'Lampu 2') backendDevice = "lampu2";
|
||||
@ -235,16 +235,16 @@ export default function PowerMonitoringPage() {
|
||||
<Lightbulb size={14} className={currentRoomStatus['Lampu 2'] ? "fill-yellow-500" : ""} /> Lampu 2
|
||||
</button>
|
||||
|
||||
{/* AC 1 */}
|
||||
{/* AC */}
|
||||
<button
|
||||
onClick={() => handleDeviceToggle(room.id, room.name, 'AC 1')}
|
||||
onClick={() => handleDeviceToggle(room.id, room.name, 'AC')}
|
||||
disabled={!room.isRelayOn}
|
||||
className={`flex justify-center items-center gap-2 p-2 rounded-lg text-xs font-bold transition-all
|
||||
${currentRoomStatus['AC 1']
|
||||
${currentRoomStatus['AC']
|
||||
? 'bg-blue-100 text-blue-600 border border-blue-200'
|
||||
: 'bg-gray-50 text-gray-400 border border-transparent'}`}
|
||||
>
|
||||
<Wind size={14} className={currentRoomStatus['AC 1'] ? "animate-pulse" : ""} /> AC 1
|
||||
<Wind size={14} className={currentRoomStatus['AC'] ? "animate-pulse" : ""} /> AC
|
||||
</button>
|
||||
|
||||
{/* PROYEKTOR */}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user