fix drag
parent
03bc10a98e
commit
6a904b76f0
1
app.py
1
app.py
|
|
@ -168,6 +168,7 @@ def update_install(install_id: int, data: InstallData):
|
||||||
new_computer_name = data.computer_name if data.computer_name is not None else current[1]
|
new_computer_name = data.computer_name if data.computer_name is not None else current[1]
|
||||||
new_install_time = data.install_time if data.install_time is not None else current[2]
|
new_install_time = data.install_time if data.install_time is not None else current[2]
|
||||||
new_folder_id = data.folder_id if data.folder_id is not None else current[3]
|
new_folder_id = data.folder_id if data.folder_id is not None else current[3]
|
||||||
|
# Используем текущее значение protocol, если data.protocol не передано (None)
|
||||||
new_protocol = data.protocol if data.protocol is not None else current[4]
|
new_protocol = data.protocol if data.protocol is not None else current[4]
|
||||||
new_note = data.note if data.note is not None else current[5]
|
new_note = data.note if data.note is not None else current[5]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -787,14 +787,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveInstallToFolder(installId, folderId) {
|
function moveInstallToFolder(installId, folderId) {
|
||||||
|
const install = allInstalls.find(i => i.id === installId);
|
||||||
|
if (install) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `${API_URL}/install/${installId}`,
|
url: `${API_URL}/install/${installId}`,
|
||||||
type: 'PUT',
|
type: 'PUT',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
folder_id: folderId,
|
folder_id: folderId,
|
||||||
// Добавляем текущее значение protocol
|
protocol: install.protocol
|
||||||
protocol: allInstalls.find(i => i.id === installId)?.protocol || 'rustdesk'
|
|
||||||
}),
|
}),
|
||||||
success: function () {
|
success: function () {
|
||||||
loadInstalls(selectedFolderId);
|
loadInstalls(selectedFolderId);
|
||||||
|
|
@ -804,6 +805,45 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportCSV() {
|
||||||
|
const folderId = $('#folder-select').val() || '';
|
||||||
|
window.location.href = `${API_URL}/export/csv?folder_id=${folderId}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function importCSV(file) {
|
||||||
|
if (!file) return;
|
||||||
|
|
||||||
|
const folderId = $('#folder-select').val() || '';
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (folderId) {
|
||||||
|
formData.append('folder_id', folderId);
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: `${API_URL}/import/csv`,
|
||||||
|
type: 'POST',
|
||||||
|
data: formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function (response) {
|
||||||
|
alert(response.message);
|
||||||
|
loadInstalls(selectedFolderId);
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
alert(`Ошибка импорта: ${xhr.responseJSON.detail || error}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function openNoteModal(installId, currentNote) {
|
||||||
|
selectedInstallId = installId;
|
||||||
|
$('#note-textarea').val(currentNote);
|
||||||
|
$('#note-modal').show();
|
||||||
|
$('#modal-overlay').show();
|
||||||
|
}
|
||||||
|
|
||||||
function saveNote() {
|
function saveNote() {
|
||||||
const note = $('#note-textarea').val() || '';
|
const note = $('#note-textarea').val() || '';
|
||||||
|
|
@ -815,7 +855,6 @@
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
note: note,
|
note: note,
|
||||||
// Добавляем текущее значение protocol
|
|
||||||
protocol: install.protocol
|
protocol: install.protocol
|
||||||
}),
|
}),
|
||||||
success: function () {
|
success: function () {
|
||||||
|
|
@ -888,7 +927,7 @@
|
||||||
function formatItalic() {
|
function formatItalic() {
|
||||||
const textarea = $('#note-textarea');
|
const textarea = $('#note-textarea');
|
||||||
const start = textarea[0].selectionStart;
|
const start = textarea[0].selectionStart;
|
||||||
end: textarea[0].selectionEnd;
|
const end = textarea[0].selectionEnd;
|
||||||
const text = textarea.val();
|
const text = textarea.val();
|
||||||
const selected = text.substring(start, end);
|
const selected = text.substring(start, end);
|
||||||
const newText = `*${selected}*`;
|
const newText = `*${selected}*`;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue