From cbb5367d642b70a37653d34da0eb021f6985afe9 Mon Sep 17 00:00:00 2001 From: "Satur@it-depot.ru" Date: Thu, 6 Mar 2025 13:07:08 +0300 Subject: [PATCH] fiiix --- templates/index.html | 54 +++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/templates/index.html b/templates/index.html index f4c9506..292241f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -26,10 +26,6 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - display: flex; - justify-content: center; - align-items: center; - flex-wrap: wrap; } .install-item .connection-id { width: 30%; @@ -37,10 +33,6 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - display: flex; - justify-content: center; - align-items: center; - flex-wrap: wrap; } .install-item .install-time { width: 25%; @@ -48,17 +40,9 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - display: flex; - justify-content: center; - align-items: center; - flex-wrap: wrap; } .install-item .actions { width: 25%; - display: flex; - justify-content: center; - align-items: center; - flex-wrap: wrap; } .form-container { margin-bottom: 20px; } .jstree-node { position: relative; } @@ -92,7 +76,7 @@ color: blue; text-decoration: underline; cursor: pointer; - margin-right: 3px; /* Отступ для баланса */ + margin-right: 5px; } .edit-button { background: #fff; @@ -101,7 +85,7 @@ padding: 2px 5px; border-radius: 3px; cursor: pointer; - margin: 0 2px; /* Уменьшенный отступ для центрирования */ + margin: 0 2px; transition: background 0.2s ease; } .edit-button:hover { @@ -115,7 +99,7 @@ padding: 2px 5px; border-radius: 3px; cursor: pointer; - margin: 0 2px; /* Уменьшенный отступ для центрирования */ + margin: 0 2px; transition: background 0.2s ease; } .copy-button:hover { @@ -123,7 +107,7 @@ color: #218838; } .action-buttons { margin-left: 5px; } - .action-buttons button { margin: 0 2px; } /* Уменьшенный отступ для центрирования */ + .action-buttons button { margin: 0 2px; } #import-form { margin-top: 5px; } #import-file { display: none; } #import-label { @@ -217,9 +201,9 @@
Пример: 2025-03-05 14:30:00
-
Имя компьютера
-
ID подключения
-
Время установки
+
Имя компьютера
+
ID подключения
+
Время установки
Действия
@@ -280,6 +264,7 @@ 'core': { 'data': function (node, cb) { $.getJSON(`${API_URL}/folders`, function (data) { + console.log("Loaded folders:", data); // Лог для отладки allFolders = data; // Сохраняем все папки const treeData = [ { id: "root", text: "Корень", parent: "#" } @@ -301,6 +286,8 @@ updateFolderActions(); }, 100); // Задержка для инициализации jstree } + }).fail(function(jqxhr, textStatus, error) { + console.error("Error loading folders:", textStatus, error); }); }, 'check_callback': true @@ -343,18 +330,21 @@ $.getJSON(`${API_URL}/folders`, function (data) { allFolders = data; // Обновляем список папок updateFolderSelect(); // Обновляем выпадающий список + }).fail(function(jqxhr, textStatus, error) { + console.error("Error loading folders:", textStatus, error); }); } function loadInstalls(folderId) { $.getJSON(`${API_URL}/installs`, function (data) { - console.log("Loaded installs:", data); // Логируем данные для отладки + console.log("Loaded installs:", data); // Лог для отладки allInstalls = data; let filtered = folderId ? data.filter(i => i.folder_id == folderId && i.folder_id !== null) : data; displayInstalls(filtered); updateNotesPanel(); }).fail(function(jqxhr, textStatus, error) { console.error("Error loading installs:", textStatus, error); + $('#installs-list').html('

Ошибка загрузки данных. Проверьте консоль.

'); }); selectedFolderId = folderId; } @@ -393,10 +383,10 @@ } else { $('#installs-list').html(installs.map(item => `
-
${item.computer_name}
-
${protocolIcons[item.protocol]}${item.rust_id}
-
${item.install_time}
-
+
${item.computer_name}
+
${protocolIcons[item.protocol]}${item.rust_id}
+
${item.install_time}
+
`).join('')); } @@ -408,7 +398,6 @@ $('.install-item').removeClass('selected'); $(`#installs-list .install-item[data-id="${installId}"]`).addClass('selected'); updateNotesPanel(); - // Убрано подтверждение, переход сразу const link = protocolLinks[protocol] + rustId; window.location.href = link; } @@ -598,13 +587,6 @@ }); } - function openRemote(id, protocol) { - if (confirm(`Подключиться к ${id} через ${protocol}?`)) { - const link = protocolLinks[protocol] + id; - window.location.href = link; - } - } - function exportCSV() { const folderId = $('#folder-select').val() || ''; window.location.href = `${API_URL}/export/csv?folder_id=${folderId}`;