WIP: storage-fix-local-nas work before playlist controls feature
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
6b3ab5b65e
commit
c160242dbc
46 files changed
+5365
-815
No files matched your search
@@ -366,7 +366,7 @@
|
||||
<td style="color:var(--text-secondary);font-weight:700;">{{ $i + 1 }}</td>
|
||||
<td>
|
||||
@if($v->thumbnail)
|
||||
<img src="{{ asset('storage/thumbnails/'.$v->thumbnail) }}" class="top-thumb" alt="">
|
||||
<img src="{{ route('media.thumbnail', $v->thumbnail) }}" class="top-thumb" alt="">
|
||||
@else
|
||||
<div class="top-thumb-placeholder"><i class="bi bi-play-fill"></i></div>
|
||||
@endif
|
||||
@@ -559,7 +559,7 @@
|
||||
<tr class="clickable-row" onclick="window.open('{{ route('videos.show', $video) }}','_blank')">
|
||||
<td>
|
||||
@if($video->thumbnail)
|
||||
<img src="{{ asset('storage/thumbnails/'.$video->thumbnail) }}" class="top-thumb" alt="">
|
||||
<img src="{{ route('media.thumbnail', $video->thumbnail) }}" class="top-thumb" alt="">
|
||||
@else
|
||||
<div class="top-thumb-placeholder"><i class="bi bi-play-fill"></i></div>
|
||||
@endif
|
||||
@@ -619,6 +619,12 @@
|
||||
<i class="bi bi-trash3-fill me-2"></i> Clean Orphaned Files
|
||||
</button>
|
||||
<div id="cleanupStatus" class="mt-2"></div>
|
||||
@if(\App\Models\Setting::get('nas_sync_enabled', 'false') === 'true')
|
||||
<button id="nasRepairBtn" class="btn btn-warning w-100 mt-2">
|
||||
<i class="bi bi-arrow-repeat me-2"></i> Repair NAS Storage
|
||||
</button>
|
||||
<div id="nasRepairStatus" class="mt-2"></div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
@@ -1046,5 +1052,32 @@ document.getElementById('cleanupBtn')?.addEventListener('click', async function(
|
||||
this.disabled = false;
|
||||
this.innerHTML = '<i class="bi bi-trash3-fill me-2"></i> Clean Orphaned Files';
|
||||
});
|
||||
|
||||
// ── NAS Repair ──────────────────────────────────────────────────
|
||||
document.getElementById('nasRepairBtn')?.addEventListener('click', async function() {
|
||||
this.disabled = true;
|
||||
this.innerHTML = '<i class="bi bi-arrow-repeat me-2"></i> Scanning…';
|
||||
const status = document.getElementById('nasRepairStatus');
|
||||
status.innerHTML = '';
|
||||
try {
|
||||
const res = await fetch('{{ url("/admin/nas-repair") }}', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content, 'X-Requested-With': 'XMLHttpRequest' }
|
||||
});
|
||||
const data = await res.json();
|
||||
const cls = data.success ? 'alert-success' : 'alert-warning';
|
||||
const icon = data.success ? '✅' : '⚠️';
|
||||
let html = `<div class="alert ${cls} mt-2 py-2 px-3" style="font-size:13px;">${icon} ${data.message}`;
|
||||
if (data.details && data.details.length) {
|
||||
html += `<ul class="mb-0 mt-1 ps-3" style="font-size:12px;">` + data.details.map(d => `<li>${d}</li>`).join('') + `</ul>`;
|
||||
}
|
||||
html += `</div>`;
|
||||
status.innerHTML = html;
|
||||
} catch(e) {
|
||||
status.innerHTML = `<div class="alert alert-danger mt-2 py-2 px-3" style="font-size:13px;">❌ ${e.message}</div>`;
|
||||
}
|
||||
this.disabled = false;
|
||||
this.innerHTML = '<i class="bi bi-arrow-repeat me-2"></i> Repair NAS Storage';
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in new issue
Block a user