@geniusdynamics/ns8-ui-lib 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -0
- package/dist/index.d.ts +14 -0
- package/dist/ns8-ui-lib.es.js +4278 -0
- package/dist/ns8-ui-lib.es.js.map +1 -0
- package/dist/ns8-ui-lib.umd.js +7 -0
- package/dist/ns8-ui-lib.umd.js.map +1 -0
- package/dist/src/App.vue.d.ts +2 -0
- package/dist/src/components/HelloWorld.vue.d.ts +5 -0
- package/dist/src/components/NS/cards/NSBackupCard.vue.d.ts +51 -0
- package/dist/src/components/NS/cards/NSSystemInfoCard.vue.d.ts +58 -0
- package/dist/src/components/NS/cards/NSSystemdServiceCard.vue.d.ts +47 -0
- package/dist/src/components/NS/cards/index.d.ts +3 -0
- package/dist/src/components/NS/checkbox/NSCheckbox.vue.d.ts +37 -0
- package/dist/src/components/NS/checkbox/index.d.ts +1 -0
- package/dist/src/components/NS/data-table/NSDataTable.vue.d.ts +98 -0
- package/dist/src/components/NS/data-table/index.d.ts +1 -0
- package/dist/src/components/NS/empty-state/NSEmptyState.vue.d.ts +45 -0
- package/dist/src/components/NS/empty-state/index.d.ts +1 -0
- package/dist/src/components/NS/index.d.ts +35 -0
- package/dist/src/components/NS/inline-notification/NSInlineNotification.vue.d.ts +44 -0
- package/dist/src/components/NS/inline-notification/index.d.ts +1 -0
- package/dist/src/components/NS/lottie-animation/NSLottieAnimation.vue.d.ts +75 -0
- package/dist/src/components/NS/lottie-animation/index.d.ts +1 -0
- package/dist/src/components/NS/modal/NSModal.vue.d.ts +56 -0
- package/dist/src/components/NS/modal/NSModalTrigger.vue.d.ts +64 -0
- package/dist/src/components/NS/modal/index.d.ts +2 -0
- package/dist/src/components/NS/pagination/NSPagination.vue.d.ts +36 -0
- package/dist/src/components/NS/pagination/index.d.ts +1 -0
- package/dist/src/components/NS/progress/NSProgress.vue.d.ts +37 -0
- package/dist/src/components/NS/progress/NSProgressBar.vue.d.ts +39 -0
- package/dist/src/components/NS/progress/index.d.ts +2 -0
- package/dist/src/components/NS/slider/NSByteSlider.vue.d.ts +50 -0
- package/dist/src/components/NS/slider/NSSlider.vue.d.ts +49 -0
- package/dist/src/components/NS/slider/index.d.ts +2 -0
- package/dist/src/components/NS/tag/NSTag.vue.d.ts +41 -0
- package/dist/src/components/NS/tag/index.d.ts +1 -0
- package/dist/src/components/NS/text-input/NSTextInput.vue.d.ts +67 -0
- package/dist/src/components/NS/text-input/index.d.ts +1 -0
- package/dist/src/components/NS/toast-notification/NSToastNotification.vue.d.ts +44 -0
- package/dist/src/components/NS/toast-notification/index.d.ts +1 -0
- package/dist/src/components/NS/toggle/NSToggle.vue.d.ts +51 -0
- package/dist/src/components/NS/toggle/index.d.ts +1 -0
- package/dist/src/components/NS/wizard/NSWizard.vue.d.ts +86 -0
- package/dist/src/components/NS/wizard/index.d.ts +1 -0
- package/dist/src/components/ui/button/Button.vue.d.ts +27 -0
- package/dist/src/components/ui/button/index.d.ts +7 -0
- package/dist/src/components/ui/card/Card.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardAction.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardContent.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardDescription.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardTitle.vue.d.ts +21 -0
- package/dist/src/components/ui/card/index.d.ts +7 -0
- package/dist/src/components/ui/checkbox/NsCheckbox.vue.d.ts +49 -0
- package/dist/src/components/ui/checkbox/index.d.ts +11 -0
- package/dist/src/components/ui/dialog/Dialog.vue.d.ts +28 -0
- package/dist/src/components/ui/dialog/index.d.ts +1 -0
- package/dist/src/components/ui/empty-state/NsEmptyState.vue.d.ts +45 -0
- package/dist/src/components/ui/empty-state/index.d.ts +11 -0
- package/dist/src/components/ui/inline-notification/NsInlineNotification.vue.d.ts +45 -0
- package/dist/src/components/ui/inline-notification/index.d.ts +6 -0
- package/dist/src/components/ui/input/Input.vue.d.ts +12 -0
- package/dist/src/components/ui/input/index.d.ts +1 -0
- package/dist/src/components/ui/input-group/InputGroup.vue.d.ts +21 -0
- package/dist/src/components/ui/input-group/InputGroupAddon.vue.d.ts +25 -0
- package/dist/src/components/ui/input-group/InputGroupButton.vue.d.ts +22 -0
- package/dist/src/components/ui/input-group/InputGroupInput.vue.d.ts +6 -0
- package/dist/src/components/ui/input-group/InputGroupText.vue.d.ts +21 -0
- package/dist/src/components/ui/input-group/InputGroupTextarea.vue.d.ts +6 -0
- package/dist/src/components/ui/input-group/index.d.ts +22 -0
- package/dist/src/components/ui/item/Item.vue.d.ts +27 -0
- package/dist/src/components/ui/item/ItemActions.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemContent.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemDescription.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemGroup.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemMedia.vue.d.ts +23 -0
- package/dist/src/components/ui/item/ItemSeparator.vue.d.ts +7 -0
- package/dist/src/components/ui/item/ItemTitle.vue.d.ts +21 -0
- package/dist/src/components/ui/item/index.d.ts +20 -0
- package/dist/src/components/ui/label/Label.vue.d.ts +22 -0
- package/dist/src/components/ui/label/index.d.ts +1 -0
- package/dist/src/components/ui/scroll-area/ScrollArea.vue.d.ts +22 -0
- package/dist/src/components/ui/scroll-area/ScrollBar.vue.d.ts +9 -0
- package/dist/src/components/ui/scroll-area/index.d.ts +2 -0
- package/dist/src/components/ui/select/Select.vue.d.ts +28 -0
- package/dist/src/components/ui/select/SelectContent.vue.d.ts +32 -0
- package/dist/src/components/ui/select/SelectGroup.vue.d.ts +18 -0
- package/dist/src/components/ui/select/SelectItem.vue.d.ts +23 -0
- package/dist/src/components/ui/select/SelectItemText.vue.d.ts +18 -0
- package/dist/src/components/ui/select/SelectLabel.vue.d.ts +22 -0
- package/dist/src/components/ui/select/SelectScrollDownButton.vue.d.ts +22 -0
- package/dist/src/components/ui/select/SelectScrollUpButton.vue.d.ts +22 -0
- package/dist/src/components/ui/select/SelectSeparator.vue.d.ts +7 -0
- package/dist/src/components/ui/select/SelectTrigger.vue.d.ts +25 -0
- package/dist/src/components/ui/select/SelectValue.vue.d.ts +18 -0
- package/dist/src/components/ui/select/index.d.ts +11 -0
- package/dist/src/components/ui/separator/Separator.vue.d.ts +10 -0
- package/dist/src/components/ui/separator/index.d.ts +1 -0
- package/dist/src/components/ui/sheet/Sheet.vue.d.ts +25 -0
- package/dist/src/components/ui/sheet/SheetClose.vue.d.ts +18 -0
- package/dist/src/components/ui/sheet/SheetContent.vue.d.ts +39 -0
- package/dist/src/components/ui/sheet/SheetDescription.vue.d.ts +22 -0
- package/dist/src/components/ui/sheet/SheetFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/sheet/SheetHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/sheet/SheetOverlay.vue.d.ts +22 -0
- package/dist/src/components/ui/sheet/SheetTitle.vue.d.ts +22 -0
- package/dist/src/components/ui/sheet/SheetTrigger.vue.d.ts +18 -0
- package/dist/src/components/ui/sheet/index.d.ts +8 -0
- package/dist/src/components/ui/sidebar/Sidebar.vue.d.ts +24 -0
- package/dist/src/components/ui/sidebar/SidebarContent.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarGroup.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarGroupAction.vue.d.ts +22 -0
- package/dist/src/components/ui/sidebar/SidebarGroupContent.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarGroupLabel.vue.d.ts +22 -0
- package/dist/src/components/ui/sidebar/SidebarHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarInput.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarInset.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenu.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuAction.vue.d.ts +25 -0
- package/dist/src/components/ui/sidebar/SidebarMenuBadge.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuButton.vue.d.ts +27 -0
- package/dist/src/components/ui/sidebar/SidebarMenuButtonChild.vue.d.ts +30 -0
- package/dist/src/components/ui/sidebar/SidebarMenuItem.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSkeleton.vue.d.ts +7 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSub.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSubButton.vue.d.ts +27 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSubItem.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarProvider.vue.d.ts +30 -0
- package/dist/src/components/ui/sidebar/SidebarRail.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarSeparator.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarTrigger.vue.d.ts +6 -0
- package/dist/src/components/ui/sidebar/index.d.ts +37 -0
- package/dist/src/components/ui/sidebar/utils.d.ts +56 -0
- package/dist/src/components/ui/skeleton/Skeleton.vue.d.ts +6 -0
- package/dist/src/components/ui/skeleton/index.d.ts +1 -0
- package/dist/src/components/ui/sonner/Sonner.vue.d.ts +3 -0
- package/dist/src/components/ui/sonner/index.d.ts +1 -0
- package/dist/src/components/ui/switch/Switch.vue.d.ts +28 -0
- package/dist/src/components/ui/switch/index.d.ts +1 -0
- package/dist/src/components/ui/table/Table.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableBody.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableCaption.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableCell.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableEmpty.vue.d.ts +24 -0
- package/dist/src/components/ui/table/TableFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableHead.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableRow.vue.d.ts +21 -0
- package/dist/src/components/ui/table/index.d.ts +9 -0
- package/dist/src/components/ui/table/utils.d.ts +3 -0
- package/dist/src/components/ui/tabs/Tabs.vue.d.ts +28 -0
- package/dist/src/components/ui/tabs/TabsContent.vue.d.ts +22 -0
- package/dist/src/components/ui/tabs/TabsList.vue.d.ts +22 -0
- package/dist/src/components/ui/tabs/TabsTrigger.vue.d.ts +22 -0
- package/dist/src/components/ui/tabs/index.d.ts +4 -0
- package/dist/src/components/ui/tag/NsTag.vue.d.ts +42 -0
- package/dist/src/components/ui/tag/index.d.ts +8 -0
- package/dist/src/components/ui/text-input/NsTextInput.vue.d.ts +79 -0
- package/dist/src/components/ui/text-input/index.d.ts +15 -0
- package/dist/src/components/ui/textarea/Textarea.vue.d.ts +12 -0
- package/dist/src/components/ui/textarea/index.d.ts +1 -0
- package/dist/src/components/ui/toggle/NsToggle.vue.d.ts +54 -0
- package/dist/src/components/ui/toggle/index.d.ts +15 -0
- package/dist/src/components/ui/tooltip/Tooltip.vue.d.ts +24 -0
- package/dist/src/components/ui/tooltip/TooltipContent.vue.d.ts +30 -0
- package/dist/src/components/ui/tooltip/TooltipProvider.vue.d.ts +20 -0
- package/dist/src/components/ui/tooltip/TooltipTrigger.vue.d.ts +18 -0
- package/dist/src/components/ui/tooltip/index.d.ts +4 -0
- package/dist/src/composables/index.d.ts +8 -0
- package/dist/src/composables/useDateTimeService.d.ts +10 -0
- package/dist/src/composables/useFilterService.d.ts +8 -0
- package/dist/src/composables/useIconService.d.ts +153 -0
- package/dist/src/composables/usePageTitleService.d.ts +3 -0
- package/dist/src/composables/useQueryParamService.d.ts +13 -0
- package/dist/src/composables/useStorageService.d.ts +5 -0
- package/dist/src/composables/useTaskService.d.ts +18 -0
- package/dist/src/composables/useUtilService.d.ts +27 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/vite.svg +1 -0
- package/package.json +80 -0
- package/src/App.vue +30 -0
- package/src/components/HelloWorld.vue +41 -0
- package/src/components/NS/CompleteDemo.vue +475 -0
- package/src/components/NS/Demo.vue +191 -0
- package/src/components/NS/cards/NSBackupCard.vue +272 -0
- package/src/components/NS/cards/NSSystemInfoCard.vue +252 -0
- package/src/components/NS/cards/NSSystemdServiceCard.vue +250 -0
- package/src/components/NS/checkbox/NSCheckbox.vue +104 -0
- package/src/components/NS/data-table/NSDataTable.vue +434 -0
- package/src/components/NS/empty-state/NSEmptyState.vue +188 -0
- package/src/components/NS/inline-notification/NSInlineNotification.vue +162 -0
- package/src/components/NS/lottie-animation/NSLottieAnimation.vue +255 -0
- package/src/components/NS/modal/NSModal.vue +193 -0
- package/src/components/NS/modal/NSModalTrigger.vue +109 -0
- package/src/components/NS/pagination/NSPagination.vue +247 -0
- package/src/components/NS/progress/NSProgress.vue +115 -0
- package/src/components/NS/progress/NSProgressBar.vue +137 -0
- package/src/components/NS/slider/NSByteSlider.vue +144 -0
- package/src/components/NS/slider/NSSlider.vue +142 -0
- package/src/components/NS/tag/NSTag.vue +139 -0
- package/src/components/NS/text-input/NSTextInput.vue +242 -0
- package/src/components/NS/toast-notification/NSToastNotification.vue +163 -0
- package/src/components/NS/toggle/NSToggle.vue +156 -0
- package/src/components/NS/wizard/NSWizard.vue +399 -0
- package/src/components/ui/button/Button.vue +29 -0
- package/src/components/ui/card/Card.vue +22 -0
- package/src/components/ui/card/CardAction.vue +17 -0
- package/src/components/ui/card/CardContent.vue +17 -0
- package/src/components/ui/card/CardDescription.vue +17 -0
- package/src/components/ui/card/CardFooter.vue +17 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +17 -0
- package/src/components/ui/checkbox/NsCheckbox.vue +123 -0
- package/src/components/ui/dialog/Dialog.vue +68 -0
- package/src/components/ui/empty-state/NsEmptyState.vue +149 -0
- package/src/components/ui/inline-notification/NsInlineNotification.vue +163 -0
- package/src/components/ui/input/Input.vue +33 -0
- package/src/components/ui/input-group/InputGroup.vue +35 -0
- package/src/components/ui/input-group/InputGroupAddon.vue +36 -0
- package/src/components/ui/input-group/InputGroupButton.vue +21 -0
- package/src/components/ui/input-group/InputGroupInput.vue +19 -0
- package/src/components/ui/input-group/InputGroupText.vue +19 -0
- package/src/components/ui/input-group/InputGroupTextarea.vue +19 -0
- package/src/components/ui/item/Item.vue +27 -0
- package/src/components/ui/item/ItemActions.vue +17 -0
- package/src/components/ui/item/ItemContent.vue +17 -0
- package/src/components/ui/item/ItemDescription.vue +21 -0
- package/src/components/ui/item/ItemFooter.vue +17 -0
- package/src/components/ui/item/ItemGroup.vue +18 -0
- package/src/components/ui/item/ItemHeader.vue +17 -0
- package/src/components/ui/item/ItemMedia.vue +21 -0
- package/src/components/ui/item/ItemSeparator.vue +18 -0
- package/src/components/ui/item/ItemTitle.vue +17 -0
- package/src/components/ui/label/Label.vue +26 -0
- package/src/components/ui/scroll-area/ScrollArea.vue +33 -0
- package/src/components/ui/scroll-area/ScrollBar.vue +32 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +51 -0
- package/src/components/ui/select/SelectGroup.vue +15 -0
- package/src/components/ui/select/SelectItem.vue +44 -0
- package/src/components/ui/select/SelectItemText.vue +15 -0
- package/src/components/ui/select/SelectLabel.vue +17 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +26 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +26 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +33 -0
- package/src/components/ui/select/SelectValue.vue +15 -0
- package/src/components/ui/separator/Separator.vue +29 -0
- package/src/components/ui/sheet/Sheet.vue +19 -0
- package/src/components/ui/sheet/SheetClose.vue +15 -0
- package/src/components/ui/sheet/SheetContent.vue +62 -0
- package/src/components/ui/sheet/SheetDescription.vue +21 -0
- package/src/components/ui/sheet/SheetFooter.vue +16 -0
- package/src/components/ui/sheet/SheetHeader.vue +15 -0
- package/src/components/ui/sheet/SheetOverlay.vue +21 -0
- package/src/components/ui/sheet/SheetTitle.vue +21 -0
- package/src/components/ui/sheet/SheetTrigger.vue +15 -0
- package/src/components/ui/sidebar/Sidebar.vue +96 -0
- package/src/components/ui/sidebar/SidebarContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupAction.vue +27 -0
- package/src/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
- package/src/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/src/components/ui/sidebar/SidebarInput.vue +22 -0
- package/src/components/ui/sidebar/SidebarInset.vue +21 -0
- package/src/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuAction.vue +35 -0
- package/src/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
- package/src/components/ui/sidebar/SidebarMenuButton.vue +48 -0
- package/src/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
- package/src/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
- package/src/components/ui/sidebar/SidebarMenuSub.vue +22 -0
- package/src/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
- package/src/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarProvider.vue +82 -0
- package/src/components/ui/sidebar/SidebarRail.vue +33 -0
- package/src/components/ui/sidebar/SidebarSeparator.vue +19 -0
- package/src/components/ui/sidebar/SidebarTrigger.vue +27 -0
- package/src/components/ui/skeleton/Skeleton.vue +17 -0
- package/src/components/ui/sonner/Sonner.vue +42 -0
- package/src/components/ui/switch/Switch.vue +38 -0
- package/src/components/ui/table/Table.vue +16 -0
- package/src/components/ui/table/TableBody.vue +17 -0
- package/src/components/ui/table/TableCaption.vue +17 -0
- package/src/components/ui/table/TableCell.vue +22 -0
- package/src/components/ui/table/TableEmpty.vue +34 -0
- package/src/components/ui/table/TableFooter.vue +17 -0
- package/src/components/ui/table/TableHead.vue +17 -0
- package/src/components/ui/table/TableHeader.vue +17 -0
- package/src/components/ui/table/TableRow.vue +17 -0
- package/src/components/ui/tabs/Tabs.vue +24 -0
- package/src/components/ui/tabs/TabsContent.vue +21 -0
- package/src/components/ui/tabs/TabsList.vue +24 -0
- package/src/components/ui/tabs/TabsTrigger.vue +26 -0
- package/src/components/ui/tag/NsTag.vue +114 -0
- package/src/components/ui/text-input/NsTextInput.vue +269 -0
- package/src/components/ui/textarea/Textarea.vue +28 -0
- package/src/components/ui/toggle/NsToggle.vue +126 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +34 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { Info, CheckCircle, AlertCircle, Clock, MoreHorizontal } from 'lucide-vue-next'
|
|
4
|
+
import { Button } from '@/components/ui/button'
|
|
5
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
6
|
+
import { Badge } from '@/components/ui/badge'
|
|
7
|
+
import { Skeleton } from '@/components/ui/skeleton'
|
|
8
|
+
import { cn } from '@/lib/utils'
|
|
9
|
+
|
|
10
|
+
interface ServiceStatus {
|
|
11
|
+
running: boolean
|
|
12
|
+
enabled: boolean
|
|
13
|
+
status?: string
|
|
14
|
+
uptime?: string
|
|
15
|
+
lastRestart?: string
|
|
16
|
+
memory?: string
|
|
17
|
+
cpu?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
title?: string
|
|
22
|
+
description?: string
|
|
23
|
+
icon?: any
|
|
24
|
+
loading?: boolean
|
|
25
|
+
status?: ServiceStatus
|
|
26
|
+
serviceName?: string
|
|
27
|
+
light?: boolean
|
|
28
|
+
showUptime?: boolean
|
|
29
|
+
showMetrics?: boolean
|
|
30
|
+
maxHeight?: string
|
|
31
|
+
class?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
35
|
+
title: 'Service',
|
|
36
|
+
description: '',
|
|
37
|
+
loading: false,
|
|
38
|
+
status: () => ({ running: false, enabled: false }),
|
|
39
|
+
serviceName: '',
|
|
40
|
+
light: false,
|
|
41
|
+
showUptime: true,
|
|
42
|
+
showMetrics: false,
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const emit = defineEmits<{
|
|
46
|
+
start: [serviceName: string]
|
|
47
|
+
stop: [serviceName: string]
|
|
48
|
+
restart: [serviceName: string]
|
|
49
|
+
enable: [serviceName: string]
|
|
50
|
+
disable: [serviceName: string]
|
|
51
|
+
view: [serviceName: string]
|
|
52
|
+
}>()
|
|
53
|
+
|
|
54
|
+
const statusIcon = computed(() => {
|
|
55
|
+
if (props.loading) return Clock
|
|
56
|
+
|
|
57
|
+
if (!props.status.enabled) {
|
|
58
|
+
return AlertCircle
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (props.status.running) {
|
|
62
|
+
return CheckCircle
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return Info
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const statusClass = computed(() => {
|
|
69
|
+
if (props.loading) return 'text-muted-foreground'
|
|
70
|
+
|
|
71
|
+
if (!props.status.enabled) {
|
|
72
|
+
return 'text-destructive'
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (props.status.running) {
|
|
76
|
+
return 'text-green-600'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return 'text-orange-600'
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const statusBadgeVariant = computed(() => {
|
|
83
|
+
if (props.loading) return 'secondary'
|
|
84
|
+
|
|
85
|
+
if (!props.status.enabled) {
|
|
86
|
+
return 'destructive'
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (props.status.running) {
|
|
90
|
+
return 'default'
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return 'secondary'
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const statusText = computed(() => {
|
|
97
|
+
if (props.loading) return 'Loading...'
|
|
98
|
+
|
|
99
|
+
if (!props.status.enabled) {
|
|
100
|
+
return 'Disabled'
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (props.status.running) {
|
|
104
|
+
return props.status.status || 'Running'
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return props.status.status || 'Stopped'
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const containerClasses = computed(() => {
|
|
111
|
+
return cn('w-full', props.class)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
const cardClasses = computed(() => {
|
|
115
|
+
return cn(
|
|
116
|
+
'transition-all duration-200 hover:shadow-md',
|
|
117
|
+
props.light ? 'bg-background/95' : 'bg-background'
|
|
118
|
+
)
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const iconClass = computed(() => {
|
|
122
|
+
return cn('h-8 w-8', statusClass.value)
|
|
123
|
+
})
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<template>
|
|
127
|
+
<Card :class="cardClasses">
|
|
128
|
+
<CardHeader class="pb-3">
|
|
129
|
+
<div class="flex items-center justify-between">
|
|
130
|
+
<CardTitle class="flex items-center gap-3">
|
|
131
|
+
<component
|
|
132
|
+
v-if="icon"
|
|
133
|
+
:is="icon"
|
|
134
|
+
:class="iconClass"
|
|
135
|
+
/>
|
|
136
|
+
<div>
|
|
137
|
+
<div class="text-lg font-semibold">{{ title }}</div>
|
|
138
|
+
<CardDescription v-if="description">
|
|
139
|
+
{{ description }}
|
|
140
|
+
</CardDescription>
|
|
141
|
+
</div>
|
|
142
|
+
</CardTitle>
|
|
143
|
+
|
|
144
|
+
<!-- Status badge -->
|
|
145
|
+
<Badge :variant="statusBadgeVariant">
|
|
146
|
+
{{ statusText }}
|
|
147
|
+
</Badge>
|
|
148
|
+
</div>
|
|
149
|
+
</CardHeader>
|
|
150
|
+
|
|
151
|
+
<CardContent class="space-y-4">
|
|
152
|
+
<!-- Loading state -->
|
|
153
|
+
<div v-if="loading" class="space-y-3">
|
|
154
|
+
<Skeleton class="h-4 w-3/4" />
|
|
155
|
+
<Skeleton class="h-4 w-1/2" />
|
|
156
|
+
<Skeleton class="h-4 w-2/3" />
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<!-- Service details -->
|
|
160
|
+
<div v-else class="space-y-3">
|
|
161
|
+
<!-- Service name -->
|
|
162
|
+
<div v-if="serviceName" class="text-sm text-muted-foreground">
|
|
163
|
+
<span class="font-medium">Service:</span> {{ serviceName }}
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<!-- Uptime -->
|
|
167
|
+
<div v-if="showUptime && status?.uptime" class="flex items-center gap-2">
|
|
168
|
+
<Clock class="h-4 w-4 text-muted-foreground" />
|
|
169
|
+
<span class="text-sm">
|
|
170
|
+
<span class="font-medium">Uptime:</span> {{ status.uptime }}
|
|
171
|
+
</span>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<!-- Last restart -->
|
|
175
|
+
<div v-if="status?.lastRestart" class="text-sm text-muted-foreground">
|
|
176
|
+
<span class="font-medium">Last restart:</span> {{ status.lastRestart }}
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
<!-- Metrics -->
|
|
180
|
+
<div v-if="showMetrics" class="grid grid-cols-2 gap-3">
|
|
181
|
+
<div v-if="status?.memory" class="text-sm">
|
|
182
|
+
<span class="font-medium">Memory:</span> {{ status.memory }}
|
|
183
|
+
</div>
|
|
184
|
+
<div v-if="status?.cpu" class="text-sm">
|
|
185
|
+
<span class="font-medium">CPU:</span> {{ status.cpu }}
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<!-- Custom status message -->
|
|
190
|
+
<div v-if="status?.status && status?.status !== statusText" class="text-sm">
|
|
191
|
+
{{ status.status }}
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<!-- Action buttons -->
|
|
196
|
+
<div class="flex items-center justify-between pt-4 border-t">
|
|
197
|
+
<div class="flex gap-2">
|
|
198
|
+
<Button
|
|
199
|
+
v-if="status?.enabled && !status?.running"
|
|
200
|
+
variant="default"
|
|
201
|
+
size="sm"
|
|
202
|
+
@click="emit('start', serviceName)"
|
|
203
|
+
>
|
|
204
|
+
Start
|
|
205
|
+
</Button>
|
|
206
|
+
<Button
|
|
207
|
+
v-if="status?.enabled && status?.running"
|
|
208
|
+
variant="outline"
|
|
209
|
+
size="sm"
|
|
210
|
+
@click="emit('stop', serviceName)"
|
|
211
|
+
>
|
|
212
|
+
Stop
|
|
213
|
+
</Button>
|
|
214
|
+
<Button
|
|
215
|
+
v-if="status?.enabled"
|
|
216
|
+
variant="outline"
|
|
217
|
+
size="sm"
|
|
218
|
+
@click="emit('restart', serviceName)"
|
|
219
|
+
>
|
|
220
|
+
Restart
|
|
221
|
+
</Button>
|
|
222
|
+
<Button
|
|
223
|
+
v-if="!status?.enabled"
|
|
224
|
+
variant="default"
|
|
225
|
+
size="sm"
|
|
226
|
+
@click="emit('enable', serviceName)"
|
|
227
|
+
>
|
|
228
|
+
Enable
|
|
229
|
+
</Button>
|
|
230
|
+
<Button
|
|
231
|
+
v-if="status?.enabled"
|
|
232
|
+
variant="destructive"
|
|
233
|
+
size="sm"
|
|
234
|
+
@click="emit('disable', serviceName)"
|
|
235
|
+
>
|
|
236
|
+
Disable
|
|
237
|
+
</Button>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<Button
|
|
241
|
+
variant="ghost"
|
|
242
|
+
size="sm"
|
|
243
|
+
@click="emit('view', serviceName)"
|
|
244
|
+
>
|
|
245
|
+
<MoreHorizontal class="h-4 w-4" />
|
|
246
|
+
</Button>
|
|
247
|
+
</div>
|
|
248
|
+
</CardContent>
|
|
249
|
+
</Card>
|
|
250
|
+
</template>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useId } from 'vue'
|
|
3
|
+
import { CheckboxIndicator, CheckboxRoot } from 'radix-vue'
|
|
4
|
+
import { Check } from 'lucide-vue-next'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
id?: string
|
|
9
|
+
checked?: boolean
|
|
10
|
+
defaultChecked?: boolean
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
required?: boolean
|
|
13
|
+
name?: string
|
|
14
|
+
value?: string
|
|
15
|
+
label?: string
|
|
16
|
+
hideLabel?: boolean
|
|
17
|
+
description?: string
|
|
18
|
+
errorMessage?: string
|
|
19
|
+
indeterminate?: boolean
|
|
20
|
+
class?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<Props>(), {})
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits<{
|
|
26
|
+
'update:checked': [value: boolean]
|
|
27
|
+
}>()
|
|
28
|
+
|
|
29
|
+
const uniqueId = useId()
|
|
30
|
+
const checkboxId = props.id || uniqueId
|
|
31
|
+
|
|
32
|
+
const isChecked = computed({
|
|
33
|
+
get: () => props.checked ?? false,
|
|
34
|
+
set: (value: boolean) => {
|
|
35
|
+
emit('update:checked', value)
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div :class="cn('flex items-start space-x-2', props.class)">
|
|
42
|
+
<CheckboxRoot
|
|
43
|
+
:id="checkboxId"
|
|
44
|
+
v-model:checked="isChecked"
|
|
45
|
+
:default-checked="defaultChecked"
|
|
46
|
+
:disabled="disabled"
|
|
47
|
+
:required="required"
|
|
48
|
+
:name="name"
|
|
49
|
+
:value="value"
|
|
50
|
+
:class="cn(
|
|
51
|
+
'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
|
52
|
+
{
|
|
53
|
+
'border-destructive': errorMessage,
|
|
54
|
+
'data-[state=checked]:bg-destructive data-[state=checked]:text-destructive-foreground': errorMessage
|
|
55
|
+
}
|
|
56
|
+
)"
|
|
57
|
+
:data-indeterminate="indeterminate"
|
|
58
|
+
>
|
|
59
|
+
<CheckboxIndicator
|
|
60
|
+
:class="cn('flex items-center justify-center text-current', {
|
|
61
|
+
'opacity-50': indeterminate
|
|
62
|
+
})"
|
|
63
|
+
>
|
|
64
|
+
<Check v-if="!indeterminate" class="h-4 w-4" />
|
|
65
|
+
<div v-else class="h-1 w-2 bg-current rounded-sm" />
|
|
66
|
+
</CheckboxIndicator>
|
|
67
|
+
</CheckboxRoot>
|
|
68
|
+
|
|
69
|
+
<div class="grid gap-1.5">
|
|
70
|
+
<label
|
|
71
|
+
v-if="label || $slots.label"
|
|
72
|
+
:for="checkboxId"
|
|
73
|
+
:class="cn(
|
|
74
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer',
|
|
75
|
+
{
|
|
76
|
+
'sr-only': hideLabel,
|
|
77
|
+
'cursor-not-allowed': disabled,
|
|
78
|
+
'text-destructive': errorMessage
|
|
79
|
+
}
|
|
80
|
+
)"
|
|
81
|
+
>
|
|
82
|
+
<slot name="label">{{ label }}</slot>
|
|
83
|
+
</label>
|
|
84
|
+
|
|
85
|
+
<p
|
|
86
|
+
v-if="description"
|
|
87
|
+
:class="cn('text-sm text-muted-foreground', {
|
|
88
|
+
'text-destructive': errorMessage
|
|
89
|
+
})"
|
|
90
|
+
>
|
|
91
|
+
{{ description }}
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
<p
|
|
95
|
+
v-if="errorMessage"
|
|
96
|
+
class="text-sm text-destructive"
|
|
97
|
+
>
|
|
98
|
+
{{ errorMessage }}
|
|
99
|
+
</p>
|
|
100
|
+
|
|
101
|
+
<slot name="extra" />
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|