diff --git a/templates/index.html b/templates/index.html index 90e9953..464ca2e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -100,8 +100,8 @@ color: #e0e0e0 !important; } #search-container { - margin-top: 20px; /* Сдвигаем поиск ниже */ - text-align: left; /* Выравнивание влево для поля поиска */ + margin-top: 20px; + text-align: left; } #search-container.dark-theme input, #search-container.dark-theme select { background-color: #333; @@ -109,16 +109,16 @@ border: 1px solid #555; } #search-input { - width: 300px; /* Увеличенная ширина */ - height: 40px; /* Увеличенная высота */ - font-size: 16px; /* Более заметный текст */ - padding: 5px 10px; /* Внутренние отступы */ - border: 2px solid #007bff; /* Более толстая и заметная граница */ - border-radius: 5px; /* Скругленные углы */ + width: 300px; + height: 40px; + font-size: 16px; + padding: 5px 10px; + border: 2px solid #007bff; + border-radius: 5px; transition: border-color 0.3s ease; } #search-input:focus { - border-color: #0056b3; /* Изменение цвета границы при фокусе */ + border-color: #0056b3; outline: none; } #search-input.dark-theme { @@ -314,14 +314,13 @@ .theme-toggle.dark-theme:hover { background: #0066cc; } - /* Новый стиль для правого блока кнопок */ .export-import-container { display: flex; - justify-content: flex-end; /* Выравнивание вправо */ - margin-top: 10px; /* Отступ сверху */ + justify-content: flex-end; + margin-top: 10px; } .export-import-container button { - margin-left: 10px; /* Отступ между кнопками */ + margin-left: 10px; } @@ -646,7 +645,7 @@
${item.computer_name}
${protocolIcons[item.protocol]}${item.rust_id}
${item.install_time}
-
+
`).join('')); } @@ -898,13 +897,21 @@ } function openNoteModal(installId, currentNote) { - selectedInstallId = installId; - $('#note-textarea').val(currentNote); + console.log('Opening note modal for installId:', installId, 'with note:', currentNote); + selectedInstallId = installId; // Устанавливаем выбранный ID + $('#note-textarea').val(currentNote || ''); // Устанавливаем текущую заметку или пустую строку $('#note-modal').show(); $('#modal-overlay').show(); } function saveNote() { + console.log('Saving note for installId:', selectedInstallId); + if (!selectedInstallId) { + console.error('No install selected'); + alert('Выберите запись для редактирования заметки.'); + return; + } + const note = $('#note-textarea').val() || ''; const install = allInstalls.find(i => i.id === selectedInstallId); if (install) { @@ -914,15 +921,16 @@ contentType: 'application/json', data: JSON.stringify({ note: note, - protocol: install.protocol + protocol: install.protocol // Сохраняем текущий protocol }), success: function () { - loadInstalls(selectedFolderId); + console.log('Note saved successfully'); + loadInstalls(selectedFolderId); // Обновляем список установок closeNoteModal(); }, error: function (xhr, status, error) { console.error("Ошибка сохранения заметки:", status, error); - alert("Не удалось сохранить заметку"); + alert(`Не удалось сохранить заметку: ${xhr.responseJSON?.detail || error}`); } }); }