Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dbf4b0b07 | ||
|
|
096c2d401d | ||
|
|
2d08128cb7 | ||
|
|
a7906026d5 |
No files matched your search
@@ -1,3 +1,10 @@
|
|||||||
|
## 0.12.6
|
||||||
|
- Добавлены кропки "удалить/добавть" в JsonView
|
||||||
|
- Добавлен скролл к JsonView
|
||||||
|
- Добавлена обработка ошибок к изменению конфига
|
||||||
|
## 0.12.5
|
||||||
|
- Исправлено неверное поведение показа меню
|
||||||
|
- Добавлена страница NotFoundPage
|
||||||
## 0.12.4
|
## 0.12.4
|
||||||
- Уменьшен размер бандла
|
- Уменьшен размер бандла
|
||||||
## 0.12.3
|
## 0.12.3
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 8001;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
root /opt/msp/isp-admin-ui/;
|
root /opt/msp/isp-admin-ui/;
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ server {
|
|||||||
location /api {
|
location /api {
|
||||||
client_max_body_size 10M;
|
client_max_body_size 10M;
|
||||||
|
|
||||||
proxy_pass http://10.2.4.241:9003;
|
proxy_pass http://isp-gate-service:9003;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
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;
|
||||||
|
|||||||
Generated
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "isp-admin-ui",
|
"name": "isp-admin-ui",
|
||||||
"version": "0.12.3",
|
"version": "0.12.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "isp-admin-ui",
|
"name": "isp-admin-ui",
|
||||||
"version": "0.12.3",
|
"version": "0.12.5",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apidevtools/json-schema-ref-parser": "^9.0.6",
|
"@apidevtools/json-schema-ref-parser": "^9.0.6",
|
||||||
"@codemirror/lang-json": "^6.0.1",
|
"@codemirror/lang-json": "^6.0.1",
|
||||||
@@ -7981,8 +7981,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/isp-ui-kit": {
|
"node_modules/isp-ui-kit": {
|
||||||
"version": "0.6.0",
|
"version": "0.7.1",
|
||||||
"resolved": "git+ssh://git@github.com/txix-open/isp-ui-kit.git#5f48f91bdb9b342bc7b14c3a40ea061c3474ae81",
|
"resolved": "git+ssh://git@github.com/txix-open/isp-ui-kit.git#657a9c1b62fb757938e12091faba6f5f53c7d7e9",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/lang-javascript": "^6.2.1",
|
"@codemirror/lang-javascript": "^6.2.1",
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "isp-admin-ui",
|
"name": "isp-admin-ui",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.12.4",
|
"version": "0.12.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
|
|||||||
@@ -4,26 +4,30 @@ import { ReactJsonView } from 'isp-ui-kit'
|
|||||||
import {Spin} from 'antd'
|
import {Spin} from 'antd'
|
||||||
import { cleanEmptyParamsObject } from '@utils/objectUtils.ts'
|
import { cleanEmptyParamsObject } from '@utils/objectUtils.ts'
|
||||||
|
|
||||||
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading, JsonSchema}) => {
|
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading}) => {
|
||||||
if (isCurrentConfigLoading) {
|
if (isCurrentConfigLoading) {
|
||||||
return <Spin className="spin" />
|
return <Spin className="spin" />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleEdit = (updated_src: any) => {
|
||||||
|
const newData = {
|
||||||
|
...bufConfig,
|
||||||
|
data: { ...updated_src }
|
||||||
|
}
|
||||||
|
setBufConfig(cleanEmptyParamsObject(newData))
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReactJsonView
|
<ReactJsonView
|
||||||
|
onAdd={true}
|
||||||
|
onDelete={({updated_src}: any) => handleEdit(updated_src)}
|
||||||
|
|
||||||
displayDataTypes={false}
|
displayDataTypes={false}
|
||||||
displayObjectSize={false}
|
displayObjectSize={false}
|
||||||
name={null}
|
name={null}
|
||||||
enableClipboard={true}
|
enableClipboard={true}
|
||||||
iconStyle="square"
|
iconStyle="square"
|
||||||
onEdit={({updated_src}: any) => {
|
onEdit={({updated_src}: any) => handleEdit(updated_src)}
|
||||||
const newData = {
|
|
||||||
...bufConfig,
|
|
||||||
data: { ...updated_src }
|
|
||||||
}
|
|
||||||
setBufConfig(cleanEmptyParamsObject(newData))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
src={bufConfig.data}
|
src={bufConfig.data}
|
||||||
sortKeys={true}
|
sortKeys={true}
|
||||||
collapsed={1}
|
collapsed={1}
|
||||||
@@ -31,4 +35,4 @@ const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig =
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ConfigurationEditorJson
|
export default ConfigurationEditorJson
|
||||||
@@ -32,7 +32,10 @@ import { routePaths } from '@routes/routePaths.ts'
|
|||||||
|
|
||||||
import { PermissionKeysType } from '@type/roles.type.ts'
|
import { PermissionKeysType } from '@type/roles.type.ts'
|
||||||
|
|
||||||
import './layout.scss'
|
|
||||||
|
|
||||||
|
import './layout.scss';
|
||||||
|
|
||||||
|
|
||||||
const { Content, Sider } = Layout
|
const { Content, Sider } = Layout
|
||||||
|
|
||||||
@@ -138,17 +141,16 @@ const LayoutComponent = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const menuKey = location.pathname.split('/')[1] as MenuItemKeysType
|
const menuKey = location.pathname.split('/')[1] as MenuItemKeysType
|
||||||
|
const selectedKey = selectedMenuKeys[0] || ''
|
||||||
const menuItem = menuKeys[menuKey]
|
const menuItem = menuKeys[menuKey]
|
||||||
|
|
||||||
if (menuItem) {
|
if (menuItem && menuKey !== selectedKey) {
|
||||||
setSelectedMenuKeys([menuItem.key])
|
setSelectedMenuKeys([menuItem.key])
|
||||||
setOpenKeys(menuItem.parent)
|
if (selectedKey) {
|
||||||
} else {
|
setOpenKeys(menuItem.parent)
|
||||||
setSelectedMenuKeys([])
|
}
|
||||||
setOpenKeys([])
|
|
||||||
}
|
}
|
||||||
}, [location])
|
}, [location.pathname])
|
||||||
|
|
||||||
const handlerOnClickMenu: MenuProps['onClick'] = ({ key }): void => {
|
const handlerOnClickMenu: MenuProps['onClick'] = ({ key }): void => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background: white;
|
background: white;
|
||||||
height: 100%;
|
|
||||||
-ms-overflow-style: none; /* IE и Edge */
|
-ms-overflow-style: none; /* IE и Edge */
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
border-left: 1px solid $border-color;
|
border-left: 1px solid $border-color;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: scroll;
|
||||||
|
padding-bottom: 80px;
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -17,6 +19,7 @@
|
|||||||
&__header {
|
&__header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
padding: $basic-padding *2 $basic-padding;
|
padding: $basic-padding *2 $basic-padding;
|
||||||
border-bottom: 1px solid $border-color;
|
border-bottom: 1px solid $border-color;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ const ConfigurationEditorPage: FC = () => {
|
|||||||
createUpdateConfig(cleanEmptyParamsObject(newData))
|
createUpdateConfig(cleanEmptyParamsObject(newData))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.then(({ id }) => {
|
.then(({ id }) => {
|
||||||
message.success('Конфигурация успешно сохранена')
|
|
||||||
isNew && navigate(`/${moduleId}/configEditor/${id}`)
|
isNew && navigate(`/${moduleId}/configEditor/${id}`)
|
||||||
|
message.success('Конфигурация успешно сохранена')
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
if (e.data.errorCode === 2004) {
|
if (e.data.errorCode === 2004) {
|
||||||
@@ -105,6 +105,7 @@ const ConfigurationEditorPage: FC = () => {
|
|||||||
if (e.data.errorCode === 400) {
|
if (e.data.errorCode === 400) {
|
||||||
message.error('Невалидный JSON объект')
|
message.error('Невалидный JSON объект')
|
||||||
}
|
}
|
||||||
|
message.error('Ошибка обновления элемента')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,6 +153,7 @@ const ConfigurationEditorPage: FC = () => {
|
|||||||
<RollbackOutlined />
|
<RollbackOutlined />
|
||||||
Назад
|
Назад
|
||||||
</Button>
|
</Button>
|
||||||
|
<h1>{bufConfig?.name}</h1>
|
||||||
<div className="configuration-editor-page__controll">
|
<div className="configuration-editor-page__controll">
|
||||||
<Button
|
<Button
|
||||||
disabled={!JsonSchema}
|
disabled={!JsonSchema}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { Button } from 'antd'
|
||||||
|
import { Layout } from 'isp-ui-kit'
|
||||||
|
import { useNavigate } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { routePaths } from '@routes/routePaths.ts'
|
||||||
|
|
||||||
|
|
||||||
|
const { NotFoundPage } = Layout
|
||||||
|
|
||||||
|
const NotFound = () => {
|
||||||
|
const navigate = useNavigate()
|
||||||
|
return (
|
||||||
|
<NotFoundPage>
|
||||||
|
<Button type="primary" onClick={() => navigate(routePaths.modules)}>
|
||||||
|
На главную
|
||||||
|
</Button>
|
||||||
|
</NotFoundPage>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NotFound
|
||||||
@@ -4,6 +4,7 @@ import { lazy, Suspense } from 'react'
|
|||||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||||
|
|
||||||
import LayoutComponent from '@components/Layout'
|
import LayoutComponent from '@components/Layout'
|
||||||
|
|
||||||
// Составная часть основной страницы, поэтому без lazy
|
// Составная часть основной страницы, поэтому без lazy
|
||||||
import Configurations from '@pages/ConfigurationsPage'
|
import Configurations from '@pages/ConfigurationsPage'
|
||||||
import Connections from '@pages/ConnectionsPage'
|
import Connections from '@pages/ConnectionsPage'
|
||||||
@@ -26,7 +27,9 @@ const ModulesPage = lazy(() => import('@pages/ModulesPage'))
|
|||||||
const ApplicationsPage = lazy(() => import('@pages/ApplicationsPage'))
|
const ApplicationsPage = lazy(() => import('@pages/ApplicationsPage'))
|
||||||
const AllVersionsPage = lazy(() => import('@pages/AllVersionsPage'))
|
const AllVersionsPage = lazy(() => import('@pages/AllVersionsPage'))
|
||||||
const ConfigurationEditorPage = lazy(
|
const ConfigurationEditorPage = lazy(
|
||||||
() => import('@pages/ConfigurationEditorPage'))
|
() => import('@pages/ConfigurationEditorPage')
|
||||||
|
)
|
||||||
|
const NotFound = lazy(() => import('@pages/NotFound'))
|
||||||
|
|
||||||
const Routers = () => {
|
const Routers = () => {
|
||||||
return (
|
return (
|
||||||
@@ -151,14 +154,14 @@ const Routers = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={`:moduleId/${routePaths.configEditor}/:id`}
|
<Route
|
||||||
element={
|
path={`:moduleId/${routePaths.configEditor}/:id`}
|
||||||
<Suspense fallback={<Spin />}>
|
element={
|
||||||
<ConfigurationEditorPage />
|
<Suspense fallback={<Spin />}>
|
||||||
</Suspense>
|
<ConfigurationEditorPage />
|
||||||
}>
|
</Suspense>
|
||||||
|
}
|
||||||
</Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path={routePaths.modules}
|
path={routePaths.modules}
|
||||||
element={
|
element={
|
||||||
@@ -213,6 +216,14 @@ const Routers = () => {
|
|||||||
</Suspense>
|
</Suspense>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
path={routePaths.notFound}
|
||||||
|
element={
|
||||||
|
<Suspense fallback={<Spin />}>
|
||||||
|
<NotFound />
|
||||||
|
</Suspense>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</Routes>
|
</Routes>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-15
@@ -17,23 +17,10 @@ export default defineConfig(({ mode }) => {
|
|||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
minify: 'esbuild',
|
minify: 'esbuild',
|
||||||
sourcemap: false,
|
sourcemap: true,
|
||||||
outDir: 'build',
|
outDir: 'build',
|
||||||
chunkSizeWarningLimit: 1600,
|
chunkSizeWarningLimit: 1600,
|
||||||
commonjsOptions: { transformMixedEsModules: true },
|
commonjsOptions: { transformMixedEsModules: true },
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
manualChunks(id) {
|
|
||||||
if (id.includes('node_modules')) {
|
|
||||||
return id
|
|
||||||
.toString()
|
|
||||||
.split('node_modules/')[1]
|
|
||||||
.split('/')[0]
|
|
||||||
.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
watch: {
|
watch: {
|
||||||
@@ -41,7 +28,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
},
|
},
|
||||||
host: true,
|
host: true,
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
port: 8000,
|
port: 8001,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': env.PROXY_URL
|
'/api': env.PROXY_URL
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user