Handle gongs

This commit is contained in:
nemunaire 2022-10-04 12:44:59 +02:00
commit b2d50972ed
7 changed files with 338 additions and 50 deletions

View file

@ -1,3 +1,39 @@
<h2>
Gong
</h2>
<script>
import { page } from '$app/stores';
import {
Container,
Input,
ListGroup,
ListGroupItem,
Spinner,
} from 'sveltestrap';
import { getGong } from '../../../../lib/gong';
</script>
{#await getGong($page.params.gid)}
<div class="d-flex flex-fill justify-content-center align-items-center gap-2">
<Spinner color="primary" /> Chargement en cours&hellip;
</div>
{:then gong}
<Container>
<h2>
{gong.name}
</h2>
<ListGroup>
<ListGroupItem>
<strong>Chemin</strong>
{gong.path}
</ListGroupItem>
<ListGroupItem class="d-flex gap-2">
<strong>Par défaut&nbsp;?</strong>
<Input type="switch" on:change={() => gong.setDefault()} checked={gong.enabled} disabled={gong.enabled} />
</ListGroupItem>
<ListGroupItem>
<strong>ID</strong>
<span class="text-muted">{gong.id}</span>
</ListGroupItem>
</ListGroup>
</Container>
{/await}