add health check
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "no-copy-frontend",
|
"name": "no-copy-frontend",
|
||||||
"version": "0.42.0",
|
"version": "0.43.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 2999",
|
"dev": "next dev -p 2999",
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import LanguageSwitcher from '@/app/components/LanguageSwitcher';
|
|||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import VKLogin from '@/app/components/VKLogin';
|
import VKLogin from '@/app/components/VKLogin';
|
||||||
import YandexAuthWithScript from '@/app/components/YandexLogin';
|
import YandexAuthWithScript from '@/app/components/YandexLogin';
|
||||||
|
import { getHealt } from '@/app/actions/action';
|
||||||
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Login',
|
title: 'Login',
|
||||||
@@ -15,7 +17,18 @@ export const metadata: Metadata = {
|
|||||||
export default function Page() {
|
export default function Page() {
|
||||||
const t = useTranslations('Login-register-form');
|
const t = useTranslations('Login-register-form');
|
||||||
|
|
||||||
|
async function HealthData() {
|
||||||
|
const data = await getHealt();
|
||||||
|
if (!data) {
|
||||||
|
return <div>Сервер временно не работает</div>
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
|
<HealthData />
|
||||||
<div className={`${styles['login-container-wrapper']}`}>
|
<div className={`${styles['login-container-wrapper']}`}>
|
||||||
{/* <div className={`${styles['login-container-language']}`}>
|
{/* <div className={`${styles['login-container-language']}`}>
|
||||||
<LanguageSwitcher />
|
<LanguageSwitcher />
|
||||||
@@ -67,5 +80,6 @@ export default function Page() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,3 +159,23 @@ export async function fetchINN(inn: string) {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getHealt() {
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${API_BASE_URL}/check/api/healt`, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Accept': 'application/json'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.ok) {
|
||||||
|
return await response.json();
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ export async function yooKasaCreatePayment(amount: number, tariff: string) {
|
|||||||
return_url: 'test'
|
return_url: 'test'
|
||||||
},
|
},
|
||||||
metadata: {
|
metadata: {
|
||||||
userId: userEmail,
|
userMail: userEmail,
|
||||||
tariff: tariff
|
tariff: tariff
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export default function LoginForm() {
|
|||||||
setShowPassword(!showPassword);
|
setShowPassword(!showPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const checkBoxRememberMe = useRef<HTMLInputElement>(null);
|
const checkBoxRememberMe = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user