Update logo && name
Deploy Frontend / build-and-deploy (push) Successful in 43s
Details
Deploy Frontend / build-and-deploy (push) Successful in 43s
Details
This commit is contained in:
parent
e4f401f318
commit
43fe957812
|
|
@ -1,146 +0,0 @@
|
|||
const BALANCER_URL = 'https://72.56.235.246.nip.io/balancer/api/balancer/send';
|
||||
const BALANCER_PUBLIC = '68929830b9a07e7c6fa1d4bdfbcafe798a50de4da2969e743fee690dfaec3fb4';
|
||||
const BALANCER_PRIVATE = '89bab1c15544e7bb667b773df786e65f9aed0bf173a84e66e2a88aec3f0014d89a289807c34f71c876b79f67997c9ac281ffd19d00fe8582ebcda97660bddaa3';
|
||||
const BITRIX_WEBHOOK = 'https://thebest.bitrix24.ru/rest/{USER}/{METHOD_ID}/';
|
||||
|
||||
function generateBalancerSignature_(timestampStr) {
|
||||
const message = `${BALANCER_PUBLIC}:${timestampStr}`;
|
||||
const signature = Utilities.computeHmacSha256Signature(message, BALANCER_PRIVATE);
|
||||
return signature.map(b => ('0' + (b & 0xFF).toString(16)).slice(-2)).join('');
|
||||
}
|
||||
|
||||
// ── Балансировщик: одиночный запрос
|
||||
// Используется для get, update, add, delete и любых методов
|
||||
// которые не возвращают next (не список).
|
||||
function balancerPost_(method, body) {
|
||||
const timestamp = Math.floor(Date.now() / 1000).toString();
|
||||
|
||||
const payload = {
|
||||
url: BITRIX_WEBHOOK + method + '.json',
|
||||
method: 'POST',
|
||||
body: body || {},
|
||||
};
|
||||
|
||||
const options = {
|
||||
method: 'post',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Timestamp': timestamp,
|
||||
'X-Signature': generateBalancerSignature_(timestamp),
|
||||
},
|
||||
payload: JSON.stringify(payload),
|
||||
muteHttpExceptions: true,
|
||||
};
|
||||
|
||||
let attempt = 0;
|
||||
const maxRetries = 5;
|
||||
const baseRetryMs = 1000;
|
||||
const limitWaitMs = 5000;
|
||||
|
||||
while (attempt <= maxRetries) {
|
||||
let res, data;
|
||||
try {
|
||||
res = UrlFetchApp.fetch(BALANCER_URL, options);
|
||||
const httpCode = res.getResponseCode();
|
||||
const rawText = res.getContentText();
|
||||
|
||||
if (httpCode === 401) throw new Error(`Балансировщик: ошибка авторизации — ${rawText}. Проверьте BALANCER_PUBLIC / BALANCER_PRIVATE`);
|
||||
if (httpCode === 500) throw new Error(`Балансировщик: внутренняя ошибка — ${rawText}`);
|
||||
if (httpCode !== 200) throw new Error(`Балансировщик: HTTP ${httpCode} — ${rawText}`);
|
||||
|
||||
data = JSON.parse(rawText);
|
||||
} catch (e) {
|
||||
attempt++;
|
||||
const wait = baseRetryMs * attempt;
|
||||
Logger.log(`⚠️ balancerPost_ сетевая ошибка (попытка ${attempt}): ${e} — ждём ${wait}ms`);
|
||||
if (attempt > maxRetries) throw new Error(`Сетевая ошибка после ${maxRetries} попыток: ${e}`);
|
||||
Utilities.sleep(wait);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (res.getResponseCode() !== 200) {
|
||||
attempt++;
|
||||
const wait = baseRetryMs * attempt;
|
||||
Logger.log(`🔴 balancerPost_ HTTP ${res.getResponseCode()} (попытка ${attempt}) — ждём ${wait}ms`);
|
||||
if (attempt > maxRetries) throw new Error(`balancer HTTP ${res.getResponseCode()}`);
|
||||
Utilities.sleep(wait);
|
||||
continue;
|
||||
}
|
||||
|
||||
const bitrixBody = data?.body;
|
||||
const errCode = bitrixBody?.error;
|
||||
|
||||
if (errCode === 'QUERY_LIMIT_EXCEEDED') {
|
||||
attempt++;
|
||||
const wait = limitWaitMs * attempt;
|
||||
Logger.log(`🚦 QUERY_LIMIT_EXCEEDED (попытка ${attempt}) — ждём ${wait}ms`);
|
||||
if (attempt > maxRetries) throw new Error('QUERY_LIMIT_EXCEEDED: превышен лимит');
|
||||
Utilities.sleep(wait);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (errCode === 'INTERNAL_SERVER_ERROR') {
|
||||
attempt++;
|
||||
const wait = baseRetryMs * attempt;
|
||||
Logger.log(`🔴 INTERNAL_SERVER_ERROR (попытка ${attempt}) — ждём ${wait}ms`);
|
||||
if (attempt > maxRetries) throw new Error('INTERNAL_SERVER_ERROR после нескольких попыток');
|
||||
Utilities.sleep(wait);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (errCode) {
|
||||
throw new Error(`Битрикс API [${method}]: ${errCode} — ${bitrixBody?.error_description || ''}`);
|
||||
}
|
||||
|
||||
Logger.log(`🟢 balancerPost_ [${method}] OK`);
|
||||
|
||||
return bitrixBody;
|
||||
}
|
||||
|
||||
throw new Error('balancerPost_: исчерпаны все попытки');
|
||||
}
|
||||
|
||||
// Выполняет рекуррентный запрос через балансировщик.
|
||||
// Балансировщик сам крутит пагинацию и возвращает все записи одним массивом.
|
||||
function balancerRecurrentPost_(method, body, resultKey) {
|
||||
const timestamp = Math.floor(Date.now() / 1000).toString();
|
||||
|
||||
const payload = {
|
||||
url: BITRIX_WEBHOOK + method + '.json',
|
||||
method: 'POST',
|
||||
is_recurrent: true,
|
||||
result_key: resultKey || null,
|
||||
body: body,
|
||||
};
|
||||
|
||||
const options = {
|
||||
method: 'post',
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-Timestamp': timestamp,
|
||||
'X-Signature': generateBalancerSignature_(timestamp),
|
||||
},
|
||||
payload: JSON.stringify(payload),
|
||||
muteHttpExceptions: true,
|
||||
};
|
||||
|
||||
const sig = generateBalancerSignature_(timestamp);
|
||||
Logger.log('Timestamp: ' + timestamp);
|
||||
Logger.log('Signature: ' + sig);
|
||||
Logger.log('Message: ' + BALANCER_PUBLIC + ':' + timestamp);
|
||||
|
||||
res = UrlFetchApp.fetch(BALANCER_URL, options);
|
||||
const httpCode = res.getResponseCode();
|
||||
const rawText = res.getContentText();
|
||||
|
||||
if (httpCode === 401) throw new Error(`Балансировщик: ошибка авторизации — ${rawText}. Проверьте BALANCER_PUBLIC / BALANCER_PRIVATE`);
|
||||
if (httpCode === 500) throw new Error(`Балансировщик: внутренняя ошибка — ${rawText}`);
|
||||
if (httpCode !== 200) throw new Error(`Балансировщик: HTTP ${httpCode} — ${rawText}`);
|
||||
|
||||
data = JSON.parse(rawText);
|
||||
|
||||
if (data.error) throw new Error(`balancer error [${method}]: ${JSON.stringify(data.error)}`);
|
||||
|
||||
// Возвращает { body: [...], total_fetched: N, quota_left: N }
|
||||
return data.body || [];
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -2,9 +2,9 @@
|
|||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="/logo.jpg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Административная панель РусПЭТ</title>
|
||||
<title>Портал сотрудника РусПЭТ</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
19591
react_code.txt
19591
react_code.txt
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,239 @@
|
|||
├── .DS_Store
|
||||
├── .env
|
||||
├── .env.example
|
||||
├── .gitea
|
||||
│ ├── workflows
|
||||
│ │ ├── deploy-frontend.yml
|
||||
├── .gitignore
|
||||
├── README.md
|
||||
├── eslint.config.js
|
||||
├── index.html
|
||||
├── package-lock.json
|
||||
├── package.json
|
||||
├── public
|
||||
│ ├── favicon.svg
|
||||
│ ├── icons.svg
|
||||
├── src
|
||||
│ ├── App.css
|
||||
│ ├── App.tsx
|
||||
│ ├── api
|
||||
│ │ ├── adminLogs.ts
|
||||
│ │ ├── admins.ts
|
||||
│ │ ├── approvalTasks.ts
|
||||
│ │ ├── approvals.ts
|
||||
│ │ ├── auth.ts
|
||||
│ │ ├── categories.ts
|
||||
│ │ ├── client.ts
|
||||
│ │ ├── dashboard.ts
|
||||
│ │ ├── departments.ts
|
||||
│ │ ├── flowNodes.ts
|
||||
│ │ ├── hierarchies.ts
|
||||
│ │ ├── monthlyOrders.ts
|
||||
│ │ ├── notifications.ts
|
||||
│ │ ├── permissions.ts
|
||||
│ │ ├── roles.ts
|
||||
│ │ ├── telegramManagers.ts
|
||||
│ │ ├── time.ts
|
||||
│ │ ├── topicExecutors.ts
|
||||
│ │ ├── topics.ts
|
||||
│ │ ├── userRoles.ts
|
||||
│ │ ├── users.ts
|
||||
│ │ ├── whatsappManagers.ts
|
||||
│ ├── assets
|
||||
│ │ ├── hero.png
|
||||
│ │ ├── react.svg
|
||||
│ │ ├── vite.svg
|
||||
│ ├── components
|
||||
│ │ ├── CopyRolesModal.tsx
|
||||
│ │ ├── DiagnosticErrorBoundary.tsx
|
||||
│ │ ├── Layout
|
||||
│ │ │ ├── Header.tsx
|
||||
│ │ │ ├── MainLayout.tsx
|
||||
│ │ │ ├── Sidebar.tsx
|
||||
│ │ ├── TopicGapsModal.tsx
|
||||
│ │ ├── UserEditModal.tsx
|
||||
│ ├── features
|
||||
│ │ ├── adminLogs
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useAdminLogs.ts
|
||||
│ │ ├── admins
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useAdmins.ts
|
||||
│ │ ├── approvalTasks
|
||||
│ │ │ ├── const.ts
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useApprovalTasks.ts
|
||||
│ │ ├── approvals
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useApprovals.ts
|
||||
│ │ ├── categories
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useCategories.ts
|
||||
│ │ ├── departments
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── DepartmentEditModal.tsx
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useDepartments.ts
|
||||
│ │ ├── flowNodes
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useFlowNodes.ts
|
||||
│ │ │ ├── utils
|
||||
│ │ │ │ ├── flattenTree.ts
|
||||
│ │ │ │ ├── treeWalk.ts
|
||||
│ │ ├── hierarchies
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useHierarchies.ts
|
||||
│ │ │ │ ├── useSystemOptions.ts
|
||||
│ │ │ ├── utils.ts
|
||||
│ │ ├── monthlyOrders
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useMonthlyOrderSettings.ts
|
||||
│ │ ├── notifications
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useNotifications.ts
|
||||
│ │ │ ├── utils
|
||||
│ │ │ │ ├── telegramHtml.ts
|
||||
│ │ ├── permissions
|
||||
│ │ │ ├── constants.ts
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── usePermissions.ts
|
||||
│ │ ├── roles
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useAllRoles.ts
|
||||
│ │ │ │ ├── useRoles.ts
|
||||
│ │ ├── telegramManagers
|
||||
│ │ │ ├── useTelegramManagers.ts
|
||||
│ │ ├── topicExecutors
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useTopicExecutors.ts
|
||||
│ │ │ ├── utils.ts
|
||||
│ │ ├── topics
|
||||
│ │ │ ├── constants.ts
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useTopics.ts
|
||||
│ │ ├── users
|
||||
│ │ │ ├── hooks
|
||||
│ │ │ │ ├── useDepartments.ts
|
||||
│ │ │ │ ├── useRoles.ts
|
||||
│ │ │ │ ├── useUserRoles.ts
|
||||
│ │ │ │ ├── useUsers.ts
|
||||
│ │ ├── whatsappManagers
|
||||
│ │ │ ├── useWhatsappManagers.ts
|
||||
│ ├── hooks
|
||||
│ │ ├── useAuth.ts
|
||||
│ ├── index.css
|
||||
│ ├── main.tsx
|
||||
│ ├── pages
|
||||
│ │ ├── Dashboard.tsx
|
||||
│ │ ├── DepartmentsPage.tsx
|
||||
│ │ ├── Login.tsx
|
||||
│ │ ├── adminLogs
|
||||
│ │ │ ├── AdminLogsPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── AdminLogDetailModal.tsx
|
||||
│ │ ├── admins
|
||||
│ │ │ ├── AdminsPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── CreateAdminModal.tsx
|
||||
│ │ │ │ ├── EditAdminModal.tsx
|
||||
│ │ ├── approvalTasks
|
||||
│ │ │ ├── ApprovalTasksPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── ApprovalTaskDetailsModal.tsx
|
||||
│ │ ├── approvals
|
||||
│ │ │ ├── ApprovalsPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── ApprovalDetailsModal.tsx
|
||||
│ │ │ │ ├── FilePreviewModal.tsx
|
||||
│ │ ├── categories
|
||||
│ │ │ ├── CategoriesPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── CategoryEditModal.tsx
|
||||
│ │ ├── flowNodes
|
||||
│ │ │ ├── FlowTreeGuidePage.tsx
|
||||
│ │ │ ├── FlowTreePage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── CategoryCreateModal.tsx
|
||||
│ │ │ │ ├── DataFlowExplainer.tsx
|
||||
│ │ │ │ ├── FlowNodeEditModal.tsx
|
||||
│ │ │ │ ├── SortableFlowTree.tsx
|
||||
│ │ │ │ ├── TreeHealthPanel.tsx
|
||||
│ │ ├── hierarchies
|
||||
│ │ │ ├── HierarchiesPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── ChainDuplicateModal.tsx
|
||||
│ │ │ │ ├── ChainVisualization.tsx
|
||||
│ │ │ │ ├── HierarchyEditModal.tsx
|
||||
│ │ │ │ ├── PersonDuplicateModal.tsx
|
||||
│ │ ├── monthlyOrders
|
||||
│ │ │ ├── MonthlyOrdersSettingsPage.tsx
|
||||
│ │ ├── notifications
|
||||
│ │ │ ├── NotificationsPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── NotificationDetailsModal.tsx
|
||||
│ │ │ │ ├── NotificationsHistoryTable.tsx
|
||||
│ │ │ │ ├── SendNotificationForm.tsx
|
||||
│ │ ├── permissions
|
||||
│ │ │ ├── PermissionsPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── PermissionEditModal.tsx
|
||||
│ │ ├── roles
|
||||
│ │ │ ├── RolesPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── RoleEditModal.tsx
|
||||
│ │ ├── settings
|
||||
│ │ │ ├── SettingsPage.tsx
|
||||
│ │ ├── telegramManagers
|
||||
│ │ │ ├── TelegramManagersPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── AddManagerModal.tsx
|
||||
│ │ │ │ ├── DeleteManagersModal.tsx
|
||||
│ │ ├── topicExecutors
|
||||
│ │ │ ├── TopicExecutorsPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── TopicExecutorEditModal.tsx
|
||||
│ │ │ │ ├── TopicExecutorsCard.tsx
|
||||
│ │ ├── topics
|
||||
│ │ │ ├── TopicsPage.tsx
|
||||
│ │ │ ├── components
|
||||
│ │ │ │ ├── TopicEditModal.tsx
|
||||
│ │ ├── users
|
||||
│ │ │ ├── UsersPage.tsx
|
||||
│ ├── theme.ts
|
||||
│ ├── types
|
||||
│ │ ├── api.ts
|
||||
│ ├── utils
|
||||
│ │ ├── date.ts
|
||||
│ ├── vite-env.d.ts
|
||||
├── tsconfig.app.json
|
||||
├── tsconfig.json
|
||||
├── tsconfig.node.json
|
||||
├── vite.config.ts
|
||||
File: eslint.config.js
|
||||
Lines: 22
|
||||
-----BEGIN eslint.config.js-----
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
js.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
reactHooks.configs.flat.recommended,
|
||||
reactRefresh.configs.vite,
|
||||
],
|
||||
languageOptions: {
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
-----END eslint.config.js-----
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ export default function Header({
|
|||
size="sm"
|
||||
/>
|
||||
<Text ml="md" fw={700}>
|
||||
РусПЭТ CRM
|
||||
Портал сотрудника РусПЭТ
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue