Move checkbox text before input

This commit is contained in:
2025-06-06 13:12:21 +01:00
parent 3d7d1609f3
commit ecdac3fc9a
6 changed files with 37 additions and 26 deletions

View File

@@ -616,6 +616,17 @@ th {
width: 100%; width: 100%;
} }
/* Alinhamento de texto e checkbox */
.checkbox-label {
display: flex;
align-items: center;
gap: 8px;
}
.checkbox-label input[type="checkbox"] {
margin: 0;
}
.button-grid { .button-grid {
margin-top: 10px; margin-top: 10px;
display: flex; display: flex;

View File

@@ -112,13 +112,13 @@ const Connectivity = () => {
{mqttMsg && <div className="message">{mqttMsg}</div>} {mqttMsg && <div className="message">{mqttMsg}</div>}
<form className="form" onSubmit={e => { e.preventDefault(); saveMqtt(); }}> <form className="form" onSubmit={e => { e.preventDefault(); saveMqtt(); }}>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Ativar MQTT
<input <input
type="checkbox" type="checkbox"
checked={mqttConfig.enabled} checked={mqttConfig.enabled}
onChange={e => setMqttConfig({ ...mqttConfig, enabled: e.target.checked })} onChange={e => setMqttConfig({ ...mqttConfig, enabled: e.target.checked })}
/> />
Ativar MQTT
</label> </label>
</div> </div>

View File

@@ -78,47 +78,47 @@ export default function ElectricalNetwork() {
/> />
</div> </div>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Alertas de Falha na Rede
<input <input
type="checkbox" type="checkbox"
checked={alerts} checked={alerts}
onChange={e => setAlerts(e.target.checked)} onChange={e => setAlerts(e.target.checked)}
/> />
Alertas de Falha na Rede
</label> </label>
</div> </div>
<h2>Proteção de Segurança Elétrica</h2> <h2>Proteção de Segurança Elétrica</h2>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Detecção de Falha de Aterramento
<input <input
type="checkbox" type="checkbox"
checked={security.earthFault} checked={security.earthFault}
onChange={e => setSecurity({ ...security, earthFault: e.target.checked })} onChange={e => setSecurity({ ...security, earthFault: e.target.checked })}
/> />
Detecção de Falha de Aterramento
</label> </label>
</div> </div>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Proteção RCM
<input <input
type="checkbox" type="checkbox"
checked={security.rcm} checked={security.rcm}
onChange={e => setSecurity({ ...security, rcm: e.target.checked })} onChange={e => setSecurity({ ...security, rcm: e.target.checked })}
/> />
Proteção RCM
</label> </label>
</div> </div>
<h2>Balanceamento de Carga</h2> <h2>Balanceamento de Carga</h2>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Habilitar Balanceamento de Carga
<input <input
type="checkbox" type="checkbox"
checked={loadBalancing.enabled} checked={loadBalancing.enabled}
onChange={e => setLoadBalancing({ ...loadBalancing, enabled: e.target.checked })} onChange={e => setLoadBalancing({ ...loadBalancing, enabled: e.target.checked })}
/> />
Habilitar Balanceamento de Carga
</label> </label>
</div> </div>
<div className="form-group"> <div className="form-group">
@@ -142,23 +142,23 @@ export default function ElectricalNetwork() {
/> />
</div> </div>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Direcionar Energia Solar para o EVSE
<input <input
type="checkbox" type="checkbox"
checked={solar.useSolar} checked={solar.useSolar}
onChange={e => setSolar({ ...solar, useSolar: e.target.checked })} onChange={e => setSolar({ ...solar, useSolar: e.target.checked })}
/> />
Direcionar Energia Solar para o EVSE
</label> </label>
</div> </div>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Gerenciamento de Excesso de Energia Solar
<input <input
type="checkbox" type="checkbox"
checked={solar.handleExcess} checked={solar.handleExcess}
onChange={e => setSolar({ ...solar, handleExcess: e.target.checked })} onChange={e => setSolar({ ...solar, handleExcess: e.target.checked })}
/> />
Gerenciamento de Excesso de Energia Solar
</label> </label>
</div> </div>

View File

@@ -74,13 +74,13 @@ export default function LoadBalancing() {
<form className="form" onSubmit={saveConfig}> <form className="form" onSubmit={saveConfig}>
{/* Controle de Ativação/Desativação */} {/* Controle de Ativação/Desativação */}
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Ativar Load Balancing
<input <input
type="checkbox" type="checkbox"
checked={enabled} checked={enabled}
onChange={toggleLoadBalancing} onChange={toggleLoadBalancing}
/> />
Ativar Load Balancing
</label> </label>
</div> </div>
@@ -104,14 +104,14 @@ export default function LoadBalancing() {
<label>Dispositivos a Balancear:</label> <label>Dispositivos a Balancear:</label>
{devices.map((device) => ( {devices.map((device) => (
<div key={device.id}> <div key={device.id}>
<label> <label className="checkbox-label">
{device.name}
<input <input
type="checkbox" type="checkbox"
value={device.id} value={device.id}
checked={selectedDevices.includes(device.id)} checked={selectedDevices.includes(device.id)}
onChange={handleDeviceChange} onChange={handleDeviceChange}
/> />
{device.name}
</label> </label>
</div> </div>
))} ))}

View File

@@ -44,13 +44,13 @@ export default function Mqtt() {
) : ( ) : (
<form className="form" onSubmit={e => { e.preventDefault(); save(); }}> <form className="form" onSubmit={e => { e.preventDefault(); save(); }}>
<div className="form-group"> <div className="form-group">
<label> <label className="checkbox-label">
Ativar MQTT
<input <input
type="checkbox" type="checkbox"
checked={config.enabled} checked={config.enabled}
onChange={e => setConfig({ ...config, enabled: e.target.checked })} onChange={e => setConfig({ ...config, enabled: e.target.checked })}
/> />
Ativar MQTT
</label> </label>
</div> </div>

View File

@@ -38,29 +38,29 @@ const Security = () => {
<div className="security-item"> <div className="security-item">
<h2>Métodos de Autorização</h2> <h2>Métodos de Autorização</h2>
<div className="auth-methods"> <div className="auth-methods">
<label> <label className="checkbox-label">
RFID
<input <input
type="checkbox" type="checkbox"
checked={authMethods.RFID} checked={authMethods.RFID}
onChange={() => handleAuthMethodChange('RFID')} onChange={() => handleAuthMethodChange('RFID')}
/> />
RFID
</label> </label>
<label> <label className="checkbox-label">
Aplicativo
<input <input
type="checkbox" type="checkbox"
checked={authMethods.App} checked={authMethods.App}
onChange={() => handleAuthMethodChange('App')} onChange={() => handleAuthMethodChange('App')}
/> />
Aplicativo
</label> </label>
<label> <label className="checkbox-label">
Senha
<input <input
type="checkbox" type="checkbox"
checked={authMethods.Password} checked={authMethods.Password}
onChange={() => handleAuthMethodChange('Password')} onChange={() => handleAuthMethodChange('Password')}
/> />
Senha
</label> </label>
</div> </div>
</div> </div>