From 7f77da822f6bd62a6bbc81f6475d4ff2547de47b Mon Sep 17 00:00:00 2001 From: Verum Date: Wed, 18 Mar 2026 16:28:24 +0700 Subject: [PATCH] 123 --- index.html | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 1e16765..3ce6327 100644 --- a/index.html +++ b/index.html @@ -633,39 +633,46 @@ SELECT * FROM users LIMIT 10;"> } // CRUD Operations - showAddRecordModal() { + async showAddRecordModal() { this.editingRecord = null; document.getElementById('recordModalTitle').textContent = 'Добавить запись'; - this.generateRecordForm(); + + await this.generateRecordForm(); + document.getElementById('recordModal').classList.remove('hidden'); } - editRecord(idx) { + async editRecord(idx) { this.editingRecord = idx; document.getElementById('recordModalTitle').textContent = 'Редактировать запись'; - this.generateRecordForm(); + + await this.generateRecordForm(); + document.getElementById('recordModal').classList.remove('hidden'); } - generateRecordForm() { - // Get columns based on current table structure - const columns = this.getTableStructure(this.currentTable); + async generateRecordForm() { + if (response.status === 401) { + this.logout(); + return []; + } + const columns = await this.getTableStructure(this.currentTable); const container = document.getElementById('recordForm'); - + container.innerHTML = columns.map(col => ` -
- - -

${col.type}

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

${col.type}

+
+ `).join(''); +} async getTableStructure(tableName) { try {