diff --git a/src/screens/Profile/ui/Profile.tsx b/src/screens/Profile/ui/Profile.tsx index 23f17e5..e2371af 100644 --- a/src/screens/Profile/ui/Profile.tsx +++ b/src/screens/Profile/ui/Profile.tsx @@ -57,7 +57,7 @@ export const ProfilePage = ({ params }: { params: { name: string } }) => {
- +
); diff --git a/src/shared/api/contracts/profiles/ProfileBaseEntity.ts b/src/shared/api/contracts/profiles/ProfileBaseEntity.ts index 461175a..4180316 100644 --- a/src/shared/api/contracts/profiles/ProfileBaseEntity.ts +++ b/src/shared/api/contracts/profiles/ProfileBaseEntity.ts @@ -15,6 +15,7 @@ export type ProfileExtendedBaseEntity = { iconBase64: string; description: string; arguments: string; + hasUpdate: boolean; files: ProfileFileBaseEntity[]; whiteListFiles: ProfileFileBaseEntity[]; }; diff --git a/src/widgets/client-hub/lib/useConnectionHub.ts b/src/widgets/client-hub/lib/useConnectionHub.ts index 1947cb5..02d605c 100644 --- a/src/widgets/client-hub/lib/useConnectionHub.ts +++ b/src/widgets/client-hub/lib/useConnectionHub.ts @@ -2,9 +2,10 @@ import { useEffect, useState } from "react"; import { HubConnection, HubConnectionBuilder } from "@microsoft/signalr"; import { getStorageAccessToken } from "@/shared/services"; import { useToast } from "@/shared/ui/use-toast"; +import { ProfileExtendedBaseEntity } from "@/shared/api/contracts"; interface ConnectionHubProps { - profileName: string; + profile?: ProfileExtendedBaseEntity; isLoading?: boolean; } @@ -12,7 +13,7 @@ const CONNECTION_URL = (token: string) => `${process.env.NEXT_PUBLIC_BASE_URL}/ws/profiles/restore?access_token=${token}`; export const useConnectionHub = (props: ConnectionHubProps) => { - const { profileName, isLoading } = props; + const { profile, isLoading } = props; const { toast } = useToast(); const accessToken = getStorageAccessToken(); @@ -70,7 +71,7 @@ export const useConnectionHub = (props: ConnectionHubProps) => { const onDownloadDistributive = () => { setIsRestoring(true); connectionHub - ?.invoke("Restore", profileName) + ?.invoke("Restore", profile?.profileName) .then(() => { toast({ title: "Успешно", @@ -92,7 +93,7 @@ export const useConnectionHub = (props: ConnectionHubProps) => { const onBuildDistributive = () => { setIsRestoring(true); connectionHub - ?.invoke("Build", profileName) + ?.invoke("Build", profile?.profileName) .then(() => { toast({ title: "Успешно", diff --git a/src/widgets/client-hub/ui/DownloadClientHub.tsx b/src/widgets/client-hub/ui/DownloadClientHub.tsx index e661dff..d6ce1bd 100644 --- a/src/widgets/client-hub/ui/DownloadClientHub.tsx +++ b/src/widgets/client-hub/ui/DownloadClientHub.tsx @@ -5,9 +5,10 @@ import { Button } from "@/shared/ui/button"; import { Progress } from "@/shared/ui/progress"; import { useConnectionHub } from "../lib/useConnectionHub"; +import { ProfileExtendedBaseEntity } from "@/shared/api/contracts"; interface DownloadClientHubProps { - profileName: string; + profile: ProfileExtendedBaseEntity; isLoading?: boolean; } @@ -23,7 +24,11 @@ export function DownloadClientHub(props: DownloadClientHubProps) {

Необходимо загрузить клиент

-
@@ -34,7 +39,11 @@ export function DownloadClientHub(props: DownloadClientHubProps) {

Необходимо собрать профиль

-