fix: Cleanup less often and can do it manually

This commit is contained in:
Andras Bacsai
2022-07-13 13:40:41 +00:00
parent 9914686ed7
commit d5f2d22663
7 changed files with 177 additions and 79 deletions

View File

@@ -23,7 +23,7 @@
};
import { appSession } from '$lib/store';
import { onDestroy, onMount } from 'svelte';
import { get } from '$lib/api';
import { get, post } from '$lib/api';
import { errorNotification } from '$lib/common';
import Trend from './Trend.svelte';
async function getStatus() {
@@ -59,6 +59,9 @@
cpu: 'stable',
disk: 'stable'
};
async function manuallyCleanupStorage() {
return await post('/internal/cleanup', {});
}
</script>
{#if $appSession.teamId === '0'}
@@ -129,6 +132,9 @@
<dd class="mt-1 text-3xl font-semibold text-white">
{usage?.disk.usedGb}<span class="text-sm">GB</span>
</dd>
<button on:click={manuallyCleanupStorage} class="bg-coollabs hover:bg-coollabs-100"
>Cleanup Storage</button
>
</div>
<div
class="overflow-hidden rounded px-4 py-5 text-center sm:p-6 sm:text-left"
@@ -143,5 +149,6 @@
</dd>
</div>
</dl>
<div class="px-6 pt-20 text-2xl font-bold">Resources</div>
{/if}