diff --git a/app/db/crud.py b/app/db/crud.py index 35de70d..417106e 100644 --- a/app/db/crud.py +++ b/app/db/crud.py @@ -184,6 +184,10 @@ def add_host(db: Session, inbound: Inbound, host: InboundHostModify): alpn=host.alpn.value, fingerprint=host.fingerprint, fragment=host.fragment.model_dump() if host.fragment else None, + udp_noises=host.udp_noises, + http_headers=host.http_headers, + mtu=host.mtu, + dns_servers=host.dns_servers, mux=host.mux, allowinsecure=host.allowinsecure, weight=host.weight, @@ -208,6 +212,10 @@ def update_host(db: Session, db_host: InboundHost, host: InboundHostModify): db_host.mux = host.mux db_host.is_disabled = host.is_disabled db_host.allowinsecure = host.allowinsecure + db_host.udp_noises = host.udp_noises + db_host.http_headers = host.http_headers + db_host.mtu = host.mtu + db_host.dns_servers = host.dns_servers db_host.weight = host.weight db.commit() db.refresh(db_host) diff --git a/app/db/migrations/versions/c97bd32e6e12_add_noises_to_hosts.py b/app/db/migrations/versions/c97bd32e6e12_add_noises_to_hosts.py new file mode 100644 index 0000000..30d1dcf --- /dev/null +++ b/app/db/migrations/versions/c97bd32e6e12_add_noises_to_hosts.py @@ -0,0 +1,36 @@ +"""add noises to hosts + +Revision ID: c97bd32e6e12 +Revises: b613375d2fca +Create Date: 2024-11-03 03:47:00.293632 + +""" + +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "c97bd32e6e12" +down_revision = "b613375d2fca" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.add_column("hosts", sa.Column("udp_noises", sa.JSON(), nullable=True)) + op.add_column("hosts", sa.Column("http_headers", sa.JSON(), nullable=True)) + op.add_column( + "hosts", sa.Column("dns_servers", sa.String(length=128), nullable=True) + ) + op.add_column("hosts", sa.Column("mtu", sa.Integer(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("hosts", "mtu") + op.drop_column("hosts", "dns_servers") + op.drop_column("hosts", "http_headers") + op.drop_column("hosts", "udp_noises") + # ### end Alembic commands ### diff --git a/app/db/models.py b/app/db/models.py index 40bee45..ebe261c 100644 --- a/app/db/models.py +++ b/app/db/models.py @@ -346,13 +346,20 @@ class InboundHost(Base): server_default=sqlalchemy.sql.false(), ) fragment = Column(JSON()) - + udp_noises = Column(JSON()) + http_headers = Column(JSON()) + dns_servers = Column(String(128)) + mtu = Column(Integer) inbound_id = Column(Integer, ForeignKey("inbounds.id"), nullable=False) - inbound = relationship("Inbound", back_populates="hosts") + inbound = relationship("Inbound", back_populates="hosts", lazy="joined") allowinsecure = Column(Boolean, default=False) is_disabled = Column(Boolean, default=False) weight = Column(Integer, default=1, nullable=False, server_default="1") + @property + def protocol(self): + return self.inbound.protocol if self.inbound else None + class System(Base): __tablename__ = "system" diff --git a/app/models/proxy.py b/app/models/proxy.py index b1a64d7..6649181 100644 --- a/app/models/proxy.py +++ b/app/models/proxy.py @@ -66,6 +66,12 @@ class FragmentSettings(BaseModel): interval: str = Field(pattern=r"^[\d-]{1,32}$") +class UDPNoiseSettings(BaseModel): + type: str = Field(pattern=r"^(:?rand|str|base64)$") + packet: str = Field() + interval: str = Field(pattern=r"^[\d-]{1,32}$") + + class InboundHost(BaseModel): remark: str address: str @@ -76,11 +82,17 @@ class InboundHost(BaseModel): security: InboundHostSecurity = InboundHostSecurity.inbound_default alpn: InboundHostALPN = InboundHostALPN.none fingerprint: InboundHostFingerprint = InboundHostFingerprint.none - allowinsecure: bool | None = None - is_disabled: bool | None = None + allowinsecure: bool | None = False + is_disabled: bool | None = False mux: bool = Field(False) fragment: FragmentSettings | None = Field(None) + udp_noises: list[UDPNoiseSettings] | None = [] + http_headers: dict[str, list[str]] | None = {} + mtu: int | None = None + dns_servers: str | None = None weight: int = 1 + protocol: ProxyTypes | None = None + inbound_id: int | None = None model_config = ConfigDict(from_attributes=True) @field_validator("remark", "address", "path") diff --git a/app/utils/share.py b/app/utils/share.py index fc4f5e6..c7538e7 100644 --- a/app/utils/share.py +++ b/app/utils/share.py @@ -299,6 +299,10 @@ def generate_user_configs( inbound.get("address"), user_id ), flow=inbound.get("flow"), + dns_servers=( + host.dns_servers.split(",") if host.dns_servers else [] + ), + mtu=host.mtu, allow_insecure=host.allowinsecure, uuid=UUID(gen_uuid(key)), password=gen_password(key), diff --git a/dashboard/public/locales/en.json b/dashboard/public/locales/en.json index 5695d75..c82335a 100644 --- a/dashboard/public/locales/en.json +++ b/dashboard/public/locales/en.json @@ -266,6 +266,13 @@ "users-data-usage": "Users Data Usage" }, "hosts": { + "dns-servers": "DNS Servers", + "obfuscation-password": "Obfuscation Password", + "server-public-key": "Server public key", + "tls-config": "TLS Config", + "network-settings": "Network Settings", + "security-settings": "Security Settings", + "camouflage-settings": "Camouflage Settings", "fragment": { "interval": "Interval", "length": "Length", diff --git a/dashboard/src/hooks/index.ts b/dashboard/src/common/hooks/index.ts similarity index 100% rename from dashboard/src/hooks/index.ts rename to dashboard/src/common/hooks/index.ts diff --git a/dashboard/src/hooks/use-dialog.ts b/dashboard/src/common/hooks/use-dialog.ts similarity index 100% rename from dashboard/src/hooks/use-dialog.ts rename to dashboard/src/common/hooks/use-dialog.ts diff --git a/dashboard/src/hooks/use-is-current-route.ts b/dashboard/src/common/hooks/use-is-current-route.ts similarity index 100% rename from dashboard/src/hooks/use-is-current-route.ts rename to dashboard/src/common/hooks/use-is-current-route.ts diff --git a/dashboard/src/hooks/use-mutation-dialog/index.ts b/dashboard/src/common/hooks/use-mutation-dialog/index.ts similarity index 98% rename from dashboard/src/hooks/use-mutation-dialog/index.ts rename to dashboard/src/common/hooks/use-mutation-dialog/index.ts index eda8209..3cf2f43 100644 --- a/dashboard/src/hooks/use-mutation-dialog/index.ts +++ b/dashboard/src/common/hooks/use-mutation-dialog/index.ts @@ -1,4 +1,4 @@ -import { useDialog } from "@marzneshin/hooks"; +import { useDialog } from "@marzneshin/common/hooks"; import { zodResolver } from "@hookform/resolvers/zod"; import { UseMutationResult } from "@tanstack/react-query"; import { useEffect } from "react"; diff --git a/dashboard/src/hooks/use-screen-breakpoint.ts b/dashboard/src/common/hooks/use-screen-breakpoint.ts similarity index 100% rename from dashboard/src/hooks/use-screen-breakpoint.ts rename to dashboard/src/common/hooks/use-screen-breakpoint.ts diff --git a/dashboard/src/types/index.ts b/dashboard/src/common/types/index.ts similarity index 100% rename from dashboard/src/types/index.ts rename to dashboard/src/common/types/index.ts diff --git a/dashboard/src/types/routes.ts b/dashboard/src/common/types/routes.ts similarity index 100% rename from dashboard/src/types/routes.ts rename to dashboard/src/common/types/routes.ts diff --git a/dashboard/src/types/status.ts b/dashboard/src/common/types/status.ts similarity index 100% rename from dashboard/src/types/status.ts rename to dashboard/src/common/types/status.ts diff --git a/dashboard/src/utils/cn.ts b/dashboard/src/common/utils/cn.ts similarity index 100% rename from dashboard/src/utils/cn.ts rename to dashboard/src/common/utils/cn.ts diff --git a/dashboard/src/utils/color-generator.ts b/dashboard/src/common/utils/color-generator.ts similarity index 100% rename from dashboard/src/utils/color-generator.ts rename to dashboard/src/common/utils/color-generator.ts diff --git a/dashboard/src/utils/compose-refs.ts b/dashboard/src/common/utils/compose-refs.ts similarity index 100% rename from dashboard/src/utils/compose-refs.ts rename to dashboard/src/common/utils/compose-refs.ts diff --git a/dashboard/src/utils/fetch.ts b/dashboard/src/common/utils/fetch.ts similarity index 100% rename from dashboard/src/utils/fetch.ts rename to dashboard/src/common/utils/fetch.ts diff --git a/dashboard/src/utils/index.ts b/dashboard/src/common/utils/index.ts similarity index 100% rename from dashboard/src/utils/index.ts rename to dashboard/src/common/utils/index.ts diff --git a/dashboard/src/utils/project-info.ts b/dashboard/src/common/utils/project-info.ts similarity index 100% rename from dashboard/src/utils/project-info.ts rename to dashboard/src/common/utils/project-info.ts diff --git a/dashboard/src/utils/query-client.ts b/dashboard/src/common/utils/query-client.ts similarity index 100% rename from dashboard/src/utils/query-client.ts rename to dashboard/src/common/utils/query-client.ts diff --git a/dashboard/src/utils/subscription-link.ts b/dashboard/src/common/utils/subscription-link.ts similarity index 100% rename from dashboard/src/utils/subscription-link.ts rename to dashboard/src/common/utils/subscription-link.ts diff --git a/dashboard/src/components/copy-button/index.tsx b/dashboard/src/components/copy-button/index.tsx index 72db482..cd4890f 100644 --- a/dashboard/src/components/copy-button/index.tsx +++ b/dashboard/src/components/copy-button/index.tsx @@ -9,7 +9,7 @@ import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { CopyCheck, CopyX, ClipboardCopy, LucideIcon } from "lucide-react"; import { toast } from "sonner"; -import { cn } from "@marzneshin/utils"; +import { cn } from "@marzneshin/common/utils"; interface CopyToClipboardButtonProps { text: string; diff --git a/dashboard/src/components/form-fields/date.tsx b/dashboard/src/components/form-fields/date.tsx index 2afa0b8..bbca968 100644 --- a/dashboard/src/components/form-fields/date.tsx +++ b/dashboard/src/components/form-fields/date.tsx @@ -1,7 +1,7 @@ import { type FC, useEffect, useState } from "react"; import { format } from "date-fns"; import { CalendarIcon } from "@radix-ui/react-icons"; -import { cn } from "@marzneshin/utils"; +import { cn } from "@marzneshin/common/utils"; import { useFormContext, type FieldValues } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { diff --git a/dashboard/src/components/header/menu.tsx b/dashboard/src/components/header/menu.tsx index d712045..fb84540 100644 --- a/dashboard/src/components/header/menu.tsx +++ b/dashboard/src/components/header/menu.tsx @@ -14,7 +14,7 @@ import { Settings, MenuIcon, ShieldCheck } from "lucide-react"; import { LanguageSwitchMenu } from "@marzneshin/features/language-switch"; import { ThemeToggle } from "@marzneshin/features/theme-switch"; import { useAuth, Logout } from "@marzneshin/features/auth"; -import { useScreenBreakpoint } from "@marzneshin/hooks/use-screen-breakpoint"; +import { useScreenBreakpoint } from "@marzneshin/common/hooks/use-screen-breakpoint"; import { useTranslation } from "react-i18next"; export const HeaderMenu: FC = () => { diff --git a/dashboard/src/components/nav-dir/index.tsx b/dashboard/src/components/nav-dir/index.tsx index 9c27f79..d20759e 100644 --- a/dashboard/src/components/nav-dir/index.tsx +++ b/dashboard/src/components/nav-dir/index.tsx @@ -24,8 +24,8 @@ import { Button, SidebarObject, } from "@marzneshin/components" -import { useScreenBreakpoint } from "@marzneshin/hooks/use-screen-breakpoint"; -import { AppRouterPaths } from "@marzneshin/types"; +import { useScreenBreakpoint } from "@marzneshin/common/hooks"; +import { AppRouterPaths } from "@marzneshin/common/types"; import i18n from "@marzneshin/features/i18n"; interface Dir { diff --git a/dashboard/src/components/page/index.tsx b/dashboard/src/components/page/index.tsx index 5bba518..28ba2dd 100644 --- a/dashboard/src/components/page/index.tsx +++ b/dashboard/src/components/page/index.tsx @@ -7,7 +7,7 @@ import { CardHeader, CardTitle, } from '@marzneshin/components'; -import { cn } from '@marzneshin/utils'; +import { cn } from '@marzneshin/common/utils'; interface PageProps { title: JSX.Element | string; diff --git a/dashboard/src/components/sidebar/sidebar-body.tsx b/dashboard/src/components/sidebar/sidebar-body.tsx index d1cba12..9e239ca 100644 --- a/dashboard/src/components/sidebar/sidebar-body.tsx +++ b/dashboard/src/components/sidebar/sidebar-body.tsx @@ -1,4 +1,4 @@ -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" import { FC, PropsWithChildren } from "react" export interface SidebarBodyProps diff --git a/dashboard/src/components/sidebar/sidebar-group.tsx b/dashboard/src/components/sidebar/sidebar-group.tsx index cf56d87..1ba7c8f 100644 --- a/dashboard/src/components/sidebar/sidebar-group.tsx +++ b/dashboard/src/components/sidebar/sidebar-group.tsx @@ -1,7 +1,7 @@ import { FC, PropsWithChildren } from "react" import { Label } from "@marzneshin/components" -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" import { useSidebarContext } from "./sidebar-provider"; export interface SidebarGroupProps diff --git a/dashboard/src/components/sidebar/sidebar-header.tsx b/dashboard/src/components/sidebar/sidebar-header.tsx index 3d71bbd..85d1093 100644 --- a/dashboard/src/components/sidebar/sidebar-header.tsx +++ b/dashboard/src/components/sidebar/sidebar-header.tsx @@ -1,4 +1,4 @@ -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" import { FC, PropsWithChildren } from "react" export interface SidebarHeaderProps extends diff --git a/dashboard/src/components/sidebar/sidebar-item.tsx b/dashboard/src/components/sidebar/sidebar-item.tsx index 07e474a..1401cd1 100644 --- a/dashboard/src/components/sidebar/sidebar-item.tsx +++ b/dashboard/src/components/sidebar/sidebar-item.tsx @@ -1,7 +1,7 @@ import { Link } from "@tanstack/react-router"; import type { FC } from "react"; import type { SidebarItem as SidebarItemType } from "./types"; -import { cn } from "@marzneshin/utils"; +import { cn } from "@marzneshin/common/utils"; import { type VariantProps, cva } from "class-variance-authority"; import { useSidebarContext } from "./sidebar-provider"; diff --git a/dashboard/src/components/sidebar/sidebar.tsx b/dashboard/src/components/sidebar/sidebar.tsx index 87b6447..8da775f 100644 --- a/dashboard/src/components/sidebar/sidebar.tsx +++ b/dashboard/src/components/sidebar/sidebar.tsx @@ -3,7 +3,7 @@ import { useMemo } from "react"; import { SidebarContext } from "./sidebar-provider"; import type { SidebarItemGroup } from "./types"; import { type VariantProps, cva } from "class-variance-authority"; -import { cn } from "@marzneshin/utils"; +import { cn } from "@marzneshin/common/utils"; import { SidebarHeader } from "./sidebar-header"; import { SidebarFooter } from "./sidebar-footer"; import { SidebarBody } from "./sidebar-body"; @@ -11,53 +11,53 @@ import { SidebarItem } from "./sidebar-item"; import { SidebarGroup } from "./sidebar-group"; const sidebarVariants = cva("flex flex-col justify-between h-full w-full", { - variants: { - variant: { - default: "", + variants: { + variant: { + default: "", + }, }, - }, }); interface ContentComposition { - Header: typeof SidebarHeader; - Footer: typeof SidebarFooter; - Body: typeof SidebarBody; - Group: typeof SidebarGroup; - Item: typeof SidebarItem; + Header: typeof SidebarHeader; + Footer: typeof SidebarFooter; + Body: typeof SidebarBody; + Group: typeof SidebarGroup; + Item: typeof SidebarItem; } export interface SidebarProps - extends React.HTMLAttributes, + extends React.HTMLAttributes, VariantProps { - sidebar: SidebarItemGroup; - collapsed: boolean; - setCollapsed: (state: boolean) => void; - open?: boolean; - setOpen?: (state: boolean) => void; + sidebar: SidebarItemGroup; + collapsed: boolean; + setCollapsed: (state: boolean) => void; + open?: boolean; + setOpen?: (state: boolean) => void; } const Sidebar: FC & ContentComposition = ({ - collapsed, - setCollapsed, - sidebar, - variant, - className, - setOpen, - open, - children, - ...props + collapsed, + setCollapsed, + sidebar, + variant, + className, + setOpen, + open, + children, + ...props }) => { - const contextValue = useMemo( - () => ({ sidebar, collapsed, setCollapsed, open, setOpen }), - [sidebar, collapsed, setCollapsed, open, setOpen], - ); - return ( - -
- {children} -
-
- ); + const contextValue = useMemo( + () => ({ sidebar, collapsed, setCollapsed, open, setOpen }), + [sidebar, collapsed, setCollapsed, open, setOpen], + ); + return ( + +
+ {children} +
+
+ ); }; Sidebar.Header = SidebarHeader; diff --git a/dashboard/src/components/sidebar/types.ts b/dashboard/src/components/sidebar/types.ts index 4b5b325..ebedc1c 100644 --- a/dashboard/src/components/sidebar/types.ts +++ b/dashboard/src/components/sidebar/types.ts @@ -1,7 +1,6 @@ -import { AppRouterPaths } from "@marzneshin/types"; +import { AppRouterPaths } from "@marzneshin/common/types"; import { ReactNode } from "react"; - export interface SidebarItem { title: string; to: AppRouterPaths; diff --git a/dashboard/src/components/stacks/horizontal.tsx b/dashboard/src/components/stacks/horizontal.tsx index fa7f8bc..d7516a6 100644 --- a/dashboard/src/components/stacks/horizontal.tsx +++ b/dashboard/src/components/stacks/horizontal.tsx @@ -1,9 +1,9 @@ import type { FC, PropsWithChildren, HTMLAttributes } from "react"; -import { cn } from "@marzneshin/utils"; +import { cn } from "@marzneshin/common/utils"; export const HStack: FC> = ({ - children, - className, + children, + className, }) => { - return
{children}
; + return
{children}
; }; diff --git a/dashboard/src/components/stacks/vertical.tsx b/dashboard/src/components/stacks/vertical.tsx index 6c7251f..ed31773 100644 --- a/dashboard/src/components/stacks/vertical.tsx +++ b/dashboard/src/components/stacks/vertical.tsx @@ -1,14 +1,14 @@ import type { FC, PropsWithChildren, HTMLAttributes } from "react"; -import { cn } from "@marzneshin/utils"; +import { cn } from "@marzneshin/common/utils"; export const VStack: FC> = ({ - children, - className, - ...props + children, + className, + ...props }) => { - return ( -
- {children} -
- ); + return ( +
+ {children} +
+ ); }; diff --git a/dashboard/src/components/ui/accordion.tsx b/dashboard/src/components/ui/accordion.tsx index 2075990..56d9648 100644 --- a/dashboard/src/components/ui/accordion.tsx +++ b/dashboard/src/components/ui/accordion.tsx @@ -2,53 +2,53 @@ import * as React from "react" import * as AccordionPrimitive from "@radix-ui/react-accordion" import { ChevronDown } from "lucide-react" -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" const Accordion = AccordionPrimitive.Root const AccordionItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )) AccordionItem.displayName = "AccordionItem" const AccordionTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - - svg]:rotate-180", - className - )} - {...props} - > - {children} - - - + + svg]:rotate-180", + className + )} + {...props} + > + {children} + + + )) AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName const AccordionContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - -
{children}
-
+ +
{children}
+
)) AccordionContent.displayName = AccordionPrimitive.Content.displayName diff --git a/dashboard/src/components/ui/alert-dialog.tsx b/dashboard/src/components/ui/alert-dialog.tsx index 6738d8f..1e66674 100644 --- a/dashboard/src/components/ui/alert-dialog.tsx +++ b/dashboard/src/components/ui/alert-dialog.tsx @@ -1,7 +1,7 @@ import * as React from "react" import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" import { buttonVariants } from "@marzneshin/components/ui/button" const AlertDialog = AlertDialogPrimitive.Root @@ -11,129 +11,129 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger const AlertDialogPortal = AlertDialogPrimitive.Portal const AlertDialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )) AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName const AlertDialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - - - - + + + + )) AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName const AlertDialogHeader = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
+
) AlertDialogHeader.displayName = "AlertDialogHeader" const AlertDialogFooter = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
+
) AlertDialogFooter.displayName = "AlertDialogFooter" const AlertDialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )) AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName const AlertDialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )) AlertDialogDescription.displayName = - AlertDialogPrimitive.Description.displayName + AlertDialogPrimitive.Description.displayName const AlertDialogAction = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )) AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName const AlertDialogCancel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )) AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName export { - AlertDialog, - AlertDialogPortal, - AlertDialogOverlay, - AlertDialogTrigger, - AlertDialogContent, - AlertDialogHeader, - AlertDialogFooter, - AlertDialogTitle, - AlertDialogDescription, - AlertDialogAction, - AlertDialogCancel, + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel, } diff --git a/dashboard/src/components/ui/alert.tsx b/dashboard/src/components/ui/alert.tsx index 9f22b3a..cf2e03c 100644 --- a/dashboard/src/components/ui/alert.tsx +++ b/dashboard/src/components/ui/alert.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" const alertVariants = cva( "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", diff --git a/dashboard/src/components/ui/badge.tsx b/dashboard/src/components/ui/badge.tsx index 88a7db5..ad438d6 100644 --- a/dashboard/src/components/ui/badge.tsx +++ b/dashboard/src/components/ui/badge.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" const badgeVariants = cva( "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", diff --git a/dashboard/src/components/ui/breadcrumb.tsx b/dashboard/src/components/ui/breadcrumb.tsx index 06bc3f6..c0186ad 100644 --- a/dashboard/src/components/ui/breadcrumb.tsx +++ b/dashboard/src/components/ui/breadcrumb.tsx @@ -2,114 +2,114 @@ import * as React from "react" import { Slot } from "@radix-ui/react-slot" import { ChevronRight, MoreHorizontal } from "lucide-react" -import { cn } from "@marzneshin/utils" +import { cn } from "@marzneshin/common/utils" const Breadcrumb = React.forwardRef< - HTMLElement, - React.ComponentPropsWithoutRef<"nav"> & { - separator?: React.ReactNode - } + HTMLElement, + React.ComponentPropsWithoutRef<"nav"> & { + separator?: React.ReactNode + } >(({ ...props }, ref) =>