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:
@@ -0,0 +1,32 @@
|
||||
import { useState } from 'react'
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { X } from 'lucide-react'
|
||||
import { useAuthStore } from '@/features/auth/store'
|
||||
|
||||
export function TelegramLinkWarningBanner() {
|
||||
const { t } = useTranslation()
|
||||
const { user, isBootstrapping } = useAuthStore()
|
||||
const [dismissed, setDismissed] = useState(false)
|
||||
|
||||
if (isBootstrapping || !user || user.telegramLinked || dismissed) return null
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-between gap-4 border-b border-border bg-amber-500/10 px-6 py-2 text-sm text-amber-700 dark:text-amber-400">
|
||||
<p>
|
||||
{t('telegramLinkWarning.message')}{' '}
|
||||
<Link to="/settings" className="font-medium underline underline-offset-2">
|
||||
{t('telegramLinkWarning.action')}
|
||||
</Link>
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setDismissed(true)}
|
||||
aria-label={t('telegramLinkWarning.dismiss')}
|
||||
className="shrink-0 text-amber-700/70 hover:text-amber-700 dark:text-amber-400/70 dark:hover:text-amber-400"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user