Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7ec8b9489 | ||
|
|
23b9e1a1f0 | ||
|
|
dd7aee01ed | ||
|
|
bf773a58f0 | ||
|
|
ac08aef65c | ||
|
|
03fa976526 | ||
|
|
64852bca9f | ||
|
|
fbad913311 | ||
|
|
685a32ee30 | ||
|
|
75f491520b | ||
|
|
a1c96ab2e7 |
No files matched your search
@@ -32,6 +32,7 @@
|
|||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"import/default": "off",
|
||||||
"import/no-named-as-default":"off",
|
"import/no-named-as-default":"off",
|
||||||
"prettier/prettier": "off",
|
"prettier/prettier": "off",
|
||||||
"quotes": ["error", "single"],
|
"quotes": ["error", "single"],
|
||||||
|
|||||||
@@ -1,3 +1,32 @@
|
|||||||
|
## 0.18.8
|
||||||
|
- Добавлено кеширование статики для nginx
|
||||||
|
## 0.18.7
|
||||||
|
- Включена поддержка кэширования зависимостей через Docker
|
||||||
|
- Добавлен файл конфигурации nginx
|
||||||
|
## 0.18.6
|
||||||
|
- Обновлена версия библиотеки isp-ui-kit
|
||||||
|
## 0.18.5
|
||||||
|
- Изолирование стилей в ConfirmConfigModal
|
||||||
|
## 0.18.4
|
||||||
|
- Правка стилей модальных окон
|
||||||
|
## 0.18.3
|
||||||
|
- Изменен репозиторий библиотеки isp-ui-kit
|
||||||
|
- Обновлена версия библиотеки isp-ui-kit
|
||||||
|
## 0.18.2
|
||||||
|
- Добавлено закрытие модального окна после изменения пароля
|
||||||
|
- Добавлен рефеч данных профиля пос после обновления роли
|
||||||
|
- Исправлена верстка модального окна
|
||||||
|
- Добавлено отправка формы на странице логина по нажатии Enter
|
||||||
|
## 0.18.1
|
||||||
|
- В разделе модули в таблице подключений модуля для key строк в таблице добавлено id
|
||||||
|
## 0.18.0
|
||||||
|
- Исправлено редактирование JSON в конфиге
|
||||||
|
## 0.17.3
|
||||||
|
- Обновлены зависимости в package.json
|
||||||
|
## 0.17.1
|
||||||
|
- Обновлена библиотека isp-ui-kit
|
||||||
|
## 0.17.0
|
||||||
|
- Codemirror заменен на MonacoEditor
|
||||||
## 0.16.0
|
## 0.16.0
|
||||||
- Добавлена форма на страницу редактора конфигов
|
- Добавлена форма на страницу редактора конфигов
|
||||||
## 0.15.1
|
## 0.15.1
|
||||||
|
|||||||
+22
-7
@@ -1,13 +1,28 @@
|
|||||||
FROM node:20-alpine as build-deps
|
ARG NODE_VERSION=lts
|
||||||
|
|
||||||
|
FROM node:${NODE_VERSION}-alpine as base
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY . ./
|
|
||||||
RUN apk add git
|
FROM base as deps
|
||||||
RUN npm install
|
|
||||||
|
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||||
|
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||||
|
--mount=type=cache,target=/root/.npm \
|
||||||
|
npm ci --omit=dev
|
||||||
|
|
||||||
|
FROM deps as build
|
||||||
|
|
||||||
|
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||||
|
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||||
|
--mount=type=cache,target=/root/.npm \
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM nginx:1.25-alpine-slim
|
FROM nginx:alpine-slim as final
|
||||||
EXPOSE 8001
|
|
||||||
RUN rm -f /etc/nginx/conf.d/default.conf
|
RUN rm -f /etc/nginx/conf.d/default.conf
|
||||||
COPY cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf
|
COPY cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf
|
||||||
COPY --from=build-deps /usr/src/app/build /opt/msp/isp-admin-ui
|
COPY --from=build /usr/src/app/build /opt/msp/isp-admin-ui
|
||||||
|
|
||||||
@@ -4,6 +4,9 @@ server {
|
|||||||
root /opt/msp/isp-admin-ui/;
|
root /opt/msp/isp-admin-ui/;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||||
|
add_header Pragma "no-cache"; # Для совместимости с HTTP/1.0
|
||||||
|
expires off;
|
||||||
try_files $uri /index.html;
|
try_files $uri /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,4 +18,39 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
}
|
}
|
||||||
|
location /assets/ {
|
||||||
|
gzip on;
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
||||||
|
|
||||||
|
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
||||||
|
}
|
||||||
|
|
||||||
|
# Кэширование для шрифтов и изображений (1 неделя)
|
||||||
|
location ~* \.(?:ico|png|jpg|jpeg|svg|gif|webp|ttf|woff|woff2|otf|eot)$ {
|
||||||
|
gzip on;
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
||||||
|
|
||||||
|
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
||||||
|
}
|
||||||
|
|
||||||
|
# Кэширование JS и CSS (1 неделя)
|
||||||
|
location ~* \.(?:js|css)$ {
|
||||||
|
gzip on;
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_types text/plain text/css application/javascript application/json application/xml application/xml+rss text/javascript image/x-icon;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_disable "msie6"; # Отключение Gzip для устаревших версий Internet Explorer
|
||||||
|
|
||||||
|
add_header Cache-Control "public, max-age=604800, immutable"; # 1 неделя
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Generated
+275
-473
File diff suppressed because it is too large.
Load diff
+7
-10
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "isp-admin-ui",
|
"name": "isp-admin-ui",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.16.0",
|
"version": "0.18.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
@@ -11,28 +11,25 @@
|
|||||||
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
|
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
|
||||||
"lint:fix": "eslint --fix .",
|
"lint:fix": "eslint --fix .",
|
||||||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||||
"prepare": "husky install"
|
"prepare": "husky || true"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apidevtools/json-schema-ref-parser": "^9.0.6",
|
"@apidevtools/json-schema-ref-parser": "^9.0.6",
|
||||||
"@codemirror/lang-json": "^6.0.1",
|
|
||||||
"@monaco-editor/react": "^4.6.0",
|
"@monaco-editor/react": "^4.6.0",
|
||||||
"@reduxjs/toolkit": "^2.2.3",
|
"@reduxjs/toolkit": "^2.2.3",
|
||||||
"@rjsf/antd": "^5.21.2",
|
"@rjsf/antd": "^5.21.2",
|
||||||
"@rjsf/core": "^5.21.2",
|
"@rjsf/core": "^5.21.2",
|
||||||
"@rjsf/validator-ajv8": "^5.21.2",
|
"@rjsf/validator-ajv8": "^5.21.2",
|
||||||
"@uiw/react-codemirror": "^4.21.25",
|
"axios": "^1.7.7",
|
||||||
"axios": "^1.6.8",
|
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"compare-versions": "^6.1.0",
|
"compare-versions": "^6.1.0",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"deep-equal": "^2.2.3",
|
"deep-equal": "^2.2.3",
|
||||||
"isp-ui-kit": "github:txix-open/isp-ui-kit",
|
"isp-ui-kit": "^0.10.1",
|
||||||
"json-schema-view-js": "^2.0.1",
|
"json-schema-view-js": "^2.0.1",
|
||||||
"lodash.clonedeep": "^4.5.0",
|
"lodash.clonedeep": "^4.5.0",
|
||||||
"monaco-editor": "^0.52.0",
|
"monaco-editor": "^0.52.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-codemirror-merge": "^4.21.25",
|
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-hook-form": "^7.51.2",
|
"react-hook-form": "^7.51.2",
|
||||||
"react-redux": "^9.1.0",
|
"react-redux": "^9.1.0",
|
||||||
@@ -66,10 +63,10 @@
|
|||||||
"eslint-plugin-react-refresh": "^0.4.6",
|
"eslint-plugin-react-refresh": "^0.4.6",
|
||||||
"husky": "^9.0.11",
|
"husky": "^9.0.11",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"sass": "^1.74.1",
|
"sass": "1.74.1",
|
||||||
"terser": "^5.30.3",
|
"terser": "^5.30.3",
|
||||||
"typescript": "^5.4.3",
|
"typescript": "^5.4.3",
|
||||||
"vite": "^5.2.8",
|
"vite": "^5.4.10",
|
||||||
"vite-bundle-visualizer": "^1.2.1",
|
"vite-bundle-visualizer": "^1.2.1",
|
||||||
"vite-plugin-node-polyfills": "^0.21.0",
|
"vite-plugin-node-polyfills": "^0.21.0",
|
||||||
"vite-plugin-style-import": "^2.0.0",
|
"vite-plugin-style-import": "^2.0.0",
|
||||||
@@ -84,7 +81,7 @@
|
|||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-coomit": "eslint --fix .",
|
"pre-commit": "eslint --fix .",
|
||||||
"pre-push": "eslint --fix ."
|
"pre-push": "eslint --fix ."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ const ChangePasswordModal: FC<ChangePasswordModalProps> = ({
|
|||||||
await logoutUser()
|
await logoutUser()
|
||||||
message.success('Пароль успешно изменен')
|
message.success('Пароль успешно изменен')
|
||||||
clearErrors('oldPassword')
|
clearErrors('oldPassword')
|
||||||
|
onClose()
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error.response.data.errorCode === 1001) {
|
if (error.response.data.errorCode === 1001) {
|
||||||
setError('oldPassword', {
|
setError('oldPassword', {
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__content {
|
&__content {
|
||||||
.cm-merge-theme {
|
.monaco-diff-editor {
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
height: calc(90vh - 150px);
|
height: calc(90vh - 150px) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__table {
|
&__table {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import { EditorState, EditorView } from '@uiw/react-codemirror'
|
import { DiffEditor } from '@monaco-editor/react'
|
||||||
import { Button, Spin, Table } from 'antd'
|
import { Button, Spin, Table } from 'antd'
|
||||||
import { ColumnsType } from 'antd/es/table'
|
import { ColumnsType } from 'antd/es/table'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { FC, memo, useContext, useState } from 'react'
|
import { FC, memo, useContext, useState } from 'react'
|
||||||
import CodeMirrorMerge from 'react-codemirror-merge'
|
|
||||||
|
|
||||||
import { dateFormats } from '@constants/date.ts'
|
import { dateFormats } from '@constants/date.ts'
|
||||||
|
|
||||||
@@ -24,9 +23,6 @@ import { VersionType } from '@type/version.type'
|
|||||||
|
|
||||||
import './compare-version-modal.scss'
|
import './compare-version-modal.scss'
|
||||||
|
|
||||||
const Original = CodeMirrorMerge.Original
|
|
||||||
const Modified = CodeMirrorMerge.Modified
|
|
||||||
|
|
||||||
const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
||||||
open,
|
open,
|
||||||
onClose,
|
onClose,
|
||||||
@@ -90,21 +86,17 @@ const CompareVersionModal: FC<CompareVersionModalPropsType> = ({
|
|||||||
: `Версия: ${config?.configVersion}`}
|
: `Версия: ${config?.configVersion}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<CodeMirrorMerge
|
<DiffEditor
|
||||||
orientation="a-b"
|
original={JSON.stringify(sortObject(selectedItem.data), null, 2)}
|
||||||
theme={changeTheme ? 'dark' : 'light'}
|
modified={JSON.stringify(sortObject(config?.data), null, 2)}
|
||||||
>
|
theme={changeTheme ? 'vs-dark' : 'vs-white'}
|
||||||
<Original
|
options={{
|
||||||
value={JSON.stringify(sortObject(selectedItem.data), null, 2)}
|
readOnly: true,
|
||||||
/>
|
domReadOnly: true,
|
||||||
<Modified
|
renderOverviewRuler: false,
|
||||||
value={JSON.stringify(sortObject(config?.data), null, 2)}
|
autoClosingOvertype: 'auto'
|
||||||
extensions={[
|
}}
|
||||||
EditorView.editable.of(false),
|
/>
|
||||||
EditorState.readOnly.of(true)
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</CodeMirrorMerge>
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="compare-version-modal__content__table">
|
<div className="compare-version-modal__content__table">
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import Editor, { loader } from '@monaco-editor/react'
|
import Editor from '@monaco-editor/react'
|
||||||
import * as monaco from 'monaco-editor'
|
|
||||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
|
||||||
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
|
|
||||||
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
|
|
||||||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
|
|
||||||
import { FC, useContext } from 'react'
|
import { FC, useContext } from 'react'
|
||||||
|
|
||||||
import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage/ConfigurationEditor.type.ts'
|
import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage/ConfigurationEditor.type.ts'
|
||||||
@@ -11,8 +6,6 @@ import { ConfigType } from '@pages/ModulesPage/module.type.ts'
|
|||||||
|
|
||||||
import { Context } from '@stores/index.tsx'
|
import { Context } from '@stores/index.tsx'
|
||||||
|
|
||||||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
|
||||||
|
|
||||||
const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({
|
const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({
|
||||||
setDisableBtn = () => {},
|
setDisableBtn = () => {},
|
||||||
bufConfig,
|
bufConfig,
|
||||||
@@ -20,28 +13,6 @@ const ConfigurationEditorCode: FC<ConfigurationEditorPropsType> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { changeTheme } = useContext(Context)
|
const { changeTheme } = useContext(Context)
|
||||||
|
|
||||||
self.MonacoEnvironment = {
|
|
||||||
getWorker(_, label) {
|
|
||||||
if (label === 'json') {
|
|
||||||
return new jsonWorker()
|
|
||||||
}
|
|
||||||
if (label === 'css' || label === 'scss' || label === 'less') {
|
|
||||||
return new cssWorker()
|
|
||||||
}
|
|
||||||
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
|
||||||
return new htmlWorker()
|
|
||||||
}
|
|
||||||
if (label === 'typescript' || label === 'javascript') {
|
|
||||||
return new tsWorker()
|
|
||||||
}
|
|
||||||
return new editorWorker()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
loader.config({ monaco })
|
|
||||||
|
|
||||||
loader.init().then()
|
|
||||||
|
|
||||||
const handleChange = (data: string | undefined) => {
|
const handleChange = (data: string | undefined) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -4,12 +4,10 @@ import { FC, useContext } from 'react'
|
|||||||
|
|
||||||
import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage/ConfigurationEditor.type.ts'
|
import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage/ConfigurationEditor.type.ts'
|
||||||
|
|
||||||
import { cleanEmptyParamsObject } from '@utils/objectUtils.ts'
|
|
||||||
|
|
||||||
import { Context } from '@stores/index.tsx'
|
import { Context } from '@stores/index.tsx'
|
||||||
|
|
||||||
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({
|
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({
|
||||||
bufConfig = {},
|
bufConfig,
|
||||||
setBufConfig,
|
setBufConfig,
|
||||||
isCurrentConfigLoading
|
isCurrentConfigLoading
|
||||||
}) => {
|
}) => {
|
||||||
@@ -23,7 +21,7 @@ const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({
|
|||||||
...bufConfig,
|
...bufConfig,
|
||||||
data: { ...updated_src }
|
data: { ...updated_src }
|
||||||
}
|
}
|
||||||
setBufConfig(cleanEmptyParamsObject(newData))
|
setBufConfig(newData)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -37,7 +35,7 @@ const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({
|
|||||||
enableClipboard={true}
|
enableClipboard={true}
|
||||||
iconStyle="square"
|
iconStyle="square"
|
||||||
onEdit={({ updated_src }: any) => handleEdit(updated_src)}
|
onEdit={({ updated_src }: any) => handleEdit(updated_src)}
|
||||||
src={bufConfig.data}
|
src={bufConfig?.data}
|
||||||
sortKeys={true}
|
sortKeys={true}
|
||||||
collapsed={1}
|
collapsed={1}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import { ConfigType } from '@pages/ModulesPage/module.type.ts'
|
|||||||
|
|
||||||
import configServiceApi from '@services/configService.ts'
|
import configServiceApi from '@services/configService.ts'
|
||||||
|
|
||||||
|
import './confirm-config-modal.scss'
|
||||||
|
|
||||||
interface ConfirmModalProps extends Omit<ModalPropsType, 'title' | 'children'> {
|
interface ConfirmModalProps extends Omit<ModalPropsType, 'title' | 'children'> {
|
||||||
handleSaveClick: (upVersion?: number, unsafe?: boolean) => void
|
handleSaveClick: (upVersion?: number, unsafe?: boolean) => void
|
||||||
setBufConfig: Dispatch<SetStateAction<ConfigType | undefined>>
|
setBufConfig: Dispatch<SetStateAction<ConfigType | undefined>>
|
||||||
@@ -33,6 +35,7 @@ const ConfirmConfigModal: FC<ConfirmModalProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className="confirm-config-modal">
|
||||||
<Modal
|
<Modal
|
||||||
title="Версия конфигурации была кем-то изменена"
|
title="Версия конфигурации была кем-то изменена"
|
||||||
open={open}
|
open={open}
|
||||||
@@ -53,6 +56,7 @@ const ConfirmConfigModal: FC<ConfirmModalProps> = ({
|
|||||||
Принять изменения
|
Принять изменения
|
||||||
</Button>
|
</Button>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default ConfirmConfigModal
|
export default ConfirmConfigModal
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.confirm-config-modal {
|
||||||
|
.modal__content {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,46 @@
|
|||||||
|
import { loader } from '@monaco-editor/react'
|
||||||
import { setupListeners } from '@reduxjs/toolkit/query'
|
import { setupListeners } from '@reduxjs/toolkit/query'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import 'dayjs/locale/ru'
|
import 'dayjs/locale/ru'
|
||||||
|
import * as monaco from 'monaco-editor'
|
||||||
|
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
||||||
|
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
|
||||||
|
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
|
||||||
|
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import { Provider } from 'react-redux'
|
import { Provider } from 'react-redux'
|
||||||
import { BrowserRouter } from 'react-router-dom'
|
import { BrowserRouter } from 'react-router-dom'
|
||||||
|
|
||||||
import App from './components/App.tsx'
|
import App from './components/App.tsx'
|
||||||
|
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
||||||
|
|
||||||
import { setupStore } from './stores'
|
import { setupStore } from './stores'
|
||||||
|
|
||||||
import 'react-resizable/css/styles.css'
|
import 'react-resizable/css/styles.css'
|
||||||
import 'simplebar-react/dist/simplebar.min.css'
|
import 'simplebar-react/dist/simplebar.min.css'
|
||||||
|
|
||||||
|
self.MonacoEnvironment = {
|
||||||
|
getWorker(_, label) {
|
||||||
|
if (label === 'json') {
|
||||||
|
return new jsonWorker()
|
||||||
|
}
|
||||||
|
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||||
|
return new cssWorker()
|
||||||
|
}
|
||||||
|
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||||
|
return new htmlWorker()
|
||||||
|
}
|
||||||
|
if (label === 'typescript' || label === 'javascript') {
|
||||||
|
return new tsWorker()
|
||||||
|
}
|
||||||
|
return new editorWorker()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loader.config({ monaco })
|
||||||
|
|
||||||
|
loader.init().then()
|
||||||
|
|
||||||
dayjs.locale('ru')
|
dayjs.locale('ru')
|
||||||
const store = setupStore()
|
const store = setupStore()
|
||||||
setupListeners(store.dispatch)
|
setupListeners(store.dispatch)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
|
|
||||||
export interface ConfigurationEditorPropsType {
|
export interface ConfigurationEditorPropsType {
|
||||||
jsonSchema?: ResponseSchemaType
|
jsonSchema?: ResponseSchemaType
|
||||||
bufConfig?: ConfigType
|
bufConfig: ConfigType
|
||||||
setBufConfig: Dispatch<SetStateAction<ConfigType | undefined>>
|
setBufConfig: Dispatch<SetStateAction<ConfigType | undefined>>
|
||||||
isCurrentConfigLoading: boolean
|
isCurrentConfigLoading: boolean
|
||||||
setDisableBtn?: Dispatch<SetStateAction<boolean>>
|
setDisableBtn?: Dispatch<SetStateAction<boolean>>
|
||||||
|
|||||||
@@ -113,9 +113,6 @@
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-btn-group {
|
.ant-btn-group {
|
||||||
@@ -136,11 +133,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.confirm-btn {
|
.confirm-btn {
|
||||||
width: 190px;
|
width: auto;
|
||||||
}
|
min-width: 190px;
|
||||||
|
|
||||||
.confirm-btn, .danger {
|
|
||||||
margin-right: $basic-margin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-data {
|
.error-data {
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ const ConfigurationEditorPage: FC = () => {
|
|||||||
return (
|
return (
|
||||||
<ConfigurationEditorForm
|
<ConfigurationEditorForm
|
||||||
submitRef={submitRef}
|
submitRef={submitRef}
|
||||||
bufConfig={bufConfig}
|
bufConfig={bufConfig as ConfigType}
|
||||||
setBufConfig={setBufConfig}
|
setBufConfig={setBufConfig}
|
||||||
jsonSchema={jsonSchema}
|
jsonSchema={jsonSchema}
|
||||||
isCurrentConfigLoading={isCurrentConfigLoading}
|
isCurrentConfigLoading={isCurrentConfigLoading}
|
||||||
@@ -140,7 +140,7 @@ const ConfigurationEditorPage: FC = () => {
|
|||||||
case jsonRadio:
|
case jsonRadio:
|
||||||
return (
|
return (
|
||||||
<ConfigurationEditorJson
|
<ConfigurationEditorJson
|
||||||
bufConfig={bufConfig}
|
bufConfig={bufConfig as ConfigType}
|
||||||
setBufConfig={setBufConfig}
|
setBufConfig={setBufConfig}
|
||||||
isCurrentConfigLoading={isCurrentConfigLoading}
|
isCurrentConfigLoading={isCurrentConfigLoading}
|
||||||
/>
|
/>
|
||||||
@@ -149,7 +149,7 @@ const ConfigurationEditorPage: FC = () => {
|
|||||||
return (
|
return (
|
||||||
<ConfigurationEditorCode
|
<ConfigurationEditorCode
|
||||||
setDisableBtn={setDisableBtn}
|
setDisableBtn={setDisableBtn}
|
||||||
bufConfig={bufConfig}
|
bufConfig={bufConfig as ConfigType}
|
||||||
setBufConfig={setBufConfig}
|
setBufConfig={setBufConfig}
|
||||||
isCurrentConfigLoading={isCurrentConfigLoading}
|
isCurrentConfigLoading={isCurrentConfigLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -60,11 +60,6 @@ const Connections = () => {
|
|||||||
const formatFullDate = (obj: string) =>
|
const formatFullDate = (obj: string) =>
|
||||||
dayjs(obj).format(dateFormats.fullFormat)
|
dayjs(obj).format(dateFormats.fullFormat)
|
||||||
|
|
||||||
const keySelector = ({
|
|
||||||
address: { ip, port },
|
|
||||||
establishedAt
|
|
||||||
}: ModuleStatusType) => ip + port + establishedAt
|
|
||||||
|
|
||||||
const renderEndpoints = ({ endpoints }: ModuleStatusType) => {
|
const renderEndpoints = ({ endpoints }: ModuleStatusType) => {
|
||||||
if (endpoints && endpoints.length) {
|
if (endpoints && endpoints.length) {
|
||||||
return (
|
return (
|
||||||
@@ -144,7 +139,7 @@ const Connections = () => {
|
|||||||
<div className="connection-page__content">
|
<div className="connection-page__content">
|
||||||
<div className="connection-page__content__wrap-table">
|
<div className="connection-page__content__wrap-table">
|
||||||
<Table
|
<Table
|
||||||
rowKey={keySelector}
|
rowKey={(record) => record.id}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
dataSource={obj}
|
dataSource={obj}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ const LoginPage = () => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
className="login-page__content__submit-btn"
|
className="login-page__content__submit-btn"
|
||||||
onClick={handleSubmit(handleSubmitForm)}
|
onClick={handleSubmit(handleSubmitForm)}
|
||||||
|
htmlType="submit"
|
||||||
>
|
>
|
||||||
Войти
|
Войти
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import { routePaths } from '@routes/routePaths.ts'
|
|||||||
import { NewRoleType, PermissionKeysType, RoleType } from '@type/roles.type.ts'
|
import { NewRoleType, PermissionKeysType, RoleType } from '@type/roles.type.ts'
|
||||||
|
|
||||||
import './roles-page.scss'
|
import './roles-page.scss'
|
||||||
|
import { useAppDispatch } from '@hooks/redux.ts'
|
||||||
|
import { fetchProfile } from '@stores/redusers/ActionCreators.ts'
|
||||||
|
|
||||||
const { Column, EmptyData, NoData } = Layout
|
const { Column, EmptyData, NoData } = Layout
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@ const RolesPage = () => {
|
|||||||
const fromApp = location.state?.fromApp || false
|
const fromApp = location.state?.fromApp || false
|
||||||
const { role, hasPermission } = useRole()
|
const { role, hasPermission } = useRole()
|
||||||
const [searchParams, setSearchParams] = useSearchParams()
|
const [searchParams, setSearchParams] = useSearchParams()
|
||||||
|
const dispatch = useAppDispatch()
|
||||||
const searchValue = searchParams.get('search') || ''
|
const searchValue = searchParams.get('search') || ''
|
||||||
const { data: permissionList = [], isLoading: isPermissionLoading } =
|
const { data: permissionList = [], isLoading: isPermissionLoading } =
|
||||||
userServiceApi.useGetAllPermissionsQuery()
|
userServiceApi.useGetAllPermissionsQuery()
|
||||||
@@ -97,6 +100,7 @@ const RolesPage = () => {
|
|||||||
updateRole(formValue as RoleType)
|
updateRole(formValue as RoleType)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
dispatch(fetchProfile())
|
||||||
message.success('Элемент успешно добавлен').then()
|
message.success('Элемент успешно добавлен').then()
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
.close-btn {
|
.close-btn {
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
padding: 5px !important;
|
padding: 5px !important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 8px;
|
top: 8px;
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
&__footer {
|
&__footer {
|
||||||
|
padding: 0 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
margin-top: $basic-margin;
|
margin-top: $basic-margin;
|
||||||
|
|||||||
+5
-2
@@ -5,7 +5,6 @@ import svgr from 'vite-plugin-svgr'
|
|||||||
|
|
||||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||||
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd(), '')
|
const env = loadEnv(mode, process.cwd(), '')
|
||||||
@@ -17,10 +16,14 @@ export default defineConfig(({ mode }) => {
|
|||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
minify: 'esbuild',
|
minify: 'esbuild',
|
||||||
sourcemap: true,
|
sourcemap: mode !== 'production',
|
||||||
outDir: 'build',
|
outDir: 'build',
|
||||||
chunkSizeWarningLimit: 1600,
|
chunkSizeWarningLimit: 1600,
|
||||||
commonjsOptions: { transformMixedEsModules: true },
|
commonjsOptions: { transformMixedEsModules: true },
|
||||||
|
esbuild: {
|
||||||
|
target: 'es2020',
|
||||||
|
legalComments: 'none'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
Reference in new issue
Block a user