Configurar Top-Rack como ajuste global
This commit is contained in:
+25
-7
@@ -233,7 +233,6 @@
|
||||
.field-role { grid-column: span 3; }
|
||||
.field-model { grid-column: span 2; }
|
||||
.field-location { grid-column: span 2; }
|
||||
.field-rack-temp { grid-column: span 4; }
|
||||
.field-host { grid-column: span 3; }
|
||||
.field-port { grid-column: span 1; }
|
||||
.field-username { grid-column: span 2; }
|
||||
@@ -446,7 +445,7 @@
|
||||
|
||||
@media (max-width: 1180px) {
|
||||
.device { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; }
|
||||
.field-name, .field-role, .field-host, .password-credential, .field-rack-temp { grid-column: span 3; }
|
||||
.field-name, .field-role, .field-host, .password-credential { grid-column: span 3; }
|
||||
.field-id, .field-model, .field-location, .field-username, .field-auth, .field-active, .field-delete { grid-column: span 2; }
|
||||
.field-port { grid-column: span 1; }
|
||||
.credential-note { grid-column: span 4; }
|
||||
@@ -461,7 +460,7 @@
|
||||
.top-grid, .device { grid-template-columns: 1fr; }
|
||||
.field-active, .field-name, .field-id, .field-role, .field-model, .field-location,
|
||||
.field-host, .field-port, .field-username, .field-auth, .password-credential,
|
||||
.credential-note, .field-rack-temp, .field-delete { grid-column: span 1; }
|
||||
.credential-note, .field-delete { grid-column: span 1; }
|
||||
.threshold-row { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
@@ -503,6 +502,17 @@
|
||||
<input id="sshTimeoutSeconds" type="number" min="2" step="1">
|
||||
</label>
|
||||
</div>
|
||||
<div class="ssh-key-panel">
|
||||
<h2>Temperatura Top-Rack</h2>
|
||||
<div class="ssh-key-fields">
|
||||
<label title="RPi desde el que el monitor leera el archivo JSON de temperatura. Se muestra nombre e IP para identificarlo rapido.">RPi origen
|
||||
<select id="rackTemperatureSourceDeviceId"></select>
|
||||
</label>
|
||||
<label title="Path del archivo JSON en el RPi origen. Node-RED debe escribir ahi la ultima temperatura.">Path JSON temperatura
|
||||
<input id="rackTemperatureFile" placeholder="/home/yamaray/monitor-rpi/rack-temp.json">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ssh-key-panel">
|
||||
<h2>Clave SSH del monitor</h2>
|
||||
<div class="ssh-key-fields">
|
||||
@@ -703,9 +713,6 @@
|
||||
<div class="credential-note">
|
||||
Metodo activo: <strong>${authMethod === "key" ? "Clave asimetrica: copiar clave publica del monitor en la RPi" : "Password"}</strong>
|
||||
</div>
|
||||
<label class="field-rack-temp" title="Archivo opcional en este RPi con la temperatura del rack escrita por Node-RED. Si esta vacio, no se recoge temperatura Top-Rack desde este dispositivo.">Archivo temp rack
|
||||
<input data-field="rackTemperatureFile" value="${device.rackTemperatureFile || ""}" placeholder="/home/yamaray/monitor-rpi/rack-temp.json">
|
||||
</label>
|
||||
<label class="field-active" title="Si esta activo, este dispositivo se consulta por SSH. Si esta inactivo, se muestra deshabilitado y no se escanea.">Activo
|
||||
<input data-field="active" type="checkbox" ${device.active ? "checked" : ""}>
|
||||
</label>
|
||||
@@ -720,6 +727,16 @@
|
||||
document.querySelector("#refreshIntervalSeconds").value = state.config.refreshIntervalSeconds || 30;
|
||||
document.querySelector("#idleScanIntervalSeconds").value = state.config.idleScanIntervalSeconds || 300;
|
||||
document.querySelector("#sshTimeoutSeconds").value = state.config.sshTimeoutSeconds || 8;
|
||||
const rackSource = document.querySelector("#rackTemperatureSourceDeviceId");
|
||||
rackSource.innerHTML = [
|
||||
`<option value="">Sin sensor Top-Rack</option>`,
|
||||
...state.config.devices.map((device) => {
|
||||
const value = device.id || device.host || device.name || "";
|
||||
const label = `${device.name || value} · ${device.host || "sin IP"}`;
|
||||
return `<option value="${value}" ${state.config.rackTemperatureSourceDeviceId === value ? "selected" : ""}>${label}</option>`;
|
||||
})
|
||||
].join("");
|
||||
document.querySelector("#rackTemperatureFile").value = state.config.rackTemperatureFile || "";
|
||||
document.querySelector("#sshPrivateKeyPath").value = state.config.sshPrivateKeyPath || "/ssh/monitor_rpi_ed25519";
|
||||
document.querySelector("#sshPublicKeyPath").value = state.config.sshPublicKeyPath || `${document.querySelector("#sshPrivateKeyPath").value}.pub`;
|
||||
document.querySelector("#warningTemp").value = state.config.temperatureThresholdsC?.warning || 60;
|
||||
@@ -745,6 +762,8 @@
|
||||
state.config.refreshIntervalSeconds = Number(document.querySelector("#refreshIntervalSeconds").value || 30);
|
||||
state.config.idleScanIntervalSeconds = Number(document.querySelector("#idleScanIntervalSeconds").value || 300);
|
||||
state.config.sshTimeoutSeconds = Number(document.querySelector("#sshTimeoutSeconds").value || 8);
|
||||
state.config.rackTemperatureSourceDeviceId = document.querySelector("#rackTemperatureSourceDeviceId").value || "";
|
||||
state.config.rackTemperatureFile = document.querySelector("#rackTemperatureFile").value || "";
|
||||
state.config.sshPrivateKeyPath = document.querySelector("#sshPrivateKeyPath").value || "/ssh/monitor_rpi_ed25519";
|
||||
state.config.sshPublicKeyPath = document.querySelector("#sshPublicKeyPath").value || `${state.config.sshPrivateKeyPath}.pub`;
|
||||
state.config.temperatureThresholdsC = {
|
||||
@@ -852,7 +871,6 @@
|
||||
password: "",
|
||||
privateKeyPath: "",
|
||||
authMethod: "password",
|
||||
rackTemperatureFile: "",
|
||||
model: "RPi 4",
|
||||
role: "",
|
||||
location: "Rack",
|
||||
|
||||
Reference in New Issue
Block a user