diff --git a/favicon.svg b/favicon.svg index cffe28a..c3d3242 100644 --- a/favicon.svg +++ b/favicon.svg @@ -1,14 +1,16 @@ - - - + + - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index 958a0dd..e5144dc 100644 --- a/index.html +++ b/index.html @@ -583,15 +583,8 @@ SELECT * FROM users LIMIT 10;"> const filterInputs = document.getElementById('filterInputs'); const body = document.getElementById('tableBody'); - if (records.length === 0) { - headers.innerHTML = ''; - filterInputs.innerHTML = ''; - body.innerHTML = 'Нет данных'; - return; - } - // Generate headers - const columns = Object.keys(records[0]); + const columns = records.length > 0 ? Object.keys(records[0]) : this.tableStructure.map(col => col.name); headers.innerHTML = columns.map(col => { const isSorted = this.sortColumn === col; const arrow = isSorted ? (this.sortDirection === 'ASC' ? '↑' : '↓') : ''; @@ -603,7 +596,10 @@ SELECT * FROM users LIMIT 10;"> return ``; }).join('') + ''; - // Generate rows + if (records.length === 0) { + body.innerHTML = 'Нет данных'; + return; + } body.innerHTML = records.map(record => { const pkValue = this.primaryKey ? record[this.primaryKey] : null; const cells = columns.map(col => {