Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
180cdb750e | ||
|
|
e730b5ace3 | ||
|
|
0b6f6cb8fa | ||
|
|
eb8e1683fb | ||
|
|
e7b680aeb1 | ||
|
|
a7ec8b9489 | ||
|
|
23b9e1a1f0 | ||
|
|
dd7aee01ed | ||
|
|
bf773a58f0 | ||
|
|
ac08aef65c | ||
|
|
03fa976526 | ||
|
|
64852bca9f | ||
|
|
fbad913311 | ||
|
|
685a32ee30 | ||
|
|
75f491520b |
No files matched your search
@@ -0,0 +1,23 @@
|
|||||||
|
docker-build:
|
||||||
|
image: docker:latest
|
||||||
|
stage: build
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
before_script:
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
- export VERSION=`sh version.sh`
|
||||||
|
- echo $VERSION
|
||||||
|
- echo $CI_DOCKER_FILE
|
||||||
|
- echo $CI_REGISTRY
|
||||||
|
script:
|
||||||
|
- set
|
||||||
|
- mkdir -p migrations
|
||||||
|
- docker build -f "$CI_DOCKER_FILE" --force-rm --build-arg="version=$VERSION" --build-arg="app_name=$CI_PROJECT_NAME" --pull -t "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION" .
|
||||||
|
- |
|
||||||
|
docker tag "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION" "$CI_REGISTRY/$CI_PROJECT_NAME:latest"
|
||||||
|
docker push "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION"
|
||||||
|
docker push "$CI_REGISTRY/$CI_PROJECT_NAME:latest"
|
||||||
|
docker rmi -f "$CI_REGISTRY/$CI_PROJECT_NAME:$VERSION"
|
||||||
|
docker rmi -f "$CI_REGISTRY/$CI_PROJECT_NAME:latest"
|
||||||
|
- docker logout $CI_REGISTRY
|
||||||
|
|
||||||
@@ -1,3 +1,32 @@
|
|||||||
|
## 0.18.9
|
||||||
|
- Исправлены дополнительные параметры подключения в форме
|
||||||
|
## 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
|
## 0.17.0
|
||||||
- Codemirror заменен на MonacoEditor
|
- Codemirror заменен на MonacoEditor
|
||||||
## 0.16.0
|
## 0.16.0
|
||||||
|
|||||||
+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
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
FROM dockerhub.mos.ru/mosos/arbat:15.5 as builder-deps
|
||||||
|
RUN zypper --no-gpg-checks update -y && zypper --no-gpg-checks install -y nodejs14 yarn
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
RUN yarn config set "strict-ssl" false
|
||||||
|
RUN yarn config set "registry" https://repo-mirror.mos.ru/repository/yarn-central/
|
||||||
|
RUN yarn config list
|
||||||
|
RUN yarn --ignore-engines install
|
||||||
|
COPY . ./
|
||||||
|
RUN sed -i 's/github.com/repo-mirror.mos.ru\/repository\/raw-github/g' package.json
|
||||||
|
RUN sed -i 's/registry.yarnpkg.com/repo-mirror.mos.ru\/repository\/yarn-central/g' yarn.lock
|
||||||
|
RUN yarn --ignore-engines build
|
||||||
|
|
||||||
|
FROM dockerhub.mos.ru/mosos/arbat:15.5
|
||||||
|
|
||||||
|
RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
|
||||||
|
RUN echo "Europe/Moscow" > /etc/timezone
|
||||||
|
RUN zypper --no-gpg-checks update -y && zypper --no-gpg-checks install -y nginx
|
||||||
|
|
||||||
|
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
|
||||||
@@ -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
+241
-447
File diff suppressed because it is too large.
Load diff
+6
-6
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "isp-admin-ui",
|
"name": "isp-admin-ui",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.17.0",
|
"version": "0.18.9",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
"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",
|
||||||
@@ -20,12 +20,12 @@
|
|||||||
"@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",
|
||||||
"axios": "^1.6.8",
|
"axios": "^1.7.7",
|
||||||
"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",
|
||||||
@@ -63,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",
|
||||||
|
|||||||
@@ -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', {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Tabs,
|
Tabs,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Form as FormAntd,
|
|
||||||
Collapse,
|
Collapse,
|
||||||
Typography,
|
Typography,
|
||||||
Space
|
Space
|
||||||
@@ -22,9 +21,9 @@ import {
|
|||||||
ConfigurationEditorPropsType,
|
ConfigurationEditorPropsType,
|
||||||
DescriptionPropsType,
|
DescriptionPropsType,
|
||||||
ErrorsObjType,
|
ErrorsObjType,
|
||||||
FieldTemplatePropsType,
|
|
||||||
ObjectFieldTemplatePropertyType,
|
ObjectFieldTemplatePropertyType,
|
||||||
ObjectFieldTemplatePropsType,
|
ObjectFieldTemplatePropsType,
|
||||||
|
RemoveButtonProps,
|
||||||
SortPropType
|
SortPropType
|
||||||
} from '@pages/ConfigurationEditorPage/ConfigurationEditor.type.ts'
|
} from '@pages/ConfigurationEditorPage/ConfigurationEditor.type.ts'
|
||||||
import { ResponseSchemaType } from '@pages/ModulesPage/module.type.ts'
|
import { ResponseSchemaType } from '@pages/ModulesPage/module.type.ts'
|
||||||
@@ -103,98 +102,12 @@ const ConfigurationEditorForm: FC<ConfigurationEditorPropsType> = ({
|
|||||||
return id.split('_').length
|
return id.split('_').length
|
||||||
}
|
}
|
||||||
|
|
||||||
const getName = (id: string) => {
|
|
||||||
if (!id) {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
const arr = id.split('_')
|
|
||||||
return `#${arr[arr.length - 1] || ''}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const FieldTemplate: FC<FieldTemplatePropsType> = (props) => {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
classNames,
|
|
||||||
label,
|
|
||||||
rawHelp,
|
|
||||||
required,
|
|
||||||
rawDescription,
|
|
||||||
rawErrors,
|
|
||||||
children,
|
|
||||||
displayLabel,
|
|
||||||
schema
|
|
||||||
} = props
|
|
||||||
|
|
||||||
const isObject = schema.type === 'object'
|
|
||||||
const depth = getDepth(id)
|
|
||||||
const name = label || getName(id)
|
|
||||||
|
|
||||||
// Проверяем на наличие ошибок и формируем их вывод
|
|
||||||
const errorMessages = rawErrors ? rawErrors.join('\n') : null
|
|
||||||
|
|
||||||
// Объекты и массивы - Обработка по глубине
|
|
||||||
if (isObject && depth !== 1) {
|
|
||||||
const title = (
|
|
||||||
<div className={required ? 'ant-form-item-required' : ''}>
|
|
||||||
{depth !== 2 && <AntdText strong>{name}</AntdText>}
|
|
||||||
{errorMessages && (
|
|
||||||
<AntdText type="danger">{` (${errorMessages})`}</AntdText>
|
|
||||||
)}
|
|
||||||
{depth !== 2 && <Description description={rawDescription} />}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
|
|
||||||
if (depth === 2 || schema.dynamic) {
|
|
||||||
return (
|
|
||||||
<div style={{ width: '100%' }}>
|
|
||||||
{!schema.dynamic && title}
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Collapse className="collapse" defaultActiveKey={depth > 1 ? '' : id}>
|
|
||||||
<Collapse.Panel
|
|
||||||
key={id}
|
|
||||||
className="configEditor_collapseObject"
|
|
||||||
header={title}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Collapse.Panel>
|
|
||||||
</Collapse>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Для остальных типов возвращаем форму с элементами
|
|
||||||
return (
|
|
||||||
<FormAntd.Item
|
|
||||||
className={classNames}
|
|
||||||
validateStatus={errorMessages ? 'error' : undefined}
|
|
||||||
help={errorMessages || undefined}
|
|
||||||
extra={rawHelp}
|
|
||||||
required={required}
|
|
||||||
label={
|
|
||||||
displayLabel && !schema.dynamic ? (
|
|
||||||
<>
|
|
||||||
{name}
|
|
||||||
<Description description={rawDescription} />
|
|
||||||
</>
|
|
||||||
) : null
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</FormAntd.Item>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const ArrayFieldTemplate: FC<ArrayFieldTemplatePropsType> = ({
|
const ArrayFieldTemplate: FC<ArrayFieldTemplatePropsType> = ({
|
||||||
items,
|
items,
|
||||||
onAddClick,
|
onAddClick,
|
||||||
canAdd,
|
canAdd,
|
||||||
title,
|
title,
|
||||||
idSchema,
|
idSchema
|
||||||
schema: { description }
|
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Collapse defaultActiveKey={idSchema.$id}>
|
<Collapse defaultActiveKey={idSchema.$id}>
|
||||||
@@ -207,9 +120,11 @@ const ConfigurationEditorForm: FC<ConfigurationEditorPropsType> = ({
|
|||||||
style={{ justifyContent: 'space-between', width: '100%' }}
|
style={{ justifyContent: 'space-between', width: '100%' }}
|
||||||
>
|
>
|
||||||
<Space direction="horizontal">
|
<Space direction="horizontal">
|
||||||
|
<Tooltip title={title}>
|
||||||
<AntdText>{title}</AntdText>
|
<AntdText>{title}</AntdText>
|
||||||
|
</Tooltip>
|
||||||
<Badge count={items ? items.length : 0} showZero />
|
<Badge count={items ? items.length : 0} showZero />
|
||||||
<Description description={description} />
|
<Description description={title} />
|
||||||
</Space>
|
</Space>
|
||||||
{canAdd && (
|
{canAdd && (
|
||||||
<Button
|
<Button
|
||||||
@@ -242,54 +157,124 @@ const ConfigurationEditorForm: FC<ConfigurationEditorPropsType> = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const RemoveButton = (props: RemoveButtonProps) => {
|
||||||
|
const { icon, iconType, ...btnProps } = props
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
icon={<DeleteOutlined />}
|
||||||
|
{...btnProps}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const ObjectFieldTemplate: FC<ObjectFieldTemplatePropsType> = (props) => {
|
const ObjectFieldTemplate: FC<ObjectFieldTemplatePropsType> = (props) => {
|
||||||
const {
|
const { properties, schema, idSchema, onAddClick, activeTabKey, handleTabsChange, title } = props
|
||||||
properties,
|
const depth = getDepth(idSchema.$id)
|
||||||
idSchema,
|
|
||||||
schema: { properties: schemaProperties },
|
|
||||||
activeTabKey,
|
|
||||||
handleTabsChange
|
|
||||||
} = props
|
|
||||||
|
|
||||||
properties.sort(sortProps)
|
const renderComplexTabs = (propsComplex: any[]) => {
|
||||||
if (idSchema.$id === 'root') {
|
return (
|
||||||
const propsComplex: ObjectFieldTemplatePropertyType[] = []
|
propsComplex.map((element) => ({
|
||||||
const propsSimple: ObjectFieldTemplatePropertyType[] = []
|
label: schema.properties[element.name]?.title || element.name,
|
||||||
|
key: element.name,
|
||||||
|
children: schema.additionalProperties
|
||||||
|
? (properties.map((element: any) => (
|
||||||
|
<div key={element.content.key} className="collapseArray_item">
|
||||||
|
<div className="collapseArray_item_content">{element.content}</div>
|
||||||
|
</div>
|
||||||
|
)))
|
||||||
|
: <>{element.content}</>
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
properties.forEach((prop) => {
|
const propsComplex: ObjectFieldTemplatePropertyType[] = []
|
||||||
const fieldType = schemaProperties[prop.name]?.type
|
const propsSimple: ObjectFieldTemplatePropertyType[] = []
|
||||||
if (!fieldType || fieldType === 'array' || fieldType === 'object') {
|
|
||||||
|
const processProperties = (properties: any) => {
|
||||||
|
properties.forEach((prop: any) => {
|
||||||
|
const fieldType = schema.properties[prop.name]?.type
|
||||||
|
const isComplex = !fieldType || fieldType === 'array' || fieldType === 'object'
|
||||||
|
if (isComplex) {
|
||||||
propsComplex.push(prop)
|
propsComplex.push(prop)
|
||||||
} else {
|
} else {
|
||||||
propsSimple.push(prop)
|
propsSimple.push(prop)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!schema.additionalProperties) {
|
||||||
|
properties.sort(sortProps)
|
||||||
|
}
|
||||||
|
processProperties(properties)
|
||||||
|
|
||||||
|
if (idSchema.$id === 'root') {
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<Tabs
|
||||||
activeKey={activeTabKey}
|
activeKey={activeTabKey}
|
||||||
tabPosition="right"
|
tabPosition="right"
|
||||||
onChange={handleTabsChange}
|
onChange={handleTabsChange}
|
||||||
items={[
|
items={[
|
||||||
...(propsSimple.length
|
...(propsSimple.length ? [{
|
||||||
? [
|
label: 'Остальные',
|
||||||
{
|
key: 'General',
|
||||||
label: 'Остальные',
|
children: propsSimple.map((element) => element.content)
|
||||||
key: 'General',
|
}] : []),
|
||||||
children: propsSimple.map((element) => element.content)
|
...renderComplexTabs(propsComplex)
|
||||||
}
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
...propsComplex.map((element) => ({
|
|
||||||
label: schemaProperties[element.name]?.title || element.name,
|
|
||||||
key: element.name,
|
|
||||||
children: element.content
|
|
||||||
}))
|
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return <>{properties.map((element) => element.content)}</>
|
|
||||||
|
if (schema.additionalProperties) {
|
||||||
|
return (
|
||||||
|
<Collapse className="collapse" defaultActiveKey={depth > 1 ? '' : idSchema.$id}>
|
||||||
|
<Collapse.Panel
|
||||||
|
key={idSchema.$id}
|
||||||
|
className="configEditor_collapseObject"
|
||||||
|
header={
|
||||||
|
<Space direction="horizontal" style={{ justifyContent: 'space-between', width: '100%' }}>
|
||||||
|
<Space direction="horizontal">
|
||||||
|
<Tooltip title={title}>
|
||||||
|
<AntdText>{title}</AntdText>
|
||||||
|
</Tooltip>
|
||||||
|
</Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
icon={<PlusOutlined />}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation()
|
||||||
|
onAddClick(schema)()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{properties.map((element: any) => (
|
||||||
|
<div key={element.content.key} className="collapseArray_item">
|
||||||
|
<div className="collapseArray_item_content">{element.content}</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (depth > 2) {
|
||||||
|
return (
|
||||||
|
<Collapse className="collapse" defaultActiveKey={depth > 1 ? '' : idSchema.$id}>
|
||||||
|
<Collapse.Panel
|
||||||
|
key={idSchema.$id}
|
||||||
|
className="configEditor_collapseObject"
|
||||||
|
header={<><Tooltip title={title}>{title}</Tooltip></>}
|
||||||
|
>
|
||||||
|
<>{properties.map((element) => element.content)}</>
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return properties.map((element) => element.content)
|
||||||
}
|
}
|
||||||
|
|
||||||
const transformErrors = (errors: ErrorsObjType[]): ErrorsObjType[] => {
|
const transformErrors = (errors: ErrorsObjType[]): ErrorsObjType[] => {
|
||||||
@@ -313,8 +298,8 @@ const ConfigurationEditorForm: FC<ConfigurationEditorPropsType> = ({
|
|||||||
uiSchema={uiSchema}
|
uiSchema={uiSchema}
|
||||||
templates={{
|
templates={{
|
||||||
ObjectFieldTemplate: ObjectFieldTemplate as any,
|
ObjectFieldTemplate: ObjectFieldTemplate as any,
|
||||||
FieldTemplate: FieldTemplate as any,
|
ArrayFieldTemplate: ArrayFieldTemplate as any,
|
||||||
ArrayFieldTemplate: ArrayFieldTemplate as any
|
ButtonTemplates: { RemoveButton } as any
|
||||||
}}
|
}}
|
||||||
ref={formRef}
|
ref={formRef}
|
||||||
transformErrors={transformErrors as any}
|
transformErrors={transformErrors as any}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
ReactNode,
|
ReactNode,
|
||||||
SetStateAction
|
SetStateAction
|
||||||
} from 'react'
|
} from 'react'
|
||||||
|
import { ButtonProps } from 'antd'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ConfigType,
|
ConfigType,
|
||||||
@@ -13,7 +14,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>>
|
||||||
@@ -74,12 +75,20 @@ export interface ObjectFieldTemplatePropsType {
|
|||||||
$id: string
|
$id: string
|
||||||
}
|
}
|
||||||
schema: {
|
schema: {
|
||||||
properties: SchemaPropertiesType
|
properties: SchemaPropertiesType,
|
||||||
}
|
additionalProperties: boolean | {type: string}
|
||||||
|
},
|
||||||
|
onAddClick: (schema: any) => () => void,
|
||||||
|
title: string,
|
||||||
activeTabKey: string
|
activeTabKey: string
|
||||||
handleTabsChange: (key: string) => void
|
handleTabsChange: (key: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RemoveButtonProps extends ButtonProps {
|
||||||
|
icon?: ReactNode;
|
||||||
|
iconType?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ErrorsObjType {
|
export interface ErrorsObjType {
|
||||||
message: string
|
message: string
|
||||||
name: string
|
name: string
|
||||||
|
|||||||
@@ -10,6 +10,15 @@
|
|||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
padding-bottom: 80px;
|
padding-bottom: 80px;
|
||||||
|
|
||||||
|
.ant-tabs-nav {
|
||||||
|
width: 250px;
|
||||||
|
|
||||||
|
.ant-tabs-tab-btn {
|
||||||
|
text-align: left;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -48,6 +57,12 @@
|
|||||||
|
|
||||||
.ant-form-item-label {
|
.ant-form-item-label {
|
||||||
text-align: start;
|
text-align: start;
|
||||||
|
max-width: 100%;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-tabs-right {
|
.ant-tabs-right {
|
||||||
@@ -65,18 +80,41 @@
|
|||||||
|
|
||||||
.collapseArray_item_content {
|
.collapseArray_item_content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
.ant-btn {
|
||||||
|
position: relative;
|
||||||
|
top: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-collapse-item {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
.ant-collapse-header {
|
.ant-collapse-header {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding: 4px 11px;
|
||||||
|
|
||||||
|
.ant-collapse-header-text {
|
||||||
|
display: inline;
|
||||||
|
max-width: 100%;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.ant-btn {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapseArray_item {
|
.collapseArray_item {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
|
||||||
|
.ant-form-item {
|
||||||
|
height: 100%;
|
||||||
|
align-items: baseline;
|
||||||
|
align-content: end;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.anticon-delete {
|
.anticon-delete {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@@ -96,6 +134,10 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
flex: auto;
|
flex: auto;
|
||||||
|
|
||||||
|
.ant-collapse {
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex-space-between {
|
.flex-space-between {
|
||||||
@@ -109,13 +151,33 @@
|
|||||||
}
|
}
|
||||||
.collapseArray_item {
|
.collapseArray_item {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.ant-btn-link {
|
}
|
||||||
margin-bottom: 8px;
|
}
|
||||||
|
|
||||||
|
.collapse {
|
||||||
|
.configEditor_collapseObject {
|
||||||
|
border-radius: 6px;
|
||||||
|
.ant-row {
|
||||||
|
display: grid;
|
||||||
|
|
||||||
|
grid-template-columns: minmax(0, 30%) minmax(0, 70%) auto;
|
||||||
|
.ant-col {
|
||||||
|
height: 100%;
|
||||||
|
align-content: center;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
|
||||||
|
.ant-form-item {
|
||||||
|
height: 100%;
|
||||||
|
align-items: baseline;
|
||||||
|
align-content: end;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-form-item-row {
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-btn-group {
|
.ant-btn-group {
|
||||||
@@ -136,11 +198,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;
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
grep version package.json | sed 's/.*"version": "\(.*\)".*/\1/'
|
||||||
+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