From 1a672f0908978ea6019e451970b50f792bc6ef09 Mon Sep 17 00:00:00 2001 From: Verum Date: Wed, 18 Mar 2026 16:35:48 +0700 Subject: [PATCH] 21312 --- index.html | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 3ce6327..5fa88f1 100644 --- a/index.html +++ b/index.html @@ -652,27 +652,28 @@ SELECT * FROM users LIMIT 10;"> } async generateRecordForm() { - if (response.status === 401) { - this.logout(); - return []; - } const columns = await this.getTableStructure(this.currentTable); const container = document.getElementById('recordForm'); + if (!columns || columns.length === 0) { + container.innerHTML = `

Не удалось загрузить структуру таблицы

`; + return; + } + container.innerHTML = columns.map(col => ` -
- - -

${col.type}

-
- `).join(''); -} +
+ + +

${col.type}

+
+ `).join(''); + } async getTableStructure(tableName) { try { @@ -706,7 +707,11 @@ SELECT * FROM users LIMIT 10;"> const inputs = form.querySelectorAll('input'); const data = {}; inputs.forEach(input => { - if (input.type === 'number') { + if (input.name === 'id') return; + + if (input.type === 'checkbox') { + data[input.name] = input.checked; + } else if (input.type === 'number') { data[input.name] = parseFloat(input.value); } else { data[input.name] = input.value;