Skip to content

Commit 3363920

Browse files
fix: show noises inputs in mobile view
1 parent a55a32b commit 3363920

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

dashboard/src/components/dialogs/host-modal.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover
99
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from '@/components/ui/select'
1010
import { Switch } from '@/components/ui/switch'
1111
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
12-
import { VariablesPopover, VariablesList } from '@/components/ui/variables-popover'
12+
import { VariablesList, VariablesPopover } from '@/components/ui/variables-popover'
1313
import useDirDetection from '@/hooks/use-dir-detection'
1414
import { cn } from '@/lib/utils'
15-
import { getHosts, getInbounds, UserStatus } from '@/service/api'
15+
import { UserStatus, getHosts, getInbounds } from '@/service/api'
1616
import { queryClient } from '@/utils/query-client'
1717
import { useQuery } from '@tanstack/react-query'
1818
import { Cable, Check, ChevronsLeftRightEllipsis, Copy, Edit, GlobeLock, Info, Lock, Network, Plus, Trash2, X } from 'lucide-react'
@@ -59,7 +59,7 @@ const NoiseItem = memo<NoiseItemProps>(({ index, form, onRemove, onDuplicate, t
5959
}, [index, onDuplicate])
6060

6161
return (
62-
<div className="grid grid-cols-[minmax(100px,120px),1fr,1fr,1fr,auto] gap-2">
62+
<div className="grid grid-cols-2 gap-2 rounded-md border p-2 md:grid-cols-[minmax(100px,120px),1fr,1fr,1fr,auto] md:border-none md:p-0">
6363
<FormField
6464
control={form.control}
6565
name={`noise_settings.xray.${index}.type`}
@@ -86,7 +86,7 @@ const NoiseItem = memo<NoiseItemProps>(({ index, form, onRemove, onDuplicate, t
8686
control={form.control}
8787
name={`noise_settings.xray.${index}.packet`}
8888
render={({ field }) => (
89-
<FormItem>
89+
<FormItem className="order-3 md:order-none">
9090
<FormControl>
9191
<Input placeholder={t('hostsDialog.noise.packetPlaceholder')} {...field} value={field.value || ''} className="h-8" />
9292
</FormControl>
@@ -98,7 +98,7 @@ const NoiseItem = memo<NoiseItemProps>(({ index, form, onRemove, onDuplicate, t
9898
control={form.control}
9999
name={`noise_settings.xray.${index}.delay`}
100100
render={({ field }) => (
101-
<FormItem>
101+
<FormItem className="order-4 md:order-none">
102102
<FormControl>
103103
<Input placeholder={t('hostsDialog.noise.delayPlaceholder')} {...field} value={field.value || ''} className="h-8" />
104104
</FormControl>
@@ -110,7 +110,7 @@ const NoiseItem = memo<NoiseItemProps>(({ index, form, onRemove, onDuplicate, t
110110
control={form.control}
111111
name={`noise_settings.xray.${index}.apply_to`}
112112
render={({ field }) => (
113-
<FormItem>
113+
<FormItem className="order-2 md:order-none">
114114
<Select onValueChange={field.onChange} value={field.value}>
115115
<FormControl>
116116
<SelectTrigger className="h-8">
@@ -127,7 +127,7 @@ const NoiseItem = memo<NoiseItemProps>(({ index, form, onRemove, onDuplicate, t
127127
</FormItem>
128128
)}
129129
/>
130-
<div className="flex items-center gap-1">
130+
<div className="order-5 col-span-2 flex items-center justify-end gap-1 md:order-none md:col-auto md:justify-start">
131131
<Button type="button" variant="ghost" size="icon" className="h-8 w-8 shrink-0 transition-colors hover:bg-muted/70" onClick={handleDuplicate} title={t('hostsDialog.noise.duplicateNoise')}>
132132
<Copy className="h-4 w-4" />
133133
</Button>
@@ -727,7 +727,7 @@ const HostModal: React.FC<HostModalProps> = ({ isDialogOpen, onOpenChange, onSub
727727
)}
728728
/>
729729

730-
<div className="flex justify-between gap-4 !mb-4">
730+
<div className="!mb-4 flex justify-between gap-4">
731731
<div className="flex-[2]">
732732
<FormField
733733
control={form.control}

0 commit comments

Comments
 (0)