diff --git a/src/shared/constants/index.ts b/src/shared/constants/index.ts index 0b06c8ce..1ca4a85d 100644 --- a/src/shared/constants/index.ts +++ b/src/shared/constants/index.ts @@ -9,6 +9,7 @@ export const HREF_GET_WORDPRESS_AUTH_PHP = export const HREF_DOCUMENTATION_CUSTOM_ENDPOINT = 'https://wiki.recloud.tech/docs/gml-launcher/backend/authorization/custom'; export const HREF_DISCORD = 'https://discord.com/invite/b5xgqfWgNt'; +export const HREF_YOUTRACK = 'https://youtrack.recloud.tech/agiles/173-5/current'; export const HREF_RECLOUD_PRO = 'https://market.recloud.tech/#:~:text=Gml%20Лаунчер%20%7C-,Тариф%20Pro,-(месяц)'; diff --git a/src/shared/converters/index.tsx b/src/shared/converters/index.tsx index e323f113..01488fe8 100644 --- a/src/shared/converters/index.tsx +++ b/src/shared/converters/index.tsx @@ -11,13 +11,13 @@ import quilt from '@/assets/logos/quilt.png'; export const convertGameLoaderImage = (loader: GameLoaderOption) => { const converter: Record = { - [GameLoaderOption.VANILLA]: Minecraft, - [GameLoaderOption.FORGE]: Forge, - [GameLoaderOption.FABRIC]: Fabric, - [GameLoaderOption.NEOFORGE]: NeoForge, - [GameLoaderOption.QUILT]: Quilt, + [GameLoaderOption.VANILLA]: Minecraft, + [GameLoaderOption.FORGE]: Forge, + [GameLoaderOption.FABRIC]: Fabric, + [GameLoaderOption.NEOFORGE]: NeoForge, + [GameLoaderOption.QUILT]: Quilt, [GameLoaderOption.LITELOADER]: ( - Liteloader + Liteloader ), }; @@ -27,24 +27,38 @@ export const convertGameLoaderImage = (loader: GameLoaderOption) => { export const convertApiGameLoaderImage = (loader: GameLoaderType) => { const converter: Record = { [GameLoaderType.VANILLA]: ( - Minecraft + Minecraft ), [GameLoaderType.FORGE]: ( - Forge + Forge ), [GameLoaderType.FABRIC]: ( - Fabric + Fabric ), [GameLoaderType.NEOFORGE]: ( - NeoForge + NeoForge ), [GameLoaderType.QUILT]: ( - Quilt + Quilt ), [GameLoaderType.LITELOADER]: ( - Liteloader + Liteloader ), }; return converter[loader]; }; + + +export const convertApiGameLoaderName = (loader: GameLoaderType) => { + const converter: Record = { + [GameLoaderType.VANILLA]: 'Minecraft', + [GameLoaderType.FORGE]: 'Forge', + [GameLoaderType.FABRIC]: 'Fabric', + [GameLoaderType.NEOFORGE]: 'NeoForge', + [GameLoaderType.QUILT]: 'Quilt', + [GameLoaderType.LITELOADER]: 'Liteloader', + }; + + return converter[loader]; +}; diff --git a/src/views/integrations/ui/Integrations.tsx b/src/views/integrations/ui/Integrations.tsx index d2a08f2c..8dc09bb0 100644 --- a/src/views/integrations/ui/Integrations.tsx +++ b/src/views/integrations/ui/Integrations.tsx @@ -1,4 +1,4 @@ -import { LinkIcon } from 'lucide-react'; +import { Lightbulb } from 'lucide-react'; import Link from 'next/link'; import { GenerateLauncherDialog } from '@/widgets/generate-launcher-dialog'; @@ -18,7 +18,7 @@ import { DATA_TEST_ID_DIALOG_NEWS_PROVIDER, } from '@/shared/constants/data'; import { Button } from '@/shared/ui/button'; -import { HREF_DISCORD } from '@/shared/constants'; +import { HREF_YOUTRACK } from '@/shared/constants'; import { NewsProviderDialog } from '@/widgets/news-provider-dialog'; export const IntegrationsPage = () => { @@ -37,25 +37,25 @@ export const IntegrationsPage = () => { } + dialog={} testid={DATA_TEST_ID_DIALOG_AUTHENTICATION_METHOD} /> } + dialog={} testid={DATA_TEST_ID_DIALOG_CONNECT_TEXTURES} /> } + dialog={} testid={DATA_TEST_ID_DIALOG_CONNECT_DISCORD} /> } + dialog={} testid={DATA_TEST_ID_DIALOG_NEWS_PROVIDER} /> @@ -66,7 +66,7 @@ export const IntegrationsPage = () => { } + dialog={} testid={DATA_TEST_ID_DIALOG_GENERATE_LAUNCHER} /> @@ -77,17 +77,17 @@ export const IntegrationsPage = () => { } + dialog={} testid={DATA_TEST_ID_DIALOG_CONNECT_SENTRY} /> + } diff --git a/src/widgets/profiles-table/lib/columns.tsx b/src/widgets/profiles-table/lib/columns.tsx index 199b664c..8f9e1c2e 100644 --- a/src/widgets/profiles-table/lib/columns.tsx +++ b/src/widgets/profiles-table/lib/columns.tsx @@ -5,7 +5,7 @@ import Image from 'next/image'; import { useRouter } from 'next/navigation'; import { useQueryClient } from '@tanstack/react-query'; import { createColumnHelper } from '@tanstack/table-core'; -import { Edit2Icon, Trash2Icon } from 'lucide-react'; +import { Edit2Icon, Trash2Icon, X } from 'lucide-react'; import { ClientState } from '@/widgets/client-hub'; import { DataTableColumnHeader } from '@/entities/Table'; @@ -16,14 +16,14 @@ import { DASHBOARD_PAGES } from '@/shared/routes'; import { Icons } from '@/shared/ui/icons'; import { getFormatDate } from '@/shared/lib/utils'; import { profileKeys } from '@/shared/hooks'; -import { convertApiGameLoaderImage } from '@/shared/converters'; +import { convertApiGameLoaderImage, convertApiGameLoaderName } from '@/shared/converters'; +import { Tooltip, TooltipContent, TooltipTrigger } from "@/shared/ui/tooltip"; enum ColumnHeader { ICON = '', NAME = 'Название', CREATED_AT = 'Дата создания', VERSION_LAUNCHER = 'Запускаемая версия', - LOADER_LAUNCHER = '', GAME_VERSION = 'Версия', PRIORITY = 'Приоритет', PROFILE_STATE = 'Статус', @@ -71,29 +71,68 @@ export const useColumns = (props: UseColumnsProps) => { enableSorting: false, enableHiding: false, }), + + columnsHelper.accessor('iconBase64', { size: 64, header: ColumnHeader.ICON, - cell: ({ row }) => - row.original.iconBase64 ? ( - {row.original.name - ) : ( -
- {row.original.name.substring(0, 2).toUpperCase()} + cell: ({ row }) => { + const hasIcon = Boolean(row.original.iconBase64); + const hasLoader = Boolean(row.original.loader); + + const loaderIcon = convertApiGameLoaderImage(row.original.loader); + const loaderName = convertApiGameLoaderName(row.original.loader); + + return ( +
+
+ {hasLoader ? ( + + + {loaderIcon} + + + {loaderName}: {row.original.launchVersion} + + + ) : ( + + + + + +

Не загружен

+
+
+ )} +
+ + + {hasIcon ? ( + {row.original.name + ) : ( +
+ {row.original.name.substring(0, 2).toUpperCase()} +
+ )}
- ), + + + ); + } + }), columnsHelper.display({ size: 400, id: 'name', - header: ({ column }) => , + header: ({ column }) => , cell: ({ row }) => (

{row.original.name}

@@ -101,18 +140,10 @@ export const useColumns = (props: UseColumnsProps) => {
), }), - columnsHelper.accessor('loader', { - size: 70, - enableSorting: false, - header: ({ column }) => ( - - ), - cell: ({ getValue }) => (getValue() ? convertApiGameLoaderImage(getValue()) : 'Не загружен'), - }), columnsHelper.accessor('launchVersion', { size: 500, header: ({ column }) => ( - + ), cell: ({ getValue }) => (getValue() ? getValue() : 'Не загружен'), }), @@ -120,37 +151,37 @@ export const useColumns = (props: UseColumnsProps) => { size: 100, header: ({ column }) => ( - + ), cell: ({ getValue }) => getValue(), }), columnsHelper.accessor('createDate', { size: 500, header: ({ column }) => ( - + ), cell: ({ getValue }) => getFormatDate(getValue()), }), columnsHelper.accessor('priority', { size: 150, header: ({ column }) => ( - + ), cell: ({ getValue }) => getValue(), }), columnsHelper.accessor('state', { size: 270, header: ({ column }) => ( - + ), - cell: ({ getValue }) => , + cell: ({ getValue }) => , }), columnsHelper.display({ size: 48, id: 'edit', cell: ({ row }) => ( ), }), @@ -171,9 +202,9 @@ export const useColumns = (props: UseColumnsProps) => { disabled={props.isPendingDelete} > {props.isPendingDelete ? ( - + ) : ( - + )} );