feat(rclone): akıllı cache yönetimi ve streaming performans ayarları ekle

Disk doluluk oranını izleyen ve otomatik temizleme yapan akıllı cache sistemi
eklendi. Streaming performansı için buffer size, VFS read ahead ve chunk size
ayarları yapılandırılabilir hale getirildi. Rclone crash durumunda otomatik
yeniden başlatma mekanizması eklendi. UI'da disk kullanım bilgileri ve VFS
cache modu görüntülenmeye başlandı.
This commit is contained in:
2026-02-02 21:58:32 +03:00
parent e34b8fc024
commit c61f1b0288
4 changed files with 290 additions and 20 deletions

View File

@@ -236,6 +236,25 @@
}
}
async function checkAndCleanCache() {
error = null;
success = null;
try {
const resp = await apiFetch("/api/rclone/cache/check-and-clean", { method: "POST" });
const data = await resp.json().catch(() => ({}));
if (!resp.ok) {
throw new Error(data?.error || data?.message || `HTTP ${resp.status}`);
}
if (data.cleaned) {
success = data.message || "Cache temizlendi.";
} else {
success = data.message || "Disk durumu iyi, temizleme gerekmedi.";
}
} catch (err) {
error = err?.message || "Cache kontrolü başarısız.";
}
}
onMount(() => {
loadCookies();
loadYoutubeSettings();
@@ -404,7 +423,10 @@
/>
</div>
<button class="btn" on:click={cleanRcloneCache}>
<i class="fa-solid fa-broom"></i> Clean Cache
<i class="fa-solid fa-broom"></i> Temizle
</button>
<button class="btn primary" on:click={checkAndCleanCache}>
<i class="fa-solid fa-wand-magic-sparkles"></i> Akıllı Temizle
</button>
</div>
@@ -444,11 +466,30 @@
{#if rcloneStatus}
<div class="card muted" style="margin-top:10px;">
<div><strong>Durum:</strong></div>
<div>Enabled: {rcloneStatus.enabled ? "Evet" : "Hayır"}</div>
<div>Mounted: {rcloneStatus.mounted ? "Evet" : "Hayır"}</div>
<div>Remote: {rcloneStatus.remoteConfigured ? "Hazır" : "Eksik"}</div>
{#if rcloneStatus.vfsCacheMode}
<div>VFS Cache Mode: <code>{rcloneStatus.vfsCacheMode}</code></div>
{/if}
{#if rcloneStatus.diskUsage}
<div style="margin-top: 8px;">
<div style="font-size: 12px; color: #666;">Disk Kullanımı:</div>
<div style="font-size: 13px;">
Kullanım: %{rcloneStatus.diskUsage.usedPercent} |
Boş: {rcloneStatus.diskUsage.availableGB.toFixed(1)}GB /
{rcloneStatus.diskUsage.totalGB.toFixed(1)}GB
</div>
{#if rcloneStatus.cacheCleanThreshold}
<div style="font-size: 11px; color: #888;">
Temizleme eşiği: %{rcloneStatus.cacheCleanThreshold}
</div>
{/if}
</div>
{/if}
{#if rcloneStatus.lastError}
<div>Son hata: {rcloneStatus.lastError}</div>
<div style="margin-top: 8px; color: #d32f2f;">Son hata: {rcloneStatus.lastError}</div>
{/if}
</div>
{/if}
@@ -668,6 +709,14 @@
color: #0f7a1f;
}
:global(code) {
background: #f0f0f0;
padding: 2px 6px;
border-radius: 4px;
font-family: monospace;
font-size: 12px;
}
.password-field {
position: relative;
}