123
This commit is contained in:
21
index.html
21
index.html
@@ -633,23 +633,30 @@ SELECT * FROM users LIMIT 10;"></textarea>
|
||||
}
|
||||
|
||||
// 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 => `
|
||||
|
||||
Reference in New Issue
Block a user