refactor(rclone): akıllı temizleme özelliğini kaldır

Check-and-clean özelliğini kaldırıp sadece basit cache temizleme
özelliğini korudu. Kullanıcı arayüzünde tek bir "Cache Temizle"
butonu bulunuyor.
This commit is contained in:
2026-02-03 09:26:54 +03:00
parent 8825d0af8d
commit 1b0662a5ec
2 changed files with 10 additions and 26 deletions

View File

@@ -247,28 +247,9 @@
if (!resp.ok || !data?.ok) { if (!resp.ok || !data?.ok) {
throw new Error(data?.error || `HTTP ${resp.status}`); throw new Error(data?.error || `HTTP ${resp.status}`);
} }
success = "Rclone cache temizlendi."; success = "Cache temizlendi.";
} catch (err) { } catch (err) {
error = err?.message || "Rclone cache temizlenemedi."; error = err?.message || "Cache temizlenemedi.";
}
}
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.";
} }
} }
@@ -439,11 +420,8 @@
disabled={rcloneLoading || rcloneSaving} disabled={rcloneLoading || rcloneSaving}
/> />
</div> </div>
<button class="btn" on:click={cleanRcloneCache}> <button class="btn primary" on:click={cleanRcloneCache}>
<i class="fa-solid fa-broom"></i> Temizle <i class="fa-solid fa-broom"></i> Cache Temizle
</button>
<button class="btn primary" on:click={checkAndCleanCache}>
<i class="fa-solid fa-wand-magic-sparkles"></i> Akıllı Temizle
</button> </button>
</div> </div>

6
package-lock.json generated Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "dupe",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}