fiiix
parent
b3050ec4a7
commit
cbb5367d64
|
|
@ -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 @@
|
|||
<div class="time-hint">Пример: 2025-03-05 14:30:00</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div>Имя компьютера<span class="sort-arrow"></span></div>
|
||||
<div>ID подключения<span class="sort-arrow"></span></div>
|
||||
<div>Время установки<span class="sort-arrow"></span></div>
|
||||
<div onclick="sortInstalls('computer_name')">Имя компьютера<span class="sort-arrow"></span></div>
|
||||
<div onclick="sortInstalls('rust_id')">ID подключения<span class="sort-arrow"></span></div>
|
||||
<div onclick="sortInstalls('install_time')">Время установки<span class="sort-arrow"></span></div>
|
||||
<div>Действия</div>
|
||||
</div>
|
||||
<div id="installs-list"></div>
|
||||
|
|
@ -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('<p>Ошибка загрузки данных. Проверьте консоль.</p>');
|
||||
});
|
||||
selectedFolderId = folderId;
|
||||
}
|
||||
|
|
@ -393,10 +383,10 @@
|
|||
} else {
|
||||
$('#installs-list').html(installs.map(item => `
|
||||
<div class="install-item" data-id="${item.id}" draggable="true">
|
||||
<div class="computer-name">${item.computer_name}<button class="edit-button" onclick="editField(${item.id}, 'computer_name', '${item.computer_name}')">✏️</button></div>
|
||||
<div class="connection-id"><span class="protocol-icon">${protocolIcons[item.protocol]}</span><a href="${protocolLinks[item.protocol]}${item.rust_id}" class="connection-link" target="_blank">${item.rust_id}</a><button class="copy-button" onclick="copyToClipboard('${item.rust_id}')">📋</button><button class="edit-button" onclick="editField(${item.id}, 'rust_id', '${item.rust_id}')">✏️</button></div>
|
||||
<div class="install-time">${item.install_time}<button class="edit-button" onclick="editField(${item.id}, 'install_time', '${item.install_time}')">✏️</button></div>
|
||||
<div class="actions"><span class="action-buttons"><button onclick="deleteInstall(${item.id})">Удалить</button><button onclick="openNoteModal(${item.id}, '${item.note}')">Заметка</button></span></div>
|
||||
<div class="computer-name">${item.computer_name} <button class="edit-button" onclick="editField(${item.id}, 'computer_name', '${item.computer_name}')">✏️</button></div>
|
||||
<div class="connection-id"><span class="protocol-icon">${protocolIcons[item.protocol]}</span><a href="${protocolLinks[item.protocol]}${item.rust_id}" class="connection-link" target="_blank">${item.rust_id}</a> <button class="copy-button" onclick="copyToClipboard('${item.rust_id}')">📋</button> <button class="edit-button" onclick="editField(${item.id}, 'rust_id', '${item.rust_id}')">✏️</button></div>
|
||||
<div class="install-time">${item.install_time} <button class="edit-button" onclick="editField(${item.id}, 'install_time', '${item.install_time}')">✏️</button></div>
|
||||
<div class="actions"><span class="action-buttons"><button onclick="deleteInstall(${item.id})">Удалить</button> <button onclick="openNoteModal(${item.id}, '${item.note}')">Заметка</button></span></div>
|
||||
</div>
|
||||
`).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}`;
|
||||
|
|
|
|||
Loading…
Reference in New Issue