diff --git a/backend/package-lock.json b/backend/package-lock.json index b50488c..f994142 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -1,12 +1,12 @@ { "name": "@remnawave/subscription-page", - "version": "7.0.4", + "version": "7.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@remnawave/subscription-page", - "version": "7.0.4", + "version": "7.0.5", "license": "AGPL-3.0-only", "dependencies": { "@kastov/request-ip": "^0.0.5", diff --git a/backend/package.json b/backend/package.json index f14a62f..75b8bc8 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "@remnawave/subscription-page", - "version": "7.0.4", + "version": "7.0.5", "description": "Remnawave Subscription Page", "private": false, "type": "commonjs", diff --git a/backend/src/common/axios/axios.service.ts b/backend/src/common/axios/axios.service.ts index 21efdf9..4ced623 100644 --- a/backend/src/common/axios/axios.service.ts +++ b/backend/src/common/axios/axios.service.ts @@ -102,11 +102,13 @@ export class AxiosService implements OnModuleInit { error?: unknown; }> { try { - await this.axiosInstance.request({ + const response = await this.axiosInstance.request({ method: GetStatusCommand.endpointDetails.REQUEST_METHOD, url: GetStatusCommand.TSQ_url, }); + await GetStatusCommand.ResponseSchema.parseAsync(response.data); + return { isOk: true, }; @@ -190,9 +192,12 @@ export class AxiosService implements OnModuleInit { url: GetSubscriptionPageConfigsCommand.url, }); + const validationResult = + await GetSubscriptionPageConfigsCommand.ResponseSchema.parseAsync(response.data); + return { isOk: true, - response: response.data.response, + response: validationResult.response, }; } catch (error) { if (error instanceof AxiosError) { @@ -203,11 +208,13 @@ export class AxiosService implements OnModuleInit { ); return { isOk: false }; } - } - this.logger.error('Error in GetSubscriptionPageConfigList Request:', error); - - return { isOk: false }; + this.logger.error(`Subpage Config List Request failed: ${error.message}`); + return { isOk: false }; + } else { + this.logger.error(`Subpage Config List Request failed: ${error}`); + return { isOk: false }; + } } } diff --git a/backend/src/common/config/app-config/config.schema.ts b/backend/src/common/config/app-config/config.schema.ts index 63194f7..ceae033 100644 --- a/backend/src/common/config/app-config/config.schema.ts +++ b/backend/src/common/config/app-config/config.schema.ts @@ -28,6 +28,7 @@ export const configSchema = z .transform((val) => val === 'true'), MARZBAN_LEGACY_SECRET_KEY: z.optional(z.string()), MARZBAN_LEGACY_SUBSCRIPTION_VALID_FROM: z.optional(z.string()), + INTERNAL_JWT_SECRET: z.string(), }) .superRefine((data, ctx) => { if ( diff --git a/backend/src/modules/root/subpage-config.service.ts b/backend/src/modules/root/subpage-config.service.ts index 936dc2c..2057ea0 100644 --- a/backend/src/modules/root/subpage-config.service.ts +++ b/backend/src/modules/root/subpage-config.service.ts @@ -106,24 +106,17 @@ export class SubpageConfigService implements OnApplicationBootstrap { } public getEncryptedSubpageConfigUuid(subpageConfigUuidFromRemnawave: string | null): string { - let uuidToEncrypt: string; - - const isDefaultUuid = this.subpageConfigUuid === SUBPAGE_DEFAULT_CONFIG_UUID; - - if (isDefaultUuid && subpageConfigUuidFromRemnawave) { - uuidToEncrypt = subpageConfigUuidFromRemnawave; - } else { - uuidToEncrypt = this.subpageConfigUuid; - } - - return encryptUuid(uuidToEncrypt, this.internalJwtSecret); + return encryptUuid( + this.getFinalSubpageConfigUuid(subpageConfigUuidFromRemnawave), + this.internalJwtSecret, + ); } public getBaseSettings( subpageConfigUuid: string | null, ): TSubscriptionPageRawConfig['baseSettings'] { const subpageConfig = this.subpageConfigMap.get( - subpageConfigUuid || SUBPAGE_DEFAULT_CONFIG_UUID, + this.getFinalSubpageConfigUuid(subpageConfigUuid), ); if (!subpageConfig) { @@ -140,4 +133,18 @@ export class SubpageConfigService implements OnApplicationBootstrap { showConnectionKeys: subpageConfig.baseSettings.showConnectionKeys, }; } + + private getFinalSubpageConfigUuid(subpageConfigUuid: string | null): string { + let finalSubpageConfigUuid: string; + + const isDefaultUuid = this.subpageConfigUuid === SUBPAGE_DEFAULT_CONFIG_UUID; + + if (isDefaultUuid && subpageConfigUuid) { + finalSubpageConfigUuid = subpageConfigUuid; + } else { + finalSubpageConfigUuid = this.subpageConfigUuid; + } + + return finalSubpageConfigUuid; + } } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ac531be..dfbcdb2 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "@remnawave/subscription-page", - "version": "7.0.4", + "version": "7.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@remnawave/subscription-page", - "version": "7.0.4", + "version": "7.0.5", "license": "AGPL-3.0-only", "dependencies": { "@gfazioli/mantine-spinner": "^2.3.9", diff --git a/frontend/package.json b/frontend/package.json index 68b9e2c..f7ddb17 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -2,7 +2,7 @@ "name": "@remnawave/subscription-page", "private": false, "type": "module", - "version": "7.0.4", + "version": "7.0.5", "license": "AGPL-3.0-only", "author": "REMNAWAVE ", "homepage": "https://github.com/remnawave", diff --git a/frontend/src/pages/main/ui/components/main.page.component.tsx b/frontend/src/pages/main/ui/components/main.page.component.tsx index 0f4ebad..38dfc3e 100644 --- a/frontend/src/pages/main/ui/components/main.page.component.tsx +++ b/frontend/src/pages/main/ui/components/main.page.component.tsx @@ -1,4 +1,4 @@ -import { Box, Center, Container, Group, Image, Stack, Text, Title } from '@mantine/core' +import { Box, Center, Container, Group, Image, Stack, Title } from '@mantine/core' import { TSubscriptionPagePlatformKey } from '@remnawave/subscription-page-types' import { @@ -69,7 +69,7 @@ export const MainPageComponent = ({ isMobile, platform }: IMainPageComponentProp - + {hasCustomLogo ? ( ) : ( )} - - <Text c={hasCustomLogo ? 'white' : 'cyan'} component="span" inherit> - {brandName} - </Text> + <Title + c={hasCustomLogo ? 'white' : 'cyan'} + fw={700} + order={4} + size="lg" + > + {brandName} - - - + diff --git a/frontend/src/widgets/main/installation-guide/installation-guide.connector.tsx b/frontend/src/widgets/main/installation-guide/installation-guide.connector.tsx index 4943a18..fe53d0f 100644 --- a/frontend/src/widgets/main/installation-guide/installation-guide.connector.tsx +++ b/frontend/src/widgets/main/installation-guide/installation-guide.connector.tsx @@ -3,11 +3,21 @@ import { TSubscriptionPageButtonConfig, TSubscriptionPagePlatformKey } from '@remnawave/subscription-page-types' -import { Box, Button, ButtonVariant, Card, Group, NativeSelect, Stack, Title } from '@mantine/core' +import { + Box, + Button, + ButtonVariant, + Card, + Group, + NativeSelect, + Stack, + Title, + UnstyledButton +} from '@mantine/core' import { notifications } from '@mantine/notifications' -import { IconStar } from '@tabler/icons-react' import { useClipboard } from '@mantine/hooks' import { useState } from 'react' +import clsx from 'clsx' import { constructSubscriptionUrl } from '@shared/utils/construct-subscription-url' import { useSubscription } from '@entities/subscription-info-store' @@ -186,34 +196,44 @@ export const InstallationGuideConnector = (props: IProps) => { {platformApps.length > 0 && ( - +
{platformApps.map((app: TSubscriptionPageAppConfig, index: number) => { const isActive = index === selectedAppIndex + const hasIcon = Boolean(app.svgIconKey) + return ( - + {app.featured && } + {hasIcon && ( + + )} + {app.name} + ) })} - +
{selectedApp && ( { color="var(--mantine-color-dimmed)" size={18} style={{ - transition: 'transform 200ms ease', - transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)' + transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)', + transition: 'transform 150ms ease' }} />
- + { } return ( - +