Enhance dialogs and configuration handling in the admin interface
- Updated `EditNodeDialog` and `RegisterNodeDialog` to prevent interaction outside the dialog, improving user experience. - Added data attributes to password fields in both dialogs for better password management. - Refactored `CreateConfigDialog` to accept inbounds as a prop, improving data handling and user feedback when no inbounds are available. - Introduced a warning banner in the root layout to inform users about the necessity of linking their Telegram account for notifications and password recovery. - Updated translations for improved clarity regarding available inbounds and Telegram linking requirements.
This commit is contained in:
@@ -7,6 +7,7 @@ import { Toaster } from '@/shared/ui/toaster'
|
||||
import { Button } from '@/shared/ui/button'
|
||||
import { useAuthStore } from '@/features/auth/store'
|
||||
import { bootstrapSession, clearSession, logout } from '@/features/auth/api'
|
||||
import { TelegramLinkWarningBanner } from '@/features/telegram/TelegramLinkWarningBanner'
|
||||
|
||||
export const Route = createRootRoute({ component: RootLayout })
|
||||
|
||||
@@ -87,6 +88,8 @@ function RootLayout() {
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<TelegramLinkWarningBanner />
|
||||
|
||||
<main className="flex flex-1 flex-col">
|
||||
<Outlet />
|
||||
</main>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ActivationGate } from '@/features/activation/ActivationGate'
|
||||
import { ConfigCard } from '@/features/configs/ConfigCard'
|
||||
import { CreateConfigDialog } from '@/features/configs/CreateConfigDialog'
|
||||
import { SubscriptionCard } from '@/features/configs/SubscriptionCard'
|
||||
import { getMyConfigs } from '@/features/configs/api'
|
||||
import { getMyConfigs, listAvailableInbounds } from '@/features/configs/api'
|
||||
|
||||
export const Route = createFileRoute('/dashboard')({ component: DashboardPage })
|
||||
|
||||
@@ -25,10 +25,11 @@ function DashboardPage() {
|
||||
function ConfigsList() {
|
||||
const { t } = useTranslation()
|
||||
const { data, isLoading } = useQuery({ queryKey: ['my-configs'], queryFn: getMyConfigs })
|
||||
const inboundsQuery = useQuery({ queryKey: ['available-inbounds'], queryFn: listAvailableInbounds })
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-10">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-2xl font-semibold tracking-tight">{t('configs.title')}</h1>
|
||||
{data && (
|
||||
@@ -39,7 +40,11 @@ function ConfigsList() {
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<CreateConfigDialog />
|
||||
{inboundsQuery.data?.length === 0 ? (
|
||||
<p className="max-w-xs text-right text-sm text-muted-foreground">{t('configs.noInboundsNotice')}</p>
|
||||
) : (
|
||||
inboundsQuery.data && <CreateConfigDialog inbounds={inboundsQuery.data} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{!isLoading && data && data.configs.length > 0 && <SubscriptionCard />}
|
||||
|
||||
Reference in New Issue
Block a user