-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Scondic/GL-00
GL-00: восстановление билда проекта
- Loading branch information
Showing
29 changed files
with
266 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,11 @@ | ||
"use client"; | ||
import type { Metadata } from "next"; | ||
|
||
import { useState } from "react"; | ||
import { IntegrationsPage } from "@/views/integrations"; | ||
|
||
import { GenerateLauncherDialog } from "@/widgets/generate-launcher-dialog"; | ||
import { ChooseAuthenticationMethodDialog } from "@/widgets/choose-authentication-method-dialog"; | ||
import { ConnectSentryDialog } from "@/widgets/connect-sentry-dialog"; | ||
import { ConnectTexturesDialog } from "@/widgets/connect-textures-dialog"; | ||
|
||
import { IntegrationCard } from "@/entities/IntegrationCard"; | ||
|
||
import { Breadcrumbs } from "@/shared/ui/Breadcrumbs"; | ||
import { useSentry } from "@/shared/hooks"; | ||
import { DASHBOARD_PAGES } from "@/shared/routes"; | ||
|
||
export default function IntegrationsPage() { | ||
const [isGenerateLauncherDialogOpen, setIsGenerateLauncherDialogOpen] = useState(false); | ||
const onGenerateLauncherDialogToggle = () => setIsGenerateLauncherDialogOpen((prev) => !prev); | ||
|
||
const [isAuthenticationDialogOpen, setIsAuthenticationDialogOpen] = useState(false); | ||
const onAuthenticationDialogToggle = () => setIsAuthenticationDialogOpen((prev) => !prev); | ||
|
||
const [isSentryConnectDialogOpen, setIsSentryConnectDialogOpen] = useState(false); | ||
const onSentryConnectDialogToggle = () => setIsSentryConnectDialogOpen((prev) => !prev); | ||
|
||
const [isConnectTexturesDialogOpen, setIsConnectTexturesDialogOpen] = useState(false); | ||
const onConnectTexturesDialogToggle = () => setIsConnectTexturesDialogOpen((prev) => !prev); | ||
|
||
const { data: sentry, isLoading: isLoadingSentry } = useSentry(); | ||
|
||
return ( | ||
<> | ||
<Breadcrumbs | ||
current={"Интеграции"} | ||
breadcrumbs={[{ value: "Главная", path: DASHBOARD_PAGES.HOME }]} | ||
/> | ||
<div className="flex flex-col items-start py-4"> | ||
<div className="flex justify-between w-full"> | ||
<h1 className="text-xl font-bold mb-8">Интеграции</h1> | ||
</div> | ||
<div className="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4"> | ||
<IntegrationCard | ||
title="Аутентификация" | ||
description="Синхронизация и управление данными о пользователях на платформе" | ||
action={onAuthenticationDialogToggle} | ||
status={"CONNECTED"} | ||
buttonText={"Изменить"} | ||
/> | ||
<IntegrationCard | ||
title="Сборка лаунчера" | ||
description="Создайте лаунчер для платформ Windows, MacOS и Linux в пару кликов" | ||
action={onGenerateLauncherDialogToggle} | ||
status={"CONNECTED"} | ||
buttonText={"Собрать"} | ||
/> | ||
<IntegrationCard | ||
title="Сервис скинов" | ||
description="Добавь интеграцию со сервисом скинов, для отображения скинов и плащей в игре" | ||
action={onConnectTexturesDialogToggle} | ||
status={"CONNECTED"} | ||
buttonText={"Настроить"} | ||
/> | ||
<IntegrationCard | ||
title="Sentry" | ||
description={"Подключение платформы для отслеживания ошибок и мониторинга приложений"} | ||
action={onSentryConnectDialogToggle} | ||
isDisabled={isLoadingSentry} | ||
status={sentry?.url ? "CONNECTED" : "UNCONNECTED"} | ||
buttonText={sentry?.url ? "Изменить" : "Подключить"} | ||
/> | ||
<IntegrationCard | ||
isDisabled | ||
title="Discord" | ||
description="Синхронизация лаунчера и вашего Discord сервера" | ||
/> | ||
<IntegrationCard | ||
isDisabled | ||
buttonText="Предложить" | ||
title="Нужен сервис?" | ||
description="Отправь заявку, а мы придумаем что-нибудь" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<ChooseAuthenticationMethodDialog | ||
open={isAuthenticationDialogOpen} | ||
onOpenChange={onAuthenticationDialogToggle} | ||
/> | ||
|
||
<GenerateLauncherDialog | ||
open={isGenerateLauncherDialogOpen} | ||
onOpenChange={onGenerateLauncherDialogToggle} | ||
/> | ||
|
||
<ConnectSentryDialog | ||
open={isSentryConnectDialogOpen} | ||
onOpenChange={onSentryConnectDialogToggle} | ||
/> | ||
|
||
<ConnectTexturesDialog | ||
open={isConnectTexturesDialogOpen} | ||
onOpenChange={onConnectTexturesDialogToggle} | ||
/> | ||
</> | ||
); | ||
} | ||
export const metadata: Metadata = { | ||
title: "Интеграции", | ||
}; | ||
const Page = async () => { | ||
return <IntegrationsPage />; | ||
}; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,16 @@ | ||
"use client"; | ||
import type { Metadata } from "next"; | ||
|
||
import { useEffect } from "react"; | ||
import { ProfilePage } from "@/views/profile"; | ||
|
||
import Image from "next/image"; | ||
|
||
import { DownloadClientHub } from "@/widgets/client-hub"; | ||
|
||
import { Section } from "@/entities/Section"; | ||
|
||
import { EditProfileForm } from "@/features/edit-profile-form/ui/EditProfileForm"; | ||
|
||
import { DASHBOARD_PAGES } from "@/shared/routes"; | ||
import { OsArchitectureEnum, OsTypeEnum } from "@/shared/enums"; | ||
import { useProfile } from "@/shared/hooks"; | ||
import { Breadcrumbs } from "@/shared/ui/Breadcrumbs"; | ||
import { getStorageAccessToken, getStorageProfile } from "@/shared/services/AuthTokenService"; | ||
|
||
import { default as ProfileLoading } from "./loading"; | ||
|
||
export default function ProfilePage() { | ||
const account = getStorageProfile(); | ||
const accessToken = getStorageAccessToken(); | ||
const { data, mutate, isPending } = useProfile(); | ||
const profile = data?.data; | ||
|
||
useEffect(() => { | ||
if (account && accessToken && profile) { | ||
mutate({ | ||
UserName: account.login, | ||
ProfileName: profile.profileName, | ||
UserAccessToken: accessToken, | ||
UserUuid: "uuid", | ||
OsArchitecture: OsArchitectureEnum.X64, | ||
OsType: OsTypeEnum.WINDOWS.toString(), | ||
}); | ||
} | ||
}, []); | ||
|
||
if (isPending || !profile) return <ProfileLoading />; | ||
|
||
return ( | ||
<> | ||
<Breadcrumbs | ||
current={profile.profileName} | ||
breadcrumbs={[ | ||
{ value: "Главная", path: DASHBOARD_PAGES.HOME }, | ||
{ | ||
value: "Профили", | ||
path: DASHBOARD_PAGES.PROFILES, | ||
}, | ||
]} | ||
/> | ||
<div className="flex gap-x-8 items-center"> | ||
<div className={"flex justify-center items-center h-24 w-24 bg-gray-50 rounded-lg"}> | ||
<Image | ||
className="min-w-12 min-h-12" | ||
src={`data:text/plain;base64,${profile.iconBase64}`} | ||
alt={profile.profileName} | ||
width={32} | ||
height={32} | ||
/> | ||
</div> | ||
<div className="flex flex-col gap-y-2"> | ||
<h2 className="text-4xl font-bold">Профиль {profile.profileName}</h2> | ||
<p className="text-sm text-gray-700 dark:text-gray-300">{profile.clientVersion}</p> | ||
</div> | ||
</div> | ||
export async function generateMetadata({ params: { name } }: Props): Promise<Metadata> { | ||
return { title: `Настройка профиля ${name}` }; | ||
} | ||
|
||
<Section | ||
title="Настройки профиля" | ||
subtitle="Обновите фотографию профиля и подробную информацию здесь" | ||
> | ||
<EditProfileForm profile={profile} /> | ||
</Section> | ||
type Props = { | ||
params: { name: string }; | ||
}; | ||
|
||
<Section title="Загрузка клиента" subtitle="Необходимо для генерации клиента Minecraft"> | ||
<DownloadClientHub key="DownloadClientHub" profile={profile} /> | ||
</Section> | ||
</> | ||
); | ||
} | ||
const Page = async (props: Props) => { | ||
return <ProfilePage {...props} />; | ||
}; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,11 @@ | ||
"use client"; | ||
import type { Metadata } from "next"; | ||
|
||
import { useState } from "react"; | ||
import { ProfilesPage } from "@/views/profiles"; | ||
|
||
import { CreateProfileDialog } from "@/widgets/create-profile-dialog"; | ||
import { ProfilesTable } from "@/widgets/profiles-table"; | ||
|
||
import { Button } from "@/shared/ui/button"; | ||
import { Breadcrumbs } from "@/shared/ui/Breadcrumbs"; | ||
import { DASHBOARD_PAGES } from "@/shared/routes"; | ||
|
||
export default function ProfilesPage() { | ||
const [isCreateProfileDialog, setIsCreateProfileDialog] = useState(false); | ||
const onCreateProfileDialogToggle = () => setIsCreateProfileDialog((prev) => !prev); | ||
|
||
return ( | ||
<> | ||
<Breadcrumbs | ||
current={"Профили"} | ||
breadcrumbs={[{ value: "Главная", path: DASHBOARD_PAGES.HOME }]} | ||
/> | ||
<div className="flex flex-col items-start py-4"> | ||
<div className="flex justify-between w-full"> | ||
<h1 className="text-xl font-bold mb-8">Профили</h1> | ||
<Button className="w-fit" onClick={onCreateProfileDialogToggle}> | ||
Создать профиль | ||
</Button> | ||
</div> | ||
<div className="flex flex-col gap-y-6 w-full"> | ||
<ProfilesTable /> | ||
</div> | ||
</div> | ||
|
||
<CreateProfileDialog | ||
open={isCreateProfileDialog} | ||
onOpenChange={onCreateProfileDialogToggle} | ||
/> | ||
</> | ||
); | ||
} | ||
export const metadata: Metadata = { | ||
title: "Профили", | ||
}; | ||
const Page = async () => { | ||
return <ProfilesPage />; | ||
}; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { Metadata } from "next"; | ||
import type { Metadata } from "next"; | ||
|
||
import { SettingsPage } from "@/screens/settings"; | ||
import { SettingsPage } from "@/views/settings"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Настройки платформы", | ||
}; | ||
|
||
export default SettingsPage; | ||
const Page = async () => { | ||
return <SettingsPage />; | ||
}; | ||
export default Page; |
Oops, something went wrong.