Speichern von Holding und Coils ging nicht mehr

This commit is contained in:
eneuber committed 2026-03-23 21:13:04 +01:00
1 parent e6c60d0707
commit 58f5522442
3 files changed
+28 -31

No files matched your search

+8 -7
View File
@@ -56,7 +56,7 @@ function addRow() {
<button class="delete-btn" onclick="deleteRow(this)">🗑️</button>
</td>
`;
} else if (typeof tableId !== 'undefined' && tableId === 'modbus_holding_registers') {
} else if (typeof tableId !== 'undefined' && tableId === 'modbus_holding_register') {
newRow.innerHTML = `
<td><input type='text' class='text-input' data-field='bezeichnung' value='' /></td>
<td><input type='text' class='text-input' data-field='adresse' value='' /></td>
@@ -147,14 +147,14 @@ async function saveTable() {
influxdb: influxdb,
comment: comment
};
} else if (typeof tableId !== 'undefined' && tableId === 'modbus_holding_registers') {
} else if (typeof tableId !== 'undefined' && tableId === 'modbus_holding_register') {
const write = row.querySelector("input[data-field='write']")?.checked || false;
const rtype = row.querySelector("input[data-field='type']")?.value || null;
const type = row.querySelector("input[data-field='type']")?.value || null;
const factor = parseFloat(row.querySelector("input[data-field='factor']")?.value || row.querySelector("input[data-field='faktor']")?.value || '1.0');
const comment = row.querySelector("input[data-field='comment']")?.value || null;
value = {
addr: addr,
rtype: rtype,
type: type,
factor: factor,
write: write,
mqtt: mqtt,
@@ -162,12 +162,12 @@ async function saveTable() {
comment: comment
};
} else {
const rtype = row.querySelector("input[data-field='type']")?.value || null;
const type = row.querySelector("input[data-field='type']")?.value || null;
const factor = parseFloat(row.querySelector("input[data-field='factor']")?.value || row.querySelector("input[data-field='faktor']")?.value || '1.0');
const comment = row.querySelector("input[data-field='comment']")?.value || null;
value = {
addr: addr,
rtype: rtype,
type: type,
factor: factor,
mqtt: mqtt,
influxdb: influxdb,
@@ -196,8 +196,9 @@ async function saveTable() {
messageDiv.className = 'message success';
messageDiv.textContent = '✓ Erfolgreich gespeichert!';
} else {
const errorText = (await response.text()) || 'Unbekannter Fehler';
messageDiv.className = 'message error';
messageDiv.textContent = '✗ Fehler beim Speichern!';
messageDiv.textContent = `✗ Fehler beim Speichern: ${errorText}`;
}
setTimeout(() => {