|
1 | 1 | <script setup> |
2 | 2 | import { computed } from 'vue' |
| 3 | +import { Button } from '@/uikit/components/ui/button' |
| 4 | +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/uikit/components/ui/tooltip' |
| 5 | +import { Database, RefreshCw } from 'lucide-vue-next' |
3 | 6 | import useAPI from '@/core/composables/useAPI' |
4 | 7 | const api = useAPI() |
5 | 8 |
|
@@ -29,47 +32,54 @@ const database_tooltip = computed(() => { |
29 | 32 | </script> |
30 | 33 |
|
31 | 34 | <template> |
32 | | - <button class="button devbar-button has-tooltip-arrow has-tooltip-bottom" :data-tooltip="database_tooltip"> |
33 | | - <FAIcon |
34 | | - icon="fa-solid fa-database" |
35 | | - class="disconnected" |
36 | | - :class="{ connected: api.store.browserEphemeral.dbConnected == true }" |
37 | | - /> |
38 | | - | |
39 | | - <template v-if="!api.store.browserEphemeral.dbConnected"> |
40 | | - <FAIcon icon="fa-solid fa-rotate" class="has-text-grey" /> |
41 | | - </template> |
42 | | - <template v-else-if="api.store.browserEphemeral.dbChanges && api.store.browserEphemeral.dbConnected"> |
43 | | - <FAIcon icon="fa-solid fa-rotate" class="outofsync" /> |
44 | | - </template> |
45 | | - <template v-else> |
46 | | - <FAIcon icon="fa-solid fa-rotate" class="insync" /> |
47 | | - </template> |
48 | | - <template v-if="!api.store.browserEphemeral.dbConnected"> |
49 | | - | |
50 | | - <div class="mt-1"> |
51 | | - <CircleProgress |
52 | | - :percentage="Math.round(api.store.browserPersisted.approxDataSize / 1048576) * 100" |
53 | | - :size="12" |
54 | | - :strokeWidth="40" |
55 | | - slicecolor="#aaa" |
56 | | - basecolor="#aaa" |
57 | | - /> |
58 | | - </div> |
59 | | - </template> |
60 | | - <template v-else> |
61 | | - | |
62 | | - <div class="mt-1"> |
63 | | - <CircleProgress |
64 | | - :percentage="Math.round(api.store.browserPersisted.approxDataSize / 1048576) * 100" |
65 | | - :size="12" |
66 | | - :strokeWidth="40" |
67 | | - slicecolor="hsl(var(--bulma-button-h), var(--bulma-button-s), calc(var(--bulma-button-background-l) + var(--bulma-button-background-l-delta)))" |
68 | | - basecolor="var(--status-green)" |
69 | | - /> |
70 | | - </div> |
71 | | - </template> |
72 | | - </button> |
| 35 | + <TooltipProvider> |
| 36 | + <Tooltip> |
| 37 | + <TooltipTrigger asChild> |
| 38 | + <Button size="menu" variant="outline"> |
| 39 | + <i-ix-database-filled |
| 40 | + style="font-size: 2em" |
| 41 | + class="disconnected" |
| 42 | + :class="{ connected: api.store.browserEphemeral.dbConnected == true }" |
| 43 | + /> |
| 44 | + |
| 45 | + <template v-if="!api.store.browserEphemeral.dbConnected"> |
| 46 | + <RefreshCw class="has-text-grey" /> |
| 47 | + </template> |
| 48 | + <template v-else-if="api.store.browserEphemeral.dbChanges && api.store.browserEphemeral.dbConnected"> |
| 49 | + <RefreshCw class="outofsync" /> |
| 50 | + </template> |
| 51 | + <template v-else> |
| 52 | + <RefreshCw class="insync" /> |
| 53 | + </template> |
| 54 | + <template v-if="!api.store.browserEphemeral.dbConnected"> |
| 55 | + <div class="mt-1"> |
| 56 | + <CircleProgress |
| 57 | + :percentage="Math.round(api.store.browserPersisted.approxDataSize / 1048576) * 100" |
| 58 | + :size="12" |
| 59 | + :strokeWidth="40" |
| 60 | + slicecolor="#aaa" |
| 61 | + basecolor="#aaa" |
| 62 | + /> |
| 63 | + </div> |
| 64 | + </template> |
| 65 | + <template v-else> |
| 66 | + <div class="mt-1"> |
| 67 | + <CircleProgress |
| 68 | + :percentage="Math.round(api.store.browserPersisted.approxDataSize / 1048576) * 100" |
| 69 | + :size="12" |
| 70 | + :strokeWidth="40" |
| 71 | + slicecolor="hsl(var(--bulma-button-h), var(--bulma-button-s), calc(var(--bulma-button-background-l) + var(--bulma-button-background-l-delta)))" |
| 72 | + basecolor="var(--status-green)" |
| 73 | + /> |
| 74 | + </div> |
| 75 | + </template> |
| 76 | + </Button> |
| 77 | + </TooltipTrigger> |
| 78 | + <TooltipContent side="bottom"> |
| 79 | + {{ database_tooltip }} |
| 80 | + </TooltipContent> |
| 81 | + </Tooltip> |
| 82 | + </TooltipProvider> |
73 | 83 | </template> |
74 | 84 |
|
75 | 85 | <style scoped> |
|
0 commit comments