Refactor Dockerfile and docker-compose.yml to use new directory structure and update volume paths
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -203,6 +203,7 @@
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function performUpdate() {
|
||||
fetch('/applyupdate')
|
||||
.then(response => response.json())
|
||||
@@ -467,21 +468,71 @@ async function getUserIdFromFolder(username) {
|
||||
return user ? user.id : null;
|
||||
}
|
||||
|
||||
async function showFileInfo(fileLink) {
|
||||
window.onload = async function() {
|
||||
console.log("Page loaded, fetching file info...");
|
||||
|
||||
let data;
|
||||
try {
|
||||
let response = await fetch('/data/file_info.json');
|
||||
let response = await fetch('/api/dpanel/dashboard/getmetadatafile/file_info', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
console.log("Response from fetch:", response);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
let fileContent = await response.text();
|
||||
data = JSON.parse(fileContent);
|
||||
data = await response.json();
|
||||
console.log("Data from response:", data);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.log("Error in fetch:", error);
|
||||
Swal.fire({
|
||||
position: 'top',
|
||||
icon: 'error',
|
||||
title: 'Les informations sur le fichier ne sont pas disponibles pour le moment. Veuillez réessayer plus tard.',
|
||||
text: `Error: ${error.message}`,
|
||||
showConfirmButton: false,
|
||||
timer: 1800,
|
||||
toast: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let table = document.getElementById("fileTable");
|
||||
for (let file of data) {
|
||||
let row = table.insertRow();
|
||||
let cell = row.insertCell();
|
||||
cell.innerHTML = `<a href="#" onclick="showFileInfo('${file.fileName}')">${file.fileName}</a>`;
|
||||
}
|
||||
}
|
||||
|
||||
async function showFileInfo(fileLink) {
|
||||
console.log("showFileInfo called with fileLink:", fileLink);
|
||||
let data;
|
||||
try {
|
||||
let response = await fetch('/api/dpanel/dashboard/getmetadatafile/file_info', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
fileLink: fileLink,
|
||||
})
|
||||
});
|
||||
console.log("Response from fetch:", response);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
data = await response.json();
|
||||
console.log("Data from response:", data);
|
||||
} catch (error) {
|
||||
console.log("Error in fetch:", error);
|
||||
Swal.fire({
|
||||
position: 'top',
|
||||
icon: 'error',
|
||||
title: 'Les informations sur le fichier ne sont pas disponibles pour le moment. Veuillez réessayer plus tard.',
|
||||
text: `Error: ${error.message}`,
|
||||
showConfirmButton: false,
|
||||
timer: 1800,
|
||||
toast: true,
|
||||
@@ -490,11 +541,12 @@ async function showFileInfo(fileLink) {
|
||||
}
|
||||
|
||||
let pathParts = fileLink.split('/');
|
||||
console.log("pathParts:", pathParts);
|
||||
if (pathParts.length < 4) {
|
||||
Swal.fire({
|
||||
position: 'top',
|
||||
icon: 'error',
|
||||
title: `Le lien du fichier ${fileLink} n'est pas valide.`,
|
||||
title: `The file link ${fileLink} is not valid.`,
|
||||
showConfirmButton: false,
|
||||
timer: 1800,
|
||||
toast: true,
|
||||
@@ -510,7 +562,7 @@ async function showFileInfo(fileLink) {
|
||||
Swal.fire({
|
||||
position: 'top',
|
||||
icon: 'error',
|
||||
title: `Aucune information trouvée pour le fichier ${fileName} pour l'utilisateur avec l'ID ${userId}.`,
|
||||
title: `No information found for the file ${fileName} for the user with ID ${userId}.`,
|
||||
showConfirmButton: false,
|
||||
timer: 1800,
|
||||
toast: true,
|
||||
@@ -520,17 +572,20 @@ async function showFileInfo(fileLink) {
|
||||
|
||||
console.log('Found fileInfo:', fileInfo);
|
||||
|
||||
let html = `<p>Nom du fichier : ${fileInfo.fileName}</p>`;
|
||||
let html = `<p>File name: ${fileInfo.fileName}</p>`;
|
||||
if (fileInfo.expiryDate) {
|
||||
html += `<p>Date de fin de disponibilité : ${fileInfo.expiryDate}</p>`;
|
||||
html += `<p>Expiry date: ${fileInfo.expiryDate}</p>`;
|
||||
}
|
||||
if (fileInfo.password) {
|
||||
html += `<p>Mot de passe : Oui</p>`;
|
||||
html += `<p>Password: Yes</p>`;
|
||||
}
|
||||
if (fileInfo.userId) {
|
||||
html += `<p>User: <a href="/api/dpanel/dashboard/getuser/${fileInfo.userId}" target="_blank">${fileInfo.userId}</a></p>`;
|
||||
}
|
||||
Swal.fire({
|
||||
title: 'Informations sur le fichier',
|
||||
title: 'File Information',
|
||||
html: html,
|
||||
confirmButtonText: 'Fermer'
|
||||
confirmButtonText: 'Close'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -561,4 +616,4 @@ async function displayMetadata() {
|
||||
function closeModal() {
|
||||
const modal = document.getElementById('metadataModal');
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user