Compare commits
11
Commits
d7d2e36573
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6696cc1027 | ||
|
|
98cb5ab09b | ||
|
|
c501c2bbbf | ||
|
|
a74ea966ad | ||
|
|
0a7d29419f | ||
|
|
a9599d8a1f | ||
|
|
cbc1311e9d | ||
|
|
587d7ceead | ||
|
|
ac8ef8caa2 | ||
|
|
7d0fb265d4 | ||
|
|
743db57bb3 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "no-copy-frontend",
|
"name": "no-copy-frontend",
|
||||||
"version": "0.120.0",
|
"version": "0.122.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 2999",
|
"dev": "next dev -p 2999",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function Page() {
|
|||||||
<ViolationsStatistic />
|
<ViolationsStatistic />
|
||||||
<ViolationsCheckAllSection />
|
<ViolationsCheckAllSection />
|
||||||
<ViolationsTable />
|
<ViolationsTable />
|
||||||
<ViolationsLastCombinedCases />
|
{/* <ViolationsLastCombinedCases /> */}
|
||||||
{/* <ViolationsMyComplaint />
|
{/* <ViolationsMyComplaint />
|
||||||
<ViolationsMyClaims /> */}
|
<ViolationsMyClaims /> */}
|
||||||
<div className="analytics-grid">
|
<div className="analytics-grid">
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ interface DocumentInfo {
|
|||||||
updatedAt?: string;
|
updatedAt?: string;
|
||||||
uploadSessionId?: string;
|
uploadSessionId?: string;
|
||||||
userId?: number;
|
userId?: number;
|
||||||
|
appealInfos?: any[]; //Не знаю что тут будет
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function Page({ searchParams }: PageProps) {
|
export default async function Page({ searchParams }: PageProps) {
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ export async function getUserFilesInfo() {
|
|||||||
msg_id: 20005,
|
msg_id: 20005,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'user_files_info',
|
action: 'user_files_info',
|
||||||
token: token
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -81,13 +81,13 @@ export async function fetchTariffs(tariffTerm: 'MONTHLY' | 'YEAR') {
|
|||||||
msg_id: 30001,
|
msg_id: 30001,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'get',
|
action: 'get',
|
||||||
user_token: token,
|
|
||||||
tariff_term: tariffTerm
|
tariff_term: tariffTerm
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -108,6 +108,7 @@ export async function fetchTariffs(tariffTerm: 'MONTHLY' | 'YEAR') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchTokensBundle() {
|
export async function fetchTokensBundle() {
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
@@ -122,7 +123,8 @@ export async function fetchTokensBundle() {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -143,6 +145,7 @@ export async function fetchTokensBundle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getBuildData() {
|
export async function getBuildData() {
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/check/api/build`, {
|
const response = await fetch(`${API_BASE_URL}/check/api/build`, {
|
||||||
@@ -150,6 +153,7 @@ export async function getBuildData() {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -165,7 +169,7 @@ export async function getBuildData() {
|
|||||||
|
|
||||||
export async function fetchINN(inn: string) {
|
export async function fetchINN(inn: string) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/auth`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
|
|||||||
+9
-12
@@ -72,7 +72,7 @@ export async function authorization(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const { email, password } = validatedFields.data;
|
const { email, password } = validatedFields.data;
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/auth`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
@@ -89,6 +89,7 @@ export async function authorization(
|
|||||||
});
|
});
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
let parsed = await response.json();
|
let parsed = await response.json();
|
||||||
|
|
||||||
if (parsed.message_code === 0) {
|
if (parsed.message_code === 0) {
|
||||||
await createSession(parsed.message_body.token, email);
|
await createSession(parsed.message_body.token, email);
|
||||||
} else {
|
} else {
|
||||||
@@ -234,7 +235,7 @@ export async function registration(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const { fullName, email, password, phone } = validatedFields.data;
|
const { fullName, email, password, phone } = validatedFields.data;
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/auth`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
@@ -400,13 +401,11 @@ export async function tokenLifeExtension() {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 20008,
|
msg_id: 20008
|
||||||
message_body: {
|
|
||||||
token: token
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -431,14 +430,14 @@ export async function confirmEmail(userId: number, verifyToken: string) {
|
|||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
|
'Authorization': `Bearer ${verifyToken}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 20009,
|
msg_id: 20009,
|
||||||
message_body: {
|
message_body: {
|
||||||
resend: 0,
|
resend: 0,
|
||||||
user_id: userId,
|
user_id: userId
|
||||||
verify_token: verifyToken
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -474,7 +473,6 @@ export async function confirmEmail(userId: number, verifyToken: string) {
|
|||||||
export async function resendConfirmEmail(userId: number) {
|
export async function resendConfirmEmail(userId: number) {
|
||||||
console.log('resendConfirmEmail');
|
console.log('resendConfirmEmail');
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -524,10 +522,9 @@ export async function resetPassword(
|
|||||||
formData: FormData,
|
formData: FormData,
|
||||||
) {
|
) {
|
||||||
const email = formData.get('email');
|
const email = formData.get('email');
|
||||||
console.log('resetPassword');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/auth`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@@ -611,6 +608,7 @@ export async function confirmPassword(
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${verifyToken}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
@@ -618,7 +616,6 @@ export async function confirmPassword(
|
|||||||
message_body: {
|
message_body: {
|
||||||
email: email,
|
email: email,
|
||||||
password: password,
|
password: password,
|
||||||
verifyToken: verifyToken,
|
|
||||||
action: "confirmVerification"
|
action: "confirmVerification"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ export async function companyUserRegistration(
|
|||||||
phone: phone,
|
phone: phone,
|
||||||
password,
|
password,
|
||||||
accountType: 'b2b',
|
accountType: 'b2b',
|
||||||
authToken: token,
|
|
||||||
mail_verified: false,
|
mail_verified: false,
|
||||||
ip: ip,
|
ip: ip,
|
||||||
user_agent: userAgent,
|
user_agent: userAgent,
|
||||||
@@ -103,7 +102,8 @@ export async function companyUserRegistration(
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -113,14 +113,6 @@ export async function companyUserRegistration(
|
|||||||
message_body: { token: string },
|
message_body: { token: string },
|
||||||
message_code: number
|
message_code: number
|
||||||
};
|
};
|
||||||
console.log({
|
|
||||||
fullName: fullName,
|
|
||||||
email,
|
|
||||||
phone: phone,
|
|
||||||
password,
|
|
||||||
accountType: 'b2b',
|
|
||||||
authToken: token
|
|
||||||
});
|
|
||||||
|
|
||||||
if (parsed.message_code === 0) {
|
if (parsed.message_code === 0) {
|
||||||
console.log(`registration - ${email}`);
|
console.log(`registration - ${email}`);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ export async function getUserFilesData({
|
|||||||
msg_id: 20005,
|
msg_id: 20005,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'search_files',
|
action: 'search_files',
|
||||||
token: token,
|
|
||||||
page: page,
|
page: page,
|
||||||
page_size: pageSize,
|
page_size: pageSize,
|
||||||
query: query,
|
query: query,
|
||||||
@@ -43,7 +42,8 @@ export async function getUserFilesData({
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -77,12 +77,12 @@ export async function removeUserFile(fileId: string, fullDelete: number) {
|
|||||||
action: 'delete_file',
|
action: 'delete_file',
|
||||||
file_id: fileId,
|
file_id: fileId,
|
||||||
full_delete: fullDelete,
|
full_delete: fullDelete,
|
||||||
token: token
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -114,13 +114,13 @@ export async function viewFileInfo(fileId: string) {
|
|||||||
msg_id: 20005,
|
msg_id: 20005,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'file_info',
|
action: 'file_info',
|
||||||
file_id: fileId,
|
file_id: fileId
|
||||||
token: token
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -176,14 +176,14 @@ export async function FileAnAppeal(fileId: string, appealReason: string, additio
|
|||||||
message_body: {
|
message_body: {
|
||||||
action: 'submit_appeal',
|
action: 'submit_appeal',
|
||||||
file_id: fileId,
|
file_id: fileId,
|
||||||
token: token,
|
|
||||||
appeal_reason: appealReason,
|
appeal_reason: appealReason,
|
||||||
additional_info: additionalInfo
|
additional_info: additionalInfo
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
import { API_BASE_URL } from '@/app/actions/definitions';
|
import { API_BASE_URL } from '@/app/actions/definitions';
|
||||||
import { getSessionData } from '@/app/actions/session';
|
import { getSessionData } from '@/app/actions/session';
|
||||||
import { FormState } from '@/app/actions/auth';
|
|
||||||
import { unknown } from 'zod';
|
|
||||||
|
|
||||||
interface initMessageBody {
|
interface initMessageBody {
|
||||||
file_name: string,
|
file_name: string,
|
||||||
@@ -22,7 +20,6 @@ export async function fileUpload(messageBody: initMessageBody, convertTo?: strin
|
|||||||
}
|
}
|
||||||
const message = messageBody;
|
const message = messageBody;
|
||||||
message.action = 'init';
|
message.action = 'init';
|
||||||
message.token = token;
|
|
||||||
|
|
||||||
if (convertTo && convertTo !== 'reject') {
|
if (convertTo && convertTo !== 'reject') {
|
||||||
message.convertTo = convertTo;
|
message.convertTo = convertTo;
|
||||||
@@ -38,7 +35,8 @@ export async function fileUpload(messageBody: initMessageBody, convertTo?: strin
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -68,6 +66,8 @@ export async function fileUpload(messageBody: initMessageBody, convertTo?: strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function cancelUpload(udloadId: string) {
|
export async function cancelUpload(udloadId: string) {
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -81,7 +81,8 @@ export async function cancelUpload(udloadId: string) {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -114,7 +115,6 @@ export type ChunkResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function chunkUpload(formData: FormData, itPrivate?: boolean): Promise<ChunkResponse> {
|
export async function chunkUpload(formData: FormData, itPrivate?: boolean): Promise<ChunkResponse> {
|
||||||
console.log('chunkUpload');
|
|
||||||
const token = await getSessionData('token');
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -123,19 +123,21 @@ export async function chunkUpload(formData: FormData, itPrivate?: boolean): Prom
|
|||||||
: `${API_BASE_URL}/api/v1/files/chunk`;
|
: `${API_BASE_URL}/api/v1/files/chunk`;
|
||||||
|
|
||||||
|
|
||||||
if (token && itPrivate) {
|
/* if (token && itPrivate) {
|
||||||
formData.append('token', token);
|
formData.append('token', token);
|
||||||
}
|
} */
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData,
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
/* ...(token && itPrivate && { 'Authorization': `Bearer ${token}` }) возможно нужно будет условно отправлять токен*/
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
let parsed = await response.json();
|
let parsed = await response.json();
|
||||||
console.log(formData);
|
|
||||||
console.log(parsed);
|
|
||||||
|
|
||||||
if (parsed.message_code === 0) {
|
if (parsed.message_code === 0) {
|
||||||
return {
|
return {
|
||||||
@@ -171,6 +173,8 @@ export async function chunkUpload(formData: FormData, itPrivate?: boolean): Prom
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function checkChunkStatus(upload_id: string) {
|
export async function checkChunkStatus(upload_id: string) {
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -184,7 +188,8 @@ export async function checkChunkStatus(upload_id: string) {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -206,6 +211,8 @@ export async function checkChunkStatus(upload_id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getAllowedFilesExtensions(type: string) {
|
export async function getAllowedFilesExtensions(type: string) {
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -219,7 +226,8 @@ export async function getAllowedFilesExtensions(type: string) {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -250,7 +258,6 @@ export async function checkOperationPrice(action: string, filesCount: number, fi
|
|||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30008,
|
msg_id: 30008,
|
||||||
message_body: {
|
message_body: {
|
||||||
auth_token: token,
|
|
||||||
action: action,
|
action: action,
|
||||||
file_type: fileType,
|
file_type: fileType,
|
||||||
count_files: filesCount
|
count_files: filesCount
|
||||||
@@ -258,7 +265,8 @@ export async function checkOperationPrice(action: string, filesCount: number, fi
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ export async function setMonitoring(fileId: string, monitoringType: string) {
|
|||||||
msg_id: 30007,
|
msg_id: 30007,
|
||||||
message_body: {
|
message_body: {
|
||||||
monitoring_type: monitoringType,
|
monitoring_type: monitoringType,
|
||||||
file_id: fileId,
|
file_id: fileId
|
||||||
auth_token: token
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -65,14 +65,12 @@ export async function fetchMonitoringStats(): Promise<MonitoringStats | null> {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30011,
|
msg_id: 30011
|
||||||
message_body: {
|
|
||||||
token: token
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -99,13 +97,13 @@ export async function fetchLastMonitoringCheck() {
|
|||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30011,
|
msg_id: 30011,
|
||||||
message_body: {
|
message_body: {
|
||||||
token: token,
|
|
||||||
limit: 1
|
limit: 1
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -131,14 +129,12 @@ export async function fetchMonitoringInfo() {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30027,
|
msg_id: 30027
|
||||||
message_body: {
|
|
||||||
authToken: token
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ export async function fetchActiveNotifications() {
|
|||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30015,
|
msg_id: 30015,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'active',
|
action: 'active'
|
||||||
authToken: token,
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -59,7 +59,6 @@ export async function fetchAllNotifications(page: number = 0, size: number = 10)
|
|||||||
msg_id: 30015,
|
msg_id: 30015,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'list',
|
action: 'list',
|
||||||
authToken: token,
|
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
sortBy: "createdAt",
|
sortBy: "createdAt",
|
||||||
@@ -70,7 +69,8 @@ export async function fetchAllNotifications(page: number = 0, size: number = 10)
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -101,13 +101,13 @@ export async function notificationsMarkAsRead(ids: number[]) {
|
|||||||
msg_id: 30015,
|
msg_id: 30015,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'markRead',
|
action: 'markRead',
|
||||||
authToken: token,
|
|
||||||
notificationIds: ids
|
notificationIds: ids
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -132,7 +132,6 @@ export async function notificationsMarkAsRead(ids: number[]) {
|
|||||||
|
|
||||||
export async function notificationsDelete(ids: number[]) {
|
export async function notificationsDelete(ids: number[]) {
|
||||||
const token = await getSessionData('token');
|
const token = await getSessionData('token');
|
||||||
console.log('notificationsDelete');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
@@ -142,13 +141,13 @@ export async function notificationsDelete(ids: number[]) {
|
|||||||
msg_id: 30015,
|
msg_id: 30015,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'delete',
|
action: 'delete',
|
||||||
authToken: token,
|
|
||||||
notificationIds: ids
|
notificationIds: ids
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ export async function fetchReferralsLevels() {
|
|||||||
msg_id: 30003,
|
msg_id: 30003,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'levels',
|
action: 'levels',
|
||||||
token: token,
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -57,12 +57,12 @@ export async function fetchReferralUserStats() {
|
|||||||
msg_id: 30003,
|
msg_id: 30003,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'userStats',
|
action: 'userStats',
|
||||||
token: token,
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -96,14 +96,14 @@ export async function fetchReferralInvitees() {
|
|||||||
msg_id: 30003,
|
msg_id: 30003,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'invitees',
|
action: 'invitees',
|
||||||
token: token,
|
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNumber: 0
|
pageNumber: 0
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -137,25 +137,18 @@ export async function referralRefill() {
|
|||||||
msg_id: 30003,
|
msg_id: 30003,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'refill',
|
action: 'refill',
|
||||||
token: token,
|
|
||||||
amount: 2000,
|
amount: 2000,
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
console.log('referralRefill');
|
|
||||||
console.log({
|
|
||||||
action: 'refill',
|
|
||||||
token: token,
|
|
||||||
amount: 2000,
|
|
||||||
})
|
|
||||||
let parsed = await response.json();
|
let parsed = await response.json();
|
||||||
console.log(parsed);
|
|
||||||
|
|
||||||
if (parsed.message_code === 0) {
|
if (parsed.message_code === 0) {
|
||||||
return parsed.message_body;
|
return parsed.message_body;
|
||||||
@@ -366,8 +359,8 @@ export async function createPayoutRequest(
|
|||||||
const response = await fetch(`${API_BASE_URL}/api/payouts/create-request`, {
|
const response = await fetch(`${API_BASE_URL}/api/payouts/create-request`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
"amount": amount,
|
'amount': amount,
|
||||||
"payoutMethodId": payoutMethodId
|
'payoutMethodId': payoutMethodId
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@@ -7,8 +7,11 @@ export async function searchUserFiles(fileId: string) {
|
|||||||
const token = await getSessionData('token');
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/files/${fileId}/similar?similarityLevels=DUPLICATE,SIMILARITY&auth_token=${token}`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/files/${fileId}/similar?similarityLevels=DUPLICATE,SIMILARITY`, {
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
@@ -40,8 +43,6 @@ export async function searchUserFiles(fileId: string) {
|
|||||||
export async function searchGlobalFiles(fileId: string, currentPage: number) {
|
export async function searchGlobalFiles(fileId: string, currentPage: number) {
|
||||||
const token = await getSessionData('token');
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
//удалить когда поиск будет нормально работать
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -56,7 +57,8 @@ export async function searchGlobalFiles(fileId: string, currentPage: number) {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -112,6 +114,7 @@ export async function getSearchStats() {
|
|||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
let parsed = await response.json();
|
let parsed = await response.json();
|
||||||
|
|
||||||
return parsed;
|
return parsed;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ export async function requestFileWithTracking(fileId: string) {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
file_id: fileId,
|
file_id: fileId,
|
||||||
token: token,
|
|
||||||
ip: ip,
|
ip: ip,
|
||||||
user_agent: userAgent
|
user_agent: userAgent
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -57,12 +57,12 @@ export async function requestFileAsBuffer(fileId: string): Promise<ArrayBuffer |
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
file_id: fileId,
|
file_id: fileId,
|
||||||
token: token,
|
|
||||||
ip: ip,
|
ip: ip,
|
||||||
user_agent: userAgent
|
user_agent: userAgent
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -91,33 +91,20 @@ export async function requestFileAsBuffer(fileId: string): Promise<ArrayBuffer |
|
|||||||
|
|
||||||
export async function fetchDocumentInfo(fileId: string) {
|
export async function fetchDocumentInfo(fileId: string) {
|
||||||
const token = await getSessionData('token');
|
const token = await getSessionData('token');
|
||||||
|
console.log('fetchDocumentInfo');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/files/public/file-info/${fileId}`, {
|
||||||
method: 'POST',
|
method: 'GET',
|
||||||
body: JSON.stringify({
|
|
||||||
version: 1,
|
|
||||||
msg_id: 20005,
|
|
||||||
message_body: {
|
|
||||||
file_id: fileId,
|
|
||||||
token: token,
|
|
||||||
action: 'file_info'
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const parsed = await response.json();
|
const parsed = await response.json();
|
||||||
|
return parsed;
|
||||||
if (parsed.message_code === 0) {
|
|
||||||
return parsed.message_body;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`${response.status}`);
|
throw new Error(`${response.status}`);
|
||||||
}
|
}
|
||||||
@@ -137,7 +124,6 @@ export async function filePermisionChange(fileId: string, permissions: boolean)
|
|||||||
msg_id: 20005,
|
msg_id: 20005,
|
||||||
message_body: {
|
message_body: {
|
||||||
file_id: fileId,
|
file_id: fileId,
|
||||||
token: token,
|
|
||||||
action: 'change_permission',
|
action: 'change_permission',
|
||||||
permissions: {
|
permissions: {
|
||||||
DOWNLOAD: permissions
|
DOWNLOAD: permissions
|
||||||
@@ -145,7 +131,8 @@ export async function filePermisionChange(fileId: string, permissions: boolean)
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -182,7 +169,6 @@ export async function fetchHistoryView(
|
|||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30028,
|
msg_id: 30028,
|
||||||
message_body: {
|
message_body: {
|
||||||
token: token,
|
|
||||||
action: 'history_view',
|
action: 'history_view',
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
@@ -192,7 +178,8 @@ export async function fetchHistoryView(
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -223,12 +210,12 @@ export async function fetchTrackingStats() {
|
|||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30028,
|
msg_id: 30028,
|
||||||
message_body: {
|
message_body: {
|
||||||
token: token,
|
|
||||||
action: 'view_stats'
|
action: 'view_stats'
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -250,9 +237,14 @@ export async function fetchTrackingStats() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function downloadTrackingFile(fileId: string, fileName?: string) {
|
export async function downloadTrackingFile(fileId: string, fileName?: string) {
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/files/public-download/${fileId}`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/files/public-download/${fileId}`, {
|
||||||
method: 'GET'
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
@@ -91,9 +91,7 @@ export async function getViolationFilesArray(props: {
|
|||||||
const { page, size, start_date, end_date, file_name } = props;
|
const { page, size, start_date, end_date, file_name } = props;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const body: Record<string, any> = {
|
const body: Record<string, any> = {};
|
||||||
token: token
|
|
||||||
};
|
|
||||||
|
|
||||||
if (page !== undefined) body.page = page;
|
if (page !== undefined) body.page = page;
|
||||||
if (size !== undefined) body.size = size;
|
if (size !== undefined) body.size = size;
|
||||||
@@ -106,6 +104,7 @@ export async function getViolationFilesArray(props: {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
});
|
});
|
||||||
@@ -141,7 +140,6 @@ export async function getFileMatches(fileId: string, page: number, status?: stri
|
|||||||
page: (page > 0 ? page - 1 : 0),
|
page: (page > 0 ? page - 1 : 0),
|
||||||
size: 5,
|
size: 5,
|
||||||
sort_direction: 'desc',
|
sort_direction: 'desc',
|
||||||
token: token,
|
|
||||||
status: status,
|
status: status,
|
||||||
...(violationId && { action: 'getByViolationId' }),
|
...(violationId && { action: 'getByViolationId' }),
|
||||||
...(violationId && { violation_id: violationId }),
|
...(violationId && { violation_id: violationId }),
|
||||||
@@ -150,7 +148,8 @@ export async function getFileMatches(fileId: string, page: number, status?: stri
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -183,13 +182,13 @@ export async function fetchViolationAnalyticStatistic(group: 'domain' | 'tld') {
|
|||||||
message_body: {
|
message_body: {
|
||||||
group_by: group,
|
group_by: group,
|
||||||
action: "group",
|
action: "group",
|
||||||
token: token,
|
|
||||||
sort_direction: 'desc'
|
sort_direction: 'desc'
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -219,13 +218,13 @@ export async function fetchViolationStatistic(id?: string) {
|
|||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30010,
|
msg_id: 30010,
|
||||||
message_body: {
|
message_body: {
|
||||||
token: token,
|
|
||||||
...(id && { file_id: id })
|
...(id && { file_id: id })
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -253,14 +252,12 @@ export async function fetchViolationFinalSummaryStatistic() {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30023,
|
msg_id: 30023
|
||||||
message_body: {
|
|
||||||
token: token,
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -328,7 +325,6 @@ export async function createComplaint(
|
|||||||
version: 1,
|
version: 1,
|
||||||
msg_id: 30013,
|
msg_id: 30013,
|
||||||
message_body: {
|
message_body: {
|
||||||
token: token,
|
|
||||||
action: 'create',
|
action: 'create',
|
||||||
violation_id: violationId,
|
violation_id: violationId,
|
||||||
text: textArea,
|
text: textArea,
|
||||||
@@ -337,7 +333,8 @@ export async function createComplaint(
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -394,13 +391,13 @@ export async function fetchComplainInfo(id: number) {
|
|||||||
msg_id: 30013,
|
msg_id: 30013,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'get_by_violation',
|
action: 'get_by_violation',
|
||||||
violation_id: id,
|
violation_id: id
|
||||||
token
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -438,13 +435,13 @@ export async function updateMatchStatus(id: number, status: MatchStatus) {
|
|||||||
message_body: {
|
message_body: {
|
||||||
action: 'updateStatus',
|
action: 'updateStatus',
|
||||||
violation_id: id,
|
violation_id: id,
|
||||||
status: status,
|
status: status
|
||||||
token: token
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -475,7 +472,6 @@ export async function fetchClaimInfo(id: number) {
|
|||||||
msg_id: 30017,
|
msg_id: 30017,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: 'get_all',
|
action: 'get_all',
|
||||||
token: token,
|
|
||||||
pageSize: 1,
|
pageSize: 1,
|
||||||
pageNumber: 0,
|
pageNumber: 0,
|
||||||
sortBy: "createdAt",
|
sortBy: "createdAt",
|
||||||
@@ -485,7 +481,8 @@ export async function fetchClaimInfo(id: number) {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -572,7 +569,6 @@ export async function createClaim(
|
|||||||
violation_id: violationId,
|
violation_id: violationId,
|
||||||
description: textArea,
|
description: textArea,
|
||||||
email: email,
|
email: email,
|
||||||
token: token,
|
|
||||||
name: caseTitle,
|
name: caseTitle,
|
||||||
priority: 'HIGH',
|
priority: 'HIGH',
|
||||||
amount: Number(amount)
|
amount: Number(amount)
|
||||||
@@ -580,7 +576,8 @@ export async function createClaim(
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -651,7 +648,6 @@ export async function fetchLastClaims(params: ComplaintsCaseQueryParams) {
|
|||||||
msg_id: 30017,
|
msg_id: 30017,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: "get_all",
|
action: "get_all",
|
||||||
token: token,
|
|
||||||
pageNumber: page,
|
pageNumber: page,
|
||||||
size,
|
size,
|
||||||
sort_by,
|
sort_by,
|
||||||
@@ -660,7 +656,8 @@ export async function fetchLastClaims(params: ComplaintsCaseQueryParams) {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -692,7 +689,6 @@ export async function fetchLastComplaint(params: ComplaintsCaseQueryParams) {
|
|||||||
msg_id: 30013,
|
msg_id: 30013,
|
||||||
message_body: {
|
message_body: {
|
||||||
action: "get_all",
|
action: "get_all",
|
||||||
token: token,
|
|
||||||
page,
|
page,
|
||||||
size,
|
size,
|
||||||
sort_by,
|
sort_by,
|
||||||
@@ -701,7 +697,8 @@ export async function fetchLastComplaint(params: ComplaintsCaseQueryParams) {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const checkout = new YooCheckout({ shopId: '1276731', secretKey: 'test_0Yns_0NHV
|
|||||||
|
|
||||||
export async function makePaymentOperation(email: string, tariffId: number, operationUuid: string, operationType: 'TARIFF' | 'TOKEN') {
|
export async function makePaymentOperation(email: string, tariffId: number, operationUuid: string, operationType: 'TARIFF' | 'TOKEN') {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
formData.append('email', email);
|
formData.append('email', email);
|
||||||
formData.append('tariffId', tariffId.toString());
|
formData.append('tariffId', tariffId.toString());
|
||||||
@@ -17,7 +18,10 @@ export async function makePaymentOperation(email: string, tariffId: number, oper
|
|||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/payments/create`, {
|
const response = await fetch(`${API_BASE_URL}/api/payments/create`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData,
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
@@ -79,6 +83,7 @@ export async function yooKasaCreatePayment(amount: number, tariff: number, opera
|
|||||||
|
|
||||||
export async function fetchPaymentsHistory() {
|
export async function fetchPaymentsHistory() {
|
||||||
const email = await getSessionData('email');
|
const email = await getSessionData('email');
|
||||||
|
const token = await getSessionData('token');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
|
||||||
@@ -93,7 +98,8 @@ export async function fetchPaymentsHistory() {
|
|||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json'
|
'Accept': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import Link from 'next/link';
|
|||||||
import { SelectedFilesAction } from '@/app/components/tanstak-table/SelectedFilesActions';
|
import { SelectedFilesAction } from '@/app/components/tanstak-table/SelectedFilesActions';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { filePermisionChange } from '@/app/actions/trackingActions';
|
import { filePermisionChange } from '@/app/actions/trackingActions';
|
||||||
import {FileAppealModalWindow} from '@/app/ui/modal-windows/file-appeal-modal-window';
|
import { FileAppealModalWindow } from '@/app/ui/modal-windows/file-appeal-modal-window';
|
||||||
|
|
||||||
export type FileItem = {
|
export type FileItem = {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -68,9 +68,22 @@ type ApiFile = {
|
|||||||
thumbnailFileUrl: string;
|
thumbnailFileUrl: string;
|
||||||
permissions: {
|
permissions: {
|
||||||
DOWNLOAD: boolean;
|
DOWNLOAD: boolean;
|
||||||
}
|
},
|
||||||
|
appealInfos: AppealInfos[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type AppealInfos = {
|
||||||
|
additionalInfo: string | null;
|
||||||
|
adminComment: null;
|
||||||
|
appealId: string | null;
|
||||||
|
appealReason: string | null;
|
||||||
|
createdAt: string | null;
|
||||||
|
fileId: string | null;
|
||||||
|
fileName: string | null;
|
||||||
|
resolvedAt: string | null;
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
|
|
||||||
type ApiResponse = {
|
type ApiResponse = {
|
||||||
files?: ApiFile[];
|
files?: ApiFile[];
|
||||||
total_count: number;
|
total_count: number;
|
||||||
@@ -709,11 +722,10 @@ export default function TanstakFilesTable({ fileType, showFileLink }: { fileType
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleAppeal = async (file: FileItem) => {
|
const handleAppeal = async (file: FileItem) => {
|
||||||
console.log(file);
|
|
||||||
|
|
||||||
setOpenWindowChildren(() => {
|
setOpenWindowChildren(() => {
|
||||||
return (
|
return (
|
||||||
<FileAppealModalWindow fileId={file.id} setWindowClose={setOpenWindow} setWindowChildren={setOpenWindowChildren} />
|
<FileAppealModalWindow fileId={file.id} appeal={file._original?.appealInfos} setWindowClose={setOpenWindow} setWindowChildren={setOpenWindowChildren} />
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
setOpenWindow(true);
|
setOpenWindow(true);
|
||||||
|
|||||||
@@ -833,6 +833,10 @@
|
|||||||
padding: 15px 16px;
|
padding: 15px 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:has(.column-location) {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.column {
|
.column {
|
||||||
@@ -906,6 +910,31 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:has(.column-document) {
|
||||||
|
width: 35%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:has(.column-viewer-date) {
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:has(.column-viewer) {
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:has(.column-location) {
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-document,
|
||||||
|
.column-viewer-date,
|
||||||
|
.column-viewer,
|
||||||
|
.column-location {
|
||||||
|
/* width: 250px;
|
||||||
|
margin: 0 auto; */
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.table-item-file-name-image-wrapper {
|
.table-item-file-name-image-wrapper {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -3805,6 +3834,10 @@
|
|||||||
min-width: 400px;
|
min-width: 400px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
&.appeal-info {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 470px) {
|
@media (max-width: 470px) {
|
||||||
min-width: auto;
|
min-width: auto;
|
||||||
}
|
}
|
||||||
@@ -3936,6 +3969,40 @@
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.appeal-info {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.appeal-status {
|
||||||
|
display: inline-block;
|
||||||
|
background-color: #f9fafb;
|
||||||
|
padding: 4px 12px;
|
||||||
|
border-radius: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.appeal-reason-text,
|
||||||
|
.appeal-additional-text,
|
||||||
|
.admin-comment-text {
|
||||||
|
background-color: #f9fafb;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 6px;
|
||||||
|
line-height: 1.5;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.appeal-warning {
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 12px;
|
||||||
|
background-color: #fef3c7;
|
||||||
|
border-left: 4px solid #d97706;
|
||||||
|
border-radius: 6px;
|
||||||
|
color: #78350f;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,13 +158,14 @@ export default function CaseComplaint({ selectedViolation, updateStatusHandler,
|
|||||||
<div
|
<div
|
||||||
className="button-actions"
|
className="button-actions"
|
||||||
>
|
>
|
||||||
<button
|
{/* пока скроем интерфейс с шаблонами */}
|
||||||
|
{/* <button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-s btn-primary-small"
|
className="btn-s btn-primary-small"
|
||||||
onClick={openTemplateSaveModal}
|
onClick={openTemplateSaveModal}
|
||||||
>
|
>
|
||||||
{t('save-template')}
|
{t('save-template')}
|
||||||
</button>
|
</button> */}
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
@@ -176,7 +177,8 @@ export default function CaseComplaint({ selectedViolation, updateStatusHandler,
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div
|
{/* пока скроем интерфейс с шаблонами */}
|
||||||
|
{/* <div
|
||||||
className="samples-wrapper"
|
className="samples-wrapper"
|
||||||
>
|
>
|
||||||
<h5>Шаблоны</h5>
|
<h5>Шаблоны</h5>
|
||||||
@@ -272,7 +274,7 @@ export default function CaseComplaint({ selectedViolation, updateStatusHandler,
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ModalWindow
|
<ModalWindow
|
||||||
|
|||||||
@@ -256,9 +256,12 @@ export default function RegisterForm() {
|
|||||||
<ConfirmMailModalWindow userId={state?.userId} email={formState?.previousState?.email} onClose={() => { setShowMailConfirmWindow(false) }} />
|
<ConfirmMailModalWindow userId={state?.userId} email={formState?.previousState?.email} onClose={() => { setShowMailConfirmWindow(false) }} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<form action={(e) => {
|
<form
|
||||||
formAction(e);
|
action={(e) => {
|
||||||
}}>
|
formAction(e);
|
||||||
|
}}
|
||||||
|
autoComplete="off"
|
||||||
|
>
|
||||||
<div className={`${styles['form-switcher']}`}>
|
<div className={`${styles['form-switcher']}`}>
|
||||||
<button
|
<button
|
||||||
className={`${styles['form-switcher-button']} ${accountType === 'b2c' ? styles['active'] : ''}`}
|
className={`${styles['form-switcher-button']} ${accountType === 'b2c' ? styles['active'] : ''}`}
|
||||||
@@ -432,6 +435,7 @@ export default function RegisterForm() {
|
|||||||
e.target.value = e.target.value.toLocaleLowerCase();
|
e.target.value = e.target.value.toLocaleLowerCase();
|
||||||
onChangeHandler(e)
|
onChangeHandler(e)
|
||||||
}}
|
}}
|
||||||
|
autoComplete="off"
|
||||||
/>
|
/>
|
||||||
{formState?.error?.email && (
|
{formState?.error?.email && (
|
||||||
<p className="text-sm text-red-500">
|
<p className="text-sm text-red-500">
|
||||||
@@ -486,6 +490,7 @@ export default function RegisterForm() {
|
|||||||
placeholder={t('password-placeholder')}
|
placeholder={t('password-placeholder')}
|
||||||
defaultValue={formState?.previousState?.password ? formState?.previousState?.password : ''}
|
defaultValue={formState?.previousState?.password ? formState?.previousState?.password : ''}
|
||||||
onChange={onChangeHandler}
|
onChange={onChangeHandler}
|
||||||
|
autoComplete="off"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { convertBytes } from '@/app/lib/convertBytes';
|
|
||||||
import { formatDate, formatDateTime } from '@/app/lib/formatDate';
|
import { formatDate, formatDateTime } from '@/app/lib/formatDate';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { FileDetails } from '@/app/[locale]/pages/file/[id]/page';
|
import { FileDetails } from '@/app/[locale]/pages/file/[id]/page';
|
||||||
import { FileAnAppeal } from '@/app/actions/fileEntity';
|
import { FileAnAppeal } from '@/app/actions/fileEntity';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
import { AppealInfos } from '@/app/components/tanstak-table/TanstakTable';
|
||||||
|
|
||||||
export function FileAppealModalWindow({ fileId, setWindowClose, setWindowChildren }: {
|
export function FileAppealModalWindow({ fileId, appeal, setWindowClose, setWindowChildren }: {
|
||||||
fileId: string,
|
fileId: string,
|
||||||
|
appeal?: AppealInfos[],
|
||||||
setWindowClose: any,
|
setWindowClose: any,
|
||||||
setWindowChildren: any
|
setWindowChildren: any
|
||||||
}) {
|
}) {
|
||||||
@@ -17,6 +18,8 @@ export function FileAppealModalWindow({ fileId, setWindowClose, setWindowChildre
|
|||||||
const [appealReason, setAppealReason] = useState('');
|
const [appealReason, setAppealReason] = useState('');
|
||||||
const [additionalInfo, setAdditionalInfo] = useState('');
|
const [additionalInfo, setAdditionalInfo] = useState('');
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
|
const existingAppeal = appeal && appeal.length > 0 ? appeal[0] : null;
|
||||||
|
const hasActiveAppeal = existingAppeal && existingAppeal.status === 'pending';
|
||||||
|
|
||||||
const handleSubmitAppeal = async () => {
|
const handleSubmitAppeal = async () => {
|
||||||
if (!appealReason.trim()) {
|
if (!appealReason.trim()) {
|
||||||
@@ -49,40 +52,114 @@ export function FileAppealModalWindow({ fileId, setWindowClose, setWindowChildre
|
|||||||
return (
|
return (
|
||||||
<div className="modal-window-view-file">
|
<div className="modal-window-view-file">
|
||||||
<div className="modal-window-view-file-content">
|
<div className="modal-window-view-file-content">
|
||||||
{/* Форма подачи апелляции */}
|
{existingAppeal && (
|
||||||
<div className="file-info-card appeal-form">
|
<div className="file-info-card appeal-info">
|
||||||
<div className="info-header">
|
<div className="info-header">
|
||||||
<h4>{t('file-an-appeal')}</h4>
|
<h4>{t('appeal-information')}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="info-item">
|
<div className="info-item">
|
||||||
<div className="info-label">
|
<div className="info-label">{t('appeal-status')}</div>
|
||||||
{t('appeal-reason')} <span className="required">*</span>
|
<div className="info-value">
|
||||||
|
<span className="appeal-status">
|
||||||
|
{existingAppeal.status}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="info-value">
|
|
||||||
<textarea
|
|
||||||
className="appeal-textarea"
|
|
||||||
value={appealReason}
|
|
||||||
onChange={(e) => setAppealReason(e.target.value)}
|
|
||||||
placeholder={t('enter-appeal-reason')}
|
|
||||||
rows={4}
|
|
||||||
disabled={isSubmitting}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="info-item">
|
<div className="info-item">
|
||||||
<div className="info-label">{t('additional-info')}</div>
|
<div className="info-label">{t('appeal-reason')}</div>
|
||||||
<div className="info-value">
|
<div className="info-value">
|
||||||
<textarea
|
<div className="appeal-reason-text">
|
||||||
className="appeal-textarea"
|
{existingAppeal.appealReason || t('not-provided')}
|
||||||
value={additionalInfo}
|
</div>
|
||||||
onChange={(e) => setAdditionalInfo(e.target.value)}
|
</div>
|
||||||
placeholder={t('enter-additional-info')}
|
|
||||||
rows={3}
|
|
||||||
disabled={isSubmitting}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{existingAppeal.additionalInfo && (
|
||||||
|
<div className="info-item">
|
||||||
|
<div className="info-label">{t('additional-info')}</div>
|
||||||
|
<div className="info-value">
|
||||||
|
<div className="appeal-additional-text">
|
||||||
|
{existingAppeal.additionalInfo}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{existingAppeal.createdAt && (
|
||||||
|
<div className="info-item">
|
||||||
|
<div className="info-label">{t('appeal-created-at')}</div>
|
||||||
|
<div className="info-value">
|
||||||
|
{formatDate(existingAppeal.createdAt)} {formatDateTime(existingAppeal.createdAt)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{existingAppeal.adminComment && (
|
||||||
|
<div className="info-item">
|
||||||
|
<div className="info-label">{t('admin-comment')}</div>
|
||||||
|
<div className="info-value">
|
||||||
|
<div className="admin-comment-text">
|
||||||
|
{existingAppeal.adminComment}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{existingAppeal.resolvedAt && (
|
||||||
|
<div className="info-item">
|
||||||
|
<div className="info-label">{t('resolved-at')}</div>
|
||||||
|
<div className="info-value">
|
||||||
|
{formatDateTime(existingAppeal.resolvedAt)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{hasActiveAppeal && (
|
||||||
|
<div className="appeal-warning">
|
||||||
|
{t('active-appeal-pending-message')}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!hasActiveAppeal && (
|
||||||
|
<div className="file-info-card appeal-form">
|
||||||
|
<div className="info-header">
|
||||||
|
<h4>{t('file-an-appeal')}</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="info-item">
|
||||||
|
<div className="info-label">
|
||||||
|
{t('appeal-reason')} <span className="required">*</span>
|
||||||
|
</div>
|
||||||
|
<div className="info-value">
|
||||||
|
<textarea
|
||||||
|
className="appeal-textarea"
|
||||||
|
value={appealReason}
|
||||||
|
onChange={(e) => setAppealReason(e.target.value)}
|
||||||
|
placeholder={t('enter-appeal-reason')}
|
||||||
|
rows={4}
|
||||||
|
disabled={isSubmitting}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="info-item">
|
||||||
|
<div className="info-label">{t('additional-info')}</div>
|
||||||
|
<div className="info-value">
|
||||||
|
<textarea
|
||||||
|
className="appeal-textarea"
|
||||||
|
value={additionalInfo}
|
||||||
|
onChange={(e) => setAdditionalInfo(e.target.value)}
|
||||||
|
placeholder={t('enter-additional-info')}
|
||||||
|
rows={3}
|
||||||
|
disabled={isSubmitting}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="appeal-actions">
|
<div className="appeal-actions">
|
||||||
<button
|
<button
|
||||||
className="btn btn-cancel"
|
className="btn btn-cancel"
|
||||||
@@ -100,7 +177,7 @@ export function FileAppealModalWindow({ fileId, setWindowClose, setWindowChildre
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ export function TrackingHistoryView() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{t('city')}: <strong>{translatedCity}</strong>
|
{t('city')}: <strong title={translatedCity}>{translatedCity}</strong>
|
||||||
<br />
|
<br />
|
||||||
{t('country')}: <strong>{translatedCountry}</strong>
|
{t('country')}: <strong title={translatedCountry}>{translatedCountry}</strong>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ export function TrackingHistoryView() {
|
|||||||
{
|
{
|
||||||
accessorKey: 'document',
|
accessorKey: 'document',
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
<div className="column">
|
<div className="column column-document">
|
||||||
<span>
|
<span>
|
||||||
{t('document')}
|
{t('document')}
|
||||||
</span>
|
</span>
|
||||||
@@ -133,7 +133,7 @@ export function TrackingHistoryView() {
|
|||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<div className="text-center table-item">
|
<div className="text-center table-item column-document">
|
||||||
{row.original.document}
|
{row.original.document}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -141,7 +141,7 @@ export function TrackingHistoryView() {
|
|||||||
{
|
{
|
||||||
accessorKey: 'view_date',
|
accessorKey: 'view_date',
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
<div className="column">
|
<div className="column column-viewer-date">
|
||||||
<span>
|
<span>
|
||||||
{t('date')} / {t('time')}
|
{t('date')} / {t('time')}
|
||||||
</span>
|
</span>
|
||||||
@@ -167,7 +167,7 @@ export function TrackingHistoryView() {
|
|||||||
),
|
),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
return (
|
return (
|
||||||
<div className="text-center table-item">
|
<div className="text-center table-item column-viewer-date">
|
||||||
{row.original.view_date ? (
|
{row.original.view_date ? (
|
||||||
<>
|
<>
|
||||||
{formatDate(row.original.view_date)}
|
{formatDate(row.original.view_date)}
|
||||||
@@ -186,7 +186,7 @@ export function TrackingHistoryView() {
|
|||||||
{
|
{
|
||||||
accessorKey: 'viewer',
|
accessorKey: 'viewer',
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
<div className="column">
|
<div className="column column-viewer">
|
||||||
<span>
|
<span>
|
||||||
{t('who-opened')}
|
{t('who-opened')}
|
||||||
</span>
|
</span>
|
||||||
@@ -212,7 +212,7 @@ export function TrackingHistoryView() {
|
|||||||
),
|
),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
return (
|
return (
|
||||||
<div className="text-center font-semibold table-item">
|
<div className="text-center font-semibold table-item column-viewer">
|
||||||
{row.original.viewer}
|
{row.original.viewer}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -247,7 +247,7 @@ export function TrackingHistoryView() {
|
|||||||
),
|
),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
return (
|
return (
|
||||||
<div className="text-center font-semibold table-item">
|
<div className="text-center font-semibold table-item column-location">
|
||||||
{row.original.country === 'unknow/unknow' ? (
|
{row.original.country === 'unknow/unknow' ? (
|
||||||
t('not-defined')
|
t('not-defined')
|
||||||
) : (
|
) : (
|
||||||
@@ -260,7 +260,7 @@ export function TrackingHistoryView() {
|
|||||||
],
|
],
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
/* `${editLocationName(row.original.country)}` */
|
|
||||||
// Создание таблицы
|
// Создание таблицы
|
||||||
const table = useReactTable({
|
const table = useReactTable({
|
||||||
data: tableData,
|
data: tableData,
|
||||||
|
|||||||
@@ -493,7 +493,15 @@
|
|||||||
"enter-additional-info": "Any additional information that may help...",
|
"enter-additional-info": "Any additional information that may help...",
|
||||||
"submit-appeal": "Submit appeal",
|
"submit-appeal": "Submit appeal",
|
||||||
"submitting": "Submitting...",
|
"submitting": "Submitting...",
|
||||||
"active-appeal-already-exists-for-this-file": "Active appeal already exists for this file"
|
"active-appeal-already-exists-for-this-file": "Active appeal already exists for this file",
|
||||||
|
"appeal-information": "Appeal Information",
|
||||||
|
"appeal-status": "Status",
|
||||||
|
"appeal-created-at": "Created at",
|
||||||
|
"appeal-resolution": "Appeal Resolution",
|
||||||
|
"not-provided": "Not provided",
|
||||||
|
"admin-comment": "Admin Comment",
|
||||||
|
"resolved-at": "Resolved at",
|
||||||
|
"active-appeal-pending-message": "You have an active appeal pending review. Please wait for the admin to respond."
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "and",
|
"and": "and",
|
||||||
|
|||||||
@@ -493,7 +493,15 @@
|
|||||||
"enter-additional-info": "Любая дополнительная информация, которая может помочь...",
|
"enter-additional-info": "Любая дополнительная информация, которая может помочь...",
|
||||||
"submit-appeal": "Отправить апелляцию",
|
"submit-appeal": "Отправить апелляцию",
|
||||||
"submitting": "Отправка...",
|
"submitting": "Отправка...",
|
||||||
"active-appeal-already-exists-for-this-file": "По данному делу уже подана активная апелляция"
|
"active-appeal-already-exists-for-this-file": "По данному делу уже подана активная апелляция",
|
||||||
|
"appeal-information": "Информация об апелляции",
|
||||||
|
"appeal-status": "Статус",
|
||||||
|
"appeal-created-at": "Дата создания",
|
||||||
|
"appeal-resolution": "Результат апелляции",
|
||||||
|
"not-provided": "Не указано",
|
||||||
|
"admin-comment": "Комментарий администратора",
|
||||||
|
"resolved-at": "Дата решения",
|
||||||
|
"active-appeal-pending-message": "У вас есть активная апелляция на рассмотрении. Пожалуйста, дождитесь ответа администратора."
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "и",
|
"and": "и",
|
||||||
|
|||||||
Reference in New Issue
Block a user