mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-27 05:02:10 +00:00
New Badges components: destination, public, status, teams + container/status
This commit is contained in:
25
apps/ui/src/lib/components/badges/StatusBadge.svelte
Normal file
25
apps/ui/src/lib/components/badges/StatusBadge.svelte
Normal file
@@ -0,0 +1,25 @@
|
||||
<script lang="ts">
|
||||
import {getStatus} from '$lib/container/status'
|
||||
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
export let thing:any;
|
||||
let getting = getStatus(thing)
|
||||
let refreshing:any;
|
||||
let status:any;
|
||||
// AutoUpdates Status every 5 seconds
|
||||
onMount( ()=>{
|
||||
refreshing = setInterval( () =>{
|
||||
getStatus(thing).then( (r) => status = r )
|
||||
}, 5000)
|
||||
})
|
||||
onDestroy( () =>{
|
||||
clearInterval(refreshing);
|
||||
})
|
||||
</script>
|
||||
{#await getting}
|
||||
<span class="badge badge-lg rounded uppercase">...</span>
|
||||
{:then status}
|
||||
<span class="badge badge-lg rounded uppercase badge-status-{status}">
|
||||
{status}
|
||||
</span>
|
||||
{/await}
|
||||
Reference in New Issue
Block a user