nextcloud connessione ok gdrive no
This commit is contained in:
@@ -1357,7 +1357,7 @@ function toggleUploadRepo() {
|
||||
}
|
||||
|
||||
// === Remote Repository AJAX Browser ===
|
||||
let currentRepoBrowse = null;
|
||||
var currentRepoBrowse = null;
|
||||
|
||||
function showLocalContent() {
|
||||
document.getElementById('localContent').style.display = '';
|
||||
@@ -1401,22 +1401,43 @@ function loadRemoteContents(repoId, path) {
|
||||
document.getElementById('remoteLoading').style.display = 'block';
|
||||
const view = localStorage.getItem('documenti_view') || 'grid';
|
||||
|
||||
fetch('/storage-repositories/' + repoId + '/browse?path=' + encodeURIComponent(path), {
|
||||
headers: { 'Accept': 'application/json' }
|
||||
const url = '/storage-repositories/' + repoId + '/browse?path=' + encodeURIComponent(path);
|
||||
console.log('Loading remote contents from:', url);
|
||||
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log('Response status:', response.status);
|
||||
if (!response.ok) {
|
||||
throw new Error('HTTP Error: ' + response.status);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
console.log('Data received:', data);
|
||||
document.getElementById('remoteLoading').style.display = 'none';
|
||||
if (data.success && data.contents) {
|
||||
if (data.success && data.contents !== undefined) {
|
||||
console.log('Contents count:', data.contents.length);
|
||||
renderRemoteContents(data.contents, repoId, path, view);
|
||||
} else if (data.contents !== undefined && data.contents.length === 0) {
|
||||
document.getElementById('remoteEmpty').style.display = 'block';
|
||||
document.getElementById('remoteEmpty').querySelector('p').textContent = 'Cartella vuota';
|
||||
} else {
|
||||
document.getElementById('remoteEmpty').style.display = 'block';
|
||||
document.getElementById('remoteEmpty').querySelector('p').textContent = 'Errore caricamento repository.';
|
||||
const msg = data.message || 'Errore caricamento repository.';
|
||||
console.error('Error response:', msg);
|
||||
document.getElementById('remoteEmpty').querySelector('p').textContent = msg;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
document.getElementById('remoteLoading').style.display = 'none';
|
||||
document.getElementById('remoteEmpty').style.display = 'block';
|
||||
console.error('Fetch error:', error);
|
||||
document.getElementById('remoteEmpty').querySelector('p').textContent = 'Errore: ' + error.message;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user