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:
@@ -247,28 +247,9 @@
|
||||
if (!resp.ok || !data?.ok) {
|
||||
throw new Error(data?.error || `HTTP ${resp.status}`);
|
||||
}
|
||||
success = "Rclone cache temizlendi.";
|
||||
success = "Cache temizlendi.";
|
||||
} catch (err) {
|
||||
error = err?.message || "Rclone 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.";
|
||||
error = err?.message || "Cache temizlenemedi.";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,11 +420,8 @@
|
||||
disabled={rcloneLoading || rcloneSaving}
|
||||
/>
|
||||
</div>
|
||||
<button class="btn" on:click={cleanRcloneCache}>
|
||||
<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 class="btn primary" on:click={cleanRcloneCache}>
|
||||
<i class="fa-solid fa-broom"></i> Cache Temizle
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
6
package-lock.json
generated
Normal file
6
package-lock.json
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "dupe",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {}
|
||||
}
|
||||
Reference in New Issue
Block a user