mirror of
https://github.com/cupcakearmy/ora.git
synced 2026-04-02 12:05:23 +00:00
progress
This commit is contained in:
17
src/dashboard/components/StorageQuota.svelte
Normal file
17
src/dashboard/components/StorageQuota.svelte
Normal file
@@ -0,0 +1,17 @@
|
||||
<script>
|
||||
import pretty from 'pretty-bytes'
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
let usage = null
|
||||
|
||||
onMount(async () => {
|
||||
const estimate = await window.navigator.storage.estimate()
|
||||
usage = pretty(estimate.usage)
|
||||
})
|
||||
</script>
|
||||
|
||||
{#if usage === null}
|
||||
<span class="loading" />
|
||||
{:else}
|
||||
<span>Storage used: <span class="font-mono">{usage}</span></span>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user