diff --git a/templates/index.html b/templates/index.html index 7d8106a..303495f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -351,6 +351,32 @@ .export-import-container button { margin-left: 10px; } + #add-record-button { + display: block; + margin: 20px auto; + width: 250px; + height: 60px; + font-size: 18px; + font-weight: bold; + color: #fff; + background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%); + border: none; + border-radius: 30px; + cursor: pointer; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); + transition: all 0.3s ease; + } + #add-record-button:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); + background: linear-gradient(90deg, #3d9afe 0%, #00d4fe 100%); + } + #add-record-button.dark-theme { + background: linear-gradient(90deg, #2a6eb4 0%, #1e90ff 100%); + } + #add-record-button.dark-theme:hover { + background: linear-gradient(90deg, #1e5ea4 0%, #1c7ed6 100%); + }
@@ -379,7 +405,7 @@ - +Ошибка загрузки данных. Проверьте консоль.
'); @@ -754,6 +789,10 @@ `).join('')); } updateSortArrows(); + // Восстанавливаем выделение после перерендера + if (selectedInstallId) { + $(`#installs-list .install-item[data-id="${selectedInstallId}"]`).addClass('selected'); + } } function selectInstall(installId, rustId, protocol) { @@ -1079,6 +1118,7 @@ const note = $('#note-textarea').val() || ''; const install = allInstalls.find(i => i.id === selectedInstallId); if (install) { + const currentSelectedId = selectedInstallId; // Сохраняем текущий selectedInstallId $.ajax({ url: `${API_URL}/install/${selectedInstallId}`, type: 'PUT', @@ -1093,8 +1133,13 @@ }), success: function () { console.log('Note saved successfully'); - loadInstalls(selectedFolderId); - closeNoteModal(); + loadInstalls(selectedFolderId); // Перезагружаем список + selectedInstallId = currentSelectedId; // Восстанавливаем selectedInstallId + closeNoteModal(); // Закрываем модальное окно + // Восстанавливаем выделение + const items = $('#installs-list .install-item'); + $(`#installs-list .install-item[data-id="${selectedInstallId}"]`).addClass('selected'); + updateNotesPanel(); }, error: function (xhr, status, error) { console.error("Ошибка сохранения заметки:", status, error);