File tree Expand file tree Collapse file tree
src/routes/(authenticated) Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { Plus } from ' @lucide/svelte' ;
23 import RotateCcw from ' @lucide/svelte/icons/rotate-ccw' ;
34 import type { SortingState } from ' @tanstack/table-core' ;
45 import Container from ' $lib/components/Container.svelte' ;
3839 });
3940 let sorting = $state <SortingState >([]);
4041
42+ let showAddHubModal = $state <boolean >(false );
43+
4144 onMount (refreshOwnHubs );
4245 </script >
4346
4447<Container >
4548 <Card .Header class =" w-full" >
4649 <Card .Title class =" flex items-center justify-between space-x-2 text-3xl" >
4750 Hubs
51+ <div >
52+ <Button onclick ={() => (showAddHubModal = true )}>
53+ <Plus />
54+ Add Hub
55+ </Button >
56+ <Button onclick ={refreshOwnHubs }>
57+ <RotateCcw />
58+ Refresh
59+ </Button >
60+ </div >
4861 <Button class ="btn variant-filled-primary text-xl" onclick ={() => {}}>
4962 <RotateCcw />
50- <span > Refresh </span >
63+ <span > Add </span >
5164 </Button >
5265 </Card .Title >
5366 <Card .Description >This is a list of all hubs you own.</Card .Description >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { hubManagementV1Api } from ' $lib/api' ;
23 import Button from ' $lib/components/ui/button/button.svelte' ;
34 import * as Dialog from ' $lib/components/ui/dialog' ;
5+ import { handleApiError } from ' $lib/errorhandling/apiErrorHandling' ;
46 import type { Hub } from ' ./columns' ;
57
68 interface Props {
1113 let { open = $bindable <boolean >(), hub }: Props = $props ();
1214
1315 function deleteHub() {
14- console .log (' deleteHub' );
16+ hubManagementV1Api
17+ .devicesRemoveDevice (hub .id )
18+ .then (() => (open = false ))
19+ .catch (handleApiError );
1520 }
1621 </script >
1722
2025 <Dialog .Header >
2126 <Dialog .Title >Delete hub</Dialog .Title >
2227 <Dialog .Description >
23- Are you sure you want to delete <strong >{hub .name }</strong >?
28+ Are you sure you want to delete <strong >{hub .name }</strong >?<br />
29+ <strong >This action is irreversible.</strong >
2430 </Dialog .Description >
2531 </Dialog .Header >
2632 <Button variant ="destructive" onclick ={deleteHub }>Delete</Button >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import Plus from ' @lucide/svelte/icons/plus' ;
23 import RotateCcw from ' @lucide/svelte/icons/rotate-ccw' ;
34 import type { SortingState } from ' @tanstack/table-core' ;
45 import type { TokenResponse } from ' $lib/api/internal/v1' ;
4041 API Tokens
4142 <div >
4243 <Button onclick ={() => (showGenerateTokenModal = true )}>
43- <RotateCcw />
44- < span > Generate Token </ span >
44+ <Plus />
45+ Generate Token
4546 </Button >
4647 <Button onclick ={refreshApiTokens }>
4748 <RotateCcw />
You can’t perform that action at this time.
0 commit comments