File tree Expand file tree Collapse file tree
src/routes/(authenticated)/hubs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 import { onMount } from ' svelte' ;
1313 import { type Hub , columns } from ' ./columns' ;
1414 import DataTableActions from ' ./data-table-actions.svelte' ;
15+ import HubCreateDialog from ' ./dialog-hub-create.svelte' ;
1516
1617 const isMobile = new IsMobile ();
1718
4849 onMount (refreshOwnHubs );
4950 </script >
5051
52+ <HubCreateDialog bind:open ={showAddHubModal } />
53+
5154<Container >
5255 <Card .Header class =" w-full" >
5356 <Card .Title class =" flex items-center justify-between space-x-2 text-3xl" >
Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ import { hubManagementV1Api } from ' $lib/api' ;
3+ import { Button } from ' $lib/components/ui/button' ;
4+ import * as Dialog from ' $lib/components/ui/dialog' ;
5+ import { handleApiError } from ' $lib/errorhandling/apiErrorHandling' ;
6+
7+ interface Props {
8+ open: boolean ;
9+ }
10+
11+ let { open = $bindable <boolean >() }: Props = $props ();
12+
13+ function onSubmit() {
14+ hubManagementV1Api
15+ .devicesCreateDevice ()
16+ .catch (handleApiError )
17+ .finally (() => (open = false ));
18+ }
19+ </script >
20+
21+ <Dialog .Root bind:open ={() => open , (o ) => (open = o )}>
22+ <Dialog .Content >
23+ <Dialog .Header >
24+ <Dialog .Title >Create hub</Dialog .Title >
25+ </Dialog .Header >
26+ <Button onclick ={onSubmit }>Create</Button >
27+ </Dialog .Content >
28+ </Dialog .Root >
You can’t perform that action at this time.
0 commit comments