added notification that profiles are missing

This commit is contained in:
coolcoala
2025-07-13 22:55:20 +03:00
parent 8e0f5b6abd
commit f9376f6903
3 changed files with 54 additions and 29 deletions

View File

@@ -641,8 +641,10 @@
"Invalid Profile URL": "Invalid profile URL. Please enter a URL starting with http:// or https://",
"Saved Successfully": "Saved successfully",
"Connected": "Connected",
"Disconnected": "Disconnected",
"Attention Required": "Attention Required",
"Menu": "Menu",
"Add New Profile": "Add New Profile",
"Add Profile": "Add Profile",
"Delete Profile": "Delete Profile {{name}}?",
"This action cannot be undone.": "This action cannot be undone.",
"Check Group Latency": "Check Group Latency",
@@ -650,5 +652,9 @@
"Show Basic Info": "Show Basic Info",
"Show Detailed Info": "Show Detailed Info",
"Set Latency Test URL": "Set Latency Test URL",
"Filter by Name": "Filter by Name"
"Filter by Name": "Filter by Name",
"Expires in": "Expires in {{duration}}",
"Expired": "Expired",
"Get Started": "Get Started",
"You don't have any profiles yet. Add your first one to begin.": "You don't have any profiles yet.\nAdd your first one to begin."
}

View File

@@ -591,7 +591,7 @@
"Proxy disabled": "Прокси выключено",
"Connecting...": "Подключение...",
"Disconnecting...": "Отключение...",
"Add New Profile": "Добавить новый профиль",
"Add Profile": "Добавить профиль",
"Delete Profile": "Удалить профиль {{name}}?",
"This action cannot be undone.": "Это действие не может быть отменено",
"Update via proxy": "Обновить через прокси",
@@ -604,5 +604,9 @@
"Update with Clash proxy successfully": "Обновление с помощью прокси Clash прошло успешно",
"Proxy Count": "Число прокси",
"Set Latency Test URL": "Установить URL-адрес тестирования задержки",
"Filter by Name": "Фильтр по имени"
"Filter by Name": "Фильтр по имени",
"Expires in": "Истекает через {{duration}}",
"Expired": "Истекло",
"Get Started": "Приступить к работе",
"You don't have any profiles yet. Add your first one to begin.": "У вас еще нет профилей.\nДобавьте свой первый профиль, чтобы начать."
}

View File

@@ -95,31 +95,33 @@ const MinimalHomePage: React.FC = () => {
<header className="absolute top-0 left-0 right-0 p-5 flex items-center justify-between z-20">
<div className="w-10"></div>
<div className="flex-shrink-0">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="w-full max-w-[250px] sm:max-w-xs">
<span className="truncate">{currentProfileName}</span>
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-[--radix-dropdown-menu-trigger-width]">
<DropdownMenuLabel>{t("Profiles")}</DropdownMenuLabel>
<DropdownMenuSeparator />
{profileItems.map((p) => (
<DropdownMenuItem key={p.uid} onSelect={() => handleProfileChange(p.uid)}>
<span className="flex-1 truncate">{p.name}</span>
{profiles?.current === p.uid && <Check className="ml-4 h-4 w-4" />}
{profileItems.length > 0 && (
<div className="flex-shrink-0">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="w-full max-w-[250px] sm:max-w-xs">
<span className="truncate">{currentProfileName}</span>
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-[--radix-dropdown-menu-trigger-width]">
<DropdownMenuLabel>{t("Profiles")}</DropdownMenuLabel>
<DropdownMenuSeparator />
{profileItems.map((p) => (
<DropdownMenuItem key={p.uid} onSelect={() => handleProfileChange(p.uid)}>
<span className="flex-1 truncate">{p.name}</span>
{profiles?.current === p.uid && <Check className="ml-4 h-4 w-4" />}
</DropdownMenuItem>
))}
<DropdownMenuSeparator />
<DropdownMenuItem onSelect={() => viewerRef.current?.create()}>
<PlusCircle className="mr-2 h-4 w-4" />
<span>{t("Add New Profile")}</span>
</DropdownMenuItem>
))}
<DropdownMenuSeparator />
<DropdownMenuItem onSelect={() => viewerRef.current?.create()}>
<PlusCircle className="mr-2 h-4 w-4" />
<span>{t("Add New Profile")}</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
</DropdownMenuContent>
</DropdownMenu>
</div>
)}
<div className="w-10">
<DropdownMenu>
@@ -180,8 +182,21 @@ const MinimalHomePage: React.FC = () => {
</div>
)}
<div className="w-full">
<div className="w-full mt-4 flex justify-center">
{profileItems.length > 0 ? (
<ProxySelectors />
) : (
<Alert className="flex flex-col items-center gap-2 text-center">
<PlusCircle className="h-4 w-4" />
<AlertTitle>{t("Get Started")}</AlertTitle>
<AlertDescription className="whitespace-pre-wrap">
{t("You don't have any profiles yet. Add your first one to begin.")}
</AlertDescription>
<Button className="mt-2" onClick={() => viewerRef.current?.create()}>
{t("Add Profile")}
</Button>
</Alert>
)}
</div>
</div>