|
7 | 7 | import {QueryParamStateBool} from '$lib/utils/url.svelte'; |
8 | 8 | import InputShell from '$lib/components/ui/input/input-shell.svelte'; |
9 | 9 | import Label from '$lib/components/ui/label/label.svelte'; |
| 10 | + import {CopyButton} from '$lib/components/ui/button'; |
10 | 11 |
|
11 | 12 | const openQueryParam = new QueryParamStateBool({ |
12 | 13 | key: 'troubleshootDialogOpen', |
|
42 | 43 | <DialogTitle>{$t`Troubleshoot`}</DialogTitle> |
43 | 44 | </DialogHeader> |
44 | 45 | <div class="flex flex-col gap-4 items-start"> |
45 | | - <p>{$t`Application version`}: <span class="font-mono text-muted-foreground border-b">{config.appVersion}</span> |
| 46 | + <p class="flex items-baseline gap-2"> |
| 47 | + {$t`Application version`}: |
| 48 | + <span class="font-mono text-muted-foreground border-b">{config.appVersion}</span> |
| 49 | + <CopyButton |
| 50 | + variant="ghost" |
| 51 | + size="xs-icon" |
| 52 | + iconProps={{class: 'size-4'}} |
| 53 | + title={$t`Copy version`} |
| 54 | + text={`${config.appVersion} on ${config.os}`} |
| 55 | + /> |
46 | 56 | </p> |
47 | | - <div class="w-full"> |
48 | | - <Label>{$t`Data Directory`}</Label> |
49 | | - <InputShell class="ps-2 pe-1"> |
50 | | - {#await service?.getDataDirectory() then value} |
51 | | - {value} |
52 | | - {/await} |
53 | | - <Button variant="ghost" icon="i-mdi-folder-search" size="xs-icon" title={$t`Open Data Directory`} |
54 | | - onclick={() => tryOpenDataDirectory()}/> |
55 | | - </InputShell> |
56 | | - </div> |
| 57 | + {#if service} |
| 58 | + <div class="w-full"> |
| 59 | + <Label>{$t`Data Directory`}</Label> |
| 60 | + <InputShell class="ps-2 pe-1"> |
| 61 | + {#await service?.getDataDirectory() then value} |
| 62 | + {value} |
| 63 | + {/await} |
| 64 | + <Button variant="ghost" icon="i-mdi-folder-search" size="xs-icon" title={$t`Open Data Directory`} |
| 65 | + onclick={() => tryOpenDataDirectory()}/> |
| 66 | + </InputShell> |
| 67 | + </div> |
| 68 | + {/if} |
57 | 69 | {#if projectCode} |
58 | 70 | <div class="flex gap-2"> |
59 | 71 | <Button variant="outline" onclick={() => shareProject()}> |
|
62 | 74 | </Button> |
63 | 75 | </div> |
64 | 76 | {/if} |
65 | | - <div class="flex gap-2"> |
66 | | - <Button variant="outline" onclick={() => service?.openLogFile()}> |
67 | | - <i class="i-mdi-file-eye"></i> |
68 | | - {$t`Open Log file`} |
69 | | - </Button> |
70 | | - <Button variant="outline" onclick={() => service?.shareLogFile()}> |
71 | | - <i class="i-mdi-file-export"></i> |
72 | | - {$t`Share Log file`} |
73 | | - </Button> |
74 | | - </div> |
| 77 | + {#if service} |
| 78 | + <div class="flex gap-2"> |
| 79 | + <Button variant="outline" onclick={() => service?.openLogFile()}> |
| 80 | + <i class="i-mdi-file-eye"></i> |
| 81 | + {$t`Open Log file`} |
| 82 | + </Button> |
| 83 | + <Button variant="outline" onclick={() => service?.shareLogFile()}> |
| 84 | + <i class="i-mdi-file-export"></i> |
| 85 | + {$t`Share Log file`} |
| 86 | + </Button> |
| 87 | + </div> |
| 88 | + {/if} |
75 | 89 | </div> |
76 | 90 | </DialogContent> |
77 | 91 | </Dialog> |
0 commit comments